Changeset View
Changeset View
Standalone View
Standalone View
files/002-mariadb-json.patch
- This file was added.
| diff --git a/plugins/migration/copytable/copytable.cpp b/plugins/migration/copytable/copytable.cpp | |||||
| index d42a88a..23b19e2 100644 | |||||
| --- a/plugins/migration/copytable/copytable.cpp | |||||
| +++ b/plugins/migration/copytable/copytable.cpp | |||||
| @@ -109,8 +109,10 @@ static const char *mysql_field_type_to_name(enum enum_field_types type) { | |||||
| return "MYSQL_TYPE_STRING"; | |||||
| case MYSQL_TYPE_GEOMETRY: | |||||
| return "MYSQL_TYPE_GEOMETRY"; | |||||
| +#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION | |||||
| case MYSQL_TYPE_JSON: | |||||
| return "MYSQL_TYPE_JSON"; | |||||
| +#endif | |||||
| default: | |||||
| return "UNKNOWN"; | |||||
| } | |||||
| @@ -295,7 +297,9 @@ RowBuffer::RowBuffer(std::shared_ptr<std::vector<ColumnInfo> > columns, | |||||
| case MYSQL_TYPE_STRING: | |||||
| case MYSQL_TYPE_VAR_STRING: | |||||
| case MYSQL_TYPE_BIT: | |||||
| +#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined 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 @@ bool MySQLCopyDataSource::fetch_row(RowBuffer &rowbuffer) { | |||||
| 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 | |||||
| +#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined MARIADB_BASE_VERSION | |||||
| + || rowbuffer[index].buffer_type == MYSQL_TYPE_JSON | |||||
| +#endif | |||||
| + ){ | |||||
| if (rowbuffer[index].buffer_length) | |||||
| free(rowbuffer[index].buffer); | |||||
| @@ -2162,7 +2170,9 @@ bool MySQLCopyDataTarget::append_bulk_column(size_t col_index) { | |||||
| case MYSQL_TYPE_STRING: | |||||
| case MYSQL_TYPE_ENUM: | |||||
| case MYSQL_TYPE_SET: | |||||
| +#if MYSQL_CHECK_VERSION(5, 7, 8) && ! defined 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); | |||||
| @@ -2611,7 +2621,7 @@ bool MySQLCopyDataTarget::InsertBuffer::append_escaped(const char *data, size_t | |||||
| // 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, 8) && ! 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 | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.