summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-26 09:42:52 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-26 09:42:52 +0100
commit319bcde937fa449d55a1b58ede05a8a50960c0ec (patch)
treef359d825e37ee2fd8cf2eeb5ed00706d62cfc221 /mysql-test/t
parent218280bcd76eb8cbe083157433d709ff7a0e3580 (diff)
downloadmariadb-git-319bcde937fa449d55a1b58ede05a8a50960c0ec.tar.gz
MDEV-5861 MySQL Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES IGNORED AND BREAKS REPLICATION
escape usernames in CREATE/DROP USER error messages according to NO_BACKSLASH_ESCAPES
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/not_embedded_server.test107
1 files changed, 107 insertions, 0 deletions
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index 0878a78b885..e74da3a8ff4 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -102,3 +102,110 @@ DROP USER nopriv_user@localhost;
--echo #
--echo # End Bug#54812
--echo #
+
+
+--echo
+--echo #
+--echo # Test for Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES
+--echo # IGNORED AND BREAKS REPLICATION
+--echo #
+
+SET @org_mode=@@sql_mode;
+
+SET @@sql_mode='';
+
+--echo # USER NAME CONTAINING BACKSLASH IN CREATE USER OPERATION
+CREATE USER 'user\'s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\'s_12601974'@'localhost';
+DROP USER 'user\'s_12601974'@'localhost';
+
+CREATE USER 'user\"s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\"s_12601974'@'localhost';
+DROP USER 'user\"s_12601974'@'localhost';
+
+CREATE USER 'user\bs_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\bs_12601974'@'localhost';
+DROP USER 'user\bs_12601974'@'localhost';
+
+CREATE USER 'user\ns_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\ns_12601974'@'localhost';
+DROP USER 'user\ns_12601974'@'localhost';
+
+CREATE USER 'user\rs_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\rs_12601974'@'localhost';
+DROP USER 'user\rs_12601974'@'localhost';
+
+CREATE USER 'user\ts_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\ts_12601974'@'localhost';
+DROP USER 'user\ts_12601974'@'localhost';
+
+CREATE USER 'user\\s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\\s_12601974'@'localhost';
+DROP USER 'user\\s_12601974'@'localhost';
+
+CREATE USER 'user\%s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\%s_12601974'@'localhost';
+DROP USER 'user\%s_12601974'@'localhost';
+
+CREATE USER 'user\_s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\_s_12601974'@'localhost';
+DROP USER 'user\_s_12601974'@'localhost';
+--echo
+--echo # END OF CASE - USER NAME CONTAINING BACKSLASH IN CREATE USER OPERATION
+
+SET @@sql_mode='NO_BACKSLASH_ESCAPES';
+--echo # USER NAME CONTAINING BACKSLASH IN DROP USER OPERATION
+CREATE USER 'user\"s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\"s_12601974'@'localhost';
+DROP USER 'user\"s_12601974'@'localhost';
+
+CREATE USER 'user\bs_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\bs_12601974'@'localhost';
+DROP USER 'user\bs_12601974'@'localhost';
+
+CREATE USER 'user\ns_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\ns_12601974'@'localhost';
+DROP USER 'user\ns_12601974'@'localhost';
+
+CREATE USER 'user\rs_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\rs_12601974'@'localhost';
+DROP USER 'user\rs_12601974'@'localhost';
+
+CREATE USER 'user\ts_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\ts_12601974'@'localhost';
+DROP USER 'user\ts_12601974'@'localhost';
+
+CREATE USER 'user\\s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\\s_12601974'@'localhost';
+DROP USER 'user\\s_12601974'@'localhost';
+
+CREATE USER 'user\%s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\%s_12601974'@'localhost';
+DROP USER 'user\%s_12601974'@'localhost';
+
+CREATE USER 'user\_s_12601974'@'localhost';
+--error ER_CANNOT_USER
+CREATE USER 'user\_s_12601974'@'localhost';
+DROP USER 'user\_s_12601974'@'localhost';
+--echo
+--echo # END OF CASE - USER NAME CONTAINING BACKSLASH IN CREATE USER OPERATION
+SET @@sql_mode= @org_mode;
+
+--echo
+--echo #End of Test for Bug#12601974