Commit 26aa83bf authored by Michael Widenius's avatar Michael Widenius

Fix for LP#702786 "Two handler read f1 next gives different errors"


mysql-test/suite/handler/heap.result:
  New test case
mysql-test/suite/handler/heap.test:
  New test case
sql/sql_handler.cc:
  If we get a fatal error in handler read, end table/index scan as it's likely it was wrongly used (for example not supported feature for index)
parent bda130e6
......@@ -772,4 +772,15 @@ HANDLER t1 READ NEXT LIMIT 2;
ERROR HY000: Record has changed since last read in table 't1'
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.1 tests
create table t1 (f1 integer not null, key (f1)) engine=Memory;
insert into t1 values (1);
HANDLER t1 OPEN;
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
HANDLER t1 READ f1 NEXT;
ERROR HY000: Table storage engine for 't1' doesn't have this option
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.3 tests
......@@ -70,4 +70,19 @@ HANDLER t1 CLOSE;
DROP TABLE t1;
disconnect con1;
--echo End of 5.1 tests
#
# LP#702786 Two handler read f1 next gives different errors
#
create table t1 (f1 integer not null, key (f1)) engine=Memory;
insert into t1 values (1);
HANDLER t1 OPEN;
--error 1031
HANDLER t1 READ f1 NEXT;
--error 1031
HANDLER t1 READ f1 NEXT;
--error 1031
HANDLER t1 READ f1 NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
--echo End of 5.3 tests
......@@ -819,6 +819,7 @@ retry:
"table '%s'",
error, tables->table_name);
table->file->print_error(error,MYF(0));
table->file->ha_index_or_rnd_end();
goto err;
}
goto ok;
......
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