Loading mysql-test/r/innodb_mysql.result +16 −0 Original line number Diff line number Diff line Loading @@ -104,3 +104,19 @@ SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = id1 2 DROP TABLE t1, t2; DROP TABLE IF EXISTS t2, t1; CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE= InnoDB; CREATE TABLE t2 ( i INT NOT NULL, FOREIGN KEY (i) REFERENCES t1 (i) ON DELETE NO ACTION ) ENGINE= InnoDB; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); DELETE IGNORE FROM t1 WHERE i = 1; Warnings: Error 1217 Cannot delete or update a parent row: a foreign key constraint fails SELECT * FROM t1, t2; i i 1 1 DROP TABLE t2, t1; End of 4.1 tests. mysql-test/r/ps.result +97 −0 Original line number Diff line number Diff line Loading @@ -936,3 +936,100 @@ GROUP_CONCAT(Track SEPARATOR ', ') CAD DEALLOCATE PREPARE STMT; DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 (i INT, INDEX(i)); INSERT INTO t1 VALUES (1); PREPARE stmt FROM "SELECT (COUNT(i) = 1), COUNT(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 0 0 PREPARE stmt FROM "SELECT (AVG(i) = 1), AVG(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) 1 1.0000 SET @a = 0; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) NULL NULL PREPARE stmt FROM "SELECT (VARIANCE(i) = 1), VARIANCE(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) 0 0.0000 SET @a = 0; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) NULL NULL PREPARE stmt FROM "SELECT (STDDEV(i) = 1), STDDEV(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) 0 0.0000 SET @a = 0; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) NULL NULL PREPARE stmt FROM "SELECT (BIT_OR(i) = 1), BIT_OR(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 0 0 PREPARE stmt FROM "SELECT (BIT_AND(i) = 1), BIT_AND(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 0 18446744073709551615 SET @a = 1; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 0 18446744073709551615 PREPARE stmt FROM "SELECT (BIT_XOR(i) = 1), BIT_XOR(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 0 0 DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 4.1 tests. mysql-test/r/rpl_insert_id.result +27 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,33 @@ a 1 drop table t1; drop table t2; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, j INT DEFAULT 0 ); INSERT INTO t1 VALUES (NULL, -1); INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)), (NULL, @@LAST_INSERT_ID); INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID()); UPDATE t1 SET j= -1 WHERE i IS NULL; SELECT * FROM t1; i j 1 -1 2 1 3 5 4 1 5 -1 6 2 SELECT * FROM t1; i j 1 -1 2 1 3 5 4 1 5 -1 6 2 DROP TABLE t1; # # End of 4.1 tests # mysql-test/t/func_gconcat.test +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'withou select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1; drop table t1; # check zero rows # check zero rows (bug#836) create table t1(id int); create table t2(id int); insert into t1 values(0),(1); Loading mysql-test/t/innodb_mysql.test +29 −0 Original line number Diff line number Diff line Loading @@ -117,3 +117,32 @@ INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2); DROP TABLE t1, t2; # # BUG#18819: DELETE IGNORE hangs on foreign key parent delete # # The bug itself does not relate to InnoDB, but we have to use foreign # keys to reproduce it. # --disable_warnings DROP TABLE IF EXISTS t2, t1; --enable_warnings CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE= InnoDB; CREATE TABLE t2 ( i INT NOT NULL, FOREIGN KEY (i) REFERENCES t1 (i) ON DELETE NO ACTION ) ENGINE= InnoDB; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); DELETE IGNORE FROM t1 WHERE i = 1; SELECT * FROM t1, t2; DROP TABLE t2, t1; --echo End of 4.1 tests. Loading
mysql-test/r/innodb_mysql.result +16 −0 Original line number Diff line number Diff line Loading @@ -104,3 +104,19 @@ SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = id1 2 DROP TABLE t1, t2; DROP TABLE IF EXISTS t2, t1; CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE= InnoDB; CREATE TABLE t2 ( i INT NOT NULL, FOREIGN KEY (i) REFERENCES t1 (i) ON DELETE NO ACTION ) ENGINE= InnoDB; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); DELETE IGNORE FROM t1 WHERE i = 1; Warnings: Error 1217 Cannot delete or update a parent row: a foreign key constraint fails SELECT * FROM t1, t2; i i 1 1 DROP TABLE t2, t1; End of 4.1 tests.
mysql-test/r/ps.result +97 −0 Original line number Diff line number Diff line Loading @@ -936,3 +936,100 @@ GROUP_CONCAT(Track SEPARATOR ', ') CAD DEALLOCATE PREPARE STMT; DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 (i INT, INDEX(i)); INSERT INTO t1 VALUES (1); PREPARE stmt FROM "SELECT (COUNT(i) = 1), COUNT(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (COUNT(i) = 1) COUNT(i) 0 0 PREPARE stmt FROM "SELECT (AVG(i) = 1), AVG(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) 1 1.0000 SET @a = 0; EXECUTE stmt USING @a; (AVG(i) = 1) AVG(i) NULL NULL PREPARE stmt FROM "SELECT (VARIANCE(i) = 1), VARIANCE(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) 0 0.0000 SET @a = 0; EXECUTE stmt USING @a; (VARIANCE(i) = 1) VARIANCE(i) NULL NULL PREPARE stmt FROM "SELECT (STDDEV(i) = 1), STDDEV(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) NULL NULL SET @a = 1; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) 0 0.0000 SET @a = 0; EXECUTE stmt USING @a; (STDDEV(i) = 1) STDDEV(i) NULL NULL PREPARE stmt FROM "SELECT (BIT_OR(i) = 1), BIT_OR(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_OR(i) = 1) BIT_OR(i) 0 0 PREPARE stmt FROM "SELECT (BIT_AND(i) = 1), BIT_AND(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 0 18446744073709551615 SET @a = 1; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_AND(i) = 1) BIT_AND(i) 0 18446744073709551615 PREPARE stmt FROM "SELECT (BIT_XOR(i) = 1), BIT_XOR(i) FROM t1 WHERE i = ?"; SET @a = 0; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 0 0 SET @a = 1; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 1 1 SET @a = 0; EXECUTE stmt USING @a; (BIT_XOR(i) = 1) BIT_XOR(i) 0 0 DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 4.1 tests.
mysql-test/r/rpl_insert_id.result +27 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,33 @@ a 1 drop table t1; drop table t2; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, j INT DEFAULT 0 ); INSERT INTO t1 VALUES (NULL, -1); INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)), (NULL, @@LAST_INSERT_ID); INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID()); UPDATE t1 SET j= -1 WHERE i IS NULL; SELECT * FROM t1; i j 1 -1 2 1 3 5 4 1 5 -1 6 2 SELECT * FROM t1; i j 1 -1 2 1 3 5 4 1 5 -1 6 2 DROP TABLE t1; # # End of 4.1 tests #
mysql-test/t/func_gconcat.test +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'withou select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1; drop table t1; # check zero rows # check zero rows (bug#836) create table t1(id int); create table t2(id int); insert into t1 values(0),(1); Loading
mysql-test/t/innodb_mysql.test +29 −0 Original line number Diff line number Diff line Loading @@ -117,3 +117,32 @@ INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2); DROP TABLE t1, t2; # # BUG#18819: DELETE IGNORE hangs on foreign key parent delete # # The bug itself does not relate to InnoDB, but we have to use foreign # keys to reproduce it. # --disable_warnings DROP TABLE IF EXISTS t2, t1; --enable_warnings CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE= InnoDB; CREATE TABLE t2 ( i INT NOT NULL, FOREIGN KEY (i) REFERENCES t1 (i) ON DELETE NO ACTION ) ENGINE= InnoDB; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); DELETE IGNORE FROM t1 WHERE i = 1; SELECT * FROM t1, t2; DROP TABLE t2, t1; --echo End of 4.1 tests.