mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Test of range optimizer in InnoDB
sql/ha_myisam.cc: Added function comment
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t3;
|
||||
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb;
|
||||
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
|
||||
select id, code, name from t1 order by id;
|
||||
@ -1091,3 +1091,34 @@ SELECT * from t1;
|
||||
id
|
||||
3
|
||||
DROP TABLE t1,t2;
|
||||
set autocommit=0;
|
||||
CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB;
|
||||
CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB;
|
||||
CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB;
|
||||
INSERT INTO t3 VALUES("my-test-1", "my-test-2");
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES("this-key", "will disappear");
|
||||
INSERT INTO t2 VALUES("this-key", "will also disappear");
|
||||
DELETE FROM t3 WHERE id1="my-test-1";
|
||||
SELECT * FROM t1;
|
||||
id value
|
||||
this-key will disappear
|
||||
SELECT * FROM t2;
|
||||
id value
|
||||
this-key will also disappear
|
||||
SELECT * FROM t3;
|
||||
id1 id2
|
||||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
id value
|
||||
SELECT * FROM t2;
|
||||
id value
|
||||
SELECT * FROM t3;
|
||||
id1 id2
|
||||
my-test-1 my-test-2
|
||||
SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
|
||||
id1 id2
|
||||
my-test-1 my-test-2
|
||||
COMMIT;
|
||||
set autocommit=1;
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Small basic test with ignore
|
||||
#
|
||||
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t3;
|
||||
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb;
|
||||
|
||||
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
|
||||
@ -726,3 +726,35 @@ SELECT * from t1;
|
||||
UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
|
||||
SELECT * from t1;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Test of range_optimizer
|
||||
#
|
||||
|
||||
set autocommit=0;
|
||||
|
||||
CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB;
|
||||
|
||||
INSERT INTO t3 VALUES("my-test-1", "my-test-2");
|
||||
COMMIT;
|
||||
|
||||
INSERT INTO t1 VALUES("this-key", "will disappear");
|
||||
INSERT INTO t2 VALUES("this-key", "will also disappear");
|
||||
DELETE FROM t3 WHERE id1="my-test-1";
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t3;
|
||||
ROLLBACK;
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t3;
|
||||
SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
|
||||
COMMIT;
|
||||
set autocommit=1;
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
Reference in New Issue
Block a user