Commit d1e162e0 authored by Alexander Barkov's avatar Alexander Barkov

Merging utf16le from MySQL-5.6

added:
  mysql-test/include/ctype_heap.inc
  mysql-test/include/ctype_strtoll10.inc
  mysql-test/r/ctype_utf16le.result
  mysql-test/t/ctype_utf16le.test
modified:
  cmake/character_sets.cmake
  include/m_ctype.h
  mysql-test/r/ctype_ucs.result
  mysql-test/r/ctype_utf16.result
  mysql-test/r/ctype_utf32.result
  mysql-test/suite/funcs_1/r/innodb_func_view.result
  mysql-test/suite/funcs_1/r/memory_func_view.result
  mysql-test/suite/funcs_1/r/myisam_func_view.result
  mysql-test/suite/sys_vars/r/character_set_client_basic.result
  mysql-test/suite/sys_vars/r/character_set_connection_basic.result
  mysql-test/suite/sys_vars/r/character_set_database_basic.result
  mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
  mysql-test/suite/sys_vars/r/character_set_results_basic.result
  mysql-test/t/ctype_ucs.test
  mysql-test/t/ctype_utf16.test
  mysql-test/t/ctype_utf32.test
  mysys/charset-def.c
  sql/item_func.cc
  sql/sys_vars.cc
  strings/ctype-latin1.c
  strings/ctype-ucs2.c
parent 41013f16
......@@ -25,14 +25,14 @@ ENDIF()
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
SET(CHARSETS_COMPLEX
big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf16le utf32)
SET(CHARSETS_AVAILABLE
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
greek hebrew hp8 keybcs2 koi8r koi8u
latin1 latin2 latin5 latin7 macce macroman
sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf16le utf32)
SET (EXTRA_CHARSETS "all")
......
......@@ -362,6 +362,8 @@ extern struct charset_info_st my_charset_ujis_japanese_ci;
extern struct charset_info_st my_charset_utf16_bin;
extern struct charset_info_st my_charset_utf16_general_ci;
extern struct charset_info_st my_charset_utf16_unicode_ci;
extern struct charset_info_st my_charset_utf16le_bin;
extern struct charset_info_st my_charset_utf16le_general_ci;
extern struct charset_info_st my_charset_utf32_bin;
extern struct charset_info_st my_charset_utf32_general_ci;
extern struct charset_info_st my_charset_utf32_unicode_ci;
......
--echo #
--echo # Test that cs->coll->hash_sort() ignores trailing spaces
--echo #
SELECT @@collation_connection;
CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT (' ', 10) AS a LIMIT 0;
ALTER TABLE t1 ADD KEY (a);
CREATE TABLE t2 (a VARCHAR(10));
INSERT INTO t2 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
INSERT INTO t2 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
INSERT INTO t1 SELECT CONCAT('a',t21.a,t22.a) FROM t2 t21, t2 t22 ORDER BY 1;
DROP TABLE t2;
INSERT INTO t1 VALUES ('a ');
SELECT a, HEX(a) FROM t1 WHERE a='a';
DROP TABLE t1;
--echo #
--echo # Testing cs->cset->strtoll10()
--echo #
SELECT @@character_set_connection;
SELECT CAST('1' AS UNSIGNED);
SELECT CAST('12' AS UNSIGNED);
SELECT CAST('123' AS UNSIGNED);
SELECT CAST('1234' AS UNSIGNED);
SELECT CAST('12345' AS UNSIGNED);
SELECT CAST('123456' AS UNSIGNED);
SELECT CAST('1234567' AS UNSIGNED);
SELECT CAST('12345678' AS UNSIGNED);
SELECT CAST('123456789' AS UNSIGNED);
SELECT CAST('1234567891' AS UNSIGNED);
SELECT CAST('12345678912' AS UNSIGNED);
SELECT CAST('123456789123' AS UNSIGNED);
SELECT CAST('1234567891234' AS UNSIGNED);
SELECT CAST('12345678912345' AS UNSIGNED);
SELECT CAST('123456789123456' AS UNSIGNED);
SELECT CAST('1234567891234567' AS UNSIGNED);
SELECT CAST('12345678912345678' AS UNSIGNED);
SELECT CAST('123456789123456789' AS UNSIGNED);
SELECT CAST('1234567891234567891' AS UNSIGNED);
SELECT CAST('12345678912345678912' AS UNSIGNED);
SELECT CAST('123456789123456789123' AS UNSIGNED);
SELECT CAST('1x' AS UNSIGNED);
SELECT CAST('12x' AS UNSIGNED);
SELECT CAST('123x' AS UNSIGNED);
SELECT CAST('1234x' AS UNSIGNED);
SELECT CAST('12345x' AS UNSIGNED);
SELECT CAST('123456x' AS UNSIGNED);
SELECT CAST('1234567x' AS UNSIGNED);
SELECT CAST('12345678x' AS UNSIGNED);
SELECT CAST('123456789x' AS UNSIGNED);
SELECT CAST('1234567891x' AS UNSIGNED);
SELECT CAST('12345678912x' AS UNSIGNED);
SELECT CAST('123456789123x' AS UNSIGNED);
SELECT CAST('1234567891234x' AS UNSIGNED);
SELECT CAST('12345678912345x' AS UNSIGNED);
SELECT CAST('123456789123456x' AS UNSIGNED);
SELECT CAST('1234567891234567x' AS UNSIGNED);
SELECT CAST('12345678912345678x' AS UNSIGNED);
SELECT CAST('123456789123456789x' AS UNSIGNED);
SELECT CAST('1234567891234567891x' AS UNSIGNED);
SELECT CAST('12345678912345678912x' AS UNSIGNED);
SELECT CAST('123456789123456789123x' AS UNSIGNED);
......@@ -1274,7 +1274,7 @@ SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
Warning 1292 Truncated incorrect INTEGER value: ''õ''
End of 5.0 tests
#
# Start of 5.1 tests
......@@ -4200,3 +4200,22 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
#
# Start of 5.6 tests
#
#
# Bug#59145 valgrind warnings for uninitialized values in my_strtoll10_mb2
#
SET NAMES latin1;
SELECT CONVERT(CHAR(NULL USING ucs2), UNSIGNED);
CONVERT(CHAR(NULL USING ucs2), UNSIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
DO IFNULL(CHAR(NULL USING ucs2), '');
DO CAST(CONVERT('' USING ucs2) AS UNSIGNED);
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
#
# End of 5.6 tests
#
......@@ -921,6 +921,182 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.2xxx'
select left('aaa','1');
left('aaa','1')
a
#
# Testing cs->cset->strtoll10()
#
SELECT @@character_set_connection;
@@character_set_connection
utf16
SELECT CAST('1' AS UNSIGNED);
CAST('1' AS UNSIGNED)
1
SELECT CAST('12' AS UNSIGNED);
CAST('12' AS UNSIGNED)
12
SELECT CAST('123' AS UNSIGNED);
CAST('123' AS UNSIGNED)
123
SELECT CAST('1234' AS UNSIGNED);
CAST('1234' AS UNSIGNED)
1234
SELECT CAST('12345' AS UNSIGNED);
CAST('12345' AS UNSIGNED)
12345
SELECT CAST('123456' AS UNSIGNED);
CAST('123456' AS UNSIGNED)
123456
SELECT CAST('1234567' AS UNSIGNED);
CAST('1234567' AS UNSIGNED)
1234567
SELECT CAST('12345678' AS UNSIGNED);
CAST('12345678' AS UNSIGNED)
12345678
SELECT CAST('123456789' AS UNSIGNED);
CAST('123456789' AS UNSIGNED)
123456789
SELECT CAST('1234567891' AS UNSIGNED);
CAST('1234567891' AS UNSIGNED)
1234567891
SELECT CAST('12345678912' AS UNSIGNED);
CAST('12345678912' AS UNSIGNED)
12345678912
SELECT CAST('123456789123' AS UNSIGNED);
CAST('123456789123' AS UNSIGNED)
123456789123
SELECT CAST('1234567891234' AS UNSIGNED);
CAST('1234567891234' AS UNSIGNED)
1234567891234
SELECT CAST('12345678912345' AS UNSIGNED);
CAST('12345678912345' AS UNSIGNED)
12345678912345
SELECT CAST('123456789123456' AS UNSIGNED);
CAST('123456789123456' AS UNSIGNED)
123456789123456
SELECT CAST('1234567891234567' AS UNSIGNED);
CAST('1234567891234567' AS UNSIGNED)
1234567891234567
SELECT CAST('12345678912345678' AS UNSIGNED);
CAST('12345678912345678' AS UNSIGNED)
12345678912345678
SELECT CAST('123456789123456789' AS UNSIGNED);
CAST('123456789123456789' AS UNSIGNED)
123456789123456789
SELECT CAST('1234567891234567891' AS UNSIGNED);
CAST('1234567891234567891' AS UNSIGNED)
1234567891234567891
SELECT CAST('12345678912345678912' AS UNSIGNED);
CAST('12345678912345678912' AS UNSIGNED)
12345678912345678912
SELECT CAST('123456789123456789123' AS UNSIGNED);
CAST('123456789123456789123' AS UNSIGNED)
18446744073709551615
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789123'
SELECT CAST('1x' AS UNSIGNED);
CAST('1x' AS UNSIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1x'
SELECT CAST('12x' AS UNSIGNED);
CAST('12x' AS UNSIGNED)
12
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12x'
SELECT CAST('123x' AS UNSIGNED);
CAST('123x' AS UNSIGNED)
123
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123x'
SELECT CAST('1234x' AS UNSIGNED);
CAST('1234x' AS UNSIGNED)
1234
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234x'
SELECT CAST('12345x' AS UNSIGNED);
CAST('12345x' AS UNSIGNED)
12345
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345x'
SELECT CAST('123456x' AS UNSIGNED);
CAST('123456x' AS UNSIGNED)
123456
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456x'
SELECT CAST('1234567x' AS UNSIGNED);
CAST('1234567x' AS UNSIGNED)
1234567
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567x'
SELECT CAST('12345678x' AS UNSIGNED);
CAST('12345678x' AS UNSIGNED)
12345678
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678x'
SELECT CAST('123456789x' AS UNSIGNED);
CAST('123456789x' AS UNSIGNED)
123456789
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789x'
SELECT CAST('1234567891x' AS UNSIGNED);
CAST('1234567891x' AS UNSIGNED)
1234567891
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891x'
SELECT CAST('12345678912x' AS UNSIGNED);
CAST('12345678912x' AS UNSIGNED)
12345678912
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912x'
SELECT CAST('123456789123x' AS UNSIGNED);
CAST('123456789123x' AS UNSIGNED)
123456789123
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123x'
SELECT CAST('1234567891234x' AS UNSIGNED);
CAST('1234567891234x' AS UNSIGNED)
1234567891234
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234x'
SELECT CAST('12345678912345x' AS UNSIGNED);
CAST('12345678912345x' AS UNSIGNED)
12345678912345
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345x'
SELECT CAST('123456789123456x' AS UNSIGNED);
CAST('123456789123456x' AS UNSIGNED)
123456789123456
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456x'
SELECT CAST('1234567891234567x' AS UNSIGNED);
CAST('1234567891234567x' AS UNSIGNED)
1234567891234567
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234567x'
SELECT CAST('12345678912345678x' AS UNSIGNED);
CAST('12345678912345678x' AS UNSIGNED)
12345678912345678
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345678x'
SELECT CAST('123456789123456789x' AS UNSIGNED);
CAST('123456789123456789x' AS UNSIGNED)
123456789123456789
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789x'
SELECT CAST('1234567891234567891x' AS UNSIGNED);
CAST('1234567891234567891x' AS UNSIGNED)
1234567891234567891
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234567891x'
SELECT CAST('12345678912345678912x' AS UNSIGNED);
CAST('12345678912345678912x' AS UNSIGNED)
12345678912345678912
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345678912x'
SELECT CAST('123456789123456789123x' AS UNSIGNED);
CAST('123456789123456789123x' AS UNSIGNED)
18446744073709551615
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789123x'
create table t1 (a int);
insert into t1 values ('-1234.1e2');
insert into t1 values ('-1234.1e2xxxx');
......
This diff is collapsed.
......@@ -919,6 +919,182 @@ Warning 1292 Truncated incorrect DOUBLE value: '1.2xxx'
select left('aaa','1');
left('aaa','1')
a
#
# Testing cs->cset->strtoll10()
#
SELECT @@character_set_connection;
@@character_set_connection
utf32
SELECT CAST('1' AS UNSIGNED);
CAST('1' AS UNSIGNED)
1
SELECT CAST('12' AS UNSIGNED);
CAST('12' AS UNSIGNED)
12
SELECT CAST('123' AS UNSIGNED);
CAST('123' AS UNSIGNED)
123
SELECT CAST('1234' AS UNSIGNED);
CAST('1234' AS UNSIGNED)
1234
SELECT CAST('12345' AS UNSIGNED);
CAST('12345' AS UNSIGNED)
12345
SELECT CAST('123456' AS UNSIGNED);
CAST('123456' AS UNSIGNED)
123456
SELECT CAST('1234567' AS UNSIGNED);
CAST('1234567' AS UNSIGNED)
1234567
SELECT CAST('12345678' AS UNSIGNED);
CAST('12345678' AS UNSIGNED)
12345678
SELECT CAST('123456789' AS UNSIGNED);
CAST('123456789' AS UNSIGNED)
123456789
SELECT CAST('1234567891' AS UNSIGNED);
CAST('1234567891' AS UNSIGNED)
1234567891
SELECT CAST('12345678912' AS UNSIGNED);
CAST('12345678912' AS UNSIGNED)
12345678912
SELECT CAST('123456789123' AS UNSIGNED);
CAST('123456789123' AS UNSIGNED)
123456789123
SELECT CAST('1234567891234' AS UNSIGNED);
CAST('1234567891234' AS UNSIGNED)
1234567891234
SELECT CAST('12345678912345' AS UNSIGNED);
CAST('12345678912345' AS UNSIGNED)
12345678912345
SELECT CAST('123456789123456' AS UNSIGNED);
CAST('123456789123456' AS UNSIGNED)
123456789123456
SELECT CAST('1234567891234567' AS UNSIGNED);
CAST('1234567891234567' AS UNSIGNED)
1234567891234567
SELECT CAST('12345678912345678' AS UNSIGNED);
CAST('12345678912345678' AS UNSIGNED)
12345678912345678
SELECT CAST('123456789123456789' AS UNSIGNED);
CAST('123456789123456789' AS UNSIGNED)
123456789123456789
SELECT CAST('1234567891234567891' AS UNSIGNED);
CAST('1234567891234567891' AS UNSIGNED)
1234567891234567891
SELECT CAST('12345678912345678912' AS UNSIGNED);
CAST('12345678912345678912' AS UNSIGNED)
12345678912345678912
SELECT CAST('123456789123456789123' AS UNSIGNED);
CAST('123456789123456789123' AS UNSIGNED)
18446744073709551615
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789123'
SELECT CAST('1x' AS UNSIGNED);
CAST('1x' AS UNSIGNED)
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1x'
SELECT CAST('12x' AS UNSIGNED);
CAST('12x' AS UNSIGNED)
12
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12x'
SELECT CAST('123x' AS UNSIGNED);
CAST('123x' AS UNSIGNED)
123
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123x'
SELECT CAST('1234x' AS UNSIGNED);
CAST('1234x' AS UNSIGNED)
1234
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234x'
SELECT CAST('12345x' AS UNSIGNED);
CAST('12345x' AS UNSIGNED)
12345
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345x'
SELECT CAST('123456x' AS UNSIGNED);
CAST('123456x' AS UNSIGNED)
123456
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456x'
SELECT CAST('1234567x' AS UNSIGNED);
CAST('1234567x' AS UNSIGNED)
1234567
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567x'
SELECT CAST('12345678x' AS UNSIGNED);
CAST('12345678x' AS UNSIGNED)
12345678
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678x'
SELECT CAST('123456789x' AS UNSIGNED);
CAST('123456789x' AS UNSIGNED)
123456789
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789x'
SELECT CAST('1234567891x' AS UNSIGNED);
CAST('1234567891x' AS UNSIGNED)
1234567891
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891x'
SELECT CAST('12345678912x' AS UNSIGNED);
CAST('12345678912x' AS UNSIGNED)
12345678912
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912x'
SELECT CAST('123456789123x' AS UNSIGNED);
CAST('123456789123x' AS UNSIGNED)
123456789123
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123x'
SELECT CAST('1234567891234x' AS UNSIGNED);
CAST('1234567891234x' AS UNSIGNED)
1234567891234
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234x'
SELECT CAST('12345678912345x' AS UNSIGNED);
CAST('12345678912345x' AS UNSIGNED)
12345678912345
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345x'
SELECT CAST('123456789123456x' AS UNSIGNED);
CAST('123456789123456x' AS UNSIGNED)
123456789123456
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456x'
SELECT CAST('1234567891234567x' AS UNSIGNED);
CAST('1234567891234567x' AS UNSIGNED)
1234567891234567
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234567x'
SELECT CAST('12345678912345678x' AS UNSIGNED);
CAST('12345678912345678x' AS UNSIGNED)
12345678912345678
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345678x'
SELECT CAST('123456789123456789x' AS UNSIGNED);
CAST('123456789123456789x' AS UNSIGNED)
123456789123456789
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789x'
SELECT CAST('1234567891234567891x' AS UNSIGNED);
CAST('1234567891234567891x' AS UNSIGNED)
1234567891234567891
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1234567891234567891x'
SELECT CAST('12345678912345678912x' AS UNSIGNED);
CAST('12345678912345678912x' AS UNSIGNED)
12345678912345678912
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '12345678912345678912x'
SELECT CAST('123456789123456789123x' AS UNSIGNED);
CAST('123456789123456789123x' AS UNSIGNED)
18446744073709551615
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '123456789123456789123x'
create table t1 (a int);
insert into t1 values ('-1234.1e2');
insert into t1 values ('-1234.1e2xxxx');
......@@ -1126,6 +1302,20 @@ my_col
00
DROP TABLE t1;
#
# Bug#32859 Character sets: no warning with non-fitting chariot wheel
#
CREATE TABLE t1 (utf32 CHAR(5) CHARACTER SET utf32, latin1 CHAR(5) CHARACTER SET latin1);
INSERT INTO t1 (utf32) VALUES (0xc581);
UPDATE t1 SET latin1 = utf32;
Warnings:
Warning 1366 Incorrect string value: '\x00\x00\xC5\x81' for column 'latin1' at row 1
DELETE FROM t1;
INSERT INTO t1 (utf32) VALUES (0x100cc);
UPDATE t1 SET latin1 = utf32;
Warnings:
Warning 1366 Incorrect string value: '\x00\x01\x00\xCC' for column 'latin1' at row 1
DROP TABLE t1;
#
# Bug#55912 FORMAT with locale set fails for numbers < 1000
#
SET collation_connection=utf32_general_ci;
......
......@@ -430,7 +430,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
39
40
'#--------------------FN_DYNVARS_010_10-------------------------#'
SET @@character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
......
......@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
39
40
'#--------------------FN_DYNVARS_011_10-------------------------#'
SET @@character_set_connection = abc;
ERROR 42000: Unknown character set: 'abc'
......
......@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
39
40
'#--------------------FN_DYNVARS_012_10-------------------------#'
SET @@character_set_database = "grek";
ERROR 42000: Unknown character set: 'grek'
......
......@@ -402,7 +402,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
39
40
'#--------------------FN_DYNVARS_008_10-------------------------#'
SET @@character_set_filesystem = abc;
ERROR 42000: Unknown character set: 'abc'
......
......@@ -839,3 +839,20 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 5.6 tests
--echo #
--echo #
--echo # Bug#59145 valgrind warnings for uninitialized values in my_strtoll10_mb2
--echo #
SET NAMES latin1;
SELECT CONVERT(CHAR(NULL USING ucs2), UNSIGNED);
DO IFNULL(CHAR(NULL USING ucs2), '');
DO CAST(CONVERT('' USING ucs2) AS UNSIGNED);
--echo #
--echo # End of 5.6 tests
--echo #
......@@ -653,6 +653,7 @@ select 1.1 + '1.2xxx';
# Testing strntoll10_utf16
# Testing cs->cset->strtoll10
select left('aaa','1');
--source include/ctype_strtoll10.inc
#
# Testing cs->cset->strntoull10rnd
......
This diff is collapsed.
......@@ -692,6 +692,7 @@ select 1.1 + '1.2xxx';
# Testing strntoll10_utf32
# Testing cs->cset->strtoll10
select left('aaa','1');
--source include/ctype_strtoll10.inc
#
# Testing cs->cset->strntoull10rnd
......@@ -812,6 +813,17 @@ CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Bug#32859 Character sets: no warning with non-fitting chariot wheel
--echo #
CREATE TABLE t1 (utf32 CHAR(5) CHARACTER SET utf32, latin1 CHAR(5) CHARACTER SET latin1);
INSERT INTO t1 (utf32) VALUES (0xc581);
UPDATE t1 SET latin1 = utf32;
DELETE FROM t1;
INSERT INTO t1 (utf32) VALUES (0x100cc);
UPDATE t1 SET latin1 = utf32;
DROP TABLE t1;
--echo #
--echo # Bug#55912 FORMAT with locale set fails for numbers < 1000
--echo #
......
......@@ -304,6 +304,8 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_utf16
add_compiled_collation(&my_charset_utf16_general_ci);
add_compiled_collation(&my_charset_utf16_bin);
add_compiled_collation(&my_charset_utf16le_general_ci);
add_compiled_collation(&my_charset_utf16le_bin);
#ifdef HAVE_UCA_COLLATIONS
add_compiled_collation(&my_charset_utf16_unicode_ci);
add_compiled_collation(&my_charset_utf16_icelandic_uca_ci);
......
......@@ -1027,13 +1027,11 @@ longlong Item_func_signed::val_int_from_str(int *error)
value= cs->cset->strtoll10(cs, start, &end, error);
if (*error > 0 || end != start+ length)
{
char err_buff[128];
String err_tmp(err_buff,(uint32) sizeof(err_buff), system_charset_info);
err_tmp.copy(start, length, system_charset_info);
ErrConvString err(res);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
err_tmp.c_ptr());
err.ptr());
}
return value;
}
......
......@@ -509,16 +509,19 @@ static bool check_charset(sys_var *self, THD *thd, set_var *var)
if (var->value->result_type() == STRING_RESULT)
{
String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
if (!(res= var->value->val_str(&str)))
var->save_result.ptr= NULL;
else if (!(var->save_result.ptr= get_charset_by_csname(res->c_ptr(),
MY_CS_PRIMARY,
MYF(0))) &&
!(var->save_result.ptr=get_old_charset_by_name(res->c_ptr())))
else
{
ErrConvString err(res);
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
return true;
ErrConvString err(res); /* Get utf8 '\0' terminated string */
if (!(var->save_result.ptr= get_charset_by_csname(err.ptr(),
MY_CS_PRIMARY,
MYF(0))) &&
!(var->save_result.ptr= get_old_charset_by_name(err.ptr())))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), err.ptr());
return true;
}
}
}
else // INT_RESULT
......@@ -629,11 +632,14 @@ static bool check_collation_not_null(sys_var *self, THD *thd, set_var *var)
String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res= var->value->val_str(&str)))
var->save_result.ptr= NULL;
else if (!(var->save_result.ptr= get_charset_by_name(res->c_ptr(), MYF(0))))
else
{
ErrConvString err(res);
my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
return true;
ErrConvString err(res); /* Get utf8 '\0'-terminated string */
if (!(var->save_result.ptr= get_charset_by_name(err.ptr(), MYF(0))))
{
my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr());
return true;
}
}
}
else // INT_RESULT
......
......@@ -380,7 +380,10 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
if (str >= end)
return MY_CS_TOOSMALL;
pl= uni_to_cs[(wc>>8) & 0xFF];
if (wc > 0xFFFF)
return MY_CS_ILUNI;
pl= uni_to_cs[wc >> 8];
str[0]= pl ? pl[wc & 0xFF] : '\0';
return (!str[0] && wc) ? MY_CS_ILUNI : 1;
}
......
This diff is collapsed.
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