Commit 84580f95 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-5481 mysqldump fails to dump geometry types properly.

Fixed so the MYSQL_TYPE_GEOMETRY is treated as BLOB.
parent 820b1a66
...@@ -3637,7 +3637,8 @@ static void dump_table(char *table, char *db) ...@@ -3637,7 +3637,8 @@ static void dump_table(char *table, char *db)
field->type == MYSQL_TYPE_BLOB || field->type == MYSQL_TYPE_BLOB ||
field->type == MYSQL_TYPE_LONG_BLOB || field->type == MYSQL_TYPE_LONG_BLOB ||
field->type == MYSQL_TYPE_MEDIUM_BLOB || field->type == MYSQL_TYPE_MEDIUM_BLOB ||
field->type == MYSQL_TYPE_TINY_BLOB)) ? 1 : 0; field->type == MYSQL_TYPE_TINY_BLOB ||
field->type == MYSQL_TYPE_GEOMETRY)) ? 1 : 0;
if (extended_insert && !opt_xml) if (extended_insert && !opt_xml)
{ {
if (i == 0) if (i == 0)
......
...@@ -5193,6 +5193,20 @@ slow_log CREATE TABLE `slow_log` ( ...@@ -5193,6 +5193,20 @@ slow_log CREATE TABLE `slow_log` (
SET @@global.log_output= @old_log_output_state; SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state; SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state; SET @@global.general_log= @old_general_log_state;
# MDEV-5481 mysqldump fails to dump geometry types properly
create table t1 (g GEOMETRY) CHARSET koi8r;
create table t2 (g GEOMETRY) CHARSET koi8r;
insert into t1 values (point(1,1)), (point(2,2));
##################################################
\0\0\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0?
\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@
##################################################
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET koi8r;
select astext(g) from t2;
astext(g)
POINT(1 1)
POINT(2 2)
drop table t1, t2;
# #
# End of 5.1 tests # End of 5.1 tests
# #
...@@ -2345,6 +2345,21 @@ SET @@global.log_output= @old_log_output_state; ...@@ -2345,6 +2345,21 @@ SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state; SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state; SET @@global.general_log= @old_general_log_state;
--echo # MDEV-5481 mysqldump fails to dump geometry types properly
create table t1 (g GEOMETRY) CHARSET koi8r;
create table t2 (g GEOMETRY) CHARSET koi8r;
insert into t1 values (point(1,1)), (point(2,2));
--exec $MYSQL_DUMP --hex-blob --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1
--echo ##################################################
--cat_file $file
--echo ##################################################
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET koi8r
--remove_file $file
select astext(g) from t2;
drop table t1, t2;
--echo # --echo #
--echo # End of 5.1 tests --echo # End of 5.1 tests
--echo # --echo #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment