summaryrefslogtreecommitdiff
blob: 74c84e374dc79cdcf5ca8079a84df4156ea8c605 (plain)
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
--- a/plugins/migration/copytable/copytable.cpp.~1~	2017-02-03 19:40:18.000000000 +0100
+++ b/plugins/migration/copytable/copytable.cpp	2017-05-21 17:23:14.135875375 +0200
@@ -109,8 +109,10 @@
       return "MYSQL_TYPE_STRING";
     case MYSQL_TYPE_GEOMETRY:
       return "MYSQL_TYPE_GEOMETRY";
+#ifndef MARIADB_BASE_VERSION    
     case MYSQL_TYPE_JSON:
       return "MYSQL_TYPE_JSON";
+#endif     
     default:
       return "UNKNOWN";
   }
@@ -295,7 +297,9 @@
       case MYSQL_TYPE_STRING:
       case MYSQL_TYPE_VAR_STRING:
       case MYSQL_TYPE_BIT:
+#ifndef MARIADB_BASE_VERSION        
       case MYSQL_TYPE_JSON:
+#endif        
         if (!col->is_long_data)
           bind.buffer_length = (unsigned)col->source_length + 1;
 
@@ -1392,7 +1396,11 @@
               rowbuffer[index].buffer_type == MYSQL_TYPE_MEDIUM_BLOB ||
               rowbuffer[index].buffer_type == MYSQL_TYPE_LONG_BLOB || rowbuffer[index].buffer_type == MYSQL_TYPE_BLOB ||
               rowbuffer[index].buffer_type == MYSQL_TYPE_STRING ||
-              rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON) {
+              rowbuffer[index].buffer_type == MYSQL_TYPE_GEOMETRY
+#ifndef MARIADB_BASE_VERSION              
+              || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON
+#endif              
+              ) {
             if (rowbuffer[index].buffer_length)
               free(rowbuffer[index].buffer);
 
@@ -2162,7 +2170,9 @@
       case MYSQL_TYPE_STRING:
       case MYSQL_TYPE_ENUM:
       case MYSQL_TYPE_SET:
+#ifndef MARIADB_BASE_VERSION        
       case MYSQL_TYPE_JSON:
+#endif        
         _bulk_insert_record.append("'", 1);
         ret_val = _bulk_insert_record.append_escaped((char *)(*_row_buffer)[col_index].buffer,
                                                      *(*_row_buffer)[col_index].length);
@@ -2621,7 +2621,7 @@
   // This is needed because the escaping depends on the character set in use by the server
   unsigned long ret_length = 0;
 
-#if MYSQL_CHECK_VERSION(5, 7, 6)
+#if MYSQL_CHECK_VERSION(5, 7, 6) && ! defined MARIADB_BASE_VERSION
   if (_target->is_mysql_version_at_least(5, 7, 6))
     ret_length += mysql_real_escape_string_quote(_mysql, buffer + length, data, (unsigned long)dlength, '"');
   else