Loading mysql-test/r/cast.result +6 −0 Original line number Diff line number Diff line Loading @@ -281,4 +281,10 @@ DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); isnull(date(NULL)) isnull(cast(NULL as DATE)) 1 1 SELECT CAST(cast('01-01-01' as date) AS UNSIGNED); CAST(cast('01-01-01' as date) AS UNSIGNED) 20010101 SELECT CAST(cast('01-01-01' as date) AS SIGNED); CAST(cast('01-01-01' as date) AS SIGNED) 20010101 End of 4.1 tests mysql-test/r/join.result +50 −0 Original line number Diff line number Diff line Loading @@ -376,3 +376,53 @@ i i i 2 NULL 4 2 2 2 drop table t1,t2,t3; CREATE TABLE t1 (a int, b int default 0, c int default 1); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); INSERT INTO t1 (a) SELECT a + 8 FROM t1; INSERT INTO t1 (a) SELECT a + 16 FROM t1; CREATE TABLE t2 (a int, d int, e int default 0); INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4); INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2; INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2; EXPLAIN SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort 1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 DROP TABLE t1,t2; mysql-test/r/query_cache.result +52 −0 Original line number Diff line number Diff line Loading @@ -1008,3 +1008,55 @@ Variable_name Value Qcache_hits 1 drop table t1; set GLOBAL query_cache_size=0; create table t1 (a int); insert into t1 values (1),(2),(3); set GLOBAL query_cache_type=1; set GLOBAL query_cache_limit=10000; set GLOBAL query_cache_min_res_unit=0; set GLOBAL query_cache_size= 100000; reset query cache; set LOCAL default_week_format = 0; select week('2007-01-04'); week('2007-01-04') 0 select week('2007-01-04') from t1; week('2007-01-04') 0 0 0 set LOCAL default_week_format = 2; select week('2007-01-04'); week('2007-01-04') 53 select week('2007-01-04') from t1; week('2007-01-04') 53 53 53 drop table t1; CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Full-text indexes', 'are called collections'), ('Only MyISAM tables','support collections'), ('Function MATCH ... AGAINST()','is used to do a search'), ('Full-text search in MySQL', 'implements vector space model'); set GLOBAL ft_boolean_syntax='+ -><()~*:""&|'; select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1; a b x MySQL has now support for full-text search 0 Full-text indexes are called collections 1 Only MyISAM tables support collections 0 Function MATCH ... AGAINST() is used to do a search 0 Full-text search in MySQL implements vector space model 0 set GLOBAL ft_boolean_syntax='- +><()~*:""&|'; select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1; a b x MySQL has now support for full-text search 0 Full-text indexes are called collections 0 Only MyISAM tables support collections 0 Function MATCH ... AGAINST() is used to do a search 0 Full-text search in MySQL implements vector space model 0 set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; mysql-test/t/cast.test +6 −0 Original line number Diff line number Diff line Loading @@ -173,4 +173,10 @@ DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); # # Bug#23656: Wrong result of CAST from DATE to int # SELECT CAST(cast('01-01-01' as date) AS UNSIGNED); SELECT CAST(cast('01-01-01' as date) AS SIGNED); --echo End of 4.1 tests mysql-test/t/join.test +24 −0 Original line number Diff line number Diff line Loading @@ -326,4 +326,28 @@ select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i; select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i; drop table t1,t2,t3; # # Bug #27531: Query performance degredation in 4.1.22 and greater # CREATE TABLE t1 (a int, b int default 0, c int default 1); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); INSERT INTO t1 (a) SELECT a + 8 FROM t1; INSERT INTO t1 (a) SELECT a + 16 FROM t1; CREATE TABLE t2 (a int, d int, e int default 0); INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4); INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2; INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2; # should use join cache EXPLAIN SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; DROP TABLE t1,t2; # End of 4.1 tests Loading
mysql-test/r/cast.result +6 −0 Original line number Diff line number Diff line Loading @@ -281,4 +281,10 @@ DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); isnull(date(NULL)) isnull(cast(NULL as DATE)) 1 1 SELECT CAST(cast('01-01-01' as date) AS UNSIGNED); CAST(cast('01-01-01' as date) AS UNSIGNED) 20010101 SELECT CAST(cast('01-01-01' as date) AS SIGNED); CAST(cast('01-01-01' as date) AS SIGNED) 20010101 End of 4.1 tests
mysql-test/r/join.result +50 −0 Original line number Diff line number Diff line Loading @@ -376,3 +376,53 @@ i i i 2 NULL 4 2 2 2 drop table t1,t2,t3; CREATE TABLE t1 (a int, b int default 0, c int default 1); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); INSERT INTO t1 (a) SELECT a + 8 FROM t1; INSERT INTO t1 (a) SELECT a + 16 FROM t1; CREATE TABLE t2 (a int, d int, e int default 0); INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4); INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2; INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2; EXPLAIN SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort 1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 DROP TABLE t1,t2;
mysql-test/r/query_cache.result +52 −0 Original line number Diff line number Diff line Loading @@ -1008,3 +1008,55 @@ Variable_name Value Qcache_hits 1 drop table t1; set GLOBAL query_cache_size=0; create table t1 (a int); insert into t1 values (1),(2),(3); set GLOBAL query_cache_type=1; set GLOBAL query_cache_limit=10000; set GLOBAL query_cache_min_res_unit=0; set GLOBAL query_cache_size= 100000; reset query cache; set LOCAL default_week_format = 0; select week('2007-01-04'); week('2007-01-04') 0 select week('2007-01-04') from t1; week('2007-01-04') 0 0 0 set LOCAL default_week_format = 2; select week('2007-01-04'); week('2007-01-04') 53 select week('2007-01-04') from t1; week('2007-01-04') 53 53 53 drop table t1; CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Full-text indexes', 'are called collections'), ('Only MyISAM tables','support collections'), ('Function MATCH ... AGAINST()','is used to do a search'), ('Full-text search in MySQL', 'implements vector space model'); set GLOBAL ft_boolean_syntax='+ -><()~*:""&|'; select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1; a b x MySQL has now support for full-text search 0 Full-text indexes are called collections 1 Only MyISAM tables support collections 0 Function MATCH ... AGAINST() is used to do a search 0 Full-text search in MySQL implements vector space model 0 set GLOBAL ft_boolean_syntax='- +><()~*:""&|'; select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1; a b x MySQL has now support for full-text search 0 Full-text indexes are called collections 0 Only MyISAM tables support collections 0 Function MATCH ... AGAINST() is used to do a search 0 Full-text search in MySQL implements vector space model 0 set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default;
mysql-test/t/cast.test +6 −0 Original line number Diff line number Diff line Loading @@ -173,4 +173,10 @@ DROP TABLE t1; select isnull(date(NULL)), isnull(cast(NULL as DATE)); # # Bug#23656: Wrong result of CAST from DATE to int # SELECT CAST(cast('01-01-01' as date) AS UNSIGNED); SELECT CAST(cast('01-01-01' as date) AS SIGNED); --echo End of 4.1 tests
mysql-test/t/join.test +24 −0 Original line number Diff line number Diff line Loading @@ -326,4 +326,28 @@ select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i; select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i; drop table t1,t2,t3; # # Bug #27531: Query performance degredation in 4.1.22 and greater # CREATE TABLE t1 (a int, b int default 0, c int default 1); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); INSERT INTO t1 (a) SELECT a + 8 FROM t1; INSERT INTO t1 (a) SELECT a + 16 FROM t1; CREATE TABLE t2 (a int, d int, e int default 0); INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4); INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2; INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2; # should use join cache EXPLAIN SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e ORDER BY t1.b, t1.c; DROP TABLE t1,t2; # End of 4.1 tests