Loading mysql-test/r/func_str.result +15 −0 Original line number Diff line number Diff line Loading @@ -1038,6 +1038,21 @@ select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test")); f1 f2 test a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 drop table t1; CREATE TABLE t1 (a varchar(10)); INSERT INTO t1 VALUES ('abc'), ('xyz'); SELECT a, CONCAT(a,' ',a) AS c FROM t1 HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a; a c abc abc abc xyz xyz xyz SELECT a, CONCAT(a,' ',a) AS c FROM t1 HAVING LEFT(CONCAT(a,' ',a), LENGTH(CONCAT(a,' ',a))- INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a; a c abc abc abc xyz xyz xyz DROP TABLE t1; End of 4.1 tests create table t1 (d decimal default null); insert into t1 values (null); Loading mysql-test/r/odbc.result +11 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,14 @@ explain select * from t1 where b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE drop table t1; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY); INSERT INTO t1 VALUES (NULL); SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; a last_insert_id() 1 1 SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; a last_insert_id() SELECT sql_no_cache a, last_insert_id() FROM t1; a last_insert_id() 1 1 DROP TABLE t1; mysql-test/r/rpl_insert_id.result +13 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,19 @@ SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 1 drop table t1; create table t1(a int auto_increment, key(a)); create table t2(a int); insert into t1 (a) values (null); insert into t2 (a) select a from t1 where a is null; insert into t2 (a) select a from t1 where a is null; select * from t2; a 1 select * from t2; a 1 drop table t1; drop table t2; drop function if exists bug15728; drop function if exists bug15728_insert; drop table if exists t1, t2; Loading mysql-test/r/select.result +3 −0 Original line number Diff line number Diff line Loading @@ -3395,3 +3395,6 @@ a t1.b + 0 t1.c + 0 a t2.b + 0 c d 1 0 1 1 0 1 NULL 2 0 1 NULL NULL NULL NULL drop table t1,t2; SELECT 0.9888889889 * 1.011111411911; 0.9888889889 * 1.011111411911 0.9998769417899202067879 mysql-test/r/view.result +28 −1 Original line number Diff line number Diff line Loading @@ -2735,4 +2735,31 @@ m e 4 a 1 b DROP VIEW v1; DROP TABLE IF EXISTS t1,t2; DROP TABLE t1,t2; CREATE TABLE t1 (a INT NOT NULL, b INT NULL DEFAULT NULL); CREATE VIEW v1 AS SELECT a, b FROM t1; INSERT INTO v1 (b) VALUES (2); Warnings: Warning 1423 Field of view 'test.v1' underlying table doesn't have a default value SET SQL_MODE = STRICT_ALL_TABLES; INSERT INTO v1 (b) VALUES (4); ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default value SET SQL_MODE = ''; SELECT * FROM t1; a b 0 2 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (firstname text, surname text); INSERT INTO t1 VALUES ("Bart","Simpson"),("Milhouse","van Houten"),("Montgomery","Burns"); CREATE VIEW v1 AS SELECT CONCAT(firstname," ",surname) AS name FROM t1; SELECT CONCAT(LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," ")), LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," "))) AS f1 FROM v1; f1 BartBart Milhouse vanMilhouse van MontgomeryMontgomery DROP VIEW v1; DROP TABLE t1; Loading
mysql-test/r/func_str.result +15 −0 Original line number Diff line number Diff line Loading @@ -1038,6 +1038,21 @@ select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test")); f1 f2 test a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 drop table t1; CREATE TABLE t1 (a varchar(10)); INSERT INTO t1 VALUES ('abc'), ('xyz'); SELECT a, CONCAT(a,' ',a) AS c FROM t1 HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a; a c abc abc abc xyz xyz xyz SELECT a, CONCAT(a,' ',a) AS c FROM t1 HAVING LEFT(CONCAT(a,' ',a), LENGTH(CONCAT(a,' ',a))- INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a; a c abc abc abc xyz xyz xyz DROP TABLE t1; End of 4.1 tests create table t1 (d decimal default null); insert into t1 values (null); Loading
mysql-test/r/odbc.result +11 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,14 @@ explain select * from t1 where b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE drop table t1; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY); INSERT INTO t1 VALUES (NULL); SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; a last_insert_id() 1 1 SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; a last_insert_id() SELECT sql_no_cache a, last_insert_id() FROM t1; a last_insert_id() 1 1 DROP TABLE t1;
mysql-test/r/rpl_insert_id.result +13 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,19 @@ SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 1 drop table t1; create table t1(a int auto_increment, key(a)); create table t2(a int); insert into t1 (a) values (null); insert into t2 (a) select a from t1 where a is null; insert into t2 (a) select a from t1 where a is null; select * from t2; a 1 select * from t2; a 1 drop table t1; drop table t2; drop function if exists bug15728; drop function if exists bug15728_insert; drop table if exists t1, t2; Loading
mysql-test/r/select.result +3 −0 Original line number Diff line number Diff line Loading @@ -3395,3 +3395,6 @@ a t1.b + 0 t1.c + 0 a t2.b + 0 c d 1 0 1 1 0 1 NULL 2 0 1 NULL NULL NULL NULL drop table t1,t2; SELECT 0.9888889889 * 1.011111411911; 0.9888889889 * 1.011111411911 0.9998769417899202067879
mysql-test/r/view.result +28 −1 Original line number Diff line number Diff line Loading @@ -2735,4 +2735,31 @@ m e 4 a 1 b DROP VIEW v1; DROP TABLE IF EXISTS t1,t2; DROP TABLE t1,t2; CREATE TABLE t1 (a INT NOT NULL, b INT NULL DEFAULT NULL); CREATE VIEW v1 AS SELECT a, b FROM t1; INSERT INTO v1 (b) VALUES (2); Warnings: Warning 1423 Field of view 'test.v1' underlying table doesn't have a default value SET SQL_MODE = STRICT_ALL_TABLES; INSERT INTO v1 (b) VALUES (4); ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default value SET SQL_MODE = ''; SELECT * FROM t1; a b 0 2 DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (firstname text, surname text); INSERT INTO t1 VALUES ("Bart","Simpson"),("Milhouse","van Houten"),("Montgomery","Burns"); CREATE VIEW v1 AS SELECT CONCAT(firstname," ",surname) AS name FROM t1; SELECT CONCAT(LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," ")), LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," "))) AS f1 FROM v1; f1 BartBart Milhouse vanMilhouse van MontgomeryMontgomery DROP VIEW v1; DROP TABLE t1;