Commit 53ba196e authored by Georgi Kodinov's avatar Georgi Kodinov

Bug #41543: Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno

No need to mask the error code returned by getting the next row to end of file when
doing filesort.
parent ec9f8852
CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
a b
3 3
START TRANSACTION;
UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ROLLBACK;
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
a b
3 3
START TRANSACTION;
UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 WHERE b = 10;
a b
DROP TABLE t1;
--innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1
-- source include/have_innodb.inc
#
# Bug #41453: Assertion `m_status == DA_ERROR' failed in
# Diagnostics_area::sql_errno
#
CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
CONNECT (con1,localhost,root,,);
CONNECT (con2,localhost,root,,);
CONNECTION con1;
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
CONNECTION con2;
START TRANSACTION;
--error ER_LOCK_WAIT_TIMEOUT
UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
ROLLBACK;
CONNECTION con1;
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
CONNECTION con2;
START TRANSACTION;
--error ER_LOCK_WAIT_TIMEOUT
UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
SELECT * FROM t1 WHERE b = 10;
CONNECTION default;
DISCONNECT con1;
DISCONNECT con2;
DROP TABLE t1;
...@@ -562,10 +562,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ...@@ -562,10 +562,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if (quick_select) if (quick_select)
{ {
if ((error= select->quick->get_next())) if ((error= select->quick->get_next()))
{
error= HA_ERR_END_OF_FILE;
break; break;
}
file->position(sort_form->record[0]); file->position(sort_form->record[0]);
DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE);); DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE););
} }
......
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