summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch')
-rw-r--r--dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch96
1 files changed, 96 insertions, 0 deletions
diff --git a/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
new file mode 100644
index 0000000..9672061
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
@@ -0,0 +1,96 @@
+diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
+--- a/driver/catalog_no_i_s.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/catalog_no_i_s.c 2017-02-17 14:07:03.979683613 -0500
+@@ -1093,7 +1093,11 @@
+ unsigned long *lengths;
+ SQLRETURN rc= SQL_SUCCESS;
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
++#else
+ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
++#endif
+
+ /* Get the list of tables that match szCatalog and szTable */
+ myodbc_mutex_lock(&stmt->dbc->lock);
+diff -aurN a/driver/desc.c b/driver/desc.c
+--- a/driver/desc.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/desc.c 2017-02-17 14:09:30.139954232 -0500
+@@ -63,13 +63,21 @@
+ 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 (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ x_free((char *)desc);
+ return NULL;
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ delete_dynamic(&desc->records);
+ x_free((char *)desc);
+@@ -997,7 +1005,11 @@
+ delete_dynamic(&dest->records);
+ if (myodbc_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ src->records.alloc_increment, MYF(0)))
++#else
+ 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 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/handle.c 2017-02-17 14:10:32.078797593 -0500
+@@ -409,7 +409,11 @@
+ }
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
++#else
+ myodbc_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 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/parse.c 2017-02-17 14:12:00.638143846 -0500
+@@ -139,8 +139,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
++ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
++ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
++#else
+ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
+ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
++#endif
+ }
+
+ return pq;
+diff -aurN a/MYODBC_MYSQL.h b/MYODBC_MYSQL.h
+--- a/MYODBC_MYSQL.h 2016-11-29 07:40:13.000000000 -0500
++++ b/MYODBC_MYSQL.h 2017-02-17 15:04:47.153994839 -0500
+@@ -44,7 +44,7 @@
+ #endif
+
+ #ifdef THREAD
+-#if MYSQL_VERSION_ID < 50703
++#if MYSQL_VERSION_ID < 50703 || defined(MARIADB_BASE_VERSION)
+ #include <my_pthread.h>
+ #define myodbc_mutex_t pthread_mutex_t
+ #define myodbc_key_t pthread_key_t