diff options
Diffstat (limited to 'mysql-test/t/errors.test')
-rw-r--r-- | mysql-test/t/errors.test | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index b426d9fd5b0..82204e1bfac 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -68,6 +68,110 @@ INSERT INTO t1 SELECT b FROM t1; DROP TABLE t1; # End of 5.0 tests +flush status; +--disable_warnings +drop table if exists t1, t2; +--enable_warnings +create table t1 (a int unique); +create table t2 (a int); +drop function if exists f1; +drop function if exists f2; + +delimiter |; + +create function f1() returns int +begin + insert into t1 (a) values (1); + insert into t1 (a) values (1); + return 1; +end| +create function f2() returns int +begin + insert into t2 (a) values (1); + return 2; +end| +delimiter ;| + +flush status; +--error 1062 +select f1(), f2(); +show status like 'Com_insert'; +select * from t1; +select * from t2; +drop table t1; +drop table t2; +drop function f1; +drop function f2; + +# +# testing the value encoding in the error messages +# +# should be TR\xC3\x9CE, TRÜE, TRÜE +# +SET NAMES utf8; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _binary x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _utf8 x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create=_latin1 x'5452DC45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create='TRÜE'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create=TRÜE; + +SET NAMES latin1; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _binary x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _utf8 x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create=_latin1 x'5452DC45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create='TRÜE'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create=TRÜE; + +SET NAMES binary; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _binary x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create= _utf8 x'5452C39C45'; +--error ER_WRONG_VALUE_FOR_VAR +SET sql_quote_show_create=_latin1 x'5452DC45'; + +--echo # +--echo # Bug#52430 Incorrect key in the error message for duplicate key error involving BINARY type +--echo # +CREATE TABLE t1(c1 BINARY(10), c2 BINARY(10), c3 BINARY(10), +PRIMARY KEY(c1,c2,c3)); +INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc'); +--error ER_DUP_ENTRY +INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc'); +DROP TABLE t1; + +CREATE TABLE t1 (f1 VARBINARY(19) PRIMARY KEY); +INSERT INTO t1 VALUES ('abc\0\0'); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES ('abc\0\0'); +DROP TABLE t1; + +--echo # +--echo # Bug#57882: Item_func_conv_charset::val_str(String*): +--echo # Assertion `fixed == 1' failed +--echo # + +--error ER_DATA_OUT_OF_RANGE +SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),'')); + +SET NAMES utf8 COLLATE utf8_latvian_ci ; +--error ER_DATA_OUT_OF_RANGE +SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null); + +--echo # +--echo # End Bug#57882 +--echo # + # # Bug #13031606 VALUES() IN A SELECT STATEMENT CRASHES SERVER # |