summaryrefslogtreecommitdiff
path: root/mysql-test/suite/handler/handler.inc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-01-11 18:51:59 +0200
committerMichael Widenius <monty@askmonty.org>2011-01-11 18:51:59 +0200
commit0d01dd200f97835dfb4e23676332f0ea28050c33 (patch)
tree9e922c6c08df36917f51c509b66df58a04ddf14d /mysql-test/suite/handler/handler.inc
parent050c004f5e6f152f5c4cdadda8a15e01d2f07a9a (diff)
downloadmariadb-git-0d01dd200f97835dfb4e23676332f0ea28050c33.tar.gz
Added HANDLER support for MEMORY tables
Added key and file version numbers to MEMORY tables so that we can detect if someone has changed them between HANDLER calls. mysql-test/suite/handler/aria.result: Fixed result after test changes mysql-test/suite/handler/handler.inc: Changed test to use combined key to ensure rows are returned in a pre-determinated order. mysql-test/suite/handler/heap.result: New result mysql-test/suite/handler/heap.test: Added test for HANDLER + HEAP mysql-test/suite/handler/innodb.result: Fixed result after test changes mysql-test/suite/handler/myisam.result: Fixed result after test changes sql/sql_handler.cc: Fixed wrong parameter to ha_index_next_same() storage/heap/ha_heap.cc: Abort key scan if table has changed. Abort table scan if table has been recreated. storage/heap/ha_heap.h: Added support for HANDLER storage/heap/hp_clear.c: Increase version number so that we can notice changes if using HANDLER storage/heap/hp_delete.c: Increase key data version number on key changes. storage/heap/hp_rfirst.c: Remember version of key data Give error if using read-first on hash key. storage/heap/hp_rkey.c: Remember version of key data storage/heap/hp_rlast.c: Remember version of key data Give error if using read-last on hash key. storage/heap/hp_rnext.c: Fixed that we get next key from last search. storage/heap/hp_rprev.c: Fixed that we get previous key from last search. storage/heap/hp_scan.c: Remember version of key and file data storage/heap/hp_update.c: Increase key data version number on key changes. storage/heap/hp_write.c: Increase key data version number on key changes.
Diffstat (limited to 'mysql-test/suite/handler/handler.inc')
-rw-r--r--mysql-test/suite/handler/handler.inc67
1 files changed, 35 insertions, 32 deletions
diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc
index 1ed80cce200..0d5f1a1e546 100644
--- a/mysql-test/suite/handler/handler.inc
+++ b/mysql-test/suite/handler/handler.inc
@@ -23,21 +23,21 @@
# Start testing the table created in init.inc
#
handler t1 open as t2;
-handler t2 read a first;
-handler t2 read a next;
-handler t2 read a next;
-handler t2 read a prev;
-handler t2 read a last;
-handler t2 read a prev;
-handler t2 read a prev;
-
-handler t2 read a first;
-handler t2 read a prev;
-
-handler t2 read a last;
-handler t2 read a prev;
-handler t2 read a next;
-handler t2 read a next;
+handler t2 read b first;
+handler t2 read b next;
+handler t2 read b next;
+handler t2 read b prev;
+handler t2 read b last;
+handler t2 read b prev;
+handler t2 read b prev;
+
+handler t2 read b first;
+handler t2 read b prev;
+
+handler t2 read b last;
+handler t2 read b prev;
+handler t2 read b next;
+handler t2 read b next;
handler t2 read a=(15);
handler t2 read a=(16);
@@ -55,16 +55,19 @@ handler t1 read a last;
handler t2 read a=(11);
handler t2 read a>=(11);
-# Search on something we ca nfind
-handler t2 read a=(18);
-handler t2 read a>=(18);
-handler t2 read a>(18);
-handler t2 read a<=(18);
-handler t2 read a<(18);
+# Search on something we can find
+handler t2 read b=(18);
+handler t2 read b>=(18);
+handler t2 read b>(18);
+handler t2 read b<=(18);
+handler t2 read b<(18);
# Search on something we can't find
+--sorted_result
handler t2 read a=(15);
+--sorted_result
handler t2 read a>=(15);
+--sorted_result
handler t2 read a>(15);
handler t2 read a<=(15);
handler t2 read a<(15);
@@ -83,17 +86,17 @@ handler t2 read a>(1);
handler t2 read a<=(1);
handler t2 read a<(1);
-handler t2 read a first limit 5;
-handler t2 read a next limit 3;
-handler t2 read a prev limit 10;
+handler t2 read b first limit 5;
+handler t2 read b next limit 3;
+handler t2 read b prev limit 10;
handler t2 read a>=(16) limit 4;
handler t2 read a>=(16) limit 2,2;
select * from t1 where a>=16 limit 2,2;
handler t2 read a last limit 3;
handler t2 read a=(16) limit 1,3;
-handler t2 read a=(19);
-handler t2 read a=(19) where b="yyy";
+handler t2 read b=(19);
+handler t2 read b=(19) where b="yyy";
handler t2 read first;
handler t2 read next;
@@ -450,7 +453,7 @@ drop table t1;
# is open by a HANDLER, no other statement can access it.
#
-eval create temporary table t1 (a int, b char(1), key a $key_type (a), key b(a,b));
+eval create temporary table t1 (a int, b char(1), key a $key_type (a), key b $key_type (a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
select a,b from t1;
@@ -466,12 +469,12 @@ handler a1 read a=(6) where b="g";
handler a1 close;
select a,b from t1;
handler t1 open as a2;
-handler a2 read a=(9);
-handler a2 read a next;
-handler a2 read a prev limit 2;
+handler a2 read b=(9);
+handler a2 read b next;
+handler a2 read b prev limit 2;
--error 0,1031
-handler a2 read a last;
-handler a2 read a prev;
+handler a2 read b last;
+handler a2 read b prev;
handler a2 close;
drop table t1;