MDEV-5481 mysqldump fails to dump geometry types properly.
Fixed so the MYSQL_TYPE_GEOMETRY is treated as BLOB.
This commit is contained in:
parent
820b1a6687
commit
84580f950c
@ -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)
|
||||
|
@ -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
|
||||
#
|
||||
|
@ -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 #
|
||||
|
Loading…
x
Reference in New Issue
Block a user