mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
ce39d29493
Crash happened when one selected data from one of INFORMATION_SCHEMA tables and in order to build its contents server had to open view which used stored function and table or view on which one had not global or database-level privileges (e.g. had only table-level or had no privileges at all). The crash was caused by usage of check_grant() function, which assumes that either number of tables to be inspected by it is limited explicitly or table list used and thd->lex->query_tables_own_last value correspond to each other (the latter should be either 0 or point to next_global member of one of elements of this table list), in conditions when above assumptions were not true. This fix just explicitly limits number of tables to be inspected. Other negative effects which are caused by the fact that thd->lex->query_tables_own_last might not be set properly during processing of I_S tables are less disastrous and will be reported and fixed separetely. mysql-test/r/information_schema_db.result: Fix for bug #18113 "SELECT * FROM information_schema.xxx crashes server" test case mysql-test/t/information_schema_db.test: Fix for bug #18113 "SELECT * FROM information_schema.xxx crashes server" test case sql/sql_acl.cc: added note
44 lines
915 B
Text
44 lines
915 B
Text
use INFORMATION_SCHEMA;
|
|
show tables;
|
|
Tables_in_information_schema
|
|
CHARACTER_SETS
|
|
COLLATIONS
|
|
COLLATION_CHARACTER_SET_APPLICABILITY
|
|
COLUMNS
|
|
COLUMN_PRIVILEGES
|
|
KEY_COLUMN_USAGE
|
|
ROUTINES
|
|
SCHEMATA
|
|
SCHEMA_PRIVILEGES
|
|
STATISTICS
|
|
TABLES
|
|
TABLE_CONSTRAINTS
|
|
TABLE_PRIVILEGES
|
|
TRIGGERS
|
|
USER_PRIVILEGES
|
|
VIEWS
|
|
show tables from INFORMATION_SCHEMA like 'T%';
|
|
Tables_in_information_schema (T%)
|
|
TABLES
|
|
TABLE_CONSTRAINTS
|
|
TABLE_PRIVILEGES
|
|
TRIGGERS
|
|
create database `inf%`;
|
|
use `inf%`;
|
|
show tables;
|
|
Tables_in_inf%
|
|
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost';
|
|
create table t1 (f1 int);
|
|
create function func1(curr_int int) returns int
|
|
begin
|
|
declare ret_val int;
|
|
select max(f1) from t1 into ret_val;
|
|
return ret_val;
|
|
end|
|
|
create view v1 as select f1 from t1 where f1 = func1(f1);
|
|
select * from information_schema.tables;
|
|
drop user mysqltest_1@localhost;
|
|
drop view v1;
|
|
drop function func1;
|
|
drop table t1;
|
|
drop database `inf%`;
|