mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#751 Error message construction, backport
This commit is contained in:
47
mysql-test/t/ctype_errors.test
Normal file
47
mysql-test/t/ctype_errors.test
Normal file
@ -0,0 +1,47 @@
|
||||
--echo Start of 5.4 tests
|
||||
|
||||
#
|
||||
# ls_messages
|
||||
#
|
||||
CREATE TABLE t1(f1 INT);
|
||||
connect (con1,localhost,root,,test);
|
||||
connection con1;
|
||||
SET lc_messages=ru_RU;
|
||||
SHOW VARIABLES LIKE 'lc_messages';
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
CREATE TABLE t1(f1 INT);
|
||||
SET NAMES utf8;
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
CREATE TABLE t1(f1 INT);
|
||||
connection default;
|
||||
SHOW VARIABLES LIKE 'lc_messages';
|
||||
--error ER_TABLE_EXISTS_ERROR
|
||||
CREATE TABLE t1(f1 INT);
|
||||
|
||||
SHOW GLOBAL VARIABLES LIKE 'lc_messages';
|
||||
SET GLOBAL lc_messages=ru_RU;
|
||||
SHOW GLOBAL VARIABLES LIKE 'lc_messages';
|
||||
SET GLOBAL lc_messages=en_US;
|
||||
|
||||
disconnect con1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#1406 Tablename in Errormessage not in default characterset
|
||||
#
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
drop table `ק`;
|
||||
|
||||
#
|
||||
# Bug#14602 Error messages not returned in character_set_results
|
||||
#
|
||||
connect (con1,localhost,root,,test);
|
||||
connection con1;
|
||||
SET lc_messages=cs_CZ;
|
||||
SET NAMES UTF8;
|
||||
--error ER_BAD_DB_ERROR
|
||||
USE nonexistant;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
--echo End of 5.4 tests
|
@ -67,3 +67,38 @@ SHOW ERRORS;
|
||||
INSERT INTO t1 SELECT b FROM t1;
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests
|
||||
|
||||
#
|
||||
# testing the value encoding in the error messages of set_var
|
||||
#
|
||||
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';
|
||||
|
@ -382,6 +382,11 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug31060.sql;
|
||||
|
||||
drop tables t1, t2;
|
||||
|
||||
#
|
||||
# mysql client with 'init-command' option
|
||||
#
|
||||
--exec $MYSQL --init-command="SET lc_messages=ru_RU" -e "SHOW VARIABLES LIKE 'lc_messages';"
|
||||
|
||||
#
|
||||
# Bug #27884: mysql --html does not quote HTML special characters in output
|
||||
#
|
||||
|
@ -948,15 +948,15 @@ SET @@global.init_file= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
SHOW VARIABLES like 'language';
|
||||
SHOW VARIABLES like 'lc_messages_dir';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.language;
|
||||
SELECT @@session.lc_messages_dir;
|
||||
--replace_column 1 #
|
||||
SELECT @@global.language;
|
||||
SELECT @@global.lc_messages_dir;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@session.language= 'x';
|
||||
SET @@session.lc_messages_dir= 'x';
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@global.language= 'x';
|
||||
SET @@global.lc_messages_dir= 'x';
|
||||
#
|
||||
--echo #
|
||||
--replace_column 2 #
|
||||
|
Reference in New Issue
Block a user