diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2014-02-18 17:45:08 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2014-02-18 17:45:08 +0400 |
commit | 84580f950cca0bd0c7369e3e84b60d4dcfe81ba6 (patch) | |
tree | 68d3f605ad5bc3e12bb4912f68d4a7d8414abd32 | |
parent | 820b1a66870639951cdf7f1cbfef14c3ba889615 (diff) | |
download | mariadb-git-84580f950cca0bd0c7369e3e84b60d4dcfe81ba6.tar.gz |
MDEV-5481 mysqldump fails to dump geometry types properly.
Fixed so the MYSQL_TYPE_GEOMETRY is treated as BLOB.
-rw-r--r-- | client/mysqldump.c | 3 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 14 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 15 |
3 files changed, 31 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index bf4dcfefa19..3c8e0f9a508 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3637,7 +3637,8 @@ static void dump_table(char *table, char *db) field->type == MYSQL_TYPE_BLOB || field->type == MYSQL_TYPE_LONG_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 (i == 0) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 02251cc8c7c..0dbb17cdbed 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5193,6 +5193,20 @@ slow_log CREATE TABLE `slow_log` ( SET @@global.log_output= @old_log_output_state; SET @@global.slow_query_log= @old_slow_query_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 # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 76a17987fb6..ca47e8ed58d 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2345,6 +2345,21 @@ SET @@global.log_output= @old_log_output_state; SET @@global.slow_query_log= @old_slow_query_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 # End of 5.1 tests --echo # |