Skip to content

Commit d89cdfc

Browse files
committed
bugfix: mysql_fix_privilege_tables table_schema=database()
fix mysql_fix_privilege_tables to look for the `user` table in the correct schema when deciding whether to convert it to `global_priv` table make related tests a bit more verbose
1 parent 84cbd69 commit d89cdfc

7 files changed

+139
-299
lines changed

mysql-test/main/system_mysql_db_fix40123.result

Lines changed: 25 additions & 51 deletions
Large diffs are not rendered by default.

mysql-test/main/system_mysql_db_fix40123.test

Lines changed: 18 additions & 37 deletions
Large diffs are not rendered by default.

mysql-test/main/system_mysql_db_fix50030.result

Lines changed: 29 additions & 51 deletions
Large diffs are not rendered by default.

mysql-test/main/system_mysql_db_fix50030.test

Lines changed: 20 additions & 42 deletions
Large diffs are not rendered by default.

mysql-test/main/system_mysql_db_fix50117.result

Lines changed: 25 additions & 51 deletions
Large diffs are not rendered by default.

mysql-test/main/system_mysql_db_fix50117.test

Lines changed: 21 additions & 66 deletions
Large diffs are not rendered by default.

scripts/mysql_system_tables_fix.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ ALTER TABLE column_stats ENGINE=Aria transactional=0;
760760
ALTER TABLE index_stats ENGINE=Aria transactional=0;
761761

762762
DELIMITER //
763-
IF 'BASE TABLE' = (select table_type from information_schema.tables where table_name='user') THEN
763+
IF 'BASE TABLE' = (select table_type from information_schema.tables where table_schema=database() and table_name='user') THEN
764764
CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User char(80) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY Host (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'
765765
SELECT Host, User, JSON_COMPACT(JSON_OBJECT('access',
766766
1*('Y'=Select_priv)+

0 commit comments

Comments
 (0)