MDEV-5553 A view or procedure with a non existing definer can block "SHOW TABLE STATUS" with an unclear error message
Don't double-check privileges for a column in the GROUP BY that refers to the same column in SELECT clause. Privileges were already checked for SELECT clause.
This commit is contained in:
parent
e5bc21af37
commit
fc58ba6c76
13
mysql-test/r/show_bad_definer-5553.result
Normal file
13
mysql-test/r/show_bad_definer-5553.result
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
create database mysqltest1;
|
||||||
|
use mysqltest1;
|
||||||
|
create table t1(id int primary key);
|
||||||
|
create definer=unknownuser@'%' sql security definer view v1 as select t1.id from t1 group by t1.id;
|
||||||
|
Warnings:
|
||||||
|
Note 1449 The user specified as a definer ('unknownuser'@'%') does not exist
|
||||||
|
show table status;
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
|
t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
|
||||||
|
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL VIEW
|
||||||
|
Warnings:
|
||||||
|
Note 1449 The user specified as a definer ('unknownuser'@'%') does not exist
|
||||||
|
drop database mysqltest1;
|
11
mysql-test/t/show_bad_definer-5553.test
Normal file
11
mysql-test/t/show_bad_definer-5553.test
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# MDEV-5553 A view or procedure with a non existing definer can block "SHOW TABLE STATUS" with an unclear error message
|
||||||
|
#
|
||||||
|
|
||||||
|
create database mysqltest1; # all-open privileges on test db desroy the test
|
||||||
|
use mysqltest1;
|
||||||
|
create table t1(id int primary key);
|
||||||
|
create definer=unknownuser@'%' sql security definer view v1 as select t1.id from t1 group by t1.id;
|
||||||
|
--replace_column 8 # 12 # 13 #
|
||||||
|
show table status;
|
||||||
|
drop database mysqltest1;
|
@ -20458,7 +20458,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
|
|||||||
order_item_type == Item::REF_ITEM)
|
order_item_type == Item::REF_ITEM)
|
||||||
{
|
{
|
||||||
from_field= find_field_in_tables(thd, (Item_ident*) order_item, tables,
|
from_field= find_field_in_tables(thd, (Item_ident*) order_item, tables,
|
||||||
NULL, &view_ref, IGNORE_ERRORS, TRUE,
|
NULL, &view_ref, IGNORE_ERRORS, FALSE,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!from_field)
|
if (!from_field)
|
||||||
from_field= (Field*) not_found_field;
|
from_field= (Field*) not_found_field;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user