mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
39616eb9ef
dbug/dbug.c: Fixed compiler warnings on windows mysql-test/r/index_intersect_innodb.result: Don't print number of rows as this varies mysql-test/suite/funcs_1/r/processlist_val_no_prot.result: Update to use new State mysql-test/suite/handler/heap.result: Update results mysql-test/suite/handler/heap.test: Changed key used in test as the key 'b' will not guarantee order of the two last elements (as the key value is the same) mysql-test/suite/pbxt/r/lock_multi.result: Update to use new State mysql-test/t/index_intersect.test: Don't print number of rows as this varies mysql-test/valgrind.supp: Added suppression for linux mysys/hash.c: Fixed compiler warnings on windows plugin/handler_socket/handlersocket/database.cpp: Fixed compiler warnings sql-common/client_plugin.c: Changed variable to define to avoid compiler warnings when variable is not used sql-common/my_time.c: Initialize all my_time elements to avoid compiler warnings storage/oqgraph/ha_oqgraph.cc: Use right function (to avoid compiler warning) storage/pbxt/src/table_xt.cc: Initialize variables (to avoid compiler warnings)
88 lines
1.9 KiB
Text
88 lines
1.9 KiB
Text
# test of HANDLER with HEAP tables
|
|
#
|
|
|
|
let $engine_type= MEMORY;
|
|
let $key_type=using btree;
|
|
|
|
--source init.inc
|
|
--source handler.inc
|
|
|
|
#
|
|
# Test what happens if table is changed (Unique test for HEAP)
|
|
#
|
|
|
|
connect (con1,localhost,root,,);
|
|
connection default;
|
|
|
|
CREATE TABLE t1(a INT, b INT, KEY(a), KEY b using btree (b), KEY ab using btree(a, b)) engine=memory;
|
|
|
|
INSERT INTO t1 VALUES (2, 20), (2,20), (1, 10), (4, 40), (3, 30), (5,50), (6,50);
|
|
|
|
HANDLER t1 OPEN;
|
|
HANDLER t1 READ a>=(2) limit 3;
|
|
HANDLER t1 READ a PREV;
|
|
HANDLER t1 READ a PREV;
|
|
HANDLER t1 READ a PREV;
|
|
HANDLER t1 READ b>=(20) limit 3;
|
|
HANDLER t1 READ b PREV;
|
|
HANDLER t1 READ b PREV LIMIT 2;
|
|
HANDLER t1 READ ab=(3,30) limit 3;
|
|
HANDLER t1 READ ab>=(3,30) limit 3;
|
|
|
|
# Test FIRST/LAST on hash and btree keys
|
|
--error ER_ILLEGAL_HA
|
|
HANDLER t1 READ a FIRST;
|
|
--error ER_ILLEGAL_HA
|
|
HANDLER t1 READ a LAST;
|
|
HANDLER t1 READ b FIRST LIMIT 2;
|
|
HANDLER t1 READ ab LAST LIMIT 2;
|
|
|
|
# Table scan
|
|
HANDLER t1 READ FIRST LIMIT 10;
|
|
# Index scan
|
|
HANDLER t1 READ b FIRST;
|
|
insert into t1 values (7,50);
|
|
--error ER_CHECKREAD
|
|
HANDLER t1 READ b NEXT;
|
|
|
|
HANDLER t1 READ b FIRST;
|
|
connection con1;
|
|
insert into t1 values (7,50);
|
|
connection default;
|
|
--error ER_CHECKREAD
|
|
HANDLER t1 READ b NEXT;
|
|
|
|
HANDLER t1 READ FIRST;
|
|
connection con1;
|
|
insert into t1 values (8,50);
|
|
connection default;
|
|
HANDLER t1 READ NEXT;
|
|
connection con1;
|
|
delete from t1 where a=3;
|
|
connection default;
|
|
HANDLER t1 READ NEXT LIMIT 2;
|
|
connection con1;
|
|
delete from t1;
|
|
connection default;
|
|
--error ER_CHECKREAD
|
|
HANDLER t1 READ NEXT LIMIT 2;
|
|
HANDLER t1 CLOSE;
|
|
DROP TABLE t1;
|
|
disconnect con1;
|
|
|
|
#
|
|
# 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
|