diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/ctype_errors.test | 47 | ||||
-rw-r--r-- | mysql-test/t/errors.test | 35 | ||||
-rw-r--r-- | mysql-test/t/mysql.test | 5 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 10 |
4 files changed, 92 insertions, 5 deletions
diff --git a/mysql-test/t/ctype_errors.test b/mysql-test/t/ctype_errors.test new file mode 100644 index 00000000000..3c73fdae264 --- /dev/null +++ b/mysql-test/t/ctype_errors.test @@ -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 diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index 89579ec1739..820766c3a78 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -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'; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index cffa6392fa3..6e74e065720 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -383,6 +383,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 # --exec $MYSQL --html test -e "select '< & >' as '<'" diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index e7d7d5ca16b..6b179c72915 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -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 # |