mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-10775 System table in InnoDB format allowed in MariaDB could lead to crash
when opening a system table for a SELECT-like read, pretend (for the sake of engines) it's SQLCOM_SELECT
This commit is contained in:
8
mysql-test/suite/innodb/r/system_tables.result
Normal file
8
mysql-test/suite/innodb/r/system_tables.result
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
alter table mysql.time_zone_name engine=InnoDB;
|
||||||
|
create table envois3 (starttime datetime) engine=InnoDB;
|
||||||
|
insert envois3 values ('2008-08-11 22:43:00');
|
||||||
|
select convert_tz(starttime,'UTC','Europe/Moscow') starttime from envois3;
|
||||||
|
starttime
|
||||||
|
2008-08-12 02:43:00
|
||||||
|
drop table envois3;
|
||||||
|
alter table mysql.time_zone_name engine=MyISAM;
|
12
mysql-test/suite/innodb/t/system_tables.test
Normal file
12
mysql-test/suite/innodb/t/system_tables.test
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-10775 System table in InnoDB format allowed in MariaDB could lead to crash
|
||||||
|
#
|
||||||
|
alter table mysql.time_zone_name engine=InnoDB;
|
||||||
|
create table envois3 (starttime datetime) engine=InnoDB;
|
||||||
|
insert envois3 values ('2008-08-11 22:43:00');
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
select convert_tz(starttime,'UTC','Europe/Moscow') starttime from envois3;
|
||||||
|
drop table envois3;
|
||||||
|
alter table mysql.time_zone_name engine=MyISAM;
|
@ -9223,6 +9223,7 @@ open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
|
|||||||
*/
|
*/
|
||||||
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
|
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
|
||||||
thd->reset_n_backup_open_tables_state(backup);
|
thd->reset_n_backup_open_tables_state(backup);
|
||||||
|
thd->lex->sql_command= SQLCOM_SELECT;
|
||||||
|
|
||||||
if (open_and_lock_tables(thd, table_list, FALSE,
|
if (open_and_lock_tables(thd, table_list, FALSE,
|
||||||
MYSQL_OPEN_IGNORE_FLUSH |
|
MYSQL_OPEN_IGNORE_FLUSH |
|
||||||
|
Reference in New Issue
Block a user