mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#30632 HANDLER read failure causes hang
If, after the tables are locked, one of the conditions to read from a HANDLER table is not met, the handler code wrongly jumps to a error path that won't unlock the tables. The user-visible effect is that after a error in a handler read command, all subsequent handler operations on the same table will hang. The fix is simply to correct the code to jump to the (same) error path that unlocks the tables. mysql-test/r/handler.result: Bug#30632 test case result mysql-test/t/handler.test: Bug#30632 test case sql/sql_handler.cc: Always unlock the internal and external table level locks if any of the conditions (including errors) to read from a HANDLER table are not met.
This commit is contained in:
@ -489,3 +489,16 @@ handler t1 open;
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
--> client 1
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
create table t1 (a int);
|
||||
handler t1 open as t1_alias;
|
||||
handler t1_alias read a next;
|
||||
ERROR HY000: Key 'a' doesn't exist in table 't1_alias'
|
||||
handler t1_alias READ a next where inexistent > 0;
|
||||
ERROR 42S22: Unknown column 'inexistent' in 'field list'
|
||||
handler t1_alias read a next;
|
||||
ERROR HY000: Key 'a' doesn't exist in table 't1_alias'
|
||||
handler t1_alias READ a next where inexistent > 0;
|
||||
ERROR 42S22: Unknown column 'inexistent' in 'field list'
|
||||
handler t1_alias close;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user