mirror of
https://github.com/MariaDB/server.git
synced 2025-08-26 01:44:06 +03:00
Bug#41110: crash with handler command when used concurrently with alter table
Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table The problem is that the server wasn't handling robustly failures to re-open a table during a HANDLER .. READ statement. If the table needed to be re-opened due to it's storage engine being altered to one that doesn't support HANDLER, a reference (dangling pointer) to a closed table could be left in place and accessed in later attempts to fetch from the table using the handler. Also, if the server failed to set a error message if the re-open failed. These problems could lead to server crashes or hangs. The solution is to remove any references to a closed table and to set a error if reopening a table during a HANDLER .. READ statement fails.
This commit is contained in:
@@ -692,3 +692,29 @@ unlock tables;
|
||||
drop table t1;
|
||||
--error ER_UNKNOWN_TABLE
|
||||
handler t1 read a next;
|
||||
|
||||
#
|
||||
# Bug#41110: crash with handler command when used concurrently with alter table
|
||||
# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
handler t1 open;
|
||||
connect(con1,localhost,root,,);
|
||||
send alter table t1 engine=memory;
|
||||
connection default;
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = "rename result table" and info = "alter table t1 engine=memory";
|
||||
--source include/wait_condition.inc
|
||||
--error ER_ILLEGAL_HA
|
||||
handler t1 read a next;
|
||||
handler t1 close;
|
||||
connection con1;
|
||||
--reap
|
||||
drop table t1;
|
||||
connection default;
|
||||
|
Reference in New Issue
Block a user