summaryrefslogtreecommitdiff
path: root/mysql-test/t/sql_mode.test
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-24 13:58:07 +0100
committerunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-24 13:58:07 +0100
commitd6dafaa1021ef93698a04556fceb3dc586463b5d (patch)
treeb3b7cfca22564f1b9a3e61043ec581ff23086753 /mysql-test/t/sql_mode.test
parenta97d77ce14ba0309321a477697d1e7522e6c08d0 (diff)
downloadmariadb-git-d6dafaa1021ef93698a04556fceb3dc586463b5d.tar.gz
Bug#32753: PAD_CHAR_TO_FULL_LENGTH is not documented and interferes with grant tables
SQL-mode PAD_CHAR_TO_FULL_LENGTH affected mysqld's user-table too. If enabled, user-name and host were space-padded and no longer matched the login-data of incoming connexions. Patch disregards pad-flag while loading privileges so ability to log in does not depend on SQL-mode. mysql-test/r/sql_mode.result: show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect loading of privileges (and by extension, ability to log in). mysql-test/t/sql_mode.test: show that SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' does not affect loading of privileges (and by extension, ability to log in). sql/sql_acl.cc: temporarily disable SQL-mode 'PAD_CHAR_TO_FULL_LENGTH' while reloading privileges
Diffstat (limited to 'mysql-test/t/sql_mode.test')
-rw-r--r--mysql-test/t/sql_mode.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index 7a9036c8621..acc9cc7979e 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -279,3 +279,32 @@ select concat('x',b,'x') from t1;
drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
+
+
+#
+# Bug #32753: PAD_CHAR_TO_FULL_LENGTH is not documented and interferes
+# with grant tables
+#
+
+create user mysqltest_32753@localhost;
+
+# try to make the user-table space-padded
+--connection default
+set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
+set session sql_mode='PAD_CHAR_TO_FULL_LENGTH';
+flush privileges;
+
+# if user-table is affected by PAD_CHAR_TO_FULL_LENGTH, our connect will fail
+# --error 1045
+connect (user_32753,localhost,mysqltest_32753,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+select current_user();
+
+# clean up
+--connection default
+set session sql_mode=@OLD_SQL_MODE;
+flush privileges;
+
+--disconnect user_32753
+
+--connection default
+drop user mysqltest_32753@localhost;