Skip to content

Commit 3db4d01

Browse files
committed
Merge branch 'bb-10.4-release' into 10.4
2 parents 48570eb + b8e655c commit 3db4d01

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

mysql-test/main/grant5.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ disconnect conn1;
127127
connection default;
128128
drop database mysqltest_1;
129129
drop user twg@'%';
130+
insert mysql.tables_priv (host,db,user,table_name,grantor,table_priv) values ('localhost','','otto','t1','root@localhost','select');
131+
flush privileges;
132+
delete from mysql.tables_priv where db='';

mysql-test/main/grant5.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,10 @@ connection default;
124124

125125
drop database mysqltest_1;
126126
drop user twg@'%';
127+
128+
#
129+
# test the empty db case
130+
#
131+
insert mysql.tables_priv (host,db,user,table_name,grantor,table_priv) values ('localhost','','otto','t1','root@localhost','select');
132+
flush privileges;
133+
delete from mysql.tables_priv where db='';

sql/sql_acl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5084,14 +5084,14 @@ GRANT_NAME::GRANT_NAME(TABLE *form, bool is_routine)
50845084
update_hostname(&host, hostname);
50855085

50865086
db= get_field(&grant_memroot,form->field[1]);
5087-
sort= get_magic_sort("hdu", host.hostname, db, user);
50885087
tname= get_field(&grant_memroot,form->field[3]);
50895088
if (!db || !tname)
50905089
{
50915090
/* Wrong table row; Ignore it */
50925091
privs= 0;
50935092
return; /* purecov: inspected */
50945093
}
5094+
sort= get_magic_sort("hdu", host.hostname, db, user);
50955095
if (lower_case_table_names)
50965096
{
50975097
my_casedn_str(files_charset_info, db);

0 commit comments

Comments
 (0)