mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
parent
730bea634f
commit
60fc91570b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user