Commit 5f458562 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.

mysql-test/r/innodb_mysql_rbk.result:
  Bug #41543: test case
mysql-test/t/innodb_mysql_rbk-master.opt:
  Bug #41543: test case
mysql-test/t/innodb_mysql_rbk.test:
  Bug #41543: test case
sql/filesort.cc:
  Bug #41543: No need to mask the error code returned by getting the next row to end of file when
  doing filesort.
parent 13bb89ed
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,
if (quick_select)
{
if ((error= select->quick->get_next()))
{
error= HA_ERR_END_OF_FILE;
break;
}
file->position(sort_form->record[0]);
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