Loading mysql-test/r/create.result +2 −2 Original line number Diff line number Diff line Loading @@ -447,8 +447,8 @@ t2 CREATE TABLE `t2` ( `ifnull(c,c)` mediumint(8) default NULL, `ifnull(d,d)` int(11) default NULL, `ifnull(e,e)` bigint(20) default NULL, `ifnull(f,f)` float(24,2) default NULL, `ifnull(g,g)` double(53,3) default NULL, `ifnull(f,f)` float(3,2) default NULL, `ifnull(g,g)` double(4,3) default NULL, `ifnull(h,h)` decimal(5,4) default NULL, `ifnull(i,i)` year(4) default NULL, `ifnull(j,j)` date default NULL, Loading mysql-test/r/insert_select.result +29 −0 Original line number Diff line number Diff line Loading @@ -744,3 +744,32 @@ f1 f2 2 2 10 10 DROP TABLE t1, t2; SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; CREATE TABLE t1 (c VARCHAR(30), INDEX ix_c (c(10))); CREATE TABLE t2 (d VARCHAR(10)); INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); EXPLAIN SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY t1 ref ix_c ix_c 13 const 1 Using where SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') 13 13 INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='7_chars') FROM t1; INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c IN (SELECT t1.c FROM t1)) FROM t1; SELECT * FROM t2; d 13 13 7 7 20 20 DROP TABLE t1,t2; mysql-test/r/temp_table.result +21 −0 Original line number Diff line number Diff line Loading @@ -152,3 +152,24 @@ SELECT * FROM t1; i DROP TABLE t1; End of 4.1 tests. CREATE TABLE t1 ( c FLOAT( 20, 14 ) ); INSERT INTO t1 VALUES( 12139 ); CREATE TABLE t2 ( c FLOAT(30,18) ); INSERT INTO t2 VALUES( 123456 ); SELECT AVG( c ) FROM t1 UNION SELECT 1; AVG( c ) 12139 1 SELECT 1 UNION SELECT AVG( c ) FROM t1; 1 1 12139 SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1; 1 1 123456 SELECT c/1 FROM t1 UNION SELECT 1; c/1 12139 1 DROP TABLE t1, t2; mysql-test/r/type_float.result +4 −4 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `col1` double default NULL, `col2` double(53,5) default NULL, `col2` double(22,5) default NULL, `col3` double default NULL, `col4` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Loading Loading @@ -232,12 +232,12 @@ insert into t2 values ("1.23456780"); create table t3 select * from t2 union select * from t1; select * from t3; d 1.234567800 100000000.000000000 1.2345678 100000000 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `d` double(22,9) default NULL `d` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; create table t1 select 105213674794682365.00 + 0.0 x; Loading mysql-test/r/union.result +2 −2 Original line number Diff line number Diff line Loading @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varbinary(20) NOT NULL default '' `a` varbinary(2) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; Loading Loading @@ -655,7 +655,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f` varbinary(24) default NULL `f` varbinary(12) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; Loading Loading
mysql-test/r/create.result +2 −2 Original line number Diff line number Diff line Loading @@ -447,8 +447,8 @@ t2 CREATE TABLE `t2` ( `ifnull(c,c)` mediumint(8) default NULL, `ifnull(d,d)` int(11) default NULL, `ifnull(e,e)` bigint(20) default NULL, `ifnull(f,f)` float(24,2) default NULL, `ifnull(g,g)` double(53,3) default NULL, `ifnull(f,f)` float(3,2) default NULL, `ifnull(g,g)` double(4,3) default NULL, `ifnull(h,h)` decimal(5,4) default NULL, `ifnull(i,i)` year(4) default NULL, `ifnull(j,j)` date default NULL, Loading
mysql-test/r/insert_select.result +29 −0 Original line number Diff line number Diff line Loading @@ -744,3 +744,32 @@ f1 f2 2 2 10 10 DROP TABLE t1, t2; SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; CREATE TABLE t1 (c VARCHAR(30), INDEX ix_c (c(10))); CREATE TABLE t2 (d VARCHAR(10)); INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); EXPLAIN SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY t1 ref ix_c ix_c 13 const 1 Using where SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') 13 13 INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='7_chars') FROM t1; INSERT INTO t2 (d) SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c IN (SELECT t1.c FROM t1)) FROM t1; SELECT * FROM t2; d 13 13 7 7 20 20 DROP TABLE t1,t2;
mysql-test/r/temp_table.result +21 −0 Original line number Diff line number Diff line Loading @@ -152,3 +152,24 @@ SELECT * FROM t1; i DROP TABLE t1; End of 4.1 tests. CREATE TABLE t1 ( c FLOAT( 20, 14 ) ); INSERT INTO t1 VALUES( 12139 ); CREATE TABLE t2 ( c FLOAT(30,18) ); INSERT INTO t2 VALUES( 123456 ); SELECT AVG( c ) FROM t1 UNION SELECT 1; AVG( c ) 12139 1 SELECT 1 UNION SELECT AVG( c ) FROM t1; 1 1 12139 SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1; 1 1 123456 SELECT c/1 FROM t1 UNION SELECT 1; c/1 12139 1 DROP TABLE t1, t2;
mysql-test/r/type_float.result +4 −4 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `col1` double default NULL, `col2` double(53,5) default NULL, `col2` double(22,5) default NULL, `col3` double default NULL, `col4` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Loading Loading @@ -232,12 +232,12 @@ insert into t2 values ("1.23456780"); create table t3 select * from t2 union select * from t1; select * from t3; d 1.234567800 100000000.000000000 1.2345678 100000000 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `d` double(22,9) default NULL `d` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; create table t1 select 105213674794682365.00 + 0.0 x; Loading
mysql-test/r/union.result +2 −2 Original line number Diff line number Diff line Loading @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varbinary(20) NOT NULL default '' `a` varbinary(2) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; Loading Loading @@ -655,7 +655,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f` varbinary(24) default NULL `f` varbinary(12) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; Loading