forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5.2.7-mariadb-dynamic-array.patch
79 lines (72 loc) · 2.98 KB
/
5.2.7-mariadb-dynamic-array.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
--- a/driver/catalog_no_i_s.c 2014-06-18 18:50:16.000000000 -0400
+++ b/driver/catalog_no_i_s.c 2014-08-20 14:08:33.997339096 -0400
@@ -1093,7 +1093,11 @@
unsigned long *lengths;
SQLRETURN rc= SQL_SUCCESS;
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
+ my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
+#else
my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
+#endif
/* Get the list of tables that match szCatalog and szTable */
pthread_mutex_lock(&stmt->dbc->lock);
diff -aurN a/driver/desc.c b/driver/desc.c
--- a/driver/desc.c 2014-06-18 18:50:16.000000000 -0400
+++ b/driver/desc.c 2014-08-20 14:07:37.409169269 -0400
@@ -63,8 +63,12 @@
but in desc_get_rec we manually get a pointer to it. This avoids
having to call set_dynamic after modifying the DESCREC.
*/
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
+ if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
+#else
if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
+#endif
{
x_free((char *)desc);
return NULL;
}
@@ -995,9 +1003,15 @@
/* copy the records */
delete_dynamic(&dest->records);
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
+ if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
+ src->records.alloc_increment, MYF(0)))
+#else
if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
src->records.max_element,
src->records.alloc_increment))
+#endif
{
return set_desc_error(dest, "HY001",
"Memory allocation error",
diff -aurN a/driver/handle.c b/driver/handle.c
--- a/driver/handle.c 2014-06-18 18:50:16.000000000 -0400
+++ b/driver/handle.c 2014-08-20 14:05:00.364248403 -0400
@@ -403,7 +403,11 @@
}
}
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
+ my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
+#else
my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10);
+#endif
memset((*param_bind)->buffer, 0, sizeof(MYSQL_BIND) *
(*param_bind)->max_element);
diff -aurN a/driver/parse.c b/driver/parse.c
--- a/driver/parse.c 2014-06-18 18:50:16.000000000 -0400
+++ b/driver/parse.c 2014-08-20 14:03:54.336383876 -0400
@@ -129,8 +129,13 @@
/* TODO: Store offsets rather than ptrs. In this case we will be fine
if work with copy of the originally parsed string */
+#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
+ my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
+ my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
+#else
my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
+#endif
}
return pq;