mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
2. Correct some logical bugs within the tests, which were caused by automatic resolve of BitKeeper mysql-test/include/mix1.inc: - Remove hardcoded assignment of storage engine, because this violates the logics of refactored tests - Remove trailing spaces - Move the FOREIGN KEY creation(probably not really needed for the testcase) out of the CREATE TABLE statement + let the FK creation depend on the storage engine capabilities mysql-test/r/index_merge_innodb.result: Updated result mysql-test/r/index_merge_myisam.result: Updated result mysql-test/r/innodb_mysql.result: Updated result mysql-test/t/disabled.def: Reenable the fixed tests mysql-test/t/index_merge_innodb.test: Important comment describing how to modify the tests when some issues (most probably no bugs) are fixed. mysql-test/t/innodb_mysql.test: Introduction of a variable for switching FOREIGN KEY on/off
This commit is contained in:
@ -99,8 +99,8 @@ CREATE TABLE `t2` (
|
||||
`id4` INT NOT NULL,
|
||||
UNIQUE (`id2`,`id4`),
|
||||
KEY (`id1`)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
|
||||
);
|
||||
INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
|
||||
(1,1,1,0),
|
||||
(1,1,2,1),
|
||||
(5,1,2,2),
|
||||
@ -271,6 +271,25 @@ explain select distinct f1, f2 from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
|
||||
INDEX (name));
|
||||
CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11));
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (fkey) REFERENCES t2(id);
|
||||
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
|
||||
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
|
||||
1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%' OR FALSE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
CREATE TABLE t2 (primary key (a)) select * from t1;
|
||||
@ -340,7 +359,7 @@ CREATE TABLE `t2` (
|
||||
`c` int(11) default NULL,
|
||||
PRIMARY KEY (`k`),
|
||||
UNIQUE KEY `idx_1` (`a`)
|
||||
) ENGINE=InnoDB;
|
||||
);
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
|
Reference in New Issue
Block a user