From 87e6c2ba77a514456f9f33e69984d67d0a588469 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Oct 2003 12:57:26 +0200 Subject: added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor() added string length for more speed made code covarage for print() method of Item fixed printability of some items (SCRUM) (WL#1274) mysql-test/r/auto_increment.result: print() code coverage mysql-test/r/bench_count_distinct.result: print() code coverage mysql-test/r/case.result: print() code coverage mysql-test/r/cast.result: print() code coverage mysql-test/r/ctype_collate.result: print() code coverage mysql-test/r/ctype_many.result: convert with 3 arguments code covarage print() code coverage mysql-test/r/ctype_utf8.result: char_length code coverage mysql-test/r/date_formats.result: print() code coverage mysql-test/r/fulltext.result: print() code coverage mysql-test/r/func_compress.result: print() code coverage mysql-test/r/func_gconcat.result: print() code coverage mysql-test/r/func_group.result: bit_xor() code coverage print() code coverage mysql-test/r/func_if.result: nullif() code coverage print() code coverage mysql-test/r/func_in.result: print() code coverage mysql-test/r/func_math.result: print() code coverage mysql-test/r/func_op.result: print() code coverage mysql-test/r/func_regexp.result: print() code coverage mysql-test/r/func_set.result: print() code coverage mysql-test/r/func_str.result: crc32() code coverage print() code coverage mysql-test/r/func_system.result: print() code coverage mysql-test/r/func_test.result: print() code coverage mysql-test/r/func_time.result: print() code coverage mysql-test/r/group_by.result: print() code coverage mysql-test/r/having.result: print() code coverage mysql-test/r/insert_update.result: print() code coverage mysql-test/r/null.result: print() code coverage mysql-test/r/olap.result: print() code coverage mysql-test/r/query_cache.result: print() code coverage mysql-test/r/row.result: print() code coverage mysql-test/r/rpl000001.result: print() code coverage mysql-test/r/rpl_get_lock.result: print() code coverage mysql-test/r/rpl_master_pos_wait.result: print() code coverage mysql-test/r/select.result: print() code coverage mysql-test/r/subselect.result: print() code coverage mysql-test/r/type_blob.result: print() code coverage mysql-test/r/varbinary.result: print() code coverage mysql-test/r/variables.result: print() code coverage mysql-test/t/auto_increment.test: print() code coverage mysql-test/t/bench_count_distinct.test: print() code coverage mysql-test/t/case.test: print() code coverage mysql-test/t/cast.test: print() code coverage mysql-test/t/ctype_collate.test: print() code coverage mysql-test/t/ctype_many.test: convert with 3 arguments code covarage print() code coverage mysql-test/t/ctype_utf8.test: char_length code coverage mysql-test/t/date_formats.test: print() code coverage mysql-test/t/fulltext.test: print() code coverage mysql-test/t/func_compress.test: print() code coverage mysql-test/t/func_gconcat.test: print() code coverage mysql-test/t/func_group.test: bit_xor() code coverage print() code coverage mysql-test/t/func_if.test: nullif() code coverage print() code coverage mysql-test/t/func_in.test: print() code coverage mysql-test/t/func_math.test: print() code coverage mysql-test/t/func_op.test: print() code coverage mysql-test/t/func_regexp.test: print() code coverage mysql-test/t/func_set.test: print() code coverage mysql-test/t/func_str.test: crc32() code covarage print() code coverage mysql-test/t/func_system.test: print() code coverage mysql-test/t/func_test.test: print() code coverage mysql-test/t/func_time.test: print() code coverage mysql-test/t/group_by.test: print() code coverage mysql-test/t/having.test: print() code coverage mysql-test/t/insert_update.test: print() code coverage mysql-test/t/null.test: print() code coverage mysql-test/t/olap.test: print() code coverage mysql-test/t/query_cache.test: print() code coverage mysql-test/t/row.test: print() code coverage mysql-test/t/rpl000001.test: print() code coverage mysql-test/t/rpl_get_lock.test: print() code coverage mysql-test/t/rpl_master_pos_wait.test: print() code coverage mysql-test/t/select.test: print() code coverage mysql-test/t/type_blob.test: print() code coverage mysql-test/t/varbinary.test: print() code coverage mysql-test/t/variables.test: print() code coverage sql/item.cc: added string length for more speed layout fix fixed string printability sql/item.h: added string length for more speed sql/item_cmpfunc.cc: added string length for more speed sql/item_cmpfunc.h: fixed printability sql/item_create.cc: fixed printability sql/item_func.cc: fixed printability added string length for more speed sql/item_func.h: fixed printability sql/item_strfunc.cc: fixed printability added string length for more speed sql/item_strfunc.h: fixed printability sql/item_subselect.cc: added string length for more speed sql/item_sum.cc: added string length for more speed sql/item_timefunc.cc: added string length for more speed sql/item_timefunc.h: fixed printability sql/item_uniq.h: added string length for more speed sql/key.cc: added string length for more speed sql/sql_lex.cc: added string length for more speed sql/sql_parse.cc: after merge fix sql/sql_repl.cc: string changed with character for more speed sql/sql_select.cc: added string length for more speed sql/sql_show.cc: added string length for more speed --- mysql-test/t/auto_increment.test | 1 + mysql-test/t/bench_count_distinct.test | 1 + mysql-test/t/case.test | 6 ++++++ mysql-test/t/cast.test | 1 + mysql-test/t/ctype_collate.test | 1 + mysql-test/t/ctype_many.test | 6 ++++++ mysql-test/t/ctype_utf8.test | 2 ++ mysql-test/t/date_formats.test | 1 + mysql-test/t/fulltext.test | 2 ++ mysql-test/t/func_compress.test | 2 ++ mysql-test/t/func_gconcat.test | 3 +++ mysql-test/t/func_group.test | 3 ++- mysql-test/t/func_if.test | 7 +++++++ mysql-test/t/func_in.test | 1 + mysql-test/t/func_math.test | 13 +++++++++++++ mysql-test/t/func_op.test | 2 ++ mysql-test/t/func_regexp.test | 1 + mysql-test/t/func_set.test | 1 + mysql-test/t/func_str.test | 7 ++++++- mysql-test/t/func_system.test | 1 + mysql-test/t/func_test.test | 7 +++++++ mysql-test/t/func_time.test | 3 +++ mysql-test/t/group_by.test | 2 +- mysql-test/t/having.test | 1 + mysql-test/t/insert_update.test | 2 ++ mysql-test/t/null.test | 3 +++ mysql-test/t/olap.test | 2 +- mysql-test/t/query_cache.test | 1 + mysql-test/t/row.test | 1 + mysql-test/t/rpl000001.test | 2 ++ mysql-test/t/rpl_get_lock.test | 4 +++- mysql-test/t/rpl_master_pos_wait.test | 1 + mysql-test/t/select.test | 1 + mysql-test/t/type_blob.test | 4 ++++ mysql-test/t/varbinary.test | 2 +- mysql-test/t/variables.test | 3 +++ 36 files changed, 95 insertions(+), 6 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index a036121f297..d02850f6745 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -80,6 +80,7 @@ create table t1 (i tinyint unsigned not null auto_increment primary key); insert into t1 set i = 254; insert into t1 set i = null; select last_insert_id(); +explain extended select last_insert_id(); --error 1062 insert into t1 set i = 254; select last_insert_id(); diff --git a/mysql-test/t/bench_count_distinct.test b/mysql-test/t/bench_count_distinct.test index c1adeab2c44..3ffb95a69c2 100644 --- a/mysql-test/t/bench_count_distinct.test +++ b/mysql-test/t/bench_count_distinct.test @@ -16,4 +16,5 @@ while ($1) } enable_query_log; select count(distinct n) from t1; +explain extended select count(distinct n) from t1; drop table t1; diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 4d4ceb062e4..9a1b6b6bbfe 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -14,6 +14,7 @@ select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END; select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end; select CASE when 1=0 then "true" else "false" END; select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END; +explain extended select CASE 1 when 1 then "one" WHEN 2 then "two" ELSE "more" END; select CASE 2.0 when 1 then "one" WHEN 2.0 then "two" ELSE "more" END; select (CASE "two" when "one" then "1" WHEN "two" then "2" END) | 0; select (CASE "two" when "one" then 1.00 WHEN "two" then 2.00 END) +0.0; @@ -30,6 +31,7 @@ select case when 1<0 then "TRUE" else "FALSE" END; create table t1 (a int); insert into t1 values(1),(2),(3),(4); select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase; +explain extended select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase; select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase; drop table t1; @@ -98,5 +100,9 @@ CREATE TABLE t1 SELECT COALESCE(1), COALESCE(1.0),COALESCE('a'), COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'), COALESCE('a' COLLATE latin1_bin,'b'); +explain extended SELECT + COALESCE(1), COALESCE(1.0),COALESCE('a'), + COALESCE(1,1.0), COALESCE(1,'1'),COALESCE(1.1,'1'), + COALESCE('a' COLLATE latin1_bin,'b'); SHOW CREATE TABLE t1; DROP TABLE t1; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index b3ae8981671..dd17904effb 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -8,6 +8,7 @@ select CONVERT('-1',UNSIGNED); select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1; select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1; select ~5, cast(~5 as signed); +explain extended select ~5, cast(~5 as signed); select cast(5 as unsigned) -6.0; select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A"; select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME); diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test index d42696e693b..2d9a4be5b36 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -139,6 +139,7 @@ SHOW FIELDS FROM t1; SET CHARACTER SET 'latin1'; SHOW VARIABLES LIKE 'character_set_client'; SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; SET CHARACTER SET koi8r; SHOW VARIABLES LIKE 'collation_client'; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 66732520f4d..a1549f952e5 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -147,6 +147,12 @@ UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8); SET CHARACTER SET koi8r; SELECT * FROM t1; +# +# codecovarage for Item_func_conv_charset3 +# +select CONVERT(koi8_ru_f, 'cp1251_general_ci', 'utf8_general_ci'), comment from t1; +explain extended select CONVERT(koi8_ru_f, 'cp1251_general_ci', 'utf8_general_ci'), comment from t1; + ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 46359e84f1d..54d934b66db 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -23,6 +23,8 @@ select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2); select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin); select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin); +select length(_utf8 0xD0B1), bit_length(_utf8 0xD0B1), char_length(_utf8 0xD0B1); + select 'a' like 'a'; select 'A' like 'a'; select 'A' like 'a' collate utf8_bin; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index 9551efaa648..e2d0e5d2c6d 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -80,3 +80,4 @@ select get_format(DATE, 'USA') as a; select get_format(TIME, 'internal') as a; select get_format(DATETIME, 'eur') as a; +explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 8c6bb97edf1..41e6d310c08 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -16,6 +16,7 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), # nl search select * from t1 where MATCH(a,b) AGAINST ("collections"); +explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); select * from t1 where MATCH(a,b) AGAINST ("indexes"); select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); select * from t1 where MATCH(a,b) AGAINST ("only"); @@ -40,6 +41,7 @@ explain select * from t1 where MATCH(a,b) AGAINST ("collections")>0 and a like ' # boolean search select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); +explain extended select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); select * from t1 where MATCH(a,b) AGAINST("support +collections" IN BOOLEAN MODE); select * from t1 where MATCH(a,b) AGAINST("sear*" IN BOOLEAN MODE); diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 069fbed8562..06ebb388517 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -7,7 +7,9 @@ select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaa select length(@test_compress_string); select uncompress(compress(@test_compress_string)); +explain extended select uncompress(compress(@test_compress_string)); select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); +explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); select uncompressed_length(compress(@test_compress_string)); select length(compress(@test_compress_string))> 2, 4 >> 63, 1<< 63 >> 60; diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 6ecb56ef9c4..edfa9afcfa6 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -36,6 +36,7 @@ drop table t1; create table t1 (xxx char(128)); insert into t1 (xxx) values('this is a test of some long text to see what happens'); select * from t1 where xxx regexp('is a test of some long text to'); +explain extended select * from t1 where xxx regexp('is a test of some long text to'); select * from t1 where xxx regexp('is a test of some long text to '); select * from t1 where xxx regexp('is a test of some long text to s'); select * from t1 where xxx regexp('is a test of some long text to se'); diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index b152c94096c..7d24140c75d 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -3,6 +3,7 @@ # select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; +explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0; select find_in_set("b","a,b,c"),find_in_set("c","a,b,c"),find_in_set("dd","a,bbb,dd"),find_in_set("bbb","a,bbb,dd"); select find_in_set("d","a,b,c"),find_in_set("dd","a,bbb,d"),find_in_set("bb","a,bbb,dd"); select make_set(0,'a','b','c'),make_set(-1,'a','b','c'),make_set(1,'a','b','c'),make_set(2,'a','b','c'),make_set(1+2,concat('a','b'),'c'); diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b421f47e5b8..835172fe3fa 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -14,7 +14,9 @@ select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; select 'hello' 'monty'; select length('\n\t\r\b\0\_\%\\'); select bit_length('\n\t\r\b\0\_\%\\'); -select concat('monty',' was here ','again'),length('hello'),char(ascii('h')); +select char_length('\n\t\r\b\0\_\%\\'); +select length(_latin1'\n\t\n\b\0\\_\\%\\'); +select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); select position(binary 'll' in 'hello'),position('a' in binary 'hello'); @@ -46,6 +48,7 @@ select null sounds like 'null'; select 'null' sounds like null; select null sounds like null; select md5('hello'); +select crc32("123"); select sha('abc'); select sha1('abc'); select aes_decrypt(aes_encrypt('abc','1'),'1'); @@ -336,3 +339,5 @@ INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and a INSERT INTO t1 VALUES ('House passes the CAREERS bill'); SELECT CONCAT("",RPAD("",(55 - LENGTH(title)),".")) from t1; DROP TABLE t1; + +explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'mood' sounds like 'mud', aes_decrypt(aes_encrypt('abc','1'),'1'),concat('*',space(5),'*'), reverse('abc'), rpad('a',4,'1'), lpad('a',4,'1'), concat_ws(',','',NULL,'a'),make_set(255,_latin2'a',_latin2'b',_latin2'c'),elt(2,1),locate("a","b",2),format(130,10),char(0),conv(130,16,10),hex(130),binary 'HE', export_set(255,_latin2'y',_latin2'n',_latin2' '),FIELD('b' COLLATE latin1_bin,'A','B'),FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'),collation(conv(130,16,10)), coercibility(conv(130,16,10)),length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'),quote(1/0),crc32("123"); diff --git a/mysql-test/t/func_system.test b/mysql-test/t/func_system.test index 998b2a5c3f4..f3b9b4ffc3f 100644 --- a/mysql-test/t/func_system.test +++ b/mysql-test/t/func_system.test @@ -17,6 +17,7 @@ select version()>="3.23.29"; select version()>=_utf8"3.23.29"; select version()>=_latin1"3.23.29"; select charset(version()); +explain extended select database(), user(); create table t1 (version char(40)) select database(), user(), version() as 'version'; show create table t1; diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index 95b10c4ffb9..86e0ee2637b 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -19,13 +19,19 @@ select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); select -1.49 or -1.49,0.6 or 0.6; select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; +explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; select 10 % 7, 10 mod 7, 10 div 3; +explain extended select 10 % 7, 10 mod 7, 10 div 3; select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; create table t1 (a int); insert t1 values (1); select * from t1 where 1 xor 1; +explain extended select * from t1 where 1 xor 1; +select - a from t1; +explain extended select - a from t1; drop table t1; # @@ -41,6 +47,7 @@ select 1 and 0 or 2, 2 or 1 and 0; # select _koi8r'a' = _koi8r'A'; select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 30d616915ab..96bdb547469 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -7,6 +7,7 @@ drop table if exists t1,t2,t3; select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29"); select period_add("9602",-12),period_diff(199505,"9404") ; + select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now()); select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0; select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"), @@ -231,3 +232,5 @@ select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d" select strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0; select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0; select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0; + +explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"), month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03 23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02 10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1 SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02 10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND); diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 752896ce7b2..705e32c82df 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -260,7 +260,7 @@ explain select spid,count(*) from t1 where spid between 1 and 2 group by spid; explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null; select spid,count(*) from t1 where spid between 1 and 2 group by spid; select spid,count(*) from t1 where spid between 1 and 2 group by spid desc; -explain select sql_big_result spid,sum(userid) from t1 group by spid desc; +explain extended select sql_big_result spid,sum(userid) from t1 group by spid desc; explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null; select sql_big_result spid,sum(userid) from t1 group by spid desc; explain select sql_big_result score,count(*) from t1 group by score desc; diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 7d5fbee011f..7e4cbe76cca 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -10,6 +10,7 @@ select count(a) as b from t1 where a=0 having b > 0; insert into t1 values (null); select count(a) as b from t1 where a=0 having b > 0; select count(a) as b from t1 where a=0 having b >=0; +explain extended select count(a) as b from t1 where a=0 having b >=0; drop table t1; # diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 4f19aca8738..550bce867cd 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -23,4 +23,6 @@ INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; SELECT * FROM t1; INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a); SELECT *, VALUES(a) FROM t1; +explain extended SELECT *, VALUES(a) FROM t1; +explain extended select * from t1 where values(a); DROP TABLE t1; diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index fa36249dce0..0be755ba7ad 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -8,6 +8,7 @@ drop table if exists t1; # select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null; +explain extended select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null; select 1 | NULL,1 & NULL,1+NULL,1-NULL; select NULL=NULL,NULL<>NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0; select strcmp("a",NULL),(1""; +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index ebe342a4ef5..c9c3284fe0d 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -298,6 +298,10 @@ select charset(load_file('../../std_data/words.dat')), collation(load_file('../../std_data/words.dat')), coercibility(load_file('../../std_data/words.dat')); +explain extended select + charset(load_file('../../std_data/words.dat')), + collation(load_file('../../std_data/words.dat')), + coercibility(load_file('../../std_data/words.dat')); update t1 set imagem=load_file('../../std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; drop table t1; diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index d58954a189b..9425bd7bd99 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -18,7 +18,7 @@ select x'31',X'ffff'+0; create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) ); insert into t1 set UNIQ=0x38afba1d73e6a18a; insert into t1 set UNIQ=123; -explain select * from t1 where UNIQ=0x38afba1d73e6a18a; +explain extended select * from t1 where UNIQ=0x38afba1d73e6a18a; drop table t1; # diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index c53559ed4cf..6365ad77c57 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -16,6 +16,7 @@ select @test_int,@test_double,@test_string,@test_string2; set @test_int=null,@test_double=null,@test_string=null,@test_string2=null; select @test_int,@test_double,@test_string,@test_string2; select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; +explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; select @t5; # @@ -52,7 +53,9 @@ select @@local.max_join_size, @@global.max_join_size; select @@identity, length(@@version)>0; select @@VERSION=version(); select last_insert_id(345); +explain extended select last_insert_id(345); select @@IDENTITY,last_insert_id(), @@identity; +explain extended select @@IDENTITY,last_insert_id(), @@identity; set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON"; -- cgit v1.2.1