1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug 11766519 - 59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.

Part 2. Function QUOTE() was not multi-byte safe.

  @ mysql-test/r/ctype_ucs.result
  @ mysql-test/t/ctype_ucs.test
  Adding tests

  @ sql/item_strfunc.cc
  Fixing Item_func_quote::val_str to be multi-byte safe.

  @ sql/item_strfunc.h
  Multiple size needed for quote characters to mbmaxlen
This commit is contained in:
Alexander Barkov
2011-03-03 18:39:26 +03:00
parent 1bc5e76efb
commit a1e9be8e8b
6 changed files with 84 additions and 7 deletions

View File

@ -218,4 +218,10 @@ hex(a) hex(lower(a)) hex(upper(a))
8352835E 8352835E 8352835E
8372835E 8372835E 8372835E
DROP TABLE t1;
#
# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
#
SELECT QUOTE('<27>\');
QUOTE('<27>\')
'<27>\'
# End of 5.1 tests

View File

@ -990,8 +990,8 @@ old_password(name)
????????
select quote(name) from bug20536;
quote(name)
????????
????????????????
'test1'
'\'test\\_2\''
drop table bug20536;
set names ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
@ -1244,4 +1244,9 @@ DROP TABLE t1;
SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850))
00
SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
End of 5.0 tests

View File

@ -92,4 +92,12 @@ INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
DROP TABLE t1;
--echo #
--echo # Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
--echo #
# In the below string backslash (0x5C) is a part of a multi-byte
# character, so it should not be quoted.
SELECT QUOTE('<27>\');
--echo # End of 5.1 tests

View File

@ -745,5 +745,6 @@ DROP TABLE t1;
--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
--echo #
SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
--echo End of 5.0 tests