summaryrefslogtreecommitdiff
path: root/mysql-test/suite/handler
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-01-14 12:32:23 +0200
committerMichael Widenius <monty@askmonty.org>2011-01-14 12:32:23 +0200
commit26aa83bfc0c0b2679bb9ce89232ce434a1695a5f (patch)
tree2f18a1ada87c8b3d2a660a020aa9f8385ce3a755 /mysql-test/suite/handler
parentbda130e6b3ddc45218e4ed1b81cb03a213e5e00c (diff)
downloadmariadb-git-26aa83bfc0c0b2679bb9ce89232ce434a1695a5f.tar.gz
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)
Diffstat (limited to 'mysql-test/suite/handler')
-rw-r--r--mysql-test/suite/handler/heap.result13
-rw-r--r--mysql-test/suite/handler/heap.test17
2 files changed, 28 insertions, 2 deletions
diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result
index 27d3f05b14e..b41f49091f1 100644
--- a/mysql-test/suite/handler/heap.result
+++ b/mysql-test/suite/handler/heap.result
@@ -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
diff --git a/mysql-test/suite/handler/heap.test b/mysql-test/suite/handler/heap.test
index 570ad59977c..e9e5c5fad44 100644
--- a/mysql-test/suite/handler/heap.test
+++ b/mysql-test/suite/handler/heap.test
@@ -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