1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#26711 "Binary content 0x00 sometimes becomes 0x5C 0x00 after dump/load"

Problem: "SELECT INTO OUTFILE" created incorrect dumps for BLOBs,
so "LOAD DATA" later incorrectly interpreted 0x5C as the second
byte of a multi-byte sequence, instead of escape character.
Fix: adding escaping of multi-byte heads.


mysql-test/r/ctype_big5.result:
  Adding test case
mysql-test/t/ctype_big5.test:
  Adding test case
sql/sql_class.cc:
  Add escape characters before multi-byte heads.
strings/ctype-big5.c:
  Flagging character set as dangerous for escaping.
strings/ctype-gbk.c:
  Flagging character set as dangerous for escaping.
strings/ctype-sjis.c:
  Flagging character set as dangerous for escaping.
This commit is contained in:
unknown
2007-06-07 13:16:49 +05:00
parent 4bdbc3396e
commit 2971d645c1
6 changed files with 89 additions and 13 deletions

View File

@@ -192,3 +192,16 @@ drop table t1;
select hex(convert(_big5 0xC84041 using ucs2));
hex(convert(_big5 0xC84041 using ucs2))
003F0041
End of 4.1 tests
create table t1 (a blob);
insert into t1 values (0xEE00);
delete from t1;
select hex(load_file('test/t1.txt'));
hex(load_file('test/t1.txt'))
5CEE5C300A
load data infile 't1.txt' into table t1;
select hex(a) from t1;
hex(a)
EE00
drop table t1;
End of 5.0 tests

View File

@@ -63,4 +63,20 @@ drop table t1;
#
select hex(convert(_big5 0xC84041 using ucs2));
# End of 4.1 tests
--echo End of 4.1 tests
#
# Bug#26711 "binary content 0x00 sometimes becomes 0x5C 0x00 after dump/load"
#
create table t1 (a blob);
insert into t1 values (0xEE00);
--exec $MYSQL_DUMP --default-character-set=big5 -T $MYSQLTEST_VARDIR/master-data/test test t1
delete from t1;
select hex(load_file('test/t1.txt'));
load data infile 't1.txt' into table t1;
select hex(a) from t1;
--exec rm $MYSQLTEST_VARDIR/master-data/test/t1.txt
--exec rm $MYSQLTEST_VARDIR/master-data/test/t1.sql
drop table t1;
--echo End of 5.0 tests