Commit fc58ba6c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5553 A view or procedure with a non existing definer can block "SHOW...

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.
parent e5bc21af
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;
#
# 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)
{
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);
if (!from_field)
from_field= (Field*) not_found_field;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment