From dab880274afbae01571257feebb819d94b861c01 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 22 Jun 2005 16:14:14 -0700 Subject: Fix LOAD DATA to handle having the escape and enclosed-by character be the same. (Bug #11203) --- mysql-test/r/loaddata.result | 8 ++++++++ mysql-test/std_data/loaddata5.dat | 3 +++ mysql-test/t/loaddata.test | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 mysql-test/std_data/loaddata5.dat (limited to 'mysql-test') diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index c0baabcc507..cb9849ec23d 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -66,3 +66,11 @@ a b 3 row 3 0 drop table t1; +create table t1 (a varchar(20), b varchar(20)); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +select * from t1; +a b +field1 field2 +a"b cd"ef +a"b c"d"e +drop table t1; diff --git a/mysql-test/std_data/loaddata5.dat b/mysql-test/std_data/loaddata5.dat new file mode 100644 index 00000000000..5bdddfa977a --- /dev/null +++ b/mysql-test/std_data/loaddata5.dat @@ -0,0 +1,3 @@ +"field1","field2" +"a""b","cd""ef" +"a"b",c"d"e diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index aa0ea0a2f55..2afd710c694 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -31,3 +31,11 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated select * from t1; drop table t1; +# +# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and +# ENCLOSED +# +create table t1 (a varchar(20), b varchar(20)); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +select * from t1; +drop table t1; -- cgit v1.2.1 From 68acf8fdea1af29bccc01bc251878989540a9aeb Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Tue, 6 Sep 2005 15:00:35 +0500 Subject: fix (bug #10303: Misleading Last_query_cost value). --- mysql-test/r/query_cache.result | 16 ++++++++++++++++ mysql-test/r/status.result | 6 ++++++ mysql-test/t/query_cache.test | 13 +++++++++++++ mysql-test/t/status.test | 7 +++++++ 4 files changed, 42 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0efd5ac1566..06f1d2d0e7c 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1127,3 +1127,19 @@ Qcache_hits 9 drop procedure f1; drop table t1; set GLOBAL query_cache_size=0; +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +a +4 +5 +select * from t1 where a > 3; +a +4 +5 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index e9616232fa1..5461e4dd563 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -17,3 +17,9 @@ Variable_name Value Table_locks_immediate 3 Table_locks_waited 1 drop table t1; +select 1; +1 +1 +show status like 'last_query_cost'; +Variable_name Value +Last_query_cost 0.000000 diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 822c27fe40d..db759fcbac3 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -816,3 +816,16 @@ drop table t1; set GLOBAL query_cache_size=0; # End of 4.1 tests + +# +# Bug #10303: problem with last_query_cost +# + +SET GLOBAL query_cache_size=102400; +create table t1(a int); +insert into t1 values(0), (1), (4), (5); +select * from t1 where a > 3; +select * from t1 where a > 3; +show status like 'last_query_cost'; +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 7fea51c9327..929a0cb5877 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -37,3 +37,10 @@ show status like 'Table_lock%'; drop table t1; # End of 4.1 tests + +# +# lost_query_cost +# + +select 1; +show status like 'last_query_cost'; -- cgit v1.2.1 From 36731edfc79c6f928a4929945fe5b2415baa7c39 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 16 Sep 2005 14:22:11 +0500 Subject: Bug#13145: A table named "C-cedilla" can't be dropped. ctype_latin1.test, ctype_latin1.result: adding test case ctype-latin1.c: Fixing ctype array to treat extended cp1252 letters as valid identifiers on server side, and as valid "isprint" characters (e.g. on client side). --- mysql-test/r/ctype_latin1.result | 3 +++ mysql-test/t/ctype_latin1.test | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 95fca1575ef..b47853a0ccc 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -296,6 +296,9 @@ FD C3BD FD 1 FE C3BE FE 1 FF C3BF FF 1 DROP TABLE t1; +SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ; +ƒ Š Œ Ž š œ ž Ÿ +1 2 3 4 5 6 7 8 select 'a' regexp 'A' collate latin1_general_ci; 'a' regexp 'A' collate latin1_general_ci 1 diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 1b83373da29..f2886088ba8 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -54,6 +54,23 @@ SELECT a=@l FROM t1; DROP TABLE t1; +# +# Bug#13145: A table named "C-cedilla" can't be dropped. +# Accept extended cp1252 letters as valid identifiers. +# This test partially checks that "ctype" array is correct +# for cp1252 extended characters 0x80-0x9F. +# +# 0x83 0x0192 #LATIN SMALL LETTER F WITH HOOK +# 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON +# 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE +# 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON +# 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON +# 0x9C 0x0153 #LATIN SMALL LIGATURE OE +# 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON +# 0x9F 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS +# +SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ; + # # Bug #6737: REGEXP gives wrong result with case sensitive collation # -- cgit v1.2.1 From a778669efdf01271c6d742005e0614eaf3b3a222 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 20 Sep 2005 09:36:35 -0700 Subject: Tweak kill test to avoid spurious test failure on SCO OpenServer. (Bug #12136) --- mysql-test/t/kill.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index fdedaa8cd7f..aada8dd2ef3 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -24,6 +24,7 @@ select ((@id := kill_id) - kill_id) from t1; kill @id; connection con1; +--sleep 1 --disable_reconnect # this statement should fail -- cgit v1.2.1 From 12068b45e8cb7cad2e429a64d864726502efe5c5 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Wed, 21 Sep 2005 14:35:01 +0500 Subject: Fix for bug #12839 (Endian support is absurd) --- mysql-test/r/gis.result | 6 ++++++ mysql-test/t/gis.test | 3 +++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index c51b07f09d6..bf2f3e2bf03 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -655,3 +655,9 @@ t1 where object_id=85984; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) 85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))) +POINT(10 10) +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); +(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))) +POINT(10 10) diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index b204bc11e2f..3eb17f3a484 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -360,4 +360,7 @@ t1 where object_id=85984; drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); + # End of 4.1 tests -- cgit v1.2.1 From 3bfe3579d4d58a33062f3c7053206d331df7659d Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 22 Sep 2005 15:59:13 -0700 Subject: Fix CAST(1.0e+300 TO SIGNED). (Bug #13344) --- mysql-test/r/cast.result | 3 +++ mysql-test/t/cast.test | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7cd0934f7a3..d5d679a0ae8 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -252,3 +252,6 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 394971f9648..e883788be51 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -143,4 +143,9 @@ select cast(concat('184467440','73709551615') as signed); select cast(repeat('1',20) as unsigned); select cast(repeat('1',20) as signed); +# +# Bug #13344: cast of large decimal to signed int not handled correctly +# +select cast(1.0e+300 as signed int); + # End of 4.1 tests -- cgit v1.2.1 From 836bc2638e1939c0f65748f219e5613cc0f0af06 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Mon, 26 Sep 2005 14:55:52 +0500 Subject: Fix for bug #12267 (primary key over GEOMETRY field) --- mysql-test/r/gis.result | 5 +++++ mysql-test/t/gis.test | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 78014137b50..2748199efad 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -680,3 +680,8 @@ select astext(fn3()); astext(fn3()) POINT(1 1) drop function fn3; +create table t1(pt POINT); +alter table t1 add primary key pti(pt); +ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length +alter table t1 add primary key pti(pt(20)); +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index aba2f33833a..1f30407c2b7 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -395,3 +395,11 @@ show create function fn3; select astext(fn3()); drop function fn3; +# +# Bug #12267 (primary key over GIS) +# +create table t1(pt POINT); +--error 1170 +alter table t1 add primary key pti(pt); +alter table t1 add primary key pti(pt(20)); +drop table t1; -- cgit v1.2.1 From 6a84506af777a19fbe730cae322d387b28e331f4 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Mon, 26 Sep 2005 18:46:31 +0200 Subject: Fixed BUG#7049: Stored procedure CALL errors are ignored Search the chain of sp_rcontexts recursively for handlers. If one is found, it will be detected in the sp_head::execute() method at the corresponding level. --- mysql-test/r/sp.result | 95 ++++++++++++++++++++++++++++++++++++++++++++---- mysql-test/t/sp.test | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index f9e6eae7e57..dea04dfdfdf 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3310,19 +3310,15 @@ select 1| 1 call bug12379_1()| bug12379() +NULL 42 42 -Warnings: -Error 1062 Duplicate entry 'X' for key 1 -Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes select 2| 2 2 call bug12379_2()| bug12379() -Warnings: -Error 1062 Duplicate entry 'X' for key 1 -Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes +NULL select 3| 3 3 @@ -3390,4 +3386,91 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| +drop table if exists t3| +drop procedure if exists bug7049_1| +drop procedure if exists bug7049_2| +drop procedure if exists bug7049_3| +drop procedure if exists bug7049_4| +drop procedure if exists bug7049_5| +drop procedure if exists bug7049_6| +drop function if exists bug7049_1| +drop function if exists bug7049_2| +create table t3 ( x int unique )| +create procedure bug7049_1() +begin +insert into t3 values (42); +insert into t3 values (42); +end| +create procedure bug7049_2() +begin +declare exit handler for sqlexception +select 'Caught it' as 'Result'; +call bug7049_1(); +select 'Missed it' as 'Result'; +end| +create procedure bug7049_3() +call bug7049_1()| +create procedure bug7049_4() +begin +declare exit handler for sqlexception +select 'Caught it' as 'Result'; +call bug7049_3(); +select 'Missed it' as 'Result'; +end| +create procedure bug7049_5() +begin +declare x decimal(2,1); +set x = 'zap'; +end| +create procedure bug7049_6() +begin +declare exit handler for sqlwarning +select 'Caught it' as 'Result'; +call bug7049_5(); +select 'Missed it' as 'Result'; +end| +create function bug7049_1() +returns int +begin +insert into t3 values (42); +insert into t3 values (42); +return 42; +end| +create function bug7049_2() +returns int +begin +declare x int default 0; +declare continue handler for sqlexception +set x = 1; +set x = bug7049_1(); +return x; +end| +call bug7049_2()| +Result +Caught it +select * from t3| +x +42 +delete from t3| +call bug7049_4()| +Result +Caught it +select * from t3| +x +42 +call bug7049_6()| +Result +Caught it +select bug7049_2()| +bug7049_2() +1 +drop table t3| +drop procedure bug7049_1| +drop procedure bug7049_2| +drop procedure bug7049_3| +drop procedure bug7049_4| +drop procedure bug7049_5| +drop procedure bug7049_6| +drop function bug7049_1| +drop function bug7049_2| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 65d4f89e2bb..67fb165d4f4 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4264,6 +4264,104 @@ drop table t3| drop procedure bug6127| +# +# BUG#7049: Stored procedure CALL errors are ignored +# +--disable_warnings +drop table if exists t3| +drop procedure if exists bug7049_1| +drop procedure if exists bug7049_2| +drop procedure if exists bug7049_3| +drop procedure if exists bug7049_4| +drop procedure if exists bug7049_5| +drop procedure if exists bug7049_6| +drop function if exists bug7049_1| +drop function if exists bug7049_2| +--enable_warnings + +create table t3 ( x int unique )| + +create procedure bug7049_1() +begin + insert into t3 values (42); + insert into t3 values (42); +end| + +create procedure bug7049_2() +begin + declare exit handler for sqlexception + select 'Caught it' as 'Result'; + + call bug7049_1(); + select 'Missed it' as 'Result'; +end| + +create procedure bug7049_3() + call bug7049_1()| + +create procedure bug7049_4() +begin + declare exit handler for sqlexception + select 'Caught it' as 'Result'; + + call bug7049_3(); + select 'Missed it' as 'Result'; +end| + +create procedure bug7049_5() +begin + declare x decimal(2,1); + + set x = 'zap'; +end| + +create procedure bug7049_6() +begin + declare exit handler for sqlwarning + select 'Caught it' as 'Result'; + + call bug7049_5(); + select 'Missed it' as 'Result'; +end| + +create function bug7049_1() + returns int +begin + insert into t3 values (42); + insert into t3 values (42); + return 42; +end| + +create function bug7049_2() + returns int +begin + declare x int default 0; + declare continue handler for sqlexception + set x = 1; + + set x = bug7049_1(); + return x; +end| + +call bug7049_2()| +select * from t3| +delete from t3| +call bug7049_4()| +select * from t3| +call bug7049_6()| +select bug7049_2()| + +drop table t3| +drop procedure bug7049_1| +drop procedure bug7049_2| +drop procedure bug7049_3| +drop procedure bug7049_4| +drop procedure bug7049_5| +drop procedure bug7049_6| +drop function bug7049_1| +drop function bug7049_2| + + # # BUG#NNNN: New bug synopsis # -- cgit v1.2.1 From 7f3e2dc48d1f40a68b45218642677738a6607370 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 15:11:39 +0500 Subject: Fix for bug #13372 (decimal union) --- mysql-test/r/type_decimal.result | 17 ++++++++++++++++- mysql-test/r/type_float.result | 15 +++++++++++++++ mysql-test/t/type_decimal.test | 14 +++++++++++++- mysql-test/t/type_float.test | 13 +++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index c3b2d5090ef..de8610f6514 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2, t3; SET SQL_WARNINGS=1; CREATE TABLE t1 ( id int(11) NOT NULL auto_increment, @@ -655,3 +655,18 @@ select * from t1; a b 123.12345 123.1 drop table t1; +create table t1 (d decimal(10,1)); +create table t2 (d decimal(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +d +1.234567800 +100000000.000000000 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `d` decimal(18,9) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 319a957498b..2e6642c3fcf 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -235,3 +235,18 @@ select * from t1 where reckey=1.09E2; reckey recdesc 109 Has 109 as key drop table t1; +create table t1 (d double(10,1)); +create table t2 (d double(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +d +1.234567800 +100000000.000000000 +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `d` double(61,9) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2, t3; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 1f133666910..cc5e9278b12 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -1,7 +1,7 @@ # bug in decimal() with negative numbers by kaido@tradenet.ee --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2, t3; --enable_warnings SET SQL_WARNINGS=1; @@ -276,4 +276,16 @@ update t1 set b=a; select * from t1; drop table t1; +# +# Bug #13372 (decimal union) +# +create table t1 (d decimal(10,1)); +create table t2 (d decimal(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +show create table t3; +drop table t1, t2, t3; + # End of 4.1 tests diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 2d4a90911a1..abaf72ea2ed 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -149,4 +149,17 @@ select * from t1 where reckey=109; select * from t1 where reckey=1.09E2; drop table t1; +# +# Bug #13372 (decimal union) +# +create table t1 (d double(10,1)); +create table t2 (d double(10,9)); +insert into t1 values ("100000000.0"); +insert into t2 values ("1.23456780"); +create table t3 select * from t2 union select * from t1; +select * from t3; +show create table t3; +drop table t1, t2, t3; + + # End of 4.1 tests -- cgit v1.2.1 From 9b88d252470984beb62bf5fd6c1c1da745f22456 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 15:31:38 +0500 Subject: additional fix to the bug #13372 (decimal union) --- mysql-test/r/type_float.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 2e6642c3fcf..6e381192270 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -247,6 +247,6 @@ d show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` double(61,9) default NULL + `d` double(22,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; -- cgit v1.2.1 From f0dfa1954856a6e49e843f4725101d05eff2c1a5 Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 27 Sep 2005 16:23:37 +0500 Subject: additional fix for bug #13372 (decimal union) --- mysql-test/r/union.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index a3dd2c5c291..318bfa2cda8 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -565,7 +565,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` double(53,1) NOT NULL default '0.0' + `a` double(21,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); -- cgit v1.2.1 From 613a494c47845aaeae7784eb148b5ddc2bd2bc99 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Thu, 29 Sep 2005 17:30:15 +0200 Subject: Updated result after manual merge of sp.test. --- mysql-test/r/sp.result | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index dea04dfdfdf..1791cd385f4 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3386,6 +3386,51 @@ s1 set sql_mode=@sm| drop table t3| drop procedure bug6127| +drop procedure if exists bug12589_1| +drop procedure if exists bug12589_2| +drop procedure if exists bug12589_3| +create procedure bug12589_1() +begin +declare spv1 decimal(3,3); +set spv1= 123.456; +set spv1 = 'test'; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_2() +begin +declare spv1 decimal(6,3); +set spv1= 123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +create procedure bug12589_3() +begin +declare spv1 decimal(6,3); +set spv1= -123.456; +create temporary table tm1 as select spv1; +show create table tm1; +drop temporary table tm1; +end| +call bug12589_1()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(1,0) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'test' +call bug12589_2()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +call bug12589_3()| +Table Create Table +tm1 CREATE TEMPORARY TABLE `tm1` ( + `spv1` decimal(6,3) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table if exists t3| drop procedure if exists bug7049_1| drop procedure if exists bug7049_2| -- cgit v1.2.1 From e9f2f9437a9c7be83db93d3461ce6e77245d1df4 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Fri, 30 Sep 2005 15:21:37 +0400 Subject: BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMIT optimization: now can use index to find records to update/delete when there is no WHERE clause. --- mysql-test/r/update.result | 59 ++++++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/update.test | 29 +++++++++++++++++++++++ 2 files changed, 88 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index d6c1118f90c..cf07487febc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -263,3 +263,62 @@ test delete from t1 where count(*)=1; ERROR HY000: Invalid use of group function drop table t1; +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); +flush status; +select a from t1 order by a limit 1; +a +0 +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +alter table t1 disable keys; +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 1 +Handler_read_rnd_next 9 +select count(*) from t1; +count(*) +5 +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 84e9ced2017..a37655b15fe 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -227,4 +227,33 @@ select DATABASE(); delete from t1 where count(*)=1; drop table t1; +# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); + +flush status; +select a from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; + +alter table t1 disable keys; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +select count(*) from t1; + +drop table t1; # End of 4.1 tests -- cgit v1.2.1 From 5a10244d8b024745b65341d4a4f09ba50621635a Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Mon, 3 Oct 2005 23:22:46 +0400 Subject: Fix bug#13535 Incorrect result from SELECT statement after SHOW TABLE STATUS After SHOW TABLE STATUS last_insert_id wasn't cleaned, and next select erroneously rewrites WHERE condition and returs a row; 5.0 isn't affected because of different SHOW TABLE STATUS handling. last_insert_id cleanup added to mysqld_extend_show_tables(). --- mysql-test/r/select.result | 10 ++++++++++ mysql-test/t/select.test | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 64cbaf4fa67..8477fa88887 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2626,3 +2626,13 @@ f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL +t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index bdadd5c536b..d158932beb1 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2174,4 +2174,14 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); drop table t1,t2; +# +# Bug #13535 +# +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X +show table status like 't1%'; +select 123 as a from t1 where f1 is null; +drop table t1,t11; # End of 4.1 tests -- cgit v1.2.1 From cb96f195c8ec86236b1673adc0db5d32e08bd957 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 4 Oct 2005 15:43:55 +0200 Subject: Improved testing of ssl and compression - Added show status variable "compression" for checking that compression is turned on. - Updated show status variable "have_openssl" to be set to DISABLED if server supports ssl but it's not turned on to accept incoming ssl connections. - Setup server to accept ssl connections from clients ig that is supported by server - New tests - ssl - Run with ssl turned on - ssl_compress - Run with ssl and compression turned on - compress - Run with compression turned in - Updated test - openssl_1, rpl_openssl1 - Changed to run if server supports ssl --- mysql-test/include/have_openssl_1.inc | 4 - mysql-test/mysql-test-run.pl | 123 +- mysql-test/r/compress.result | 2948 ++++++++++++++++++++++++++++++++ mysql-test/r/have_openssl_1.require | 2 - mysql-test/r/openssl_1.result | 12 + mysql-test/r/ssl.result | 2948 ++++++++++++++++++++++++++++++++ mysql-test/r/ssl_compress.result | 2951 +++++++++++++++++++++++++++++++++ mysql-test/t/compress.test | 19 + mysql-test/t/openssl_1.test | 11 +- mysql-test/t/rpl_openssl.test | 2 +- mysql-test/t/ssl.test | 21 + mysql-test/t/ssl_compress.test | 25 + 12 files changed, 9035 insertions(+), 31 deletions(-) delete mode 100644 mysql-test/include/have_openssl_1.inc create mode 100644 mysql-test/r/compress.result delete mode 100644 mysql-test/r/have_openssl_1.require create mode 100644 mysql-test/r/ssl.result create mode 100644 mysql-test/r/ssl_compress.result create mode 100644 mysql-test/t/compress.test create mode 100644 mysql-test/t/ssl.test create mode 100644 mysql-test/t/ssl_compress.test (limited to 'mysql-test') diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc deleted file mode 100644 index 887309c7e23..00000000000 --- a/mysql-test/include/have_openssl_1.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/have_openssl_1.require -disable_query_log; -SHOW STATUS LIKE 'Ssl_cipher'; -enable_query_log; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 651aa37fc7e..833b7515c59 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -188,6 +188,12 @@ our $opt_big_test= 0; # Send --big-test to mysqltest our @opt_extra_mysqld_opt; our $opt_compress; +our $opt_ssl; +our $opt_skip_ssl; +our $opt_ssl_supported; +our $opt_with_openssl; # Deprecated flag +our $opt_ps_protocol; + our $opt_current_test; our $opt_ddd; our $opt_debug; @@ -237,7 +243,6 @@ our $opt_skip_rpl; our $opt_skip_test; our $opt_sleep; -our $opt_ps_protocol; our $opt_sleep_time_after_restart= 1; our $opt_sleep_time_for_delete= 10; @@ -275,7 +280,6 @@ our $opt_udiff; our $opt_skip_ndbcluster; our $opt_with_ndbcluster; -our $opt_with_openssl; our $exe_ndb_mgm; our $path_ndb_tools_dir; @@ -296,7 +300,8 @@ sub executable_setup (); sub environment_setup (); sub kill_running_server (); sub kill_and_cleanup (); -sub ndbcluster_support (); +sub check_ssl_support (); +sub check_ndbcluster_support (); sub ndbcluster_install (); sub ndbcluster_start (); sub ndbcluster_stop (); @@ -331,11 +336,9 @@ sub main () { initial_setup(); command_line_setup(); executable_setup(); - - if (! $opt_skip_ndbcluster and ! $opt_with_ndbcluster) - { - $opt_with_ndbcluster= ndbcluster_support(); - } + + check_ndbcluster_support(); + check_ssl_support(); environment_setup(); signal_setup(); @@ -477,6 +480,10 @@ sub command_line_setup () { # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, + 'with-openssl' => \$opt_with_openssl, + 'ssl' => \$opt_ssl, + 'skip-ssl' => \$opt_skip_ssl, + 'compress' => \$opt_compress, 'bench' => \$opt_bench, 'small-bench' => \$opt_small_bench, 'no-manager' => \$opt_no_manager, # Currently not used @@ -527,7 +534,6 @@ sub command_line_setup () { # Misc 'big-test' => \$opt_big_test, - 'compress' => \$opt_compress, 'debug' => \$opt_debug, 'fast' => \$opt_fast, 'local' => \$opt_local, @@ -552,7 +558,6 @@ sub command_line_setup () { 'testcase-timeout=i' => \$opt_testcase_timeout, 'suite-timeout=i' => \$opt_suite_timeout, 'warnings|log-warnings' => \$opt_warnings, - 'with-openssl' => \$opt_with_openssl, 'help|h' => \$opt_usage, ) or usage("Can't read options"); @@ -1094,13 +1099,66 @@ sub kill_and_cleanup () { } +sub check_ssl_support () { + + + # Convert deprecated --with-openssl to --ssl + if ( $opt_with_openssl ) + { + $opt_ssl= 1; + } + + if ($opt_skip_ssl) + { + mtr_report("Skipping SSL"); + $opt_ssl_supported= 0; + $opt_ssl= 0; + return; + } + + # check ssl support by testing using a switch + # that is only available in that case + if ( mtr_run($exe_mysqld, + ["--no-defaults", + "--ssl", + "--help"], + "", "/dev/null", "/dev/null", "") != 0 ) + { + if ( $opt_ssl) + { + mtr_error("Couldn't find support for SSL"); + return; + } + mtr_report("Skipping SSL, mysqld does not support it"); + $opt_ssl_supported= 0; + $opt_ssl= 0; + return; + } + mtr_report("Setting mysqld to support SSL connections"); + $opt_ssl_supported= 1; +} + + ############################################################################## # # Start the ndb cluster # ############################################################################## -sub ndbcluster_support () { +sub check_ndbcluster_support () { + + if ($opt_skip_ndbcluster) + { + mtr_report("Skipping ndbcluster"); + $opt_with_ndbcluster= 0; + return; + } + + if ($opt_with_ndbcluster) + { + mtr_report("Using ndbcluster"); + return; + } # check ndbcluster support by testing using a switch # that is only available in that case @@ -1110,11 +1168,13 @@ sub ndbcluster_support () { "--help"], "", "/dev/null", "/dev/null", "") != 0 ) { - mtr_report("No ndbcluster support"); - return 0; + mtr_report("Skipping ndbcluster, mysqld does not support it"); + $opt_with_ndbcluster= 0; + return; } - mtr_report("Has ndbcluster support"); - return 1; + mtr_report("Using ndbcluster, mysqld supports it"); + $opt_with_ndbcluster= 1; + return; } # FIXME why is there a different start below?! @@ -2003,7 +2063,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix); - if ( $opt_with_openssl ) + if ( $opt_ssl_supported ) { mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix, $glob_mysql_test_dir); @@ -2468,14 +2528,26 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir); } - if ( $opt_with_openssl ) + if ( $opt_ssl_supported ) { mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem", - $glob_mysql_test_dir); + $glob_mysql_test_dir); + } + + # Turn on SSL for all test cases + if ( $opt_ssl ) + { + mtr_add_arg($args, "--ssl", + $glob_mysql_test_dir); + } + elsif ( $opt_ssl_supported ) + { + mtr_add_arg($args, "--skip-ssl", + $glob_mysql_test_dir); } mtr_add_arg($args, "-R"); @@ -2515,6 +2587,9 @@ Options to control what engine/variation to run embedded-server Use the embedded server, i.e. no mysqld daemons ps-protocol Use the binary protocol between client and server + compress Use the compressed protocol between client and server + ssl Use ssl protocol between client and server + skip-ssl Dont start sterver with support for ssl connections bench Run the benchmark suite FIXME small-bench FIXME @@ -2522,6 +2597,7 @@ Options to control what test suites or cases to run force Continue to run the suite after failure with-ndbcluster Use cluster, and enable test cases that requres it + skip-ndb[cluster] Use cluster, and enable test cases that requres it do-test=PREFIX Run test cases which name are prefixed with PREFIX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" @@ -2545,7 +2621,7 @@ Options that pass on options Options to run test on running server extern Use running server for tests FIXME DANGEROUS - ndbconnectstring=STR Use running cluster, and connect using STR + ndbconnectstring=STR Use running cluster, and connect using STR user=USER User for connect to server Options for debugging the product @@ -2570,7 +2646,6 @@ Misc options verbose Verbose output from this script script-debug Debug this script itself - compress Use the compressed protocol between client and server timer Show test case execution time start-and-exit Only initiate and start the "mysqld" servers, use the startup settings for the specified test case if any @@ -2583,6 +2658,9 @@ Misc options testcase-timeout=MINUTES Max test case run time (default 5) suite-timeout=MINUTES Max test suite run time (default 120) +Deprecated options + with-openssl Deprecated option for ssl + Options not yet described, or that I want to look into more @@ -2599,7 +2677,6 @@ Options not yet described, or that I want to look into more wait-timeout=SECONDS warnings log-warnings - with-openssl HERE mtr_exit(1); diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result new file mode 100644 index 00000000000..a86fb4e4745 --- /dev/null +++ b/mysql-test/r/compress.result @@ -0,0 +1,2948 @@ +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr 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 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr 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 +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +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; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require deleted file mode 100644 index b33a1d2854f..00000000000 --- a/mysql-test/r/have_openssl_1.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 035c84431f8..77f2d5495a9 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -6,21 +6,33 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1' +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA select * from t1; f1 5 diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result new file mode 100644 index 00000000000..5c8a7e91c71 --- /dev/null +++ b/mysql-test/r/ssl.result @@ -0,0 +1,2948 @@ +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr 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 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr 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 +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +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; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result new file mode 100644 index 00000000000..574726640d4 --- /dev/null +++ b/mysql-test/r/ssl_compress.result @@ -0,0 +1,2951 @@ +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON +drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key column 'not_used' doesn't exist in table +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +218401 faithful +018007 fanatic +228311 fated +018017 featherweight +218022 feed +088303 feminine +058004 Fenton +038017 fetched +018054 fetters +208101 fiftieth +238007 filial +013606 fingerings +218008 finishers +038205 firearm +188505 fitting +202301 Fitzpatrick +238008 fixedly +012001 flanking +018103 flint +018104 flopping +188007 flurried +013602 foldout +226205 foothill +232102 forgivably +228306 forthcoming +186002 freakish +208113 freest +231315 freezes +036002 funereal +226209 furnishings +198006 furthermore +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +37 +36 +50 +58 +29 +40 +53 +65 +41 +34 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +create temporary table tmp engine = myisam select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=1; +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +fld3 count(*) +affixed 1 +and 1 +annoyers 1 +Anthony 1 +assayed 1 +assurers 1 +attendants 1 +bedlam 1 +bedpost 1 +boasted 1 +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; +fld3 repeat("a",length(fld3)) count(*) +circus aaaaaa 1 +cited aaaaa 1 +Colombo aaaaaaa 1 +congresswoman aaaaaaaaaaaaa 1 +contrition aaaaaaaaaa 1 +corny aaaaa 1 +cultivation aaaaaaaaaaa 1 +definiteness aaaaaaaaaaaa 1 +demultiplex aaaaaaaaaaa 1 +disappointing aaaaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index period period 4 NULL 41810 +1 SIMPLE t1 ref period period 4 test.t3.period 4181 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index period period 4 NULL 41810 +1 SIMPLE t3 ref period period 4 test.t1.period 4181 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 const fld1 fld1 4 const 1 +1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1 +select fld3,period from t2,t1 where companynr*10 = 37*10; +fld3 period +breaking 9410 +Romans 9410 +intercepted 9410 +bewilderingly 9410 +astound 9410 +admonishing 9410 +sumac 9410 +flanking 9410 +combed 9410 +subjective 9410 +scatterbrain 9410 +Eulerian 9410 +Kane 9410 +overlay 9410 +perturb 9410 +goblins 9410 +annihilates 9410 +Wotan 9410 +snatching 9410 +concludes 9410 +laterally 9410 +yelped 9410 +grazing 9410 +Baird 9410 +celery 9410 +misunderstander 9410 +handgun 9410 +foldout 9410 +mystic 9410 +succumbed 9410 +Nabisco 9410 +fingerings 9410 +aging 9410 +afield 9410 +ammonium 9410 +boat 9410 +intelligibility 9410 +Augustine 9410 +teethe 9410 +dreaded 9410 +scholastics 9410 +audiology 9410 +wallet 9410 +parters 9410 +eschew 9410 +quitter 9410 +neat 9410 +Steinberg 9410 +jarring 9410 +tinily 9410 +balled 9410 +persist 9410 +attainments 9410 +fanatic 9410 +measures 9410 +rightfulness 9410 +capably 9410 +impulsive 9410 +starlet 9410 +terminators 9410 +untying 9410 +announces 9410 +featherweight 9410 +pessimist 9410 +daughter 9410 +decliner 9410 +lawgiver 9410 +stated 9410 +readable 9410 +attrition 9410 +cascade 9410 +motors 9410 +interrogate 9410 +pests 9410 +stairway 9410 +dopers 9410 +testicle 9410 +Parsifal 9410 +leavings 9410 +postulation 9410 +squeaking 9410 +contrasted 9410 +leftover 9410 +whiteners 9410 +erases 9410 +Punjab 9410 +Merritt 9410 +Quixotism 9410 +sweetish 9410 +dogging 9410 +scornfully 9410 +bellow 9410 +bills 9410 +cupboard 9410 +sureties 9410 +puddings 9410 +fetters 9410 +bivalves 9410 +incurring 9410 +Adolph 9410 +pithed 9410 +Miles 9410 +trimmings 9410 +tragedies 9410 +skulking 9410 +flint 9410 +flopping 9410 +relaxing 9410 +offload 9410 +suites 9410 +lists 9410 +animized 9410 +multilayer 9410 +standardizes 9410 +Judas 9410 +vacuuming 9410 +dentally 9410 +humanness 9410 +inch 9410 +Weissmuller 9410 +irresponsibly 9410 +luckily 9410 +culled 9410 +medical 9410 +bloodbath 9410 +subschema 9410 +animals 9410 +Micronesia 9410 +repetitions 9410 +Antares 9410 +ventilate 9410 +pityingly 9410 +interdependent 9410 +Graves 9410 +neonatal 9410 +chafe 9410 +honoring 9410 +realtor 9410 +elite 9410 +funereal 9410 +abrogating 9410 +sorters 9410 +Conley 9410 +lectured 9410 +Abraham 9410 +Hawaii 9410 +cage 9410 +hushes 9410 +Simla 9410 +reporters 9410 +Dutchman 9410 +descendants 9410 +groupings 9410 +dissociate 9410 +coexist 9410 +Beebe 9410 +Taoism 9410 +Connally 9410 +fetched 9410 +checkpoints 9410 +rusting 9410 +galling 9410 +obliterates 9410 +traitor 9410 +resumes 9410 +analyzable 9410 +terminator 9410 +gritty 9410 +firearm 9410 +minima 9410 +Selfridge 9410 +disable 9410 +witchcraft 9410 +betroth 9410 +Manhattanize 9410 +imprint 9410 +peeked 9410 +swelling 9410 +interrelationships 9410 +riser 9410 +Gandhian 9410 +peacock 9410 +bee 9410 +kanji 9410 +dental 9410 +scarf 9410 +chasm 9410 +insolence 9410 +syndicate 9410 +alike 9410 +imperial 9410 +convulsion 9410 +railway 9410 +validate 9410 +normalizes 9410 +comprehensive 9410 +chewing 9410 +denizen 9410 +schemer 9410 +chronicle 9410 +Kline 9410 +Anatole 9410 +partridges 9410 +brunch 9410 +recruited 9410 +dimensions 9410 +Chicana 9410 +announced 9410 +praised 9410 +employing 9410 +linear 9410 +quagmire 9410 +western 9410 +relishing 9410 +serving 9410 +scheduling 9410 +lore 9410 +eventful 9410 +arteriole 9410 +disentangle 9410 +cured 9410 +Fenton 9410 +avoidable 9410 +drains 9410 +detectably 9410 +husky 9410 +impelling 9410 +undoes 9410 +evened 9410 +squeezes 9410 +destroyer 9410 +rudeness 9410 +beaner 9410 +boorish 9410 +Everhart 9410 +encompass 9410 +mushrooms 9410 +Alison 9410 +externally 9410 +pellagra 9410 +cult 9410 +creek 9410 +Huffman 9410 +Majorca 9410 +governing 9410 +gadfly 9410 +reassigned 9410 +intentness 9410 +craziness 9410 +psychic 9410 +squabbled 9410 +burlesque 9410 +capped 9410 +extracted 9410 +DiMaggio 9410 +exclamation 9410 +subdirectory 9410 +Gothicism 9410 +feminine 9410 +metaphysically 9410 +sanding 9410 +Miltonism 9410 +freakish 9410 +index 9410 +straight 9410 +flurried 9410 +denotative 9410 +coming 9410 +commencements 9410 +gentleman 9410 +gifted 9410 +Shanghais 9410 +sportswriting 9410 +sloping 9410 +navies 9410 +leaflet 9410 +shooter 9410 +Joplin 9410 +babies 9410 +assails 9410 +admiring 9410 +swaying 9410 +Goldstine 9410 +fitting 9410 +Norwalk 9410 +analogy 9410 +deludes 9410 +cokes 9410 +Clayton 9410 +exhausts 9410 +causality 9410 +sating 9410 +icon 9410 +throttles 9410 +communicants 9410 +dehydrate 9410 +priceless 9410 +publicly 9410 +incidentals 9410 +commonplace 9410 +mumbles 9410 +furthermore 9410 +cautioned 9410 +parametrized 9410 +registration 9410 +sadly 9410 +positioning 9410 +babysitting 9410 +eternal 9410 +hoarder 9410 +congregates 9410 +rains 9410 +workers 9410 +sags 9410 +unplug 9410 +garage 9410 +boulder 9410 +specifics 9410 +Teresa 9410 +Winsett 9410 +convenient 9410 +buckboards 9410 +amenities 9410 +resplendent 9410 +sews 9410 +participated 9410 +Simon 9410 +certificates 9410 +Fitzpatrick 9410 +Evanston 9410 +misted 9410 +textures 9410 +save 9410 +count 9410 +rightful 9410 +chaperone 9410 +Lizzy 9410 +clenched 9410 +effortlessly 9410 +accessed 9410 +beaters 9410 +Hornblower 9410 +vests 9410 +indulgences 9410 +infallibly 9410 +unwilling 9410 +excrete 9410 +spools 9410 +crunches 9410 +overestimating 9410 +ineffective 9410 +humiliation 9410 +sophomore 9410 +star 9410 +rifles 9410 +dialysis 9410 +arriving 9410 +indulge 9410 +clockers 9410 +languages 9410 +Antarctica 9410 +percentage 9410 +ceiling 9410 +specification 9410 +regimented 9410 +ciphers 9410 +pictures 9410 +serpents 9410 +allot 9410 +realized 9410 +mayoral 9410 +opaquely 9410 +hostess 9410 +fiftieth 9410 +incorrectly 9410 +decomposition 9410 +stranglings 9410 +mixture 9410 +electroencephalography 9410 +similarities 9410 +charges 9410 +freest 9410 +Greenberg 9410 +tinting 9410 +expelled 9410 +warm 9410 +smoothed 9410 +deductions 9410 +Romano 9410 +bitterroot 9410 +corset 9410 +securing 9410 +environing 9410 +cute 9410 +Crays 9410 +heiress 9410 +inform 9410 +avenge 9410 +universals 9410 +Kinsey 9410 +ravines 9410 +bestseller 9410 +equilibrium 9410 +extents 9410 +relatively 9410 +pressure 9410 +critiques 9410 +befouled 9410 +rightfully 9410 +mechanizing 9410 +Latinizes 9410 +timesharing 9410 +Aden 9410 +embassies 9410 +males 9410 +shapelessly 9410 +mastering 9410 +Newtonian 9410 +finishers 9410 +abates 9410 +teem 9410 +kiting 9410 +stodgy 9410 +feed 9410 +guitars 9410 +airships 9410 +store 9410 +denounces 9410 +Pyle 9410 +Saxony 9410 +serializations 9410 +Peruvian 9410 +taxonomically 9410 +kingdom 9410 +stint 9410 +Sault 9410 +faithful 9410 +Ganymede 9410 +tidiness 9410 +gainful 9410 +contrary 9410 +Tipperary 9410 +tropics 9410 +theorizers 9410 +renew 9410 +already 9410 +terminal 9410 +Hegelian 9410 +hypothesizer 9410 +warningly 9410 +journalizing 9410 +nested 9410 +Lars 9410 +saplings 9410 +foothill 9410 +labeled 9410 +imperiously 9410 +reporters 9410 +furnishings 9410 +precipitable 9410 +discounts 9410 +excises 9410 +Stalin 9410 +despot 9410 +ripeness 9410 +Arabia 9410 +unruly 9410 +mournfulness 9410 +boom 9410 +slaughter 9410 +Sabine 9410 +handy 9410 +rural 9410 +organizer 9410 +shipyard 9410 +civics 9410 +inaccuracy 9410 +rules 9410 +juveniles 9410 +comprised 9410 +investigations 9410 +stabilizes 9410 +seminaries 9410 +Hunter 9410 +sporty 9410 +test 9410 +weasels 9410 +CERN 9410 +tempering 9410 +afore 9410 +Galatean 9410 +techniques 9410 +error 9410 +veranda 9410 +severely 9410 +Cassites 9410 +forthcoming 9410 +guides 9410 +vanish 9410 +lied 9410 +sawtooth 9410 +fated 9410 +gradually 9410 +widens 9410 +preclude 9410 +evenhandedly 9410 +percentage 9410 +disobedience 9410 +humility 9410 +gleaning 9410 +petted 9410 +bloater 9410 +minion 9410 +marginal 9410 +apiary 9410 +measures 9410 +precaution 9410 +repelled 9410 +primary 9410 +coverings 9410 +Artemia 9410 +navigate 9410 +spatial 9410 +Gurkha 9410 +meanwhile 9410 +Melinda 9410 +Butterfield 9410 +Aldrich 9410 +previewing 9410 +glut 9410 +unaffected 9410 +inmate 9410 +mineral 9410 +impending 9410 +meditation 9410 +ideas 9410 +miniaturizes 9410 +lewdly 9410 +title 9410 +youthfulness 9410 +creak 9410 +Chippewa 9410 +clamored 9410 +freezes 9410 +forgivably 9410 +reduce 9410 +McGovern 9410 +Nazis 9410 +epistle 9410 +socializes 9410 +conceptions 9410 +Kevin 9410 +uncovering 9410 +chews 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +raining 9410 +infest 9410 +compartment 9410 +minting 9410 +ducks 9410 +roped 9410 +waltz 9410 +Lillian 9410 +repressions 9410 +chillingly 9410 +noncritical 9410 +lithograph 9410 +spongers 9410 +parenthood 9410 +posed 9410 +instruments 9410 +filial 9410 +fixedly 9410 +relives 9410 +Pandora 9410 +watering 9410 +ungrateful 9410 +secures 9410 +poison 9410 +dusted 9410 +encompasses 9410 +presentation 9410 +Kantian 9410 +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250502 250501 +250503 250501 +250504 250501 +250505 250501 +250501 250502 +250502 250502 +250503 250502 +250504 250502 +250505 250502 +250501 250503 +250502 250503 +250503 250503 +250504 250503 +250505 250503 +250501 250504 +250502 250504 +250503 250504 +250504 250504 +250505 250504 +250501 250505 +250502 250505 +250503 250505 +250504 250505 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr 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 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr 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 +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +label +labeled +labeled +landslide +laterally +leaflet +lewdly +Lillian +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where +Warnings: +Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1'')) +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +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; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +37 12543 309394878010 5987435 39654943 24666736.6667 +78 8362 414611089292 726498 98439034 49582766.0000 +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +9 +4 +6 +7 +1 +3 +8 +5 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +37 12543 309394878010 0.0000 464091 +78 8362 414611089292 0.0000 652236 +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 Micronesia 786542 +512 Miles 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +explain select fld3 from t2 where fld1=fld1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +68 company 10 12 +50 company 11 11 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 = t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(11) NULL NO PRI NULL auto_increment # +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +companynr tinyint(2) unsigned zerofill NULL NO 00 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 # +fld3 char(30) latin1_swedish_ci NO MUL # +fld4 char(35) latin1_swedish_ci NO # +fld5 char(35) latin1_swedish_ci NO # +fld6 char(4) latin1_swedish_ci NO # +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE +t2 1 fld3 1 fld3 A NULL NULL NULL BTREE +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 1 +3 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +NULL 1 +1 2 +2 2 +3 2 +1 3 +2 3 +3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +3 1 +2 2 +3 2 +2 3 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 +1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one '), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +insert into t1 values (1,0), (1,1), (1,2); +select a-b from t1 order by 1; +a-b +0 +1 +18446744073709551615 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +18446744073709551615 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +18446744073709551615 1 2 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +18446744073709551615 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int) engine=myisam; +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +create table t1 (a int(11)); +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +create table t2 (b int(10), t2_val int(10)); +create table t3 (a int(10), b int(10)); +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +create table t2 (a int(10),b int(10)); +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test new file mode 100644 index 00000000000..45b9ab9dd1e --- /dev/null +++ b/mysql-test/t/compress.test @@ -0,0 +1,19 @@ +# Turn on compression between the client and server +# and run a number of tests + +-- source include/have_compress.inc + +enable_compress; + +# Reconnect to turn compress on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check compression turned on +SHOW STATUS LIKE 'Compression'; + +# Source select test case +-- source t/select.test + +disable_compress; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index e04c77ddf45..e9487425dd7 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -1,6 +1,6 @@ # We test openssl. Result set is optimized to be compiled with --with-openssl. # Use mysql-test-run with --with-openssl option. --- source include/have_openssl_1.inc +-- source include/have_openssl.inc --disable_warnings drop table if exists t1; @@ -13,27 +13,36 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; +enable_ssl; connect (con1,localhost,ssl_user1,,); connect (con2,localhost,ssl_user2,,); connect (con3,localhost,ssl_user3,,); connect (con4,localhost,ssl_user4,,); connection con1; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con2; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con3; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; connection con4; +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; --error 1142 delete from t1; diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test index 3c151721d8e..e15eb9b179a 100644 --- a/mysql-test/t/rpl_openssl.test +++ b/mysql-test/t/rpl_openssl.test @@ -1,4 +1,4 @@ -source include/have_openssl_1.inc; +source include/have_openssl.inc; source include/master-slave.inc; # We don't test all types of ssl auth params here since it's a bit hard diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test new file mode 100644 index 00000000000..d13bec60c2b --- /dev/null +++ b/mysql-test/t/ssl.test @@ -0,0 +1,21 @@ +# Turn on ssl between the client and server +# and run a number of tests + +-- source include/have_openssl.inc + +enable_ssl; + +# Reconnect to turn ssl on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Source select test case +-- source t/select.test + +disable_ssl; + + diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test new file mode 100644 index 00000000000..4a0d3a254ff --- /dev/null +++ b/mysql-test/t/ssl_compress.test @@ -0,0 +1,25 @@ +# Turn on compression between the client and server +# and run a number of tests + +-- source include/have_openssl.inc +-- source include/have_compress.inc + +enable_compress; +enable_ssl; + +# Reconnect to turn ssl and compress on for +# default connection +disconnect default; +connect (default,localhost,root,,); + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Check compression turned on +SHOW STATUS LIKE 'Compression'; + +# Source select test case +-- source t/select.test + +disable_compress; +disable_ssl; -- cgit v1.2.1 From 593192770840cb99db689d01bb440709d0a1cbda Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 5 Oct 2005 19:20:49 +0500 Subject: Bug#12476 Some big5 codes are still missing. ctype-big5.c: Adding extra cp950 characters into Unicode mapping. ctype_big5.result, ctype_big5.test: Adding test case --- mysql-test/r/ctype_big5.result | 19 +++++++++++++++++++ mysql-test/t/ctype_big5.test | 15 +++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index a31289775fe..4c5832a57e9 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -170,3 +170,22 @@ SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE HEX(a) A741ADCCA66EB6DC20A7DAADCCABDCA66E DROP TABLE t1; +set names big5; +create table t1 (a char character set big5); +insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9); +insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC); +select hex(a) a, hex(@u:=convert(a using utf8)) b, +hex(convert(@u using big5)) c from t1 order by a; +a b c +F9D6 E7A281 F9D6 +F9D7 E98AB9 F9D7 +F9D8 E8A38F F9D8 +F9D9 E5A2BB F9D9 +F9DA E68192 F9DA +F9DB E7B2A7 F9DB +F9DC E5ABBA F9DC +alter table t1 convert to character set utf8; +select hex(a) from t1 where a = _big5 0xF9DC; +hex(a) +E5ABBA +drop table t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index 1788dce755b..ffe2a12234e 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -38,4 +38,19 @@ INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E); SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE); DROP TABLE t1; +# +# Bug#12476 Some big5 codes are still missing. +# +set names big5; +create table t1 (a char character set big5); +insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9); +insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC); +# Check round trip +select hex(a) a, hex(@u:=convert(a using utf8)) b, +hex(convert(@u using big5)) c from t1 order by a; +# Check that there is no "illegal mix of collations" error with Unicode. +alter table t1 convert to character set utf8; +select hex(a) from t1 where a = _big5 0xF9DC; +drop table t1; + # End of 4.1 tests -- cgit v1.2.1 From 78e828d32f4c94a7135b7ddcf749ddc9e5bd0d3d Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 6 Oct 2005 17:54:43 +0300 Subject: Review of code pushed since last 5.0 pull: Ensure that ccache is also used for C programs mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter Fixed test cases by adding missing DROP's and rename views to be of type 'v#' Removed MY_UNIX_PATH from fn_format() Removed current_db_used from TABLE_LIST Removed usage of 'current_thd' in Item_splocal Removed some compiler warnings A bit faster longlong2str code --- mysql-test/r/alter_table.result | 10 ++--- mysql-test/r/func_str.result | 3 ++ mysql-test/r/information_schema.result | 23 +++++----- mysql-test/r/information_schema_inno.result | 2 +- mysql-test/r/multi_statement.result | 1 + mysql-test/r/mysql.result | 1 + mysql-test/r/mysqldump.result | 70 +++++++++++++++-------------- mysql-test/r/mysqlshow.result | 1 + mysql-test/r/temp_table.result | 29 ++++++------ mysql-test/t/alter_table.test | 10 ++--- mysql-test/t/func_str.test | 1 + mysql-test/t/information_schema.test | 11 ++--- mysql-test/t/information_schema_inno.test | 2 +- mysql-test/t/multi_statement.test | 4 ++ mysql-test/t/mysql.test | 2 +- mysql-test/t/mysqlshow.test | 4 ++ mysql-test/t/temp_table.test | 25 ++++++----- 17 files changed, 110 insertions(+), 89 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6a710a8de10..2cc56975056 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -541,16 +541,16 @@ create table t1 ( a timestamp ); alter table t1 add unique ( a(1) ); ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys drop table t1; -create database mysqltest1; +create database mysqltest; create table t1 (c1 int); -alter table t1 rename mysqltest1.t1; +alter table t1 rename mysqltest.t1; drop table t1; ERROR 42S02: Unknown table 't1' -alter table mysqltest1.t1 rename t1; +alter table mysqltest.t1 rename t1; drop table t1; create table t1 (c1 int); -use mysqltest1; -drop database mysqltest1; +use mysqltest; +drop database mysqltest; alter table test.t1 rename t1; ERROR 3D000: No database selected alter table test.t1 rename test.t1; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 577f943ebde..b027cb33185 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -818,6 +818,9 @@ lpad(12345, 5, "#") SELECT conv(71, 10, 36), conv('1Z', 36, 10); conv(71, 10, 36) conv('1Z', 36, 10) 1Z 71 +SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10); +conv(71, 10, 37) conv('1Z', 37, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10) +NULL NULL NULL NULL NULL create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb'); create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e2812283901..d7ce6a7a96a 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1,4 +1,5 @@ -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; show variables where variable_name like "skip_show_database"; Variable_name Value skip_show_database OFF @@ -638,8 +639,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -647,29 +648,29 @@ select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select table_name from information_schema.views where table_schema='test'; table_name Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select column_name from information_schema.columns where table_schema='test'; column_name f1 Warnings: -Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s) -Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) +Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) select index_name from information_schema.statistics where table_schema='test'; index_name f1_key select constraint_name from information_schema.table_constraints where table_schema='test'; constraint_name -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; select * from information_schema.table_names; ERROR 42S02: Unknown table 'table_names' in information_schema diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index 9dd92baf62f..fb6584673f6 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id, id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE, diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 3a8d86bf349..ff19cbdd698 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1; select 1; 1 1 diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index eeb6abd9f41..76faa12373a 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -1,6 +1,7 @@ drop table if exists t1; create table t1(a int); insert into t1 values(1); +ERROR at line 9: DELIMITER must be followed by a 'delimiter' character or string Test default delimiter ; a diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 48e6ded689e..de59ec74135 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1828,31 +1828,32 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; -DELIMITER //; -/*!50003 SET SESSION SQL_MODE="" */ // +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="" */;; /*!50003 CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end */ // +end */;; -/*!50003 SET SESSION SQL_MODE="" */ // +/*!50003 SET SESSION SQL_MODE="" */;; /*!50003 CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin if old.a % 2 = 0 then set new.b := 12; end if; -end */ // +end */;; -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ // +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; /*!50003 CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW begin if new.a = -1 then set @fired:= "Yes"; end if; -end */ // +end */;; -DELIMITER ;// -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;DROP TABLE IF EXISTS `t2`; +DELIMITER ; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -1864,17 +1865,18 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; -DELIMITER //; -/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ // +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;; /*!50003 CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin if new.a > 10 then set @fired:= "No"; end if; -end */ // +end */;; -DELIMITER ;// +DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; + /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; @@ -2036,37 +2038,37 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; -DELIMITER // -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +DELIMITER ;; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) -RETURN a+b */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +RETURN a+b */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) begin set f1= concat( 'hello', f1 ); return f1; -end */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `a'b` */ // -/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ // +end */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;; +/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/;; /*!50003 CREATE PROCEDURE "a'b"() -select 1 */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +select 1 */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) -BEGIN SELECT a+b INTO c; end */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // -/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ // -/*!50003 SET SESSION SQL_MODE=""*/ // +BEGIN SELECT a+b INTO c; end */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; +/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;; +/*!50003 SET SESSION SQL_MODE=""*/;; /*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; -END */ // -/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // +END */;; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result index a04a7081b34..355c20fdad3 100644 --- a/mysql-test/r/mysqlshow.result +++ b/mysql-test/r/mysqlshow.result @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1),(2),(3); CREATE TABLE t2 (a int, b int); diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result index 726861bb525..82479504b10 100644 --- a/mysql-test/r/temp_table.result +++ b/mysql-test/r/temp_table.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop view if exists v1; CREATE TABLE t1 (c int not null, d char (10) not null); insert into t1 values(1,""),(2,"a"),(3,"b"); CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); @@ -99,32 +100,32 @@ Variable_name Value Created_tmp_disk_tables 0 Created_tmp_tables 2 drop table t1; -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; A This is temp. table -show create table t1; +show create table v1; Table Create Table -t1 CREATE TEMPORARY TABLE `t1` ( +v1 CREATE TEMPORARY TABLE `v1` ( `A` varchar(19) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -show create view t1; +show create view v1; View Create View -t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t1` AS select _latin1'This is view' AS `A` -drop view t1; -select * from t1; +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'This is view' AS `A` +drop view v1; +select * from v1; A This is temp. table -create view t1 as select 'This is view again' A; -select * from t1; +create view v1 as select 'This is view again' A; +select * from v1; A This is temp. table -drop table t1; -select * from t1; +drop table v1; +select * from v1; A This is view again -drop view t1; +drop view v1; create table t1 (a int, b int, index(a), index(b)); create table t2 (c int auto_increment, d varchar(255), primary key (c)); insert into t1 values (3,1),(3,2); diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5695822be6b..2e5b68c1dc7 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -373,24 +373,24 @@ drop table t1; # Bug#11493 - Alter table rename to default database does not work without # db name qualifying # -create database mysqltest1; +create database mysqltest; create table t1 (c1 int); # Move table to other database. -alter table t1 rename mysqltest1.t1; +alter table t1 rename mysqltest.t1; # Assure that it has moved. --error 1051 drop table t1; # Move table back. -alter table mysqltest1.t1 rename t1; +alter table mysqltest.t1 rename t1; # Assure that it is back. drop table t1; # Now test for correct message if no database is selected. # Create t1 in 'test'. create table t1 (c1 int); # Change to other db. -use mysqltest1; +use mysqltest; # Drop the current db. This de-selects any db. -drop database mysqltest1; +drop database mysqltest; # Now test for correct message. --error 1046 alter table test.t1 rename t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 4a6c98c8d7f..8b14e674b2e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -467,6 +467,7 @@ SELECT lpad(12345, 5, "#"); # SELECT conv(71, 10, 36), conv('1Z', 36, 10); +SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10); # # Bug in SUBSTRING when mixed with CONCAT and ORDER BY (Bug #3089) diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 51cca0a3db1..f351d315680 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -5,7 +5,8 @@ # show databases --disable_warnings -DROP TABLE IF EXISTS t0,t1,t2,t3,t5; +DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; +DROP VIEW IF EXISTS v1; --enable_warnings @@ -364,8 +365,8 @@ use test; create function sub1(i int) returns int return i+1; create table t1(f1 int); -create view t2 (c) as select f1 from t1; -create view t3 (c) as select sub1(1); +create view v2 (c) as select f1 from t1; +create view v3 (c) as select sub1(1); create table t4(f1 int, KEY f1_key (f1)); drop table t1; drop function sub1; @@ -378,8 +379,8 @@ where table_schema='test'; select index_name from information_schema.statistics where table_schema='test'; select constraint_name from information_schema.table_constraints where table_schema='test'; -drop view t2; -drop view t3; +drop view v2; +drop view v3; drop table t4; # diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index dd7015bfd9a..9cd64a54ad9 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -1,6 +1,6 @@ -- source include/have_innodb.inc --disable_warnings -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,t3; --enable_warnings # diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index eb8d867f3f0..785aa749f5e 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -1,6 +1,10 @@ # PS doesn't support multi-statements --disable_ps_protocol +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + select 1; delimiter ||||; select 2; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index c1d9813ea39..31918cae619 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -14,7 +14,7 @@ create table t1(a int); insert into t1 values(1); # Test delimiters ---exec $MYSQL test < "./t/mysql_delimiter.sql" +--exec $MYSQL test 2>&1 < "./t/mysql_delimiter.sql" --disable_query_log # Test delimiter : supplied on the command line diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test index 33ae8aef9a0..1e2e97a4e07 100644 --- a/mysql-test/t/mysqlshow.test +++ b/mysql-test/t/mysqlshow.test @@ -1,6 +1,10 @@ # Can't run test of external client with embedded server -- source include/not_embedded.inc +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + # ## Bug #5036 mysqlshow is missing a column # diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 9a7678ed712..6b3991c9c78 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -4,6 +4,7 @@ --disable_warnings drop table if exists t1,t2; +drop view if exists v1; --enable_warnings CREATE TABLE t1 (c int not null, d char (10) not null); @@ -91,18 +92,18 @@ show status like "created_tmp%tables"; drop table t1; # Fix for BUG#8921: Check that temporary table is ingored by view commands. -create temporary table t1 as select 'This is temp. table' A; -create view t1 as select 'This is view' A; -select * from t1; -show create table t1; -show create view t1; -drop view t1; -select * from t1; -create view t1 as select 'This is view again' A; -select * from t1; -drop table t1; -select * from t1; -drop view t1; +create temporary table v1 as select 'This is temp. table' A; +create view v1 as select 'This is view' A; +select * from v1; +show create table v1; +show create view v1; +drop view v1; +select * from v1; +create view v1 as select 'This is view again' A; +select * from v1; +drop table v1; +select * from v1; +drop view v1; # Bug #8497: tmpdir with extra slashes would cause failures # -- cgit v1.2.1 From 77fbc72f472467cb67397e6a3ed7dec5dab644fb Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Oct 2005 16:15:53 -0700 Subject: Handle errors returned by system crypt() in ENCRYPT(). (Bug #13619) --- mysql-test/r/func_crypt.result | 3 +++ mysql-test/t/func_crypt.test | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 2ee3e770a2e..afdec0f4d06 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -92,3 +92,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')` +select encrypt('1234','_.'); +encrypt('1234','_.') +# diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index 5e0283feb28..cc3cdb9564d 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -49,4 +49,10 @@ select old_password(' i d k f a '); explain extended select password('idkfa '), old_password('idkfa'); +# +# Bug #13619: Crash on FreeBSD with salt like '_.' +# +--replace_column 1 # +select encrypt('1234','_.'); + # End of 4.1 tests -- cgit v1.2.1 From 82855517a1bc71243384cc6c202095670fb3c9a4 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 7 Oct 2005 03:12:15 +0300 Subject: Review of new code since last pull - Use %lx instead of %p as %p is not portable - Don't replace ROW item with Item_null --- mysql-test/r/select.result | 7 +++++++ mysql-test/t/select.test | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 64cbaf4fa67..4effb8d173c 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2625,4 +2625,11 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index bdadd5c536b..e6f91389d7b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2172,6 +2172,10 @@ create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); drop table t1,t2; # End of 4.1 tests -- cgit v1.2.1 From 62ad8922b84ee93db1fc4b9c7b76b7c99d9d6976 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 7 Oct 2005 09:52:15 +0500 Subject: ctype_utf8.result, ctype_utf8.test: Adding test case. item_func.cc: Bug#13751 find_in_set: Illegal mix of collations. Character set conversion was forgotten in find_in_set. --- mysql-test/r/ctype_utf8.result | 5 +++++ mysql-test/t/ctype_utf8.test | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index aeea574ef6c..c7606b918df 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1056,3 +1056,8 @@ hex(a) 5B E880BD drop table t1; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +a +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 23824a58dab..dcb7469d46e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -865,4 +865,12 @@ insert into t1 values (_utf8 0x5b); select hex(a) from t1; drop table t1; +# +# Bug#13751 find_in_set: Illegal mix of collations +# +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +drop table t1; + # End of 4.1 tests -- cgit v1.2.1 From fcc51afb6a5f5522def6f8f2076979e420197205 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Fri, 7 Oct 2005 20:14:34 +0500 Subject: Populate t1 in order to get more predictable explain results. --- mysql-test/r/subselect2.result | 1 + mysql-test/t/subselect2.test | 2 ++ 2 files changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 148c670c589..8fcfa06a8ae 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -14,6 +14,7 @@ DOCID VARCHAR(32)BINARY NOT NULL , PRIMARY KEY ( DOCID ) ) ENGINE=InnoDB ; +INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL diff --git a/mysql-test/t/subselect2.test b/mysql-test/t/subselect2.test index 839e94206d0..b21eda176b6 100644 --- a/mysql-test/t/subselect2.test +++ b/mysql-test/t/subselect2.test @@ -25,6 +25,8 @@ DOCID VARCHAR(32)BINARY NOT NULL ) ENGINE=InnoDB ; +INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); + CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL -- cgit v1.2.1 From 9bca1b91247b0ed82af73015f3b90186dc2fe378 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 9 Oct 2005 01:32:09 +0200 Subject: func_group.test: Test requires innodb --- mysql-test/t/func_group.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index f833f482f73..dc647dbcfeb 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -2,6 +2,8 @@ # simple test of all group functions # +--source include/have_innodb.inc + --disable_warnings drop table if exists t1,t2; --enable_warnings -- cgit v1.2.1 From 6bfc2d4b895120378a26e24eaa1b732f103d7ae2 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Sun, 9 Oct 2005 23:05:44 +0400 Subject: Fix bug#7672 Unknown column error in order clause When fixing Item_func_plus in ORDER BY clause field c is searched in all opened tables, but because c is an alias it wasn't found there. This patch adds a flag to select_lex which allows Item_field::fix_fields() to look up in select's item_list to find aliased fields. --- mysql-test/r/select.result | 10 ++++++++++ mysql-test/t/select.test | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3c7a74c0c57..299e0b6bf33 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2431,3 +2431,13 @@ AND FK_firma_id = 2; COUNT(*) 0 drop table t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 6626397e9e5..2adf4f1749c 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1983,3 +1983,12 @@ AND FK_firma_id = 2; drop table t1; +# +# Bug 7672 Unknown column error in order clause +# +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +(SELECT a, b AS c FROM t1) ORDER BY b+1; +SELECT a, b AS c FROM t1 ORDER BY c+1; +SELECT a, b AS c FROM t1 ORDER BY b+1; +drop table t1; -- cgit v1.2.1 From 82615d8b9dc1e6aeb7a9e138a60daf00cd0c3afd Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 10 Oct 2005 00:21:10 +0200 Subject: Makefile.am: Copy "disabled.def" --- mysql-test/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index e7abcd3fc95..d062ee79827 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -48,7 +48,10 @@ mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ $(distdir)/std_data $(distdir)/lib - $(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data @@ -67,7 +70,9 @@ install-data-local: $(DESTDIR)$(testdir)/std_data \ $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) + -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t -- cgit v1.2.1 From 998380521fa2d3d249a0c160c09dba61e1898b1f Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 15:10:14 +0200 Subject: BUG#12618: Removing fake locking --- mysql-test/r/rpl_multi_update3.result | 72 +++++++++++++++++++++++++++++++++++ mysql-test/t/rpl_multi_update3.test | 59 ++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/r/rpl_multi_update3.result index 1b757b1400c..b81af7c6e39 100644 --- a/mysql-test/r/rpl_multi_update3.result +++ b/mysql-test/r/rpl_multi_update3.result @@ -122,3 +122,75 @@ SELECT * FROM t1; i j x y z 1 2 23 24 71 DROP TABLE t1, t2, t3; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( +idp int(11) NOT NULL default '0', +idpro int(11) default NULL, +price decimal(19,4) default NULL, +PRIMARY KEY (idp) +); +CREATE TABLE t2 ( +idpro int(11) NOT NULL default '0', +price decimal(19,4) default NULL, +nbprice int(11) default NULL, +PRIMARY KEY (idpro) +); +INSERT INTO t1 VALUES +(1,1,'3.0000'), +(2,2,'1.0000'), +(3,1,'1.0000'), +(4,1,'4.0000'), +(5,3,'2.0000'), +(6,2,'4.0000'); +INSERT INTO t2 VALUES +(1,'0.0000',0), +(2,'0.0000',0), +(3,'0.0000',0); +update +t2 +join +( select idpro, min(price) as min_price, count(*) as nbr_price +from t1 +where idpro>0 and price>0 +group by idpro +) as table_price +on t2.idpro = table_price.idpro +set t2.price = table_price.min_price, +t2.nbprice = table_price.nbr_price; +select "-- MASTER AFTER JOIN --" as ""; + +-- MASTER AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 +select "-- SLAVE AFTER JOIN --" as ""; + +-- SLAVE AFTER JOIN -- +select * from t1; +idp idpro price +1 1 3.0000 +2 2 1.0000 +3 1 1.0000 +4 1 4.0000 +5 3 2.0000 +6 2 4.0000 +select * from t2; +idpro price nbprice +1 1.0000 3 +2 1.0000 2 +3 2.0000 1 diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test index 64e46882c16..36ac7a59cb3 100644 --- a/mysql-test/t/rpl_multi_update3.test +++ b/mysql-test/t/rpl_multi_update3.test @@ -158,4 +158,63 @@ SELECT * FROM t1; connection master; DROP TABLE t1, t2, t3; +############################################################################## +# +# BUG#12618 +# +# TEST: Replication of a statement containing a join in a multi-update. + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1 ( + idp int(11) NOT NULL default '0', + idpro int(11) default NULL, + price decimal(19,4) default NULL, + PRIMARY KEY (idp) +); + +CREATE TABLE t2 ( + idpro int(11) NOT NULL default '0', + price decimal(19,4) default NULL, + nbprice int(11) default NULL, + PRIMARY KEY (idpro) +); + +INSERT INTO t1 VALUES + (1,1,'3.0000'), + (2,2,'1.0000'), + (3,1,'1.0000'), + (4,1,'4.0000'), + (5,3,'2.0000'), + (6,2,'4.0000'); + +INSERT INTO t2 VALUES + (1,'0.0000',0), + (2,'0.0000',0), + (3,'0.0000',0); + +# This update sets t2 to the minimal prices for each product +update + t2 + join + ( select idpro, min(price) as min_price, count(*) as nbr_price + from t1 + where idpro>0 and price>0 + group by idpro + ) as table_price +on t2.idpro = table_price.idpro +set t2.price = table_price.min_price, + t2.nbprice = table_price.nbr_price; + +select "-- MASTER AFTER JOIN --" as ""; +select * from t1; +select * from t2; + +sync_slave_with_master; + +select "-- SLAVE AFTER JOIN --" as ""; +select * from t1; +select * from t2; + # End of 4.1 tests -- cgit v1.2.1 From 65325ecbbbdeb21102157716e533e1f89e256d4c Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Mon, 10 Oct 2005 18:53:57 +0400 Subject: Fix bug#13327 check_equality() wasn't checking view's fields check_equality() finds equalities among field items. It checks input items to be Item_fields thus skipping view's fields, which are represented by Item_direct_view_ref. Because of this index wasn't applied in all cases it can be. To fix this problem check_equality() now takes real item of Item_direct_view_ref, except outer view refs (with depended_from set). --- mysql-test/r/view.result | 22 ++++++++++++++++++++++ mysql-test/t/view.test | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e52ec950c8c..3503e885aa8 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2298,3 +2298,25 @@ a 3 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 (a INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1),(2),(3); +CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b; +CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a; +EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 Using where; Using index +1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index +EXPLAIN SELECT * FROM v1 WHERE a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref a a 5 const 1 Using where; Using index +1 PRIMARY t2 ref a a 10 const,test.t1.b 2 Using where; Using index +EXPLAIN SELECT * FROM v2 WHERE a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref a a 5 const 1 Using where; Using index +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +DROP VIEW v1,v2; +DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 15c8cccf69c..5f483401cff 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2167,3 +2167,23 @@ SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3); DROP VIEW v1; DROP TABLE t1; + +# +# Bug #13327 view wasn't using index for const condition +# + +CREATE TABLE t1 (a INT, b INT, INDEX(a,b)); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 (a INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); +INSERT INTO t3 VALUES (1),(2),(3); +CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b; +CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a; +EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1; +EXPLAIN SELECT * FROM v1 WHERE a=1; +EXPLAIN SELECT * FROM v2 WHERE a=1; +DROP VIEW v1,v2; +DROP TABLE t1,t2,t3; + + -- cgit v1.2.1 From af951aa6629e8f812bea3b3170433d32d54722fd Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 10 Oct 2005 19:38:58 +0200 Subject: After merge fixes --- mysql-test/r/select.result | 7 +++++++ mysql-test/r/subselect2.result | 2 ++ 2 files changed, 9 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3e4f29d7a01..c72bc332041 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2628,6 +2628,13 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); f1 select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 drop table t1,t2; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 19047725528..026bcb4b370 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -15,6 +15,8 @@ DOCID VARCHAR(32)BINARY NOT NULL ) ENGINE=InnoDB ; INSERT INTO t1 (DOCID) VALUES ("1"), ("2"); +Warnings: +Warning 1364 Field 'UUID' doesn't have a default value CREATE TABLE t2 ( DOCID VARCHAR(32)BINARY NOT NULL -- cgit v1.2.1 From 215ecd332246b0922e9f2736fbbf950b2fa5b788 Mon Sep 17 00:00:00 2001 From: "eric@mysql.com" <> Date: Mon, 10 Oct 2005 17:41:36 -0700 Subject: BUG#13724 conditionally added CONNECTION='connect string' for SHOW CREATE TABLE --- mysql-test/r/federated.result | 6 ++++++ mysql-test/t/federated.test | 2 ++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index e0e0bba3271..f40919a41a4 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -74,6 +74,12 @@ CREATE TABLE federated.t2 ( ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +SHOW CREATE TABLE federated.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(20) NOT NULL, + `name` varchar(32) NOT NULL default '' +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1' INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); SELECT * FROM federated.t2; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index c401468a940..453343e6f09 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -75,6 +75,8 @@ eval CREATE TABLE federated.t2 ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; +SHOW CREATE TABLE federated.t2; + INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); -- cgit v1.2.1 From 083c032ec3866697900d504e8e0c0c39da1a59a3 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 10 Oct 2005 19:39:16 -0700 Subject: Fix minimum value of query_prealloc_size to be the same as its default. (Bug #13334) --- mysql-test/r/variables.result | 5 +++++ mysql-test/t/variables.test | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 67c78d82a24..0aa7ea7f83c 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -499,3 +499,8 @@ set names latin1; select @@have_innodb; @@have_innodb # +set @test = @@query_prealloc_size; +set @@query_prealloc_size = @test; +select @@query_prealloc_size = @test; +@@query_prealloc_size = @test +1 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a8844070207..8322c0f84bd 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -388,7 +388,6 @@ set character_set_results=NULL; select ifnull(@@character_set_results,"really null"); set names latin1; -# End of 4.1 tests # # Bug #9613: @@have_innodb @@ -396,3 +395,12 @@ set names latin1; --replace_column 1 # select @@have_innodb; + +# +# Bug #13334: query_prealloc_size default less than minimum +# +set @test = @@query_prealloc_size; +set @@query_prealloc_size = @test; +select @@query_prealloc_size = @test; + +# End of 4.1 tests -- cgit v1.2.1 From 735f424b5ca7a150f5025d0f5c9c0b88beab9494 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Tue, 11 Oct 2005 12:09:38 +0500 Subject: Bug#12547: Inserting long string into varchar causes table crash in cp932 ctype-cp932.c: Decrement for "pos" variable disappered somehow. Restoring it back. ctype_cp932.test: ctype_cp932.result: Adding test case. --- mysql-test/r/ctype_cp932.result | 17 +++++++++++++++++ mysql-test/t/ctype_cp932.test | 10 ++++++++++ 2 files changed, 27 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/ctype_cp932.result index 08206a91b7b..1afceb86381 100755 --- a/mysql-test/r/ctype_cp932.result +++ b/mysql-test/r/ctype_cp932.result @@ -11349,3 +11349,20 @@ cp932_bin 6109 cp932_bin 61 cp932_bin 6120 drop table t1; +create table t1 (col1 varchar(1)) character set cp932; +insert into t1 values ('a'); +insert into t1 values ('ab'); +Warnings: +Warning 1265 Data truncated for column 'col1' at row 1 +select * from t1; +col1 +a +a +insert into t1 values ('abc'); +Warnings: +Warning 1265 Data truncated for column 'col1' at row 1 +select * from t1; +col1 +a +a +a diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/t/ctype_cp932.test index 3d630311b3a..082786e38af 100644 --- a/mysql-test/t/ctype_cp932.test +++ b/mysql-test/t/ctype_cp932.test @@ -424,3 +424,13 @@ SET collation_connection='cp932_japanese_ci'; -- source include/ctype_filesort.inc SET collation_connection='cp932_bin'; -- source include/ctype_filesort.inc + +# +# Bug#12547: Inserting long string into varchar causes table crash in cp932 +# +create table t1 (col1 varchar(1)) character set cp932; +insert into t1 values ('a'); +insert into t1 values ('ab'); +select * from t1; +insert into t1 values ('abc'); +select * from t1; -- cgit v1.2.1 From cb7d5f4488104771fe043d3ebc5d355c6c8890fc Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 11 Oct 2005 16:39:35 +0500 Subject: Merging --- mysql-test/r/type_float.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 21886609b5c..c10cb7d71f7 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -225,10 +225,6 @@ select * from t1 where reckey=1.09E2; reckey recdesc 109 Has 109 as key drop table t1; -create table t1 (s1 float(0,2)); -ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). -create table t1 (s1 float(1,2)); -ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (d double(10,1)); create table t2 (d double(10,9)); insert into t1 values ("100000000.0"); @@ -244,3 +240,7 @@ t3 CREATE TABLE `t3` ( `d` double(22,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2, t3; +create table t1 (s1 float(0,2)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). +create table t1 (s1 float(1,2)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). -- cgit v1.2.1 From 2456c0c6684668fc0f4675c56e061677b63464b0 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Tue, 11 Oct 2005 15:01:38 +0200 Subject: Fixed BUG#13510: Setting password local variable changes current password Disallow conflicting use of variables named "password" and "names". If such a variable is declared, and "SET ... = ..." is used for them, an error is returned; the user must resolve the conflict by either using `var` (indicating that the local variable is set) or by renaming the variable. This is necessary since setting "password" and "names" are treated as special cases by the parser. --- mysql-test/r/sp-error.result | 38 +++++++++++++++++++++++++++++++ mysql-test/t/sp-error.test | 53 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 05b6a2788ea..43430ca312b 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -834,3 +834,41 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger create trigger bug12712 before insert on t1 for each row set session autocommit = 0; ERROR HY000: Not allowed to set autocommit from a stored function or trigger +drop procedure if exists bug13510_1| +drop procedure if exists bug13510_2| +drop procedure if exists bug13510_3| +drop procedure if exists bug13510_4| +create procedure bug13510_1() +begin +declare password varchar(10); +set password = 'foo1'; +select password; +end| +ERROR 42000: Variable 'password' must be quoted with `...`, or renamed +create procedure bug13510_2() +begin +declare names varchar(10); +set names = 'foo2'; +select names; +end| +ERROR 42000: Variable 'names' must be quoted with `...`, or renamed +create procedure bug13510_3() +begin +declare password varchar(10); +set `password` = 'foo3'; +select password; +end| +create procedure bug13510_4() +begin +declare names varchar(10); +set `names` = 'foo4'; +select names; +end| +call bug13510_3()| +password +foo3 +call bug13510_4()| +names +foo4 +drop procedure bug13510_3| +drop procedure bug13510_4| diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index fa74c318db3..b3caa093487 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1212,6 +1212,59 @@ call bug9367(); drop procedure bug9367; drop table t1; --enable_parsing + +# +# BUG#13510: Setting password local variable changes current password +# +delimiter |; +--disable_warnings +drop procedure if exists bug13510_1| +drop procedure if exists bug13510_2| +drop procedure if exists bug13510_3| +drop procedure if exists bug13510_4| +--enable_warnings + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_1() +begin + declare password varchar(10); + + set password = 'foo1'; + select password; +end| + +--error ER_SP_BAD_VAR_SHADOW +create procedure bug13510_2() +begin + declare names varchar(10); + + set names = 'foo2'; + select names; +end| + +create procedure bug13510_3() +begin + declare password varchar(10); + + set `password` = 'foo3'; + select password; +end| + +create procedure bug13510_4() +begin + declare names varchar(10); + + set `names` = 'foo4'; + select names; +end| + +call bug13510_3()| +call bug13510_4()| + +drop procedure bug13510_3| +drop procedure bug13510_4| +delimiter ;| + # # BUG#NNNN: New bug synopsis # -- cgit v1.2.1 From c8a6c2c6143dd8c92704920d455cc57050ce71ad Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Oct 2005 09:12:12 -0700 Subject: Fix wait_timeout (and kill) handling on Mac OS X by cleaning up how signal handlers are set up, the blocking flags for sockets are set, and which thread-related functions are used. (Bug #8731) --- mysql-test/r/wait_timeout.result | 8 ++++++++ mysql-test/t/wait_timeout-master.opt | 1 + mysql-test/t/wait_timeout.test | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 mysql-test/r/wait_timeout.result create mode 100644 mysql-test/t/wait_timeout-master.opt create mode 100644 mysql-test/t/wait_timeout.test (limited to 'mysql-test') diff --git a/mysql-test/r/wait_timeout.result b/mysql-test/r/wait_timeout.result new file mode 100644 index 00000000000..56232e481c0 --- /dev/null +++ b/mysql-test/r/wait_timeout.result @@ -0,0 +1,8 @@ +select 1; +1 +1 +select 2; +ERROR HY000: MySQL server has gone away +select 3; +3 +3 diff --git a/mysql-test/t/wait_timeout-master.opt b/mysql-test/t/wait_timeout-master.opt new file mode 100644 index 00000000000..0ad622e9677 --- /dev/null +++ b/mysql-test/t/wait_timeout-master.opt @@ -0,0 +1 @@ +--wait-timeout=2 diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test new file mode 100644 index 00000000000..26f91569868 --- /dev/null +++ b/mysql-test/t/wait_timeout.test @@ -0,0 +1,11 @@ +# +# Bug #8731: wait_timeout does not work on Mac OS X +# +--disable_reconnect +select 1; +# wait_timeout is 2, so we should get disconnected now +--sleep 5 +--error 2006 +select 2; +--enable_reconnect +select 3; -- cgit v1.2.1 From 40bd22ef6932430ae86f1f41a621d07cb2a7b2cd Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Tue, 11 Oct 2005 21:18:04 +0500 Subject: Fix for bug #13667 (Inconsistency for decimal(m,d) specification. --- mysql-test/r/type_newdecimal.result | 2 ++ mysql-test/t/type_newdecimal.test | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index be5e29ab662..dbae646c362 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1019,3 +1019,5 @@ drop procedure wg2; select cast(@non_existing_user_var/2 as DECIMAL); cast(@non_existing_user_var/2 as DECIMAL) NULL +create table t (d decimal(0,10)); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'd'). diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 3f04aa931d2..a7087d46dca 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1044,3 +1044,9 @@ drop procedure wg2; # select cast(@non_existing_user_var/2 as DECIMAL); + +# +# Bug #13667 (Inconsistency for decimal(m,d) specification +# +--error 1427 +create table t (d decimal(0,10)); -- cgit v1.2.1 From f5fdf3e87a5f60fdb6442912ae5741a24b2461c8 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 12 Oct 2005 00:58:22 +0300 Subject: Reviewing new pushed code - CHAR() now returns binary string as default - CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR() - Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() (Some old systems returns ETIME and it's safer to test for both values than to try to write a wrapper for each old system) - Fixed new introduced bug in NOT BETWEEN X and X - Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed - Use octet2hex() for all conversion of string to hex - Simplify and optimize code --- mysql-test/r/ctype_utf8.result | 34 ++++++++++++++++++---------------- mysql-test/r/func_str.result | 7 +++++-- mysql-test/r/range.result | 7 +++++++ mysql-test/r/user_var-binlog.result | 4 ++-- mysql-test/r/view.result | 13 ++++++++----- mysql-test/t/ctype_utf8.test | 6 +++++- mysql-test/t/func_str.test | 1 + mysql-test/t/range.test | 5 +++++ mysql-test/t/view.test | 11 +++++++---- 9 files changed, 58 insertions(+), 30 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 1695f1c67e8..5516be88b75 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1079,29 +1079,31 @@ char(53647) select char(0xff,0x8f); char(0xff,0x8f) ÿ -Warnings: -Warning 1300 Invalid utf8 character string: 'FF8F' set sql_mode=traditional; select char(0xff,0x8f); char(0xff,0x8f) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'FF8F' +ÿ +select convert(char(0xff,0x8f) using utf8); +convert(char(0xff,0x8f) using utf8) +ÿ select char(195); char(195) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'C3' +à +select convert(char(195) using utf8); +convert(char(195) using utf8) +à select char(196); char(196) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'C4' -select char(2557); -char(2557) -NULL -Warnings: -Error 1300 Invalid utf8 character string: 'FD' +Ä +select convert(char(196) using utf8); +convert(char(196) using utf8) +Ä +select hex(char(2557)); +hex(char(2557)) +09FD +select hex(convert(char(2557) using utf8)); +hex(convert(char(2557) using utf8)) +09FD set names utf8; create table t1 (a char(1)) default character set utf8; create table t2 (a char(1)) default character set utf8; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d250d2fce84..a305bf20bff 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -21,6 +21,9 @@ length(_latin1'\n\t\n\b\0\\_\\%\\') select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h') monty was here again 5 h 104 +select hex(char(256)); +hex(char(256)) +0100 select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; locate('he','hello') locate('he','hello',2) locate('lo','hello',2) 1 0 4 @@ -598,7 +601,7 @@ collation(hex(130)) coercibility(hex(130)) latin1_swedish_ci 4 select collation(char(130)), coercibility(hex(130)); collation(char(130)) coercibility(hex(130)) -latin1_swedish_ci 4 +binary 4 select collation(format(130,10)), coercibility(format(130,10)); collation(format(130,10)) coercibility(format(130,10)) latin1_swedish_ci 4 @@ -720,7 +723,7 @@ t1 CREATE TABLE `t1` ( `oct(130)` varchar(64) NOT NULL default '', `conv(130,16,10)` varchar(64) NOT NULL default '', `hex(130)` varchar(6) NOT NULL default '', - `char(130)` varchar(1) NOT NULL default '', + `char(130)` varbinary(1) NOT NULL default '', `format(130,10)` varchar(4) NOT NULL default '', `left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', `right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 69c150fc0b7..6dedd020249 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -809,4 +809,11 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t2 where a = 'a' or a='a '; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref a a 13 const # Using where +update t1 set a='b' where a<>'a'; +explain select * from t1 where a not between 'b' and 'b'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 13 NULL # Using where +select * from t1 where a not between 'b' and 'b'; +a filler +a drop table t1,t2,t3; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 17ac8809d52..700ec7b09e0 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 User var 1 139 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 139 Query 1 231 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 231 User var 1 273 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 273 User var 1 311 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci +master-bin.000001 273 User var 1 311 @`var2`=_binary 0x61 COLLATE binary master-bin.000001 311 Query 1 411 use `test`; insert into t1 values (@var1),(@var2) /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; @@ -24,7 +24,7 @@ SET @@session.sql_mode=0; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; INSERT INTO t1 VALUES(@`a b`); SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; -SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; +SET @`var2`:=_binary 0x61 COLLATE `binary`; SET TIMESTAMP=10000; insert into t1 values (@var1),(@var2); # End of log file diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index e52ec950c8c..14187703ca3 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -847,13 +847,16 @@ cast(1 as char(3)) drop view v1; create table t1 (a int); create view v1 as select a from t1; -create database seconddb; -rename table v1 to seconddb.v1; -ERROR HY000: Changing schema from 'test' to 'seconddb' is not allowed. +create view v3 as select a from t1; +create database mysqltest; +rename table v1 to mysqltest.v1; +ERROR HY000: Changing schema from 'test' to 'mysqltest' is not allowed. rename table v1 to v2; +rename table v3 to v1, v2 to t1; +ERROR 42S01: Table 't1' already exists drop table t1; -drop view v2; -drop database seconddb; +drop view v2,v3; +drop database mysqltest; create view v1 as select 'a',1; create view v2 as select * from v1 union all select * from v1; create view v3 as select * from v2 where 1 = (select `1` from v2); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8194dbdb438..d186ca8a1f6 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -880,9 +880,13 @@ select char(0xff,0x8f); # incorrect value in strict mode: return NULL with "Error" level warning set sql_mode=traditional; select char(0xff,0x8f); +select convert(char(0xff,0x8f) using utf8); select char(195); +select convert(char(195) using utf8); select char(196); -select char(2557); +select convert(char(196) using utf8); +select hex(char(2557)); +select hex(convert(char(2557) using utf8)); # # Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 6cd27903a42..ac2bf820257 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -15,6 +15,7 @@ select bit_length('\n\t\r\b\0\_\%\\'); 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 hex(char(256)); 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'); diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 11c5e8d7bc5..89376d33f61 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -625,4 +625,9 @@ explain select * from t2 where a between 'a' and 'a '; --replace_column 9 # explain select * from t2 where a = 'a' or a='a '; +update t1 set a='b' where a<>'a'; +--replace_column 9 # +explain select * from t1 where a not between 'b' and 'b'; +select * from t1 where a not between 'b' and 'b'; + drop table t1,t2,t3; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 15c8cccf69c..f49191130f5 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -790,13 +790,16 @@ drop view v1; # create table t1 (a int); create view v1 as select a from t1; -create database seconddb; +create view v3 as select a from t1; +create database mysqltest; -- error 1450 -rename table v1 to seconddb.v1; +rename table v1 to mysqltest.v1; rename table v1 to v2; +--error 1050 +rename table v3 to v1, v2 to t1; drop table t1; -drop view v2; -drop database seconddb; +drop view v2,v3; +drop database mysqltest; # # bug handling from VIEWs -- cgit v1.2.1 From c248a36e30a05c57e1017fcaae9a6f4e30540d9e Mon Sep 17 00:00:00 2001 From: "grog@mysql.com" <> Date: Wed, 12 Oct 2005 09:47:59 +0200 Subject: sql_yacc.yy: Bug #10308: Parse 'purge master logs' with subselect correctly. subselect.test: Bug #10308: Test for 'purge master logs' with subselect. subselect.result: Bug #10308: Test result for 'purge master logs' with subselect. --- mysql-test/r/subselect.result | 1 + mysql-test/t/subselect.test | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 8652ed89a65..4c795abe986 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2834,3 +2834,4 @@ a 3 4 DROP TABLE t1,t2,t3; +purge master logs before (select adddate(current_timestamp(), interval -4 day)); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 3d21456ee45..cbc7a3afb5f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1814,4 +1814,10 @@ SELECT * FROM t1 DROP TABLE t1,t2,t3; +# +# BUG #10308: purge log with subselect +# + +purge master logs before (select adddate(current_timestamp(), interval -4 day)); + # End of 4.1 tests -- cgit v1.2.1 From 4c1c9db82337e7dad50d0435dc5e65de283fe975 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 12 Oct 2005 13:29:55 +0200 Subject: Fix for BUG#13023: "SQL Thread is up but doesn't move forward". Details in slave.cc; in short we now record whenever the slave I/O thread ignores a master's event because of its server id, and use this info in the slave SQL thread to advance Exec_master_log_pos. Because if we do not, this variable stays at the position of the last executed event, i.e. the last *non-ignored* executed one, which may not be the last of the master's binlog (and so the slave *looks* behind the master though it's data-wise it's not). --- mysql-test/r/rpl_dual_pos_advance.result | 22 ++++++ mysql-test/t/rpl_dual_pos_advance-master.opt | 0 mysql-test/t/rpl_dual_pos_advance.test | 108 +++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 mysql-test/r/rpl_dual_pos_advance.result create mode 100644 mysql-test/t/rpl_dual_pos_advance-master.opt create mode 100644 mysql-test/t/rpl_dual_pos_advance.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/r/rpl_dual_pos_advance.result new file mode 100644 index 00000000000..257baa81b74 --- /dev/null +++ b/mysql-test/r/rpl_dual_pos_advance.result @@ -0,0 +1,22 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +reset master; +change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; +start slave; +create table t1 (n int); +create table t4 (n int); +create table t5 (n int); +create table t6 (n int); +show tables; +Tables_in_test +t1 +t4 +t5 +t6 +stop slave; +reset slave; +drop table t1,t4,t5,t6; diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/t/rpl_dual_pos_advance-master.opt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test new file mode 100644 index 00000000000..518fa9df885 --- /dev/null +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -0,0 +1,108 @@ +# This test checks that in a dual-head setup +# A->B->A, where A has --log-slave-updates (why would it? +# assume that there is a C as slave of A), +# then the Exec_master_log_pos of SHOW SLAVE STATUS does +# not stay too low on B(BUG#13023 due to events ignored because +# of their server id). +# It also will test BUG#13861. + +source include/master-slave.inc; + + +# set up "dual head" + +connection slave; +reset master; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"; + +start slave; + +# now we test it + +connection slave; + +create table t1 (n int); + +save_master_pos; +connection master; +sync_with_master; + +# Now test BUG#13861. This will be enabled when Guilhem fixes this +# bug. + +# stop slave + +# create table t2 (n int); # create one ignored event + +# save_master_pos; +# connection slave; +# sync_with_master; + +# connection slave; + +# show tables; + +# save_master_pos; + +# create table t3 (n int); + +# connection master; + +# bug is that START SLAVE UNTIL may stop too late, we test that by +# asking it to stop before creation of t3. + +# start slave until master_log_file="slave-bin.000001",master_log_pos=195; + +# wait until it's started (the position below is the start of "CREATE +# TABLE t2") (otherwise wait_for_slave_to_stop may return at once) + +# select master_pos_wait("slave-bin.000001",137); + +# wait_for_slave_to_stop; + +# then BUG#13861 causes t3 to show up below (because stopped too +# late). + +# show tables; + +# start slave; + +# BUG#13023 is that Exec_master_log_pos may stay too low "forever": + +connection master; + +create table t4 (n int); # create 3 ignored events +create table t5 (n int); +create table t6 (n int); + +save_master_pos; +connection slave; +sync_with_master; + +connection slave; + +save_master_pos; + +connection master; + +# then BUG#13023 caused hang below ("master" looks behind, while it's +# not in terms of updates done). + +sync_with_master; + +show tables; + +# cleanup + +stop slave; +reset slave; +drop table t1,t4,t5,t6; # add t2 and t3 later + +save_master_pos; +connection slave; +sync_with_master; + +# End of 4.1 tests -- cgit v1.2.1 From 0ac28d3187afcdd159b12d9cfbc20dd613ce5a2b Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 12 Oct 2005 13:56:07 +0200 Subject: Always test ssl and compress - Updated after review --- mysql-test/mysql-test-run.pl | 13 +----- mysql-test/r/connect.result | 20 +++++++++ mysql-test/r/mysqltest.result | 12 ++++++ mysql-test/t/compress.test | 4 +- mysql-test/t/connect.test | 82 ++++++++++++++++++------------------ mysql-test/t/information_schema.test | 4 +- mysql-test/t/myisam.test | 3 ++ mysql-test/t/mysqltest.test | 68 ++++++++++++++++++++++++++++-- mysql-test/t/openssl_1.test | 10 ++--- mysql-test/t/sp-security.test | 1 + mysql-test/t/ssl.test | 5 +-- mysql-test/t/ssl_compress.test | 6 +-- 12 files changed, 154 insertions(+), 74 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 833b7515c59..35b5f9c512a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -191,7 +191,6 @@ our $opt_compress; our $opt_ssl; our $opt_skip_ssl; our $opt_ssl_supported; -our $opt_with_openssl; # Deprecated flag our $opt_ps_protocol; our $opt_current_test; @@ -480,8 +479,7 @@ sub command_line_setup () { # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, - 'with-openssl' => \$opt_with_openssl, - 'ssl' => \$opt_ssl, + 'ssl|with-openssl' => \$opt_ssl, 'skip-ssl' => \$opt_skip_ssl, 'compress' => \$opt_compress, 'bench' => \$opt_bench, @@ -1101,13 +1099,6 @@ sub kill_and_cleanup () { sub check_ssl_support () { - - # Convert deprecated --with-openssl to --ssl - if ( $opt_with_openssl ) - { - $opt_ssl= 1; - } - if ($opt_skip_ssl) { mtr_report("Skipping SSL"); @@ -2597,7 +2588,7 @@ Options to control what test suites or cases to run force Continue to run the suite after failure with-ndbcluster Use cluster, and enable test cases that requres it - skip-ndb[cluster] Use cluster, and enable test cases that requres it + skip-ndb[cluster] Skip the ndb test cases, don't start cluster do-test=PREFIX Run test cases which name are prefixed with PREFIX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 2508d751b46..0e038cb3f09 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -20,6 +20,10 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,root,z,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) +connect(localhost,root,z,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; show tables; @@ -43,6 +47,14 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,test,,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,,"",9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,zorro,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) +connect(localhost,test,zorro,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; set password=""; @@ -70,6 +82,14 @@ time_zone_transition_type user show tables; Tables_in_test +connect(localhost,test,,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) +connect(localhost,test,zorro,test2,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) +connect(localhost,test,zorro,test,9306,MYSQL_TEST_DIR/var/tmp/master.sock); +ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) delete from mysql.user where user=_binary"test"; flush privileges; create table t1 (id integer not null auto_increment primary key); diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index c643a5ae647..a21ec8de7fb 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -344,6 +344,18 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: Invalid integer argument "a" +mysqltest: At line 1: Syntax error in connect - expected '(' found 'mysqltest: At line 1: Missing connection host +mysqltest: At line 1: Missing connection host +mysqltest: At line 1: Missing connection user +mysqltest: At line 1: Missing connection user +mysqltest: At line 1: Missing connection password +mysqltest: At line 1: Missing connection db +mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db' +mysqltest: At line 1: Illegal argument for port: 'illegal_port' +mysqltest: At line 1: Illegal option to connect: SMTP +mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c +mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool +mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists failing_statement; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1 failing_statement; diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test index 45b9ab9dd1e..fb1c8793f33 100644 --- a/mysql-test/t/compress.test +++ b/mysql-test/t/compress.test @@ -3,12 +3,11 @@ -- source include/have_compress.inc -enable_compress; # Reconnect to turn compress on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,COMPRESS); # Check compression turned on SHOW STATUS LIKE 'Compression'; @@ -16,4 +15,3 @@ SHOW STATUS LIKE 'Compression'; # Source select test case -- source t/select.test -disable_compress; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 60ac7b88bbe..0bcd1d76d28 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -1,7 +1,6 @@ # This test is to check various cases of connections -# with right and wrong password, with and without database -# Unfortunately the check is incomplete as we can't handle errors on connect -# Also we can't connect without database +# with right and wrong password, with and without database +# Unfortunately the check is incomplete as we can't connect without database # This test makes no sense with the embedded server --source include/not_embedded.inc @@ -10,69 +9,72 @@ drop table if exists t1,t2; --enable_warnings + #connect (con1,localhost,root,,""); #show tables; connect (con1,localhost,root,,mysql); show tables; -connect (con1,localhost,root,,test); +connect (con2,localhost,root,,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,root,z,test2); -#--error 1045 -#connect (con1,localhost,root,z,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,root,z,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,root,z,); grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; # Now check this user with different databases - #connect (con1,localhost,test,gambling,""); #show tables; -connect (con1,localhost,test,gambling,mysql); +connect (con3,localhost,test,gambling,mysql); show tables; -connect (con1,localhost,test,gambling,test); +connect (con4,localhost,test,gambling,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,test,,test2); -#--error 1045 -#connect (con1,localhost,test,,""); -#--error 1045 -#connect (con1,localhost,test,zorro,test2); -#--error 1045 -#connect (con1,localhost,test,zorro,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,""); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,); # check if old password version also works update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; -#connect (con1,localhost,test,gambling2,""); -#show tables; -connect (con1,localhost,test,gambling2,mysql); +connect (con10,localhost,test,gambling2,); +connect (con5,localhost,test,gambling2,mysql); set password=""; --error 1372 set password='gambling3'; set password=old_password('gambling3'); show tables; -connect (con1,localhost,test,gambling3,test); +connect (con6,localhost,test,gambling3,test); show tables; -# Re enable this one day if error handling on connect will take place - -#connect (con1,localhost,test,,test2); -#--error 1045 -#connect (con1,localhost,test,,); -#--error 1045 -#connect (con1,localhost,test,zorro,test2); -#--error 1045 -#connect (con1,localhost,test,zorro,); -#--error 1045 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,,); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,test2); +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1045 +connect (fail_con,localhost,test,zorro,); # remove user 'test' so that other tests which may use 'test' @@ -84,13 +86,13 @@ flush privileges; # # Bug#12517: Clear user variables and replication events before # closing temp tables in thread cleanup. -connect (con2,localhost,root,,test); -connection con2; +connect (con7,localhost,root,,test); +connection con7; create table t1 (id integer not null auto_increment primary key); create temporary table t2(id integer not null auto_increment primary key); set @id := 1; delete from t1 where id like @id; -disconnect con2; +disconnect con7; --sleep 5 connection default; drop table t1; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 51cca0a3db1..37c319a24b5 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -498,8 +498,8 @@ drop table t1; # grant select on test.* to mysqltest_4@localhost; -connect (user4,localhost,mysqltest_4,,); -connection user4; +connect (user10261,localhost,mysqltest_4,,); +connection user10261; SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='TABLE_NAME'; connection default; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index eeac2971788..74f5afd8b8b 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -650,6 +650,7 @@ insert into t1 values (10),(11),(12); select * from t1; check table t1; drop table t1; +disconnect con1; # Same test with dynamic record length create table t1 (a int, b varchar(30) default "hello"); @@ -674,8 +675,10 @@ insert into t1 (a) values (10),(11),(12); select a from t1; check table t1; drop table t1; +disconnect con1; set global concurrent_insert=@save_concurrent_insert; + # BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce # different statistics on the same table with NULL values. create table t1 (a int, key(a)); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c903749839d..1af8560c48b 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -358,11 +358,11 @@ select 3 from t1 ; # Missing delimiter # The comment will be "sucked into" the sleep command since # delimiter is missing until after "show status" ---system echo "sleep 4" > var/log/mysqltest.sql ---system echo "# A comment" >> var/log/mysqltest.sql ---system echo "show status;" >> var/log/mysqltest.sql +--system echo "sleep 4" > var/tmp/mysqltest.sql +--system echo "# A comment" >> var/tmp/mysqltest.sql +--system echo "show status;" >> var/tmp/mysqltest.sql --error 1 ---exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 +--exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1 # # Extra delimiter @@ -808,6 +808,66 @@ select "a" as col1, "c" as col2; --error 1 --exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1 +# ---------------------------------------------------------------------------- +# Test connect +# ---------------------------------------------------------------------------- + +--error 1 +--exec echo "connect;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect ();" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,localhost);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2, localhost, root);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2, localhost, root,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con2,localhost,root,,illegal_db);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con1,localhost,root,,,illegal_port,);" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1 + +# Repeat connect/disconnect +--exec echo "let \$i=100;" > var/tmp/con.sql +--exec echo "while (\$i)" >> var/tmp/con.sql +--exec echo "{" >> var/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql +--exec echo " disconnect test_con1; " >> var/tmp/con.sql +--exec echo " dec \$i; " >> var/tmp/con.sql +--exec echo "}" >> var/tmp/con.sql +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Repeat connect/disconnect, exceed max number of connections +--exec echo "let \$i=200;" > var/tmp/con.sql +--exec echo "while (\$i)" >> var/tmp/con.sql +--exec echo "{" >> var/tmp/con.sql +--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql +--exec echo " disconnect test_con1; " >> var/tmp/con.sql +--exec echo " dec \$i; " >> var/tmp/con.sql +--exec echo "}" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Select disconnected connection +--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql +--exec echo "disconnect test_con1; " >> var/tmp/con.sql +--exec echo "connection test_con1;" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + +# Connection name already used +--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql +--exec echo "connect (test_con1,localhost,root,,);" >> var/tmp/con.sql +--error 1 +--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1 + + # ---------------------------------------------------------------------------- # Test mysqltest arguments diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index e9487425dd7..359b8b69a4d 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -13,11 +13,11 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; -enable_ssl; -connect (con1,localhost,ssl_user1,,); -connect (con2,localhost,ssl_user2,,); -connect (con3,localhost,ssl_user3,,); -connect (con4,localhost,ssl_user4,,); + +connect (con1,localhost,ssl_user1,,,,,SSL); +connect (con2,localhost,ssl_user2,,,,,SSL); +connect (con3,localhost,ssl_user3,,,,,SSL); +connect (con4,localhost,ssl_user4,,,,,SSL); connection con1; # Check ssl turned on diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 6f1332f80d5..197eede2f52 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -336,6 +336,7 @@ connection user1; do 1; use test; +disconnect user1; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost; drop function bug_9503; diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index d13bec60c2b..921b3262013 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -3,12 +3,10 @@ -- source include/have_openssl.inc -enable_ssl; - # Reconnect to turn ssl on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,SSL); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -16,6 +14,5 @@ SHOW STATUS LIKE 'Ssl_cipher'; # Source select test case -- source t/select.test -disable_ssl; diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test index 4a0d3a254ff..2d40b85c33d 100644 --- a/mysql-test/t/ssl_compress.test +++ b/mysql-test/t/ssl_compress.test @@ -4,13 +4,11 @@ -- source include/have_openssl.inc -- source include/have_compress.inc -enable_compress; -enable_ssl; # Reconnect to turn ssl and compress on for # default connection disconnect default; -connect (default,localhost,root,,); +connect (default,localhost,root,,,,,SSL COMPRESS); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -21,5 +19,3 @@ SHOW STATUS LIKE 'Compression'; # Source select test case -- source t/select.test -disable_compress; -disable_ssl; -- cgit v1.2.1 From fd0cd556525fed103e845ad20132f2f774aa55ff Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 12 Oct 2005 14:17:39 +0200 Subject: Bug #13009 No gaps allowed in node id number sequence + some small bugfixes in ndb_config + extending ndb_config to print connections and take shm option --- mysql-test/r/ndb_config.result | 5 +++++ mysql-test/std_data/ndb_config_mycnf2.cnf | 31 +++++++++++++++++++++++++++++++ mysql-test/t/ndb_config.test | 5 +++++ 3 files changed, 41 insertions(+) create mode 100644 mysql-test/std_data/ndb_config_mycnf2.cnf (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index 629d37f1e5e..9ca7ab5bf3a 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -5,3 +5,8 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql 1 2 ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,, +ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, +Cluster configuration warning line 0: Could not use next node id 2 for section [API], using next unused node id 7. +ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10, +ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15, +shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2 diff --git a/mysql-test/std_data/ndb_config_mycnf2.cnf b/mysql-test/std_data/ndb_config_mycnf2.cnf new file mode 100644 index 00000000000..3bf6b9a1194 --- /dev/null +++ b/mysql-test/std_data/ndb_config_mycnf2.cnf @@ -0,0 +1,31 @@ +# +# Testing automatic node id generation +# +[cluster_config] +NoOfReplicas=2 +Signum=39 + +[cluster_config.cluster0] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost +mysqld = ,,,, + +[cluster_config.cluster1] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost +mysqld = ,,,, +[cluster_config.ndbd.1.cluster1] +NodeId=2 +[cluster_config.mysqld.1.cluster1] +NodeId=1 + +[cluster_config.cluster2] +ndbd = localhost,localhost,localhost,localhost +ndb_mgmd = localhost,localhost +mysqld = ,,,, +[cluster_config.mysqld.1.cluster2] +NodeId=11 +[cluster_config.ndb_mgmd.1.cluster2] +NodeId=1 +[cluster_config.ndbd.1.cluster2] +NodeId=3 diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index 9d1c107472f..e40e89d76bd 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -11,3 +11,8 @@ # End of 4.1 tests --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null + +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null -- cgit v1.2.1 From a191d8cce1736bf39ea2c3babc7145efe7242783 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 12 Oct 2005 15:19:51 +0200 Subject: postt review fixes --- mysql-test/r/ndb_config.result | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index 9ca7ab5bf3a..ef5c924a398 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -6,7 +6,6 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,, ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, -Cluster configuration warning line 0: Could not use next node id 2 for section [API], using next unused node id 7. ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10, ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15, shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2 -- cgit v1.2.1 From 3ee738270361d2536159f9aab2594a17994b594a Mon Sep 17 00:00:00 2001 From: "dlenev@mysql.com" <> Date: Wed, 12 Oct 2005 23:42:51 +0400 Subject: Temporary solution for bug #13969 "Routines which are replicated from master can't be executed on slave". It will be possible to solve this problem in more correct way when we will implement WL#2897 "Complete definer support in the stored routines". --- mysql-test/r/rpl_sp.result | 8 ++++++++ mysql-test/t/rpl_sp.test | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index b1f564a0791..5f1c3afd14d 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -264,6 +264,14 @@ master-bin.000002 # Query 1 # use `mysqltest1`; insert into t1 values (1) select * from t1; a 1 +create procedure foo() +not deterministic +reads sql data +select * from t1; +call foo(); +a +1 +drop procedure foo; drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index fa44b68bd8c..e62a6c73c0a 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -258,6 +258,23 @@ sync_slave_with_master; select * from t1; +# +# Test for bug #13969 "Routines which are replicated from master can't be +# executed on slave". +# +connection master; +create procedure foo() + not deterministic + reads sql data + select * from t1; +sync_slave_with_master; +# This should not fail +call foo(); +connection master; +drop procedure foo; +sync_slave_with_master; + + # Clean up connection master; drop function fn1; -- cgit v1.2.1 From 11848b53d3072118f0d6dc792bee44e228185d18 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 12 Oct 2005 22:29:36 +0200 Subject: To force a restart at the end of test, the option file must be non-empty, it's not enough if it exists and is empty. --- mysql-test/t/rpl_dual_pos_advance-master.opt | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/t/rpl_dual_pos_advance-master.opt index e69de29bb2d..35fcc5f30c6 100644 --- a/mysql-test/t/rpl_dual_pos_advance-master.opt +++ b/mysql-test/t/rpl_dual_pos_advance-master.opt @@ -0,0 +1 @@ +--loose-to-force-a-restart -- cgit v1.2.1 From 94ea4f188a91d64c7741021e84a10d4f0a6d7121 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 12 Oct 2005 22:49:33 +0200 Subject: make_binary_distribution.sh: Copy *.cnf files in mysql-test/std_data/ Makefile.am: Added std_data/*.cnf to copy ndb config --- mysql-test/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 9b0db5774f5..1fb5f82c475 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -61,6 +61,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(distdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib @@ -89,6 +90,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib -- cgit v1.2.1 From 551961b2079802afcbc703d340a58e71902a3bcf Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Thu, 13 Oct 2005 00:58:59 +0400 Subject: select.test, sql_select.cc, sql_lex.cc, item.cc: Bug #7672 after merge fix --- mysql-test/t/select.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index a3a0faac1aa..879a84d092d 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2165,7 +2165,7 @@ select found_rows(); DROP TABLE t1; -# End of 4.1 tests +# # Bug 7672 Unknown column error in order clause # CREATE TABLE t1 (a INT, b INT); @@ -2174,3 +2174,4 @@ CREATE TABLE t1 (a INT, b INT); SELECT a, b AS c FROM t1 ORDER BY c+1; SELECT a, b AS c FROM t1 ORDER BY b+1; drop table t1; +# End of 4.1 tests -- cgit v1.2.1 From 06043b519a489935ab948b5264ae036e5f0de989 Mon Sep 17 00:00:00 2001 From: "eric@mysql.com" <> Date: Wed, 12 Oct 2005 14:33:08 -0700 Subject: replace port number with string identifier so that it may have different ports and still run (problem found by kent) --- mysql-test/r/federated.result | 2 +- mysql-test/t/federated.test | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index f40919a41a4..29f8461fd4c 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -79,7 +79,7 @@ Table Create Table t2 CREATE TABLE `t2` ( `id` int(20) NOT NULL, `name` varchar(32) NOT NULL default '' -) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:9308/federated/t1' +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); SELECT * FROM federated.t2; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 453343e6f09..b1b6baa2f33 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -75,7 +75,8 @@ eval CREATE TABLE federated.t2 ( ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -SHOW CREATE TABLE federated.t2; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval SHOW CREATE TABLE federated.t2; INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); -- cgit v1.2.1 From a6ceb59491f517df17b7fd2922100137c3033cfb Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Thu, 13 Oct 2005 00:29:23 +0200 Subject: fixes after merge of 4.1. --- mysql-test/r/subselect.result | 4 ++-- mysql-test/t/subselect.test | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 91e057da419..d42e439f4de 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1160,7 +1160,7 @@ Code2 char(2) NOT NULL default '', PRIMARY KEY (Code) ) ENGINE=MyISAM; INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); -INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); Continent Name Population Oceania Sydney 3276207 @@ -2512,7 +2512,7 @@ Code2 char(2) NOT NULL default '' ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); -INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 758ec7909f6..cc621fb5835 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -665,7 +665,7 @@ CREATE TABLE t2 ( ) ENGINE=MyISAM; INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); -INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); @@ -1526,7 +1526,7 @@ CREATE TABLE t1 ( ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); -INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); @@ -1962,7 +1962,6 @@ insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; drop table t1; - # # BUG #10308: purge log with subselect # -- cgit v1.2.1 From a46dd4125572e06943b2a07a35e3c2a7a3197477 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Wed, 12 Oct 2005 22:44:42 -0700 Subject: BUG# 13052 Clean application of patch - - Added --tz-utc to fix issue of dumping timestamp values between servers with different global time zone settings, particularly with regard to the day of DST changeover, which without this fix, would dump duplicate timestamp values. --- mysql-test/r/mysqldump.result | 184 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 21 +++++ 2 files changed, 205 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index ca303c57c5c..4757bd17b42 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -64,6 +64,8 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -80,6 +82,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -89,6 +92,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -99,6 +104,7 @@ CREATE TABLE `t1` ( ); INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -157,6 +163,8 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -173,6 +181,7 @@ INSERT INTO `t1` VALUES ('абцде'); INSERT INTO `t1` VALUES (NULL); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -185,6 +194,8 @@ UNLOCK TABLES; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; @@ -200,12 +211,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -221,6 +235,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -239,6 +254,8 @@ create table t1(a int); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -253,6 +270,7 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -262,6 +280,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -276,6 +296,7 @@ CREATE TABLE "t1" ( LOCK TABLES "t1" WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -288,6 +309,8 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -302,6 +325,7 @@ CREATE TABLE `t1` ( LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -311,6 +335,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -325,6 +351,7 @@ CREATE TABLE "t1" ( LOCK TABLES "t1" WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -340,6 +367,8 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; @@ -347,6 +376,7 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; @@ -363,6 +393,8 @@ drop table t1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -371,6 +403,7 @@ drop table t1; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `test`; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -386,6 +419,8 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -394,6 +429,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; USE `mysqldump_test_db`; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -411,6 +447,8 @@ INSERT INTO t1 VALUES (_latin1 ' /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -426,6 +464,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('ÄÖÜß'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -435,6 +474,8 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -450,12 +491,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('Ž™šá'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -471,12 +515,15 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('Ž™šá'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -492,6 +539,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('ÄÖÜß'); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -508,6 +556,8 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -523,6 +573,7 @@ LOCK TABLES `t2` WRITE; INSERT INTO `t2` VALUES (4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -541,6 +592,8 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -556,6 +609,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (0x602010000280100005E71A); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -574,6 +628,8 @@ INSERT INTO t1 VALUES (4),(5),(6); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -589,6 +645,7 @@ LOCK TABLES `t1` WRITE; INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -603,6 +660,8 @@ UNLOCK TABLES; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -616,6 +675,7 @@ CREATE TABLE `t1` ( /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -963,6 +1023,8 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1307,6 +1369,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` (`F_c4ca4238a0b923820dcc509a6f75849b`, `F_c81e728d9d4c2f636f067f89cc14862c`, `F_eccbc87e4b5ce2fe28308fd9f2a7baf3`, `F_a87ff679a2f3e71d9181a67b7542122c`, `F_e4da3b7fbbce2345d7772b0674a318d5`, `F_1679091c5a880faf6fb5e6087eb1b2dc`, `F_8f14e45fceea167a5a36dedd4bea2543`, `F_c9f0f895fb98ab9159f51fd0297e236d`, `F_45c48cce2e2d7fbdea1afc51c7c6ad26`, `F_d3d9446802a44259755d38e6d163e820`, `F_6512bd43d9caa6e02c990b0a82652dca`, `F_c20ad4d76fe97759aa27a0c99bff6710`, `F_c51ce410c124a10e0db5e4b97fc2af39`, `F_aab3238922bcc25a6f606eb525ffdc56`, `F_9bf31c7ff062936a96d3c8bd1f8f2ff3`, `F_c74d97b01eae257e44aa9d5bade97baf`, `F_70efdf2ec9b086079795c442636b55fb`, `F_6f4922f45568161a8cdf4ad2299f6d23`, `F_1f0e3dad99908345f7439f8ffabdffc4`, `F_98f13708210194c475687be6106a3b84`, `F_3c59dc048e8850243be8079a5c74d079`, `F_b6d767d2f8ed5d21a44b0e5886680cb9`, `F_37693cfc748049e45d87b8c7d8b9aacd`, `F_1ff1de774005f8da13f42943881c655f`, `F_8e296a067a37563370ded05f5a3bf3ec`, `F_4e732ced3463d06de0ca9a15b6153677`, `F_02e74f10e0327ad868d138f2b4fdd6f0`, `F_33e75ff09dd601bbe69f351039152189`, `F_6ea9ab1baa0efb9e19094440c317e21b`, `F_34173cb38f07f89ddbebc2ac9128303f`, `F_c16a5320fa475530d9583c34fd356ef5`, `F_6364d3f0f495b6ab9dcf8d3b5c6e0b01`, `F_182be0c5cdcd5072bb1864cdee4d3d6e`, `F_e369853df766fa44e1ed0ff613f563bd`, `F_1c383cd30b7c298ab50293adfecb7b18`, `F_19ca14e7ea6328a42e0eb13d585e4c22`, `F_a5bfc9e07964f8dddeb95fc584cd965d`, `F_a5771bce93e200c36f7cd9dfd0e5deaa`, `F_d67d8ab4f4c10bf22aa353e27879133c`, `F_d645920e395fedad7bbbed0eca3fe2e0`, `F_3416a75f4cea9109507cacd8e2f2aefc`, `F_a1d0c6e83f027327d8461063f4ac58a6`, `F_17e62166fc8586dfa4d1bc0e1742c08b`, `F_f7177163c833dff4b38fc8d2872f1ec6`, `F_6c8349cc7260ae62e3b1396831a8398f`, `F_d9d4f495e875a2e075a1a4a6e1b9770f`, `F_67c6a1e7ce56d3d6fa748ab6d9af3fd7`, `F_642e92efb79421734881b53e1e1b18b6`, `F_f457c545a9ded88f18ecee47145a72c0`, `F_c0c7c76d30bd3dcaefc96f40275bdc0a`, `F_2838023a778dfaecdc212708f721b788`, `F_9a1158154dfa42caddbd0694a4e9bdc8`, `F_d82c8d1619ad8176d665453cfb2e55f0`, `F_a684eceee76fc522773286a895bc8436`, `F_b53b3a3d6ab90ce0268229151c9bde11`, `F_9f61408e3afb633e50cdf1b20de6f466`, `F_72b32a1f754ba1c09b3695e0cb6cde7f`, `F_66f041e16a60928b05a7e228a89c3799`, `F_093f65e080a295f8076b1c5722a46aa2`, `F_072b030ba126b2f4b2374f342be9ed44`, `F_7f39f8317fbdb1988ef4c628eba02591`, `F_44f683a84163b3523afe57c2e008bc8c`, `F_03afdbd66e7929b125f8597834fa83a4`, `F_ea5d2f1c4608232e07d3aa3d998e5135`, `F_fc490ca45c00b1249bbe3554a4fdf6fb`, `F_3295c76acbf4caaed33c36b1b5fc2cb1`, `F_735b90b4568125ed6c3f678819b6e058`, `F_a3f390d88e4c41f2747bfa2f1b5f87db`, `F_14bfa6bb14875e45bba028a21ed38046`, `F_7cbbc409ec990f19c78c75bd1e06f215`, `F_e2c420d928d4bf8ce0ff2ec19b371514`, `F_32bb90e8976aab5298d5da10fe66f21d`, `F_d2ddea18f00665ce8623e36bd4e3c7c5`, `F_ad61ab143223efbc24c7d2583be69251`, `F_d09bf41544a3365a46c9077ebb5e35c3`, `F_fbd7939d674997cdb4692d34de8633c4`, `F_28dd2c7955ce926456240b2ff0100bde`, `F_35f4a8d465e6e1edc05f3d8ab658c551`, `F_d1fe173d08e959397adf34b1d77e88d7`, `F_f033ab37c30201f73f142449d037028d`, `F_43ec517d68b6edd3015b3edc9a11367b`, `F_9778d5d219c5080b9a6a17bef029331c`, `F_fe9fc289c3ff0af142b6d3bead98a923`, `F_68d30a9594728bc39aa24be94b319d21`, `F_3ef815416f775098fe977004015c6193`, `F_93db85ed909c13838ff95ccfa94cebd9`, `F_c7e1249ffc03eb9ded908c236bd1996d`, `F_2a38a4a9316c49e5a833517c45d31070`, `F_7647966b7343c29048673252e490f736`, `F_8613985ec49eb8f757ae6439e879bb2a`, `F_54229abfcfa5649e7003b83dd4755294`, `F_92cc227532d17e56e07902b254dfad10`, `F_98dce83da57b0395e163467c9dae521b`, `F_f4b9ec30ad9f68f89b29639786cb62ef`, `F_812b4ba287f5ee0bc9d43bbf5bbe87fb`, `F_26657d5ff9020d2abefe558796b99584`, `F_e2ef524fbf3d9fe611d5a8e90fefdc9c`, `F_ed3d2c21991e3bef5e069713af9fa6ca`, `F_ac627ab1ccbdb62ec96e702f07f6425b`, `F_f899139df5e1059396431415e770c6dd`, `F_38b3eff8baf56627478ec76a704e9b52`, `F_ec8956637a99787bd197eacd77acce5e`, `F_6974ce5ac660610b44d9b9fed0ff9548`, `F_c9e1074f5b3f9fc8ea15d152add07294`, `F_65b9eea6e1cc6bb9f0cd2a47751a186f`, `F_f0935e4cd5920aa6c7c996a5ee53a70f`, `F_a97da629b098b75c294dffdc3e463904`, `F_a3c65c2974270fd093ee8a9bf8ae7d0b`, `F_2723d092b63885e0d7c260cc007e8b9d`, `F_5f93f983524def3dca464469d2cf9f3e`, `F_698d51a19d8a121ce581499d7b701668`, `F_7f6ffaa6bb0b408017b62254211691b5`, `F_73278a4a86960eeb576a8fd4c9ec6997`, `F_5fd0b37cd7dbbb00f97ba6ce92bf5add`, `F_2b44928ae11fb9384c4cf38708677c48`, `F_c45147dee729311ef5b5c3003946c48f`, `F_eb160de1de89d9058fcb0b968dbbbd68`, `F_5ef059938ba799aaa845e1c2e8a762bd`, `F_07e1cd7dca89a1678042477183b7ac3f`, `F_da4fb5c6e93e74d3df8527599fa62642`, `F_4c56ff4ce4aaf9573aa5dff913df997a`, `F_a0a080f42e6f13b3a2df133f073095dd`, `F_202cb962ac59075b964b07152d234b70`, `F_c8ffe9a587b126f152ed3d89a146b445`, `F_3def184ad8f4755ff269862ea77393dd`, `F_069059b7ef840f0c74a814ec9237b6ec`, `F_ec5decca5ed3d6b8079e2e7e7bacc9f2`, `F_76dc611d6ebaafc66cc0879c71b5db5c`, `F_d1f491a404d6854880943e5c3cd9ca25`, `F_9b8619251a19057cff70779273e95aa6`, `F_1afa34a7f984eeabdbb0a7d494132ee5`, `F_65ded5353c5ee48d0b7d48c591b8f430`, `F_9fc3d7152ba9336a670e36d0ed79bc43`, `F_02522a2b2726fb0a03bb19f2d8d9524d`, `F_7f1de29e6da19d22b51c68001e7e0e54`, `F_42a0e188f5033bc65bf8d78622277c4e`, `F_3988c7f88ebcb58c6ce932b957b6f332`, `F_013d407166ec4fa56eb1e1f8cbe183b9`, `F_e00da03b685a0dd18fb6a08af0923de0`, `F_1385974ed5904a438616ff7bdb3f7439`, `F_0f28b5d49b3020afeecd95b4009adf4c`, `F_a8baa56554f96369ab93e4f3bb068c22`, `F_903ce9225fca3e988c2af215d4e544d3`, `F_0a09c8844ba8f0936c20bd791130d6b6`, `F_2b24d495052a8ce66358eb576b8912c8`, `F_a5e00132373a7031000fd987a3c9f87b`, `F_8d5e957f297893487bd98fa830fa6413`, `F_47d1e990583c9c67424d369f3414728e`, `F_f2217062e9a397a1dca429e7d70bc6ca`, `F_7ef605fc8dba5425d6965fbd4c8fbe1f`, `F_a8f15eda80c50adb0e71943adc8015cf`, `F_37a749d808e46495a8da1e5352d03cae`, `F_b3e3e393c77e35a4a3f3cbd1e429b5dc`, `F_1d7f7abc18fcb43975065399b0d1e48e`, `F_2a79ea27c279e471f4d180b08d62b00a`, `F_1c9ac0159c94d8d0cbedc973445af2da`, `F_6c4b761a28b734fe93831e3fb400ce87`, `F_06409663226af2f3114485aa4e0a23b4`, `F_140f6969d5213fd0ece03148e62e461e`, `F_b73ce398c39f506af761d2277d853a92`, `F_bd4c9ab730f5513206b999ec0d90d1fb`, `F_82aa4b0af34c2313a562076992e50aa3`, `F_0777d5c17d4066b82ab86dff8a46af6f`, `F_fa7cdfad1a5aaf8370ebeda47a1ff1c3`, `F_9766527f2b5d3e95d4a733fcfb77bd7e`, `F_7e7757b1e12abcb736ab9a754ffb617a`, `F_5878a7ab84fb43402106c575658472fa`, `F_006f52e9102a8d3be2fe5614f42ba989`, `F_3636638817772e42b59d74cff571fbb3`, `F_149e9677a5989fd342ae44213df68868`, `F_a4a042cf4fd6bfb47701cbc8a1653ada`, `F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e`, `F_f7e6c85504ce6e82442c770f7c8606f0`, `F_bf8229696f7a3bb4700cfddef19fa23f`, `F_82161242827b703e6acf9c726942a1e4`, `F_38af86134b65d0f10fe33d30dd76442e`, `F_96da2f590cd7246bbde0051047b0d6f7`, `F_8f85517967795eeef66c225f7883bdcb`, `F_8f53295a73878494e9bc8dd6c3c7104f`, `F_045117b0e0a11a242b9765e79cbf113f`, `F_fc221309746013ac554571fbd180e1c8`, `F_4c5bde74a8f110656874902f07378009`, `F_cedebb6e872f539bef8c3f919874e9d7`, `F_6cdd60ea0045eb7a6ec44c54d29ed402`, `F_eecca5b6365d9607ee5a9d336962c534`, `F_9872ed9fc22fc182d371c3e9ed316094`, `F_31fefc0e570cb3860f2a6d4b38c6490d`, `F_9dcb88e0137649590b755372b040afad`, `F_a2557a7b2e94197ff767970b67041697`, `F_cfecdb276f634854f3ef915e2e980c31`, `F_0aa1883c6411f7873cb83dacb17b0afc`, `F_58a2fc6ed39fd083f55d4182bf88826d`, `F_bd686fd640be98efaae0091fa301e613`, `F_a597e50502f5ff68e3e25b9114205d4a`, `F_0336dcbab05b9d5ad24f4333c7658a0e`, `F_084b6fbb10729ed4da8c3d3f5a3ae7c9`, `F_85d8ce590ad8981ca2c8286f79f59954`, `F_0e65972dce68dad4d52d063967f0a705`, `F_84d9ee44e457ddef7f2c4f25dc8fa865`, `F_3644a684f98ea8fe223c713b77189a77`, `F_757b505cfd34c64c85ca5b5690ee5293`, `F_854d6fae5ee42911677c739ee1734486`, `F_e2c0be24560d78c5e599c2a9c9d0bbd2`, `F_274ad4786c3abca69fa097b85867d9a4`, `F_eae27d77ca20db309e056e3d2dcd7d69`, `F_7eabe3a1649ffa2b3ff8c02ebfd5659f`, `F_69adc1e107f7f7d035d7baf04342e1ca`, `F_091d584fced301b442654dd8c23b3fc9`, `F_b1d10e7bafa4421218a51b1e1f1b0ba2`, `F_6f3ef77ac0e3619e98159e9b6febf557`, `F_eb163727917cbba1eea208541a643e74`, `F_1534b76d325a8f591b52d302e7181331`, `F_979d472a84804b9f647bc185a877a8b5`, `F_ca46c1b9512a7a8315fa3c5a946e8265`, `F_3b8a614226a953a8cd9526fca6fe9ba5`, `F_45fbc6d3e05ebd93369ce542e8f2322d`, `F_63dc7ed1010d3c3b8269faf0ba7491d4`, `F_e96ed478dab8595a7dbda4cbcbee168f`, `F_c0e190d8267e36708f955d7ab048990d`, `F_ec8ce6abb3e952a85b8551ba726a1227`, `F_060ad92489947d410d897474079c1477`, `F_bcbe3365e6ac95ea2c0343a2395834dd`, `F_115f89503138416a242f40fb7d7f338e`, `F_13fe9d84310e77f13a6d184dbf1232f3`, `F_d1c38a09acc34845c6be3a127a5aacaf`, `F_9cfdf10e8fc047a44b08ed031e1f0ed1`, `F_705f2172834666788607efbfca35afb3`, `F_74db120f0a8e5646ef5a30154e9f6deb`, `F_57aeee35c98205091e18d1140e9f38cf`, `F_6da9003b743b65f4c0ccd295cc484e57`, `F_9b04d152845ec0a378394003c96da594`, `F_be83ab3ecd0db773eb2dc1b0a17836a1`, `F_e165421110ba03099a1c0393373c5b43`, `F_289dff07669d7a23de0ef88d2f7129e7`, `F_577ef1154f3240ad5b9b413aa7346a1e`, `F_01161aaa0b6d1345dd8fe4e481144d84`, `F_539fd53b59e3bb12d203f45a912eeaf2`, `F_ac1dd209cbcc5e5d1c6e28598e8cbbe8`, `F_555d6702c950ecb729a966504af0a635`, `F_335f5352088d7d9bf74191e006d8e24c`, `F_f340f1b1f65b6df5b5e3f94d95b11daf`, `F_e4a6222cdb5b34375400904f03d8e6a5`, `F_cb70ab375662576bd1ac5aaf16b3fca4`, `F_9188905e74c28e489b44e954ec0b9bca`, `F_0266e33d3f546cb5436a10798e657d97`, `F_38db3aed920cf82ab059bfccbd02be6a`, `F_3cec07e9ba5f5bb252d13f5f431e4bbb`, `F_621bf66ddb7c962aa0d22ac97d69b793`, `F_077e29b11be80ab57e1a2ecabb7da330`, `F_6c9882bbac1c7093bd25041881277658`, `F_19f3cd308f1455b3fa09a282e0d496f4`, `F_03c6b06952c750899bb03d998e631860`, `F_c24cd76e1ce41366a4bbe8a49b02a028`, `F_c52f1bd66cc19d05628bd8bf27af3ad6`, `F_fe131d7f5a6b38b23cc967316c13dae2`, `F_f718499c1c8cef6730f9fd03c8125cab`, `F_d96409bf894217686ba124d7356686c9`, `F_502e4a16930e414107ee22b6198c578f`, `F_cfa0860e83a4c3a763a7e62d825349f7`, `F_a4f23670e1833f3fdb077ca70bbd5d66`, `F_b1a59b315fc9a3002ce38bbe070ec3f5`, `F_36660e59856b4de58a219bcf4e27eba3`, `F_8c19f571e251e61cb8dd3612f26d5ecf`, `F_d6baf65e0b240ce177cf70da146c8dc8`, `F_e56954b4f6347e897f954495eab16a88`, `F_f7664060cc52bc6f3d620bcedc94a4b6`, `F_eda80a3d5b344bc40f3bc04f65b7a357`, `F_8f121ce07d74717e0b1f21d122e04521`, `F_06138bc5af6023646ede0e1f7c1eac75`, `F_39059724f73a9969845dfe4146c5660e`, `F_7f100b7b36092fb9b06dfb4fac360931`, `F_7a614fd06c325499f1680b9896beedeb`, `F_4734ba6f3de83d861c3176a6273cac6d`, `F_d947bf06a885db0d477d707121934ff8`, `F_63923f49e5241343aa7acb6a06a751e7`, `F_db8e1af0cb3aca1ae2d0018624204529`, `F_20f07591c6fcb220ffe637cda29bb3f6`, `F_07cdfd23373b17c6b337251c22b7ea57`, `F_d395771085aab05244a4fb8fd91bf4ee`, `F_92c8c96e4c37100777c7190b76d28233`, `F_e3796ae838835da0b6f6ea37bcf8bcb7`, `F_6a9aeddfc689c1d0e3b9ccc3ab651bc5`, `F_0f49c89d1e7298bb9930789c8ed59d48`, `F_46ba9f2a6976570b0353203ec4474217`, `F_0e01938fc48a2cfb5f2217fbfb00722d`, `F_16a5cdae362b8d27a1d8f8c7b78b4330`, `F_918317b57931b6b7a7d29490fe5ec9f9`, `F_48aedb8880cab8c45637abc7493ecddd`, `F_839ab46820b524afda05122893c2fe8e`, `F_f90f2aca5c640289d0a29417bcb63a37`, `F_9c838d2e45b2ad1094d42f4ef36764f6`, `F_1700002963a49da13542e0726b7bb758`, `F_53c3bce66e43be4f209556518c2fcb54`, `F_6883966fd8f918a4aa29be29d2c386fb`, `F_49182f81e6a13cf5eaa496d51fea6406`, `F_d296c101daa88a51f6ca8cfc1ac79b50`, `F_9fd81843ad7f202f26c1a174c7357585`, `F_26e359e83860db1d11b6acca57d8ea88`, `F_ef0d3930a7b6c95bd2b32ed45989c61f`, `F_94f6d7e04a4d452035300f18b984988c`, `F_34ed066df378efacc9b924ec161e7639`, `F_577bcc914f9e55d5e4e4f82f9f00e7d4`, `F_11b9842e0a271ff252c1903e7132cd68`, `F_37bc2f75bf1bcfe8450a1a41c200364c`, `F_496e05e1aea0a9c4655800e8a7b9ea28`, `F_b2eb7349035754953b57a32e2841bda5`, `F_8e98d81f8217304975ccb23337bb5761`, `F_a8c88a0055f636e4a163a5e3d16adab7`, `F_eddea82ad2755b24c4e168c5fc2ebd40`, `F_06eb61b839a0cefee4967c67ccb099dc`, `F_9dfcd5e558dfa04aaf37f137a1d9d3e5`, `F_950a4152c2b4aa3ad78bdd6b366cc179`, `F_158f3069a435b314a80bdcb024f8e422`, `F_758874998f5bd0c393da094e1967a72b`, `F_ad13a2a07ca4b7642959dc0c4c740ab6`, `F_3fe94a002317b5f9259f82690aeea4cd`, `F_5b8add2a5d98b1a652ea7fd72d942dac`, `F_432aca3a1e345e339f35a30c8f65edce`, `F_8d3bba7425e7c98c50f52ca1b52d3735`, `F_320722549d1751cf3f247855f937b982`, `F_caf1a3dfb505ffed0d024130f58c5cfa`, `F_5737c6ec2e0716f3d8a7a5c4e0de0d9a`, `F_bc6dc48b743dc5d013b1abaebd2faed2`, `F_f2fc990265c712c49d51a18a32b39f0c`, `F_89f0fd5c927d466d6ec9a21b9ac34ffa`, `F_a666587afda6e89aec274a3657558a27`, `F_b83aac23b9528732c23cc7352950e880`, `F_cd00692c3bfe59267d5ecfac5310286c`, `F_6faa8040da20ef399b63a72d0e4ab575`, `F_fe73f687e5bc5280214e0486b273a5f9`) VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1324,6 +1387,8 @@ INSERT INTO t1 VALUES (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1345,6 +1410,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1372,6 +1438,8 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1396,6 +1464,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1446,6 +1515,8 @@ INSERT INTO t2 VALUES (1), (2); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1458,6 +1529,7 @@ DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1472,6 +1544,8 @@ CREATE TABLE `t2` ( /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1484,6 +1558,7 @@ DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1608,6 +1683,8 @@ create view v1 as select * from t1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1630,6 +1707,7 @@ DROP TABLE IF EXISTS `v1`; /*!50001 DROP TABLE IF EXISTS `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1658,6 +1736,8 @@ create view v2 as select * from t2 where a like 'a%' with check option; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1682,6 +1762,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1702,6 +1783,8 @@ INSERT INTO t1 VALUES ('\''); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1717,6 +1800,7 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('\''); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1740,6 +1824,8 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1785,6 +1871,7 @@ DROP TABLE IF EXISTS `v3`; /*!50001 DROP TABLE IF EXISTS `v3`*/; /*!50001 DROP VIEW IF EXISTS `v3`*/; /*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1847,6 +1934,8 @@ update t1 set a = 4 where a=3; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1917,6 +2006,7 @@ end */;; DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1931,6 +2021,8 @@ DELIMITER ; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -1961,6 +2053,7 @@ CREATE TABLE `t2` ( LOCK TABLES `t2` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -2060,6 +2153,8 @@ set sql_mode=''; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -2111,6 +2206,7 @@ select sum(id) from t1 into a; END */;; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; DELIMITER ; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -2125,3 +2221,91 @@ DROP FUNCTION bug9056_func2; DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1; +drop table if exists t1; +create table t1 (`d` timestamp, unique (`d`)); +set time_zone='+00:00'; +insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +select * from t1; +d +2003-10-25 22:00:00 +2003-10-25 23:00:00 +set time_zone='Europe/Moscow'; +select * from t1; +d +2003-10-26 02:00:00 +2003-10-26 02:00:00 +set global time_zone='Europe/Moscow'; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + UNIQUE KEY `d` (`d`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + UNIQUE KEY `d` (`d`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop table t1; +set global time_zone=default; +set time_zone=default; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7dafac2bde5..6898dbe7a8d 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -907,3 +907,24 @@ DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1; +# +# BUG# 13052 - mysqldump timestamp reloads broken +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (`d` timestamp, unique (`d`)); +set time_zone='+00:00'; +insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00'); +# results should show two different time values +select * from t1; +set time_zone='Europe/Moscow'; +# results should show two same time values, despite unique +select * from t1; +set global time_zone='Europe/Moscow'; +--exec $MYSQL_DUMP --skip-comments --databases test +--exec $MYSQL_DUMP --skip-tz-utc --skip-comments --databases test +drop table t1; +set global time_zone=default; +set time_zone=default; -- cgit v1.2.1 From b2ff38202d2ba6020ce6b5f3bfb8e2c939d0189c Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 13 Oct 2005 11:53:00 +0400 Subject: A fix and a test case for Bug#12736 "Server crash during a select". The bug was in JOIN::join_free which was wrongly determining that all joins have been already executed and therefore all used tables can be closed. --- mysql-test/r/subselect_innodb.result | 20 ++++++++++++++++++++ mysql-test/t/subselect_innodb.test | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 0666fd76661..a23b584e510 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -152,3 +152,23 @@ EXECUTE my_stmt; b count(*) deallocate prepare my_stmt; drop table t1,t2; +CREATE TABLE t1 ( +school_name varchar(45) NOT NULL, +country varchar(45) NOT NULL, +funds_requested float NOT NULL, +schooltype varchar(45) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +insert into t1 values ("the school", "USA", 1200, "Human"); +select count(country) as countrycount, sum(funds_requested) as smcnt, +country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; +countrycount smcnt country total_funds +1 1200 USA 1200 +select count(country) as countrycount, sum(funds_requested) as smcnt, +country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; +countrycount smcnt country total_funds +1 1200 USA 1200 +drop table t1; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 3b1d2f393c2..a07cc93ad68 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -161,3 +161,25 @@ deallocate prepare my_stmt; drop table t1,t2; # End of 4.1 tests + +CREATE TABLE t1 ( + school_name varchar(45) NOT NULL, + country varchar(45) NOT NULL, + funds_requested float NOT NULL, + schooltype varchar(45) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into t1 values ("the school", "USA", 1200, "Human"); + +select count(country) as countrycount, sum(funds_requested) as smcnt, + country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; + +select count(country) as countrycount, sum(funds_requested) as smcnt, + country, (select sum(funds_requested) from t1) as total_funds +from t1 +group by country; + +drop table t1; + -- cgit v1.2.1 From a93780b23d76d8add31d51bb9b9dc9c6e39c2592 Mon Sep 17 00:00:00 2001 From: "elliot@mysql.com" <> Date: Thu, 13 Oct 2005 05:12:17 -0400 Subject: BUG#13343 CREATE|etc TRIGGER|VIEW|USER don't commit the transaction (inconsistency) Updated more DDL statements to cause implicit commit. --- mysql-test/r/rpl_ddl.result | 434 ++++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/rpl_ddl.test | 107 +++++++++++ 2 files changed, 541 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result index 9f90001ab67..2a97da63c64 100644 --- a/mysql-test/r/rpl_ddl.result +++ b/mysql-test/r/rpl_ddl.result @@ -1254,6 +1254,440 @@ flush logs; SHOW PROCEDURE STATUS LIKE 'p1'; -------- switch to slave ------- SHOW PROCEDURE STATUS LIKE 'p1'; + +######## CREATE OR REPLACE VIEW v1 as select * from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 18 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +18 + +-------- switch to master ------- +CREATE OR REPLACE VIEW v1 as select * from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## ALTER VIEW v1 AS select f1 from t1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 19 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +19 + +-------- switch to master ------- +ALTER VIEW v1 AS select f1 from t1; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` + +######## DROP VIEW IF EXISTS v1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 20 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +20 + +-------- switch to master ------- +DROP VIEW IF EXISTS v1; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +-------- switch to slave ------- +SHOW CREATE VIEW v1; +ERROR 42S02: Table 'mysqltest1.v1' doesn't exist + +######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 21 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +21 + +-------- switch to master ------- +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode +trg1 INSERT t1 SET @a:=1 BEFORE NULL + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode +trg1 INSERT t1 SET @a:=1 BEFORE NULL + +######## DROP TRIGGER trg1 ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 22 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +22 + +-------- switch to master ------- +DROP TRIGGER trg1; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode + +-------- switch to slave ------- +SHOW TRIGGERS; +Trigger Event Table Statement Timing Created sql_mode + +######## CREATE USER user1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 23 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +23 + +-------- switch to master ------- +CREATE USER user1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'user1'; +user +user1 + +######## RENAME USER user1@localhost TO rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 24 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +24 + +-------- switch to master ------- +RENAME USER user1@localhost TO rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user +rename1 + +######## DROP USER rename1@localhost ######## + +-------- switch to master ------- +INSERT INTO t1 SET f1= 25 + 1; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +25 + +-------- switch to master ------- +DROP USER rename1@localhost; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +-------- switch to master ------- +ROLLBACK; +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: MASTER: The INSERT is committed (Succeeded) + +-------- switch to slave -------- +SELECT MAX(f1) FROM t1; +MAX(f1) +26 + +TEST-INFO: SLAVE: The INSERT is committed (Succeeded) + +-------- switch to master ------- +flush logs; + +-------- switch to slave -------- +flush logs; + +-------- switch to master ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user + +-------- switch to slave ------- +SELECT user FROM mysql.user WHERE user = 'rename1'; +user DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest3; diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index 60a00a7b1b4..d2a41a305b6 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -391,6 +391,113 @@ SHOW PROCEDURE STATUS LIKE 'p1'; connection master; --horizontal_results +############################################################### +# Cases with VIEWs +############################################################### +let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW CREATE VIEW v1; +connection master; + +let $my_stmt= ALTER VIEW v1 AS select f1 from t1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW CREATE VIEW v1; +connection master; + +let $my_stmt= DROP VIEW IF EXISTS v1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +--error 1146 +SHOW CREATE VIEW v1; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +--error 1146 +SHOW CREATE VIEW v1; +connection master; + +############################################################### +# Cases with TRIGGERs +############################################################### +let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW TRIGGERS; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW TRIGGERS; +connection master; + +let $my_stmt= DROP TRIGGER trg1; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SHOW TRIGGERS; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SHOW TRIGGERS; +connection master; + +############################################################### +# Cases with USERs +############################################################### +let $my_stmt= CREATE USER user1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'user1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'user1'; +connection master; + +let $my_stmt= RENAME USER user1@localhost TO rename1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'rename1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'rename1'; +connection master; + +let $my_stmt= DROP USER rename1@localhost; +let $my_master_commit= true; +let $my_slave_commit= true; +--source include/rpl_stmt_seq.inc +SELECT user FROM mysql.user WHERE user = 'rename1'; +--disable_query_log +SELECT '-------- switch to slave -------' as ""; +--enable_query_log +connection slave; +SELECT user FROM mysql.user WHERE user = 'rename1'; +connection master; + ############################################################### # Cleanup ############################################################### -- cgit v1.2.1 From cf987efb3596c4c8d91484f0255d1e19ba5715a2 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 13 Oct 2005 11:28:06 +0200 Subject: Updated after testing --- mysql-test/mysql-test-run.pl | 4 +- mysql-test/r/compress.result | 911 +++----------------------------------- mysql-test/r/ssl.result | 911 +++----------------------------------- mysql-test/r/ssl_compress.result | 914 +++------------------------------------ mysql-test/t/compress.test | 10 +- mysql-test/t/ssl.test | 9 +- mysql-test/t/ssl_compress.test | 13 +- 7 files changed, 203 insertions(+), 2569 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 29b4a0a1ed6..8e7b0dd4cca 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1166,7 +1166,7 @@ sub check_ssl_support () { mtr_error("Couldn't find support for SSL"); return; } - mtr_report("Skipping SSL, mysqld does not support it"); + mtr_report("Skipping SSL, mysqld not compiled with SSL"); $opt_ssl_supported= 0; $opt_ssl= 0; return; @@ -1205,7 +1205,7 @@ sub check_ndbcluster_support () { "--help"], "", "/dev/null", "/dev/null", "") != 0 ) { - mtr_report("Skipping ndbcluster, mysqld does not support it"); + mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster"); $opt_with_ndbcluster= 0; return; } diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result index a86fb4e4745..efcafbbe736 100644 --- a/mysql-test/r/compress.result +++ b/mysql-test/r/compress.result @@ -2,8 +2,6 @@ SHOW STATUS LIKE 'Compression'; Variable_name Value Compression ON drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2094,855 +2092,68 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index 5c8a7e91c71..bb7297d6807 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -2,8 +2,6 @@ SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2094,855 +2092,68 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result index 574726640d4..9c1cf4b0ec3 100644 --- a/mysql-test/r/ssl_compress.result +++ b/mysql-test/r/ssl_compress.result @@ -5,8 +5,6 @@ SHOW STATUS LIKE 'Compression'; Variable_name Value Compression ON drop table if exists t1,t2,t3,t4; -drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; -drop view if exists v1; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2097,855 +2095,71 @@ t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; -DO 1; -DO benchmark(100,1+1),1,1; -do default; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -do foobar; -ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( -id mediumint(8) unsigned NOT NULL auto_increment, -pseudo varchar(35) NOT NULL default '', -PRIMARY KEY (id), -UNIQUE KEY pseudo (pseudo) -); -INSERT INTO t1 (pseudo) VALUES ('test'); -INSERT INTO t1 (pseudo) VALUES ('test1'); -SELECT 1 as rnd1 from t1 where rand() > 2; -rnd1 -DROP TABLE t1; -CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM; -INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); -CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -Warnings: -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -Warning 1292 Incorrect datetime value: 'wrong-date-value' for column 'sampletime' at row 1 -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; -gvid the_success the_fail the_size the_time -DROP TABLE t1,t2; -create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); -INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); -select wss_type from t1 where wss_type ='102935229216544106'; -wss_type -select wss_type from t1 where wss_type ='102935229216544105'; -wss_type -select wss_type from t1 where wss_type ='102935229216544104'; -wss_type -select wss_type from t1 where wss_type ='102935229216544093'; -wss_type -102935229216544093 -select wss_type from t1 where wss_type =102935229216544093; -wss_type -102935229216544093 -drop table t1; -select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; -select @a; -@a -3 -select @b; -@b -aaaa -select @c; -@c -6.260 -create table t1 (a int not null auto_increment primary key); -insert into t1 values (); -insert into t1 values (); -insert into t1 values (); -select * from (t1 as t2 left join t1 as t3 using (a)), t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1, (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); -a a -1 1 -2 1 -3 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; -a a -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); -a -1 -2 -3 -select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; -a a -1 2 -1 3 -2 2 -2 3 -3 2 -3 3 -select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -1 NULL -2 1 -2 2 -2 3 -3 1 -3 2 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); -a -1 -2 -3 -select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; -a -1 -2 -3 -select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; -a a -NULL 1 -1 2 -2 2 -3 2 -1 3 -2 3 -3 3 -select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; -a a -2 1 -3 1 -2 2 -3 2 -2 3 -3 3 -select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); -a -1 -2 -3 -select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; -a -1 -2 -3 -select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); -a -1 -2 -3 -select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; -a -1 -2 -3 -drop table t1; -CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) ENGINE=MyISAM; -INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); -CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=MyISAM; -INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); -select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; -aa id t2_id id -2 8299 2517 2517 -3 8301 2518 2518 -4 8302 2519 2519 -5 8303 2520 2520 -6 8304 2521 2521 -drop table t1,t2; -create table t1 (id1 int NOT NULL); -create table t2 (id2 int NOT NULL); -create table t3 (id3 int NOT NULL); -create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); -insert into t1 values (1); -insert into t1 values (2); -insert into t2 values (1); -insert into t4 values (1,1); -explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 -1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where -select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 -left join t4 on id3 = id4 where id2 = 1 or id4 = 1; -id1 id2 id3 id4 id44 -1 1 NULL NULL NULL -drop table t1,t2,t3,t4; -create table t1(s varchar(10) not null); -create table t2(s varchar(10) not null primary key); -create table t3(s varchar(10) not null primary key); -insert into t1 values ('one\t'), ('two\t'); -insert into t2 values ('one\r'), ('two\t'); -insert into t3 values ('one '), ('two\t'); -select * from t1 where s = 'one'; -s -select * from t2 where s = 'one'; -s -select * from t3 where s = 'one'; -s -one -select * from t1,t2 where t1.s = t2.s; -s s -two two -select * from t2,t3 where t2.s = t3.s; -s s -two two -drop table t1, t2, t3; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref c,d d 5 const 2 Using where -1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) +cont_nr int(11) NOT NULL auto_increment, +ver_nr int(11) NOT NULL default '0', +aufnr int(11) NOT NULL default '0', +username varchar(50) NOT NULL default '', +hdl_nr int(11) NOT NULL default '0', +eintrag date NOT NULL default '0000-00-00', +st_klasse varchar(40) NOT NULL default '', +st_wert varchar(40) NOT NULL default '', +st_zusatz varchar(40) NOT NULL default '', +st_bemerkung varchar(255) NOT NULL default '', +kunden_art varchar(40) NOT NULL default '', +mcbs_knr int(11) default NULL, +mcbs_aufnr int(11) NOT NULL default '0', +schufa_status char(1) default '?', +bemerkung text, +wirknetz text, +wf_igz int(11) NOT NULL default '0', +tarifcode varchar(80) default NULL, +recycle char(1) default NULL, +sim varchar(30) default NULL, +mcbs_tpl varchar(30) default NULL, +emp_nr int(11) NOT NULL default '0', +laufzeit int(11) default NULL, +hdl_name varchar(30) default NULL, +prov_hdl_nr int(11) NOT NULL default '0', +auto_wirknetz varchar(50) default NULL, +auto_billing varchar(50) default NULL, +touch timestamp NOT NULL, +kategorie varchar(50) default NULL, +kundentyp varchar(20) NOT NULL default '', +sammel_rech_msisdn varchar(30) NOT NULL default '', +p_nr varchar(9) NOT NULL default '', +suffix char(3) NOT NULL default '', +PRIMARY KEY (cont_nr), +KEY idx_aufnr(aufnr), +KEY idx_hdl_nr(hdl_nr), +KEY idx_st_klasse(st_klasse), +KEY ver_nr(ver_nr), +KEY eintrag_idx(eintrag), +KEY emp_nr_idx(emp_nr), +KEY wf_igz(wf_igz), +KEY touch(touch), +KEY hdl_tag(eintrag,hdl_nr), +KEY prov_hdl_nr(prov_hdl_nr), +KEY mcbs_aufnr(mcbs_aufnr), +KEY kundentyp(kundentyp), +KEY p_nr(p_nr,suffix) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; -CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); -INSERT INTO t1 VALUES (0x8000000000000000); -SELECT b FROM t1 WHERE b=0x8000000000000000; -b -9223372036854775808 -DROP TABLE t1; -CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); -CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); -INSERT INTO `t2` VALUES (0,'READ'); -CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); -INSERT INTO `t3` VALUES (1,'fs'); -select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); -id name gid uid ident level -1 fs NULL NULL 0 READ -drop table t1,t2,t3; -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -select found_rows(); -found_rows() -0 -SELECT * FROM t1; -a b c -50 3 3 -select count(*) from t1; -count(*) -1 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 -DROP TABLE t1; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( -K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', -K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', -F2I4 int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO t1 VALUES -('W%RT', '0100', 1), -('W-RT', '0100', 1), -('WART', '0100', 1), -('WART', '0200', 1), -('WERT', '0100', 2), -('WORT','0200', 2), -('WT', '0100', 2), -('W_RT', '0100', 2), -('WaRT', '0100', 3), -('WART', '0300', 3), -('WRT' , '0400', 3), -('WURM', '0500', 3), -('W%T', '0600', 4), -('WA%T', '0700', 4), -('WA_T', '0800', 4); -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND -(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); -K2C4 K4N4 F2I4 -WART 0200 1 -SELECT K2C4, K4N4, F2I4 FROM t1 -WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); -K2C4 K4N4 F2I4 -WART 0100 1 -WART 0200 1 -WART 0300 3 -DROP TABLE t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -create table t1 (a int, b int); -create table t2 like t1; -select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; -a -select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; -a -select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; -a a a -drop table t1,t2; -create table t1 (s1 varchar(5)); -insert into t1 values ('Wall'); -select min(s1) from t1 group by s1 with rollup; -min(s1) -Wall -Wall -drop table t1; -create table t1 (s1 int) engine=myisam; -insert into t1 values (0); -select avg(distinct s1) from t1 group by s1 with rollup; -avg(distinct s1) -0.0000 -0.0000 -drop table t1; -create table t1 (s1 int); -insert into t1 values (null),(1); -select distinct avg(s1) as x from t1 group by s1 with rollup; -x -NULL -1.0000 -drop table t1; -create table t1 (a int(11)); -select all all * from t1; -a -select distinct distinct * from t1; -a -select all distinct * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -select distinct all * from t1; -ERROR HY000: Incorrect usage of ALL and DISTINCT -drop table t1; -CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); -CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); -INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); -INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ref a a 23 test.t1.a 2 -DROP TABLE t1, t2; -CREATE TABLE t1 (a int); -CREATE TABLE t2 (a int); -INSERT INTO t1 VALUES (1), (2), (3), (4), (5); -INSERT INTO t2 VALUES (2), (4), (6); -SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -a -2 -4 -EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where -EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where -DROP TABLE t1,t2; -select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 -16 16 2 2 -create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); -create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); -insert into t1 values (" 2", 2); -insert into t2 values (" 2", " one "),(" 2", " two "); -select * from t1 left join t2 on f1 = f3; -f1 f2 f3 f4 - 2 2 2 one - 2 2 2 two -drop table t1,t2; -create table t1 (empnum smallint, grp int); -create table t2 (empnum int, name char(5)); -insert into t1 values(1,1); -insert into t2 values(1,'bob'); -create view v1 as select * from t2 inner join t1 using (empnum); -select * from v1; -empnum name grp -1 bob 1 -drop table t1,t2; -drop view v1; -create table t1 (pk int primary key, b int); -create table t2 (pk int primary key, c int); -select pk from t1 inner join t2 using (pk); -pk -drop table t1,t2; -create table t1 (s1 int, s2 char(5), s3 decimal(10)); -create view v1 as select s1, s2, 'x' as s3 from t1; -select * from t1 natural join v1; -s1 s2 s3 -insert into t1 values (1,'x',5); -select * from t1 natural join v1; -s1 s2 s3 +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +Kundentyp kategorie +Privat (Private Nutzung) Mobilfunk Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; -drop view v1; -create table t1(a1 int); -create table t2(a2 int); -insert into t1 values(1),(2); -insert into t2 values(1),(2); -create view v2 (c) as select a1 from t1; -select * from t1 natural left join t2; -a1 a2 -1 1 -1 2 -2 1 -2 2 -select * from t1 natural right join t2; -a2 a1 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural left join t2; -c a2 -1 1 -1 2 -2 1 -2 2 -select * from v2 natural right join t2; -a2 c -1 1 -1 2 -2 1 -2 2 -drop table t1, t2; -drop view v2; -create table t1 (a int(10), t1_val int(10)); -create table t2 (b int(10), t2_val int(10)); -create table t3 (a int(10), b int(10)); -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(2,2),(3,3); -insert into t3 values (1,1),(2,1),(3,1),(4,1); -select * from t1 natural join t2 natural join t3; -a b t1_val t2_val -1 1 1 1 -2 1 2 1 -select * from t1 natural join t3 natural join t2; -b a t1_val t2_val -1 1 1 1 -1 2 2 1 -drop table t1, t2, t3; -DO IFNULL(NULL, NULL); -SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); -CAST(IFNULL(NULL, NULL) AS DECIMAL) -NULL -SELECT ABS(IFNULL(NULL, NULL)); -ABS(IFNULL(NULL, NULL)) -NULL -SELECT IFNULL(NULL, NULL); -IFNULL(NULL, NULL) -NULL -create table t1 (a char(1)); -create table t2 (a char(1)); -insert into t1 values ('a'),('b'),('c'); -insert into t2 values ('b'),('c'),('d'); -select a from t1 natural join t2; -a -b -c -select * from t1 natural join t2 where a = 'b'; -a -b -drop table t1, t2; -CREATE TABLE t1 (`id` TINYINT); -CREATE TABLE t2 (`id` TINYINT); -CREATE TABLE t3 (`id` TINYINT); -INSERT INTO t1 VALUES (1),(2),(3); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); -ERROR 23000: Column 'id' in from clause is ambiguous -drop table t1, t2, t3; -create table t1 (a int(10),b int(10)); -create table t2 (a int(10),b int(10)); -insert into t1 values (1,10),(2,20),(3,30); -insert into t2 values (1,10); -select * from t1 inner join t2 using (A); -a b b -1 10 10 -select * from t1 inner join t2 using (a); -a b b -1 10 10 -drop table t1, t2; -create table t1 (a int, c int); -create table t2 (b int); -create table t3 (b int, a int); -create table t4 (c int); -insert into t1 values (1,1); -insert into t2 values (1); -insert into t3 values (1,1); -insert into t4 values (1); -select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -a c b b a -1 1 1 1 1 -select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); -ERROR 42S22: Unknown column 't1.a' in 'on clause' -select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); -a c b b a c -1 1 1 1 1 1 -select * from t1 join t2 join t4 using (c); -c a b -1 1 1 -drop table t1, t2, t3, t4; +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Compression'; +Variable_name Value +Compression ON diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test index fb1c8793f33..46244edd2a8 100644 --- a/mysql-test/t/compress.test +++ b/mysql-test/t/compress.test @@ -3,15 +3,13 @@ -- source include/have_compress.inc - -# Reconnect to turn compress on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,COMPRESS); +connect (comp_con,localhost,root,,,,,COMPRESS); # Check compression turned on SHOW STATUS LIKE 'Compression'; # Source select test case --- source t/select.test +-- source include/common-tests.inc +# Check compression turned on +SHOW STATUS LIKE 'Compression'; diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index 921b3262013..de88569d74a 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -3,16 +3,15 @@ -- source include/have_openssl.inc -# Reconnect to turn ssl on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,SSL); +connect (ssl_con,localhost,root,,,,,SSL); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; # Source select test case --- source t/select.test +-- source include/common-tests.inc +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test index 2d40b85c33d..f5fe86e9a81 100644 --- a/mysql-test/t/ssl_compress.test +++ b/mysql-test/t/ssl_compress.test @@ -4,11 +4,7 @@ -- source include/have_openssl.inc -- source include/have_compress.inc - -# Reconnect to turn ssl and compress on for -# default connection -disconnect default; -connect (default,localhost,root,,,,,SSL COMPRESS); +connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS); # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; @@ -17,5 +13,10 @@ SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Compression'; # Source select test case --- source t/select.test +-- source include/common-tests.inc + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; +# Check compression turned on +SHOW STATUS LIKE 'Compression'; -- cgit v1.2.1 From b81f3ef1ef750f2ea5c4e4d71ced6c7429d5ab32 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 13 Oct 2005 15:52:22 +0200 Subject: Bug #12698 abnormal program termination running mysql_client_test - Move test for bug#93 from mysql_client_test.c to show_check.test - No need for test written in c --- mysql-test/r/show_check.result | 7 +++++++ mysql-test/t/show_check.test | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 1e5e8f442a8..9861daff409 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -513,3 +513,10 @@ t1 CREATE TABLE `t1` ( KEY `c2` USING BTREE (`c2`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +flush tables; +SHOW TABLE STATUS like 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm' +show create table t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index e6a404e3b57..d70903adbc4 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -378,4 +378,17 @@ create table t1 ( SHOW CREATE TABLE t1; DROP TABLE t1; +# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS + +flush tables; + +# Create a junk frm file on disk +system echo "this is a junk file for test" >> var/master-data/test/t1.frm ; +--replace_column 6 # 7 # 8 # 9 # +SHOW TABLE STATUS like 't1'; +--error 1033 +show create table t1; +drop table t1; + + # End of 4.1 tests -- cgit v1.2.1 From 39b0712cf76c1551ecbb4d051629fb76c72cf7df Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 19:16:19 +0500 Subject: type_binary.result, type_binary.test: new file mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh: Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding. Many files: Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes. Adding true BINARY/VARBINARY: new pad_char structure member. ctype-bin.c: Adding true BINARY/VARBINARY: new pad_char structure member. New strnxfrm, with two trailing length bytes. field.cc: Adding true BINARY/VARBINARY. --- mysql-test/r/alter_table.result | 2 +- mysql-test/r/binary.result | 2 +- mysql-test/r/cast.result | 2 +- mysql-test/r/ctype_cp1251.result | 2 +- mysql-test/r/ctype_many.result | 326 ++++++++++++++--------------- mysql-test/r/federated.result | 4 +- mysql-test/r/func_in.result | 2 +- mysql-test/r/ndb_condition_pushdown.result | 2 +- mysql-test/r/ndb_types.result | 2 +- mysql-test/r/sp.result | 2 +- mysql-test/r/system_mysql_db.result | 2 +- mysql-test/r/type_binary.result | 113 ++++++++++ mysql-test/r/type_blob.result | 6 +- mysql-test/t/alter_table.test | 2 +- mysql-test/t/binary.test | 2 +- mysql-test/t/cast.test | 2 +- mysql-test/t/ctype_cp1251.test | 2 +- mysql-test/t/ctype_many.test | 4 +- mysql-test/t/federated.test | 4 +- mysql-test/t/func_in.test | 2 +- mysql-test/t/ndb_condition_pushdown.test | 2 +- mysql-test/t/ndb_types.test | 2 +- mysql-test/t/sp.test | 2 +- mysql-test/t/type_binary.test | 67 ++++++ mysql-test/t/type_blob.test | 4 +- 25 files changed, 371 insertions(+), 191 deletions(-) create mode 100644 mysql-test/r/type_binary.result create mode 100644 mysql-test/t/type_binary.test (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 6a710a8de10..644d92b477e 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -436,7 +436,7 @@ alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; a hex(a) ÔÅÓÔ F2E5F1F2 -alter table t1 change a a binary(10); +alter table t1 change a a binary(4); select a,hex(a) from t1; a hex(a) òåñò F2E5F1F2 diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 5b5f673b071..a8d6c3bf411 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -85,7 +85,7 @@ NULL select b from t1 having binary b like ''; b drop table t1; -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(3) binary, b binary(3)); insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index fa8e810cf2b..9f79a15a181 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -231,7 +231,7 @@ t1 CREATE TABLE `t1` ( `c5` varchar(2) character set utf8 NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -create table t1 (a binary(10), b char(10) character set koi8r); +create table t1 (a binary(4), b char(4) character set koi8r); insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ'); select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; a b cast(a as char character set cp1251) cast(b as binary) diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index c65055e726d..47797af3cbe 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -23,7 +23,7 @@ a b c drop table t1; -create table t1 (a char(15) binary, b binary(15)) character set cp1251; +create table t1 (a char(3) binary, b binary(3)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 87b83acfe0f..125a3fc4286 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -340,7 +340,7 @@ CYR CAPIT SOFT SIGN CYR CAPIT E ü ü CYR CAPIT YU à à CYR CAPIT YA ñ ñ -ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default ''; +ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default ''; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f) @@ -1331,146 +1331,146 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; -SELECT * FROM t1; -comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f -LAT SMALL A a a a a -LAT SMALL B b b b b -LAT SMALL C c c c c -LAT SMALL D d d d d -LAT SMALL E e e e e -LAT SMALL F f f f f -LAT SMALL G g g g g -LAT SMALL H h h h h -LAT SMALL I i i i i -LAT SMALL J j j j j -LAT SMALL K k k k k -LAT SMALL L l l l l -LAT SMALL M m m m m -LAT SMALL N n n n n -LAT SMALL O o o o o -LAT SMALL P p p p p -LAT SMALL Q q q q q -LAT SMALL R r r r r -LAT SMALL S s s s s -LAT SMALL T t t t t -LAT SMALL U u u u u -LAT SMALL V v v v v -LAT SMALL W w w w w -LAT SMALL X x x x x -LAT SMALL Y y y y y -LAT SMALL Z z z z z -LAT CAPIT A A A A A -LAT CAPIT B B B B B -LAT CAPIT C C C C C -LAT CAPIT D D D D D -LAT CAPIT E E E E E -LAT CAPIT F F F F F -LAT CAPIT G G G G G -LAT CAPIT H H H H H -LAT CAPIT I I I I I -LAT CAPIT J J J J J -LAT CAPIT K K K K K -LAT CAPIT L L L L L -LAT CAPIT M M M M M -LAT CAPIT N N N N N -LAT CAPIT O O O O O -LAT CAPIT P P P P P -LAT CAPIT Q Q Q Q Q -LAT CAPIT R R R R R -LAT CAPIT S S S S S -LAT CAPIT T T T T T -LAT CAPIT U U U U U -LAT CAPIT V V V V V -LAT CAPIT W W W W W -LAT CAPIT X X X X X -LAT CAPIT Y Y Y Y Y -LAT CAPIT Z Z Z Z Z -CYR SMALL A а а Á а -CYR SMALL BE б б  б -CYR SMALL VE в в × Ð² -CYR SMALL GE г г Ç Ð³ -CYR SMALL DE д д Ä Ð´ -CYR SMALL IE е е Šе -CYR SMALL IO Ñ‘ Ñ‘ £ Ñ‘ -CYR SMALL ZHE ж ж Ö Ð¶ -CYR SMALL ZE з з Ú Ð· -CYR SMALL I и и É Ð¸ -CYR SMALL KA к к Ë Ðº -CYR SMALL EL л л Ì Ð» -CYR SMALL EM м м Í Ð¼ -CYR SMALL EN н н Πн -CYR SMALL O о о Ï Ð¾ -CYR SMALL PE п п Рп -CYR SMALL ER Ñ€ Ñ€ Ò Ñ€ -CYR SMALL ES Ñ Ñ Ó Ñ -CYR SMALL TE Ñ‚ Ñ‚ Ô Ñ‚ -CYR SMALL U у у Õ Ñƒ -CYR SMALL EF Ñ„ Ñ„ Æ Ñ„ -CYR SMALL HA Ñ… Ñ… È Ñ… -CYR SMALL TSE ц ц à ц -CYR SMALL CHE ч ч Þ Ñ‡ -CYR SMALL SHA ш ш Û Ñˆ -CYR SMALL SCHA щ щ Ý Ñ‰ -CYR SMALL HARD SIGN ÑŠ ÑŠ ß ÑŠ -CYR SMALL YERU Ñ‹ Ñ‹ Ù Ñ‹ -CYR SMALL SOFT SIGN ÑŒ ÑŒ Ø ÑŒ -CYR SMALL E Ñ Ñ Ü Ñ -CYR SMALL YU ÑŽ ÑŽ À ÑŽ -CYR SMALL YA Ñ Ñ Ñ Ñ -CYR CAPIT A Ð Ð á Ð -CYR CAPIT BE Б Б â Б -CYR CAPIT VE Ð’ Ð’ ÷ Ð’ -CYR CAPIT GE Г Г ç Г -CYR CAPIT DE Д Д ä Д -CYR CAPIT IE Е Е å Е -CYR CAPIT IO Ð Ð ³ Ð -CYR CAPIT ZHE Ж Ж ö Ж -CYR CAPIT ZE З З ú З -CYR CAPIT I И И é И -CYR CAPIT KA К К ë К -CYR CAPIT EL Л Л ì Л -CYR CAPIT EM Ðœ Ðœ í Ðœ -CYR CAPIT EN Ð Ð î Ð -CYR CAPIT O О О ï О -CYR CAPIT PE П П ð П -CYR CAPIT ER Р Р ò Р -CYR CAPIT ES С С ó С -CYR CAPIT TE Т Т ô Т -CYR CAPIT U У У õ У -CYR CAPIT EF Ф Ф æ Ф -CYR CAPIT HA Ð¥ Ð¥ è Ð¥ -CYR CAPIT TSE Ц Ц ã Ц -CYR CAPIT CHE Ч Ч þ Ч -CYR CAPIT SHA Ш Ш û Ш -CYR CAPIT SCHA Щ Щ ý Щ -CYR CAPIT HARD SIGN Ъ Ъ ÿ Ъ -CYR CAPIT YERU Ы Ы ù Ы -CYR CAPIT SOFT SIGN Ь Ь ø Ь -CYR CAPIT E Э Э ü Э -CYR CAPIT YU Ю Ю à Ю -CYR CAPIT YA Я Я ñ Я -GREEK CAPIT ALPHA Α Α Α -GREEK CAPIT BETA Î’ Î’ Î’ -GREEK CAPIT GAMMA Γ Γ Γ -GREEK CAPIT DELTA Δ Δ Δ -GREEK CAPIT EPSILON Ε Ε Ε -GREEK SMALL ALPHA α α α -GREEK SMALL BETA β β β -GREEK SMALL GAMMA γ γ γ -GREEK SMALL DELTA δ δ δ -GREEK SMALL EPSILON ε ε ε -ARMENIAN CAPIT AYB Ô± Ô± Ô± -ARMENIAN CAPIT BEN Ô² Ô² Ô² -ARMENIAN CAPIT GIM Ô³ Ô³ Ô³ -ARMENIAN CAPIT DA Ô´ Ô´ Ô´ -ARMENIAN CAPIT ECH Ôµ Ôµ Ôµ -ARMENIAN CAPIT ZA Ô¶ Ô¶ Ô¶ -ARMENIAN SMALL YAB Õ¡ Õ¡ Õ¡ -ARMENIAN SMALL BEN Õ¢ Õ¢ Õ¢ -ARMENIAN SMALL GIM Õ£ Õ£ Õ£ -ARMENIAN SMALL DA Õ¤ Õ¤ Õ¤ -ARMENIAN SMALL ECH Õ¥ Õ¥ Õ¥ -ARMENIAN SMALL ZA Õ¦ Õ¦ Õ¦ +SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1; +comment koi8_ru_f utf8_f hex(bin_f) ucs2_f armscii8_f greek_f +LAT SMALL A a a 61 a +LAT SMALL B b b 62 b +LAT SMALL C c c 63 c +LAT SMALL D d d 64 d +LAT SMALL E e e 65 e +LAT SMALL F f f 66 f +LAT SMALL G g g 67 g +LAT SMALL H h h 68 h +LAT SMALL I i i 69 i +LAT SMALL J j j 6A j +LAT SMALL K k k 6B k +LAT SMALL L l l 6C l +LAT SMALL M m m 6D m +LAT SMALL N n n 6E n +LAT SMALL O o o 6F o +LAT SMALL P p p 70 p +LAT SMALL Q q q 71 q +LAT SMALL R r r 72 r +LAT SMALL S s s 73 s +LAT SMALL T t t 74 t +LAT SMALL U u u 75 u +LAT SMALL V v v 76 v +LAT SMALL W w w 77 w +LAT SMALL X x x 78 x +LAT SMALL Y y y 79 y +LAT SMALL Z z z 7A z +LAT CAPIT A A A 41 A +LAT CAPIT B B B 42 B +LAT CAPIT C C C 43 C +LAT CAPIT D D D 44 D +LAT CAPIT E E E 45 E +LAT CAPIT F F F 46 F +LAT CAPIT G G G 47 G +LAT CAPIT H H H 48 H +LAT CAPIT I I I 49 I +LAT CAPIT J J J 4A J +LAT CAPIT K K K 4B K +LAT CAPIT L L L 4C L +LAT CAPIT M M M 4D M +LAT CAPIT N N N 4E N +LAT CAPIT O O O 4F O +LAT CAPIT P P P 50 P +LAT CAPIT Q Q Q 51 Q +LAT CAPIT R R R 52 R +LAT CAPIT S S S 53 S +LAT CAPIT T T T 54 T +LAT CAPIT U U U 55 U +LAT CAPIT V V V 56 V +LAT CAPIT W W W 57 W +LAT CAPIT X X X 58 X +LAT CAPIT Y Y Y 59 Y +LAT CAPIT Z Z Z 5A Z +CYR SMALL A а а C1 а +CYR SMALL BE б б C2 б +CYR SMALL VE в в D7 в +CYR SMALL GE г г C7 г +CYR SMALL DE д д C4 д +CYR SMALL IE е е C5 е +CYR SMALL IO Ñ‘ Ñ‘ A3 Ñ‘ +CYR SMALL ZHE ж ж D6 ж +CYR SMALL ZE з з DA з +CYR SMALL I и и C9 и +CYR SMALL KA к к CB к +CYR SMALL EL л л CC л +CYR SMALL EM м м CD м +CYR SMALL EN н н CE н +CYR SMALL O о о CF о +CYR SMALL PE п п D0 п +CYR SMALL ER Ñ€ Ñ€ D2 Ñ€ +CYR SMALL ES Ñ Ñ D3 Ñ +CYR SMALL TE Ñ‚ Ñ‚ D4 Ñ‚ +CYR SMALL U у у D5 у +CYR SMALL EF Ñ„ Ñ„ C6 Ñ„ +CYR SMALL HA Ñ… Ñ… C8 Ñ… +CYR SMALL TSE ц ц C3 ц +CYR SMALL CHE ч ч DE ч +CYR SMALL SHA ш ш DB ш +CYR SMALL SCHA щ щ DD щ +CYR SMALL HARD SIGN ÑŠ ÑŠ DF ÑŠ +CYR SMALL YERU Ñ‹ Ñ‹ D9 Ñ‹ +CYR SMALL SOFT SIGN ÑŒ ÑŒ D8 ÑŒ +CYR SMALL E Ñ Ñ DC Ñ +CYR SMALL YU ÑŽ ÑŽ C0 ÑŽ +CYR SMALL YA Ñ Ñ D1 Ñ +CYR CAPIT A Ð Ð E1 Ð +CYR CAPIT BE Б Б E2 Б +CYR CAPIT VE Ð’ Ð’ F7 Ð’ +CYR CAPIT GE Г Г E7 Г +CYR CAPIT DE Д Д E4 Д +CYR CAPIT IE Е Е E5 Е +CYR CAPIT IO Ð Ð B3 Ð +CYR CAPIT ZHE Ж Ж F6 Ж +CYR CAPIT ZE З З FA З +CYR CAPIT I И И E9 И +CYR CAPIT KA К К EB К +CYR CAPIT EL Л Л EC Л +CYR CAPIT EM Ðœ Ðœ ED Ðœ +CYR CAPIT EN Ð Ð EE Ð +CYR CAPIT O О О EF О +CYR CAPIT PE П П F0 П +CYR CAPIT ER Р Р F2 Р +CYR CAPIT ES С С F3 С +CYR CAPIT TE Т Т F4 Т +CYR CAPIT U У У F5 У +CYR CAPIT EF Ф Ф E6 Ф +CYR CAPIT HA Ð¥ Ð¥ E8 Ð¥ +CYR CAPIT TSE Ц Ц E3 Ц +CYR CAPIT CHE Ч Ч FE Ч +CYR CAPIT SHA Ш Ш FB Ш +CYR CAPIT SCHA Щ Щ FD Щ +CYR CAPIT HARD SIGN Ъ Ъ FF Ъ +CYR CAPIT YERU Ы Ы F9 Ы +CYR CAPIT SOFT SIGN Ь Ь F8 Ь +CYR CAPIT E Э Э FC Э +CYR CAPIT YU Ю Ю E0 Ю +CYR CAPIT YA Я Я F1 Я +GREEK CAPIT ALPHA Α 00 Α Α +GREEK CAPIT BETA Î’ 00 Î’ Î’ +GREEK CAPIT GAMMA Γ 00 Γ Γ +GREEK CAPIT DELTA Δ 00 Δ Δ +GREEK CAPIT EPSILON Ε 00 Ε Ε +GREEK SMALL ALPHA α 00 α α +GREEK SMALL BETA β 00 β β +GREEK SMALL GAMMA γ 00 γ γ +GREEK SMALL DELTA δ 00 δ δ +GREEK SMALL EPSILON ε 00 ε ε +ARMENIAN CAPIT AYB Ô± 00 Ô± Ô± +ARMENIAN CAPIT BEN Ô² 00 Ô² Ô² +ARMENIAN CAPIT GIM Ô³ 00 Ô³ Ô³ +ARMENIAN CAPIT DA Ô´ 00 Ô´ Ô´ +ARMENIAN CAPIT ECH Ôµ 00 Ôµ Ôµ +ARMENIAN CAPIT ZA Ô¶ 00 Ô¶ Ô¶ +ARMENIAN SMALL YAB Õ¡ 00 Õ¡ Õ¡ +ARMENIAN SMALL BEN Õ¢ 00 Õ¢ Õ¢ +ARMENIAN SMALL GIM Õ£ 00 Õ£ Õ£ +ARMENIAN SMALL DA Õ¤ 00 Õ¤ Õ¤ +ARMENIAN SMALL ECH Õ¥ 00 Õ¥ Õ¥ +ARMENIAN SMALL ZA Õ¦ 00 Õ¦ Õ¦ SET CHARACTER SET 'binary'; SELECT * FROM t1; comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f @@ -1590,28 +1590,28 @@ CYR CAPIT SOFT SIGN CYR CAPIT E ü Э ü - CYR CAPIT YU à Ю à . CYR CAPIT YA ñ Я ñ / -GREEK CAPIT ALPHA Α ‘ Á -GREEK CAPIT BETA Î’ ’  -GREEK CAPIT GAMMA Γ “ à -GREEK CAPIT DELTA Δ ” Ä -GREEK CAPIT EPSILON Ε • Å -GREEK SMALL ALPHA α ± á -GREEK SMALL BETA β ² â -GREEK SMALL GAMMA γ ³ ã -GREEK SMALL DELTA δ ´ ä -GREEK SMALL EPSILON ε µ å -ARMENIAN CAPIT AYB Ô± 1 ² -ARMENIAN CAPIT BEN Ô² 2 ´ -ARMENIAN CAPIT GIM Ô³ 3 ¶ -ARMENIAN CAPIT DA Ô´ 4 ¸ -ARMENIAN CAPIT ECH Ôµ 5 º -ARMENIAN CAPIT ZA Ô¶ 6 ¼ -ARMENIAN SMALL YAB Õ¡ a ³ -ARMENIAN SMALL BEN Õ¢ b µ -ARMENIAN SMALL GIM Õ£ c · -ARMENIAN SMALL DA Õ¤ d ¹ -ARMENIAN SMALL ECH Õ¥ e » -ARMENIAN SMALL ZA Õ¦ f ½ +GREEK CAPIT ALPHA Α ‘ Á +GREEK CAPIT BETA Î’ ’  +GREEK CAPIT GAMMA Γ “ à +GREEK CAPIT DELTA Δ ” Ä +GREEK CAPIT EPSILON Ε • Å +GREEK SMALL ALPHA α ± á +GREEK SMALL BETA β ² â +GREEK SMALL GAMMA γ ³ ã +GREEK SMALL DELTA δ ´ ä +GREEK SMALL EPSILON ε µ å +ARMENIAN CAPIT AYB Ô± 1 ² +ARMENIAN CAPIT BEN Ô² 2 ´ +ARMENIAN CAPIT GIM Ô³ 3 ¶ +ARMENIAN CAPIT DA Ô´ 4 ¸ +ARMENIAN CAPIT ECH Ôµ 5 º +ARMENIAN CAPIT ZA Ô¶ 6 ¼ +ARMENIAN SMALL YAB Õ¡ a ³ +ARMENIAN SMALL BEN Õ¢ b µ +ARMENIAN SMALL GIM Õ£ c · +ARMENIAN SMALL DA Õ¤ d ¹ +ARMENIAN SMALL ECH Õ¥ e » +ARMENIAN SMALL ZA Õ¦ f ½ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; min(comment) count(*) LAT CAPIT A 2 diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index e0e0bba3271..b5a1016987e 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -504,7 +504,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', -`bincol` binary(4) NOT NULL, +`bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), @@ -515,7 +515,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', -`bincol` binary(4) NOT NULL, +`bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 8562937f1ac..60022ae0d8f 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -187,7 +187,7 @@ select 1 in ('1.1',2); select 1 in ('1.1',2.0); 1 in ('1.1',2.0) 0 -create table t1 (a char(20) character set binary); +create table t1 (a char(2) character set binary); insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); a diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 1c3da1b486f..3e46a487c07 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -3,7 +3,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10), vstring varchar(10), -bin binary(7), +bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/r/ndb_types.result b/mysql-test/r/ndb_types.result index 37ce7732f65..6938277f01d 100644 --- a/mysql-test/r/ndb_types.result +++ b/mysql-test/r/ndb_types.result @@ -3,7 +3,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", vstring varchar(10) default "hello", -bin binary(7), +bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1b8cde6d3db..e3e379ac65d 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1916,7 +1916,7 @@ select bug3788()| bug3788() 2005-03-04 drop function bug3788| -create function bug3788() returns binary(5) return 5| +create function bug3788() returns binary(1) return 5| select bug3788()| bug3788() 5 diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index f68c4805d72..999f12a0573 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -73,7 +73,7 @@ Table Create Table user CREATE TABLE `user` ( `Host` char(60) collate utf8_bin NOT NULL default '', `User` char(16) collate utf8_bin NOT NULL default '', - `Password` binary(41) NOT NULL default '', + `Password` char(41) character set latin1 collate latin1_bin NOT NULL default '', `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result new file mode 100644 index 00000000000..49fd7ba5633 --- /dev/null +++ b/mysql-test/r/type_binary.result @@ -0,0 +1,113 @@ +create table t1 (s1 binary(3)); +insert into t1 values (0x61), (0x6120), (0x612020); +select hex(s1) from t1; +hex(s1) +610000 +612000 +612020 +drop table t1; +create table t1 (s1 binary(2), s2 varbinary(2)); +insert into t1 values (0x4100,0x4100); +select length(concat('*',s1,'*',s2,'*')) from t1; +length(concat('*',s1,'*',s2,'*')) +7 +delete from t1; +insert into t1 values (0x4120,0x4120); +select length(concat('*',s1,'*',s2,'*')) from t1; +length(concat('*',s1,'*',s2,'*')) +7 +drop table t1; +create table t1 (s1 varbinary(20), s2 varbinary(20)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varbinary(20) default NULL, + `s2` varbinary(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120); +select hex(s1), hex(s2) from t1; +hex(s1) hex(s2) +41 4100 +41 4120 +4100 4120 +select count(*) from t1 where s1 < s2; +count(*) +3 +drop table t1; +create table t1 (s1 varbinary(2), s2 varchar(1)); +insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d'); +select hex(s1),s2 from t1 order by s1,s2; +hex(s1) s2 +41 a +41 c +4100 b +4100 d +drop table t1; +create table t1 (s1 binary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +ERROR 23000: Duplicate entry '' for key 1 +select hex(s1) from t1 order by s1; +hex(s1) +0100 +0120 +select hex(s1) from t1 where s1=0x01; +hex(s1) +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +2 +alter table t1 drop primary key; +select hex(s1) from t1 where s1=0x01; +hex(s1) +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +2 +drop table t1; +create table t1 (s1 varbinary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +hex(s1) +01 +0100 +0120 +select hex(s1) from t1 where s1=0x01; +hex(s1) +01 +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +3 +alter table t1 drop primary key; +select hex(s1) from t1 where s1=0x01; +hex(s1) +01 +select hex(s1) from t1 where s1=0x0120; +hex(s1) +0120 +select hex(s1) from t1 where s1=0x0100; +hex(s1) +0100 +select count(distinct s1) from t1; +count(distinct s1) +3 +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 193ed298339..fd478c916c9 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -67,7 +67,7 @@ select * from t1; a Where drop table t1; -create table t1 (t text,c char(10),b blob, d binary(10)); +create table t1 (t text,c char(10),b blob, d varbinary(10)); insert into t1 values (NULL,NULL,NULL,NULL); insert into t1 values ("","","",""); insert into t1 values ("hello","hello","hello","hello"); @@ -83,14 +83,14 @@ Field Type Collation Null Key Default Extra Privileges Comment t text latin1_swedish_ci YES NULL # c char(10) latin1_swedish_ci YES NULL # b blob NULL YES NULL # -d binary(10) NULL YES NULL # +d varbinary(10) NULL YES NULL # lock tables t1 WRITE; show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment t text latin1_swedish_ci YES NULL # c char(10) latin1_swedish_ci YES NULL # b blob NULL YES NULL # -d binary(10) NULL YES NULL # +d varbinary(10) NULL YES NULL # unlock tables; select t from t1 where t like "hello"; t diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5695822be6b..bc3a4b0261d 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -278,7 +278,7 @@ insert into t1 values (' select a,hex(a) from t1; alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; -alter table t1 change a a binary(10); +alter table t1 change a a binary(4); select a,hex(a) from t1; alter table t1 change a a char(10) character set cp1251; select a,hex(a) from t1; diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 02773b32302..1ac0cfebb28 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -56,7 +56,7 @@ drop table t1; # # Test of binary and upper/lower # -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(3) binary, b binary(3)); insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; select lower(a),lower(b) from t1; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 6220b4cbae7..ca16791d9af 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -101,7 +101,7 @@ drop table t1; # Bug 2202 # CAST from BINARY to non-BINARY and from non-BINARY to BINARY # -create table t1 (a binary(10), b char(10) character set koi8r); +create table t1 (a binary(4), b char(4) character set koi8r); insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ'); select a,b,cast(a as char character set cp1251),cast(b as binary) from t1; set names koi8r; diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 1aafe7b7266..463a9cea4bc 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -21,7 +21,7 @@ drop table t1; # # Test of binary and upper/lower # -create table t1 (a char(15) binary, b binary(15)) character set cp1251; +create table t1 (a char(3) binary, b binary(3)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; select lower(a),lower(b) from t1; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 22e844c6868..0903c3dd7fa 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -148,7 +148,7 @@ SET CHARACTER SET koi8r; SELECT * FROM t1; -ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default ''; +ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default ''; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; @@ -204,7 +204,7 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; -SELECT * FROM t1; +SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1; SET CHARACTER SET 'binary'; SELECT * FROM t1; SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index c401468a940..43679c54caf 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -348,7 +348,7 @@ DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(4) NOT NULL, + `bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), @@ -363,7 +363,7 @@ DROP TABLE IF EXISTS federated.t1; eval CREATE TABLE federated.t1 ( `id` int NOT NULL auto_increment, `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(4) NOT NULL, + `bincol` binary(1) NOT NULL, `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, `other` int NOT NULL DEFAULT 0, PRIMARY KEY (id), diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index dd4edd8ca48..0472968f918 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -97,7 +97,7 @@ select 1 in ('1.1',2.0); # Test case for bug #6365 -create table t1 (a char(20) character set binary); +create table t1 (a char(2) character set binary); insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test index d090d12e81b..9f512430085 100644 --- a/mysql-test/t/ndb_condition_pushdown.test +++ b/mysql-test/t/ndb_condition_pushdown.test @@ -12,7 +12,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10), vstring varchar(10), - bin binary(7), + bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test index 3446a409b2a..10b8eb87e2c 100644 --- a/mysql-test/t/ndb_types.test +++ b/mysql-test/t/ndb_types.test @@ -12,7 +12,7 @@ CREATE TABLE t1 ( auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", vstring varchar(10) default "hello", - bin binary(7), + bin binary(2), vbin varbinary(7), tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index e16e7456056..1f4d5b6bad5 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -2431,7 +2431,7 @@ create function bug3788() returns date return cast("2005-03-04" as date)| select bug3788()| drop function bug3788| -create function bug3788() returns binary(5) return 5| +create function bug3788() returns binary(1) return 5| select bug3788()| drop function bug3788| diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test new file mode 100644 index 00000000000..b5928cb14c4 --- /dev/null +++ b/mysql-test/t/type_binary.test @@ -0,0 +1,67 @@ +# check 0x00 padding +create table t1 (s1 binary(3)); +insert into t1 values (0x61), (0x6120), (0x612020); +select hex(s1) from t1; +drop table t1; + +# check that 0x00 is not stripped in val_str +create table t1 (s1 binary(2), s2 varbinary(2)); +insert into t1 values (0x4100,0x4100); +select length(concat('*',s1,'*',s2,'*')) from t1; +delete from t1; +insert into t1 values (0x4120,0x4120); +select length(concat('*',s1,'*',s2,'*')) from t1; +drop table t1; + +# check that trailing 0x00 and 0x20 do matter on comparison +create table t1 (s1 varbinary(20), s2 varbinary(20)); +show create table t1; +insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120); +select hex(s1), hex(s2) from t1; +select count(*) from t1 where s1 < s2; +drop table t1; + +# check that trailing 0x00 do matter on filesort +create table t1 (s1 varbinary(2), s2 varchar(1)); +insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d'); +select hex(s1),s2 from t1 order by s1,s2; +drop table t1; + +# check that 0x01 is padded to 0x0100 and thus we get a duplicate value +create table t1 (s1 binary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +--error 1062 +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +# check index search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +alter table t1 drop primary key; +# check non-indexed search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +drop table t1; + +# check that 0x01 is not padded, and all three values are unique +create table t1 (s1 varbinary(2) primary key); +insert into t1 values (0x01); +insert into t1 values (0x0120); +insert into t1 values (0x0100); +select hex(s1) from t1 order by s1; +# check index search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +alter table t1 drop primary key; +# check non-indexed search +select hex(s1) from t1 where s1=0x01; +select hex(s1) from t1 where s1=0x0120; +select hex(s1) from t1 where s1=0x0100; +select count(distinct s1) from t1; +drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 1ec5c600296..4f3c02b0465 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -67,9 +67,9 @@ select * from t1; drop table t1; # -# test of blob, text, char and char binary +# test of blob, text, char and varbinary # -create table t1 (t text,c char(10),b blob, d binary(10)); +create table t1 (t text,c char(10),b blob, d varbinary(10)); insert into t1 values (NULL,NULL,NULL,NULL); insert into t1 values ("","","",""); insert into t1 values ("hello","hello","hello","hello"); -- cgit v1.2.1 From c933505d2da835169be6a5c80cffd2c2b1aa377c Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Thu, 13 Oct 2005 19:23:52 +0500 Subject: Fix for bug #3874 (Group by field is not considered) --- mysql-test/r/select.result | 36 ++++++++++++++++++++++++++++++++++++ mysql-test/t/select.test | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 299e0b6bf33..11a50d6cabc 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2441,3 +2441,39 @@ a c SELECT a, b AS c FROM t1 ORDER BY b+1; a c drop table t1; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), +(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +1 10 2 +1 11 2 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +1 10 2 +1 11 2 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 2adf4f1749c..2607a00bed4 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1992,3 +1992,24 @@ CREATE TABLE t1 (a INT, b INT); SELECT a, b AS c FROM t1 ORDER BY c+1; SELECT a, b AS c FROM t1 ORDER BY b+1; drop table t1; + +# +# Bug #3874 (function in GROUP and LEFT JOIN) +# + +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), + (1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +DROP TABLE IF EXISTS t1, t2; + -- cgit v1.2.1 From 7c81d7fc6928f47be54cdf58d0e6d0a3f3c39260 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 19:24:47 +0500 Subject: ctype_utf8.result, ctype_utf8.test: New syntax: CHAR(x USING charset) Adding test case. sql_yacc.yy: New syntax: CHAR(x USING charset) Adding new parser rule. item_strfunc.h: New syntax: CHAR(x USING charset) Adding a new constructor. --- mysql-test/r/ctype_utf8.result | 72 ++++++++++++++++++++++++------------------ mysql-test/t/ctype_utf8.test | 34 +++++++++++++------- 2 files changed, 63 insertions(+), 43 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 5516be88b75..5104d3d9d42 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1064,46 +1064,56 @@ xxx yyy DROP TABLE t1; set names utf8; -select hex(char(1)); -hex(char(1)) +select hex(char(1 using utf8)); +hex(char(1 using utf8)) 01 -select char(0xd1,0x8f); -char(0xd1,0x8f) +select char(0xd1,0x8f using utf8); +char(0xd1,0x8f using utf8) Ñ -select char(0xd18f); -char(0xd18f) +select char(0xd18f using utf8); +char(0xd18f using utf8) Ñ -select char(53647); -char(53647) +select char(53647 using utf8); +char(53647 using utf8) Ñ -select char(0xff,0x8f); -char(0xff,0x8f) +select char(0xff,0x8f using utf8); +char(0xff,0x8f using utf8) ÿ +Warnings: +Warning 1300 Invalid utf8 character string: 'FF8F' set sql_mode=traditional; -select char(0xff,0x8f); -char(0xff,0x8f) -ÿ -select convert(char(0xff,0x8f) using utf8); -convert(char(0xff,0x8f) using utf8) -ÿ -select char(195); -char(195) -à -select convert(char(195) using utf8); -convert(char(195) using utf8) -à -select char(196); -char(196) -Ä -select convert(char(196) using utf8); -convert(char(196) using utf8) -Ä +select char(0xff,0x8f using utf8); +char(0xff,0x8f using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FF8F' +select char(195 using utf8); +char(195 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C3' +select char(196 using utf8); +char(196 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'C4' +select char(2557 using utf8); +char(2557 using utf8) +NULL +Warnings: +Error 1300 Invalid utf8 character string: 'FD' +select hex(convert(char(2557 using latin1) using utf8)); +hex(convert(char(2557 using latin1) using utf8)) +09C3BD +select hex(char(195)); +hex(char(195)) +C3 +select hex(char(196)); +hex(char(196)) +C4 select hex(char(2557)); hex(char(2557)) 09FD -select hex(convert(char(2557) using utf8)); -hex(convert(char(2557) using utf8)) -09FD set names utf8; create table t1 (a char(1)) default character set utf8; create table t2 (a char(1)) default character set utf8; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index d186ca8a1f6..8f695ef315c 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -871,22 +871,32 @@ DROP TABLE t1; # set names utf8; # correct value -select hex(char(1)); -select char(0xd1,0x8f); -select char(0xd18f); -select char(53647); +select hex(char(1 using utf8)); +select char(0xd1,0x8f using utf8); +select char(0xd18f using utf8); +select char(53647 using utf8); # incorrect value: return with warning -select char(0xff,0x8f); +select char(0xff,0x8f using utf8); # incorrect value in strict mode: return NULL with "Error" level warning set sql_mode=traditional; -select char(0xff,0x8f); -select convert(char(0xff,0x8f) using utf8); -select char(195); -select convert(char(195) using utf8); -select char(196); -select convert(char(196) using utf8); +select char(0xff,0x8f using utf8); +select char(195 using utf8); +select char(196 using utf8); +select char(2557 using utf8); + +# +# Check convert + char + using +# +select hex(convert(char(2557 using latin1) using utf8)); + +# +# char() without USING returns "binary" by default, any argument is ok +# +select hex(char(195)); +select hex(char(196)); select hex(char(2557)); -select hex(convert(char(2557) using utf8)); + + # # Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters -- cgit v1.2.1 From 27d8bc5b1fae0b384250922f1b5983c5bd79dfbc Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Thu, 13 Oct 2005 19:51:07 +0500 Subject: merging --- mysql-test/r/select.result | 55 ---------------------------------------------- mysql-test/t/select.test | 1 - 2 files changed, 56 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 025bd1c6ba5..be46d180f2d 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2653,60 +2653,6 @@ t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL select 123 as a from t1 where f1 is null; a drop table t1,t11; -CREATE TABLE t1 ( -kunde_intern_id int(10) unsigned NOT NULL default '0', -kunde_id int(10) unsigned NOT NULL default '0', -FK_firma_id int(10) unsigned NOT NULL default '0', -aktuell enum('Ja','Nein') NOT NULL default 'Ja', -vorname varchar(128) NOT NULL default '', -nachname varchar(128) NOT NULL default '', -geloescht enum('Ja','Nein') NOT NULL default 'Nein', -firma varchar(128) NOT NULL default '' -); -INSERT INTO t1 VALUES -(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), -(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 -WHERE -( -( -( '' != '' AND firma LIKE CONCAT('%', '', '%')) -OR -(vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND -'Vorname1' != '' AND 'xxxx' != '') -) -AND -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, -geloescht FROM t1 -WHERE -( -( -aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 -) -AND -( -( '' != '' AND firma LIKE CONCAT('%', '', '%') ) -OR -( vorname LIKE CONCAT('%', 'Vorname1', '%') AND -nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND -'xxxx' != '') -) -) -; -kunde_id FK_firma_id aktuell vorname nachname geloescht -SELECT COUNT(*) FROM t1 WHERE -( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) -AND FK_firma_id = 2; -COUNT(*) -0 -drop table t1; CREATE TABLE t1 (a INT, b INT); (SELECT a, b AS c FROM t1) ORDER BY c+1; a c @@ -2717,7 +2663,6 @@ a c SELECT a, b AS c FROM t1 ORDER BY b+1; a c drop table t1; -DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 938518fcb14..56fab52729e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2213,7 +2213,6 @@ drop table t1; # Bug #3874 (function in GROUP and LEFT JOIN) # -DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); -- cgit v1.2.1 From bf1a3bc030b20255ae582bbf436743604dc70431 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 21:28:44 +0500 Subject: select.result, mysqldump-max.result: after merge fix. range.result: fixing result accordingly , cast.result: after merge fix range.test: Avoid SELECT'ing of BINARY column not to output 0x00 bytes. --- mysql-test/r/cast.result | 6 +++--- mysql-test/r/mysqldump-max.result | 6 ++++++ mysql-test/r/range.result | 6 +++--- mysql-test/r/select.result | 20 ++++++++++---------- mysql-test/t/range.test | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 6246d574a82..817be3a2e7c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -334,6 +334,9 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 select cast('1.2' as decimal(3,2)); cast('1.2' as decimal(3,2)) 1.20 @@ -367,6 +370,3 @@ DROP TABLE t1; select cast(NULL as decimal(6)) as t1; t1 NULL -select cast(1.0e+300 as signed int); -cast(1.0e+300 as signed int) -9223372036854775807 diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 699552bd514..39d607910aa 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -99,6 +99,8 @@ id name /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -167,6 +169,7 @@ CREATE TABLE `t6` ( /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -181,6 +184,8 @@ INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first va /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -249,6 +254,7 @@ CREATE TABLE `t6` ( /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 6dedd020249..f6b7409ea6a 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -813,7 +813,7 @@ update t1 set a='b' where a<>'a'; explain select * from t1 where a not between 'b' and 'b'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 13 NULL # Using where -select * from t1 where a not between 'b' and 'b'; -a filler -a +select a, hex(filler) from t1 where a not between 'b' and 'b'; +a hex(filler) +a 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 drop table t1,t2,t3; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index fd8a0a35275..31cbeb89584 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2620,6 +2620,16 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; create table t1(f1 int, f2 int); create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); @@ -2737,16 +2747,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; -CREATE TABLE t1 (a INT, b INT); -(SELECT a, b AS c FROM t1) ORDER BY c+1; -a c -(SELECT a, b AS c FROM t1) ORDER BY b+1; -a c -SELECT a, b AS c FROM t1 ORDER BY c+1; -a c -SELECT a, b AS c FROM t1 ORDER BY b+1; -a c -drop table t1; create table t1 (a int, b int); create table t2 like t1; select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 89376d33f61..f6493bac244 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -628,6 +628,6 @@ explain select * from t2 where a = 'a' or a='a '; update t1 set a='b' where a<>'a'; --replace_column 9 # explain select * from t1 where a not between 'b' and 'b'; -select * from t1 where a not between 'b' and 'b'; +select a, hex(filler) from t1 where a not between 'b' and 'b'; drop table t1,t2,t3; -- cgit v1.2.1 From 3ef920a7c783b2da98f72fd52b51cf064b874da0 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 13 Oct 2005 19:34:15 +0300 Subject: Merged from 4.1. --- mysql-test/r/cast.result | 6 +++--- mysql-test/r/select.result | 40 ++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7bf710f3491..fff6f039f6e 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -334,6 +334,9 @@ cast(repeat('1',20) as signed) -7335632962598440505 Warnings: Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement +select cast(1.0e+300 as signed int); +cast(1.0e+300 as signed int) +9223372036854775807 select cast('1.2' as decimal(3,2)); cast('1.2' as decimal(3,2)) 1.20 @@ -367,6 +370,3 @@ DROP TABLE t1; select cast(NULL as decimal(6)) as t1; t1 NULL -select cast(1.0e+300 as signed int); -cast(1.0e+300 as signed int) -9223372036854775807 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index b3ba3c4b0e0..10ecd64c53f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2620,6 +2620,16 @@ select found_rows(); found_rows() 1 DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; create table t1(f1 int, f2 int); create table t2(f3 int); select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); @@ -2636,6 +2646,16 @@ select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); f1 f2 f3 2 NULL 2 drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL +t11 MyISAM 10 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); @@ -2737,16 +2757,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; -CREATE TABLE t1 (a INT, b INT); -(SELECT a, b AS c FROM t1) ORDER BY c+1; -a c -(SELECT a, b AS c FROM t1) ORDER BY b+1; -a c -SELECT a, b AS c FROM t1 ORDER BY c+1; -a c -SELECT a, b AS c FROM t1 ORDER BY b+1; -a c -drop table t1; create table t1 (a int, b int); create table t2 like t1; select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; @@ -3078,13 +3088,3 @@ from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; count(*) 6 drop table a, b, c; -create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); -create table t11 like t1; -insert into t1 values(1,""),(2,""); -show table status like 't1%'; -Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 MyISAM 9 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL -t11 MyISAM 9 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL -select 123 as a from t1 where f1 is null; -a -drop table t1,t11; -- cgit v1.2.1 From 8ae2cfb0f74eaf8a87707c839d1f9c0a8adacbc0 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Oct 2005 11:10:45 -0700 Subject: Force a server restart for the not_embedded_server test to satisfy conditions of its first test. (Bug #13796) --- mysql-test/t/not_embedded_server-master.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/t/not_embedded_server-master.opt (limited to 'mysql-test') diff --git a/mysql-test/t/not_embedded_server-master.opt b/mysql-test/t/not_embedded_server-master.opt new file mode 100644 index 00000000000..35fcc5f30c6 --- /dev/null +++ b/mysql-test/t/not_embedded_server-master.opt @@ -0,0 +1 @@ +--loose-to-force-a-restart -- cgit v1.2.1 From d86f40650f77512ecd11d58a981511c82dd63dcd Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Thu, 13 Oct 2005 13:42:56 -0700 Subject: BUG# 13146 Re-application of patch to clean 5.0 tree. Fixed issue with ANSI quotes when dumping triggers --- mysql-test/r/mysqldump.result | 65 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 34 ++++++++++++++++++++++ 2 files changed, 99 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 4757bd17b42..c3f2e55939e 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2309,3 +2309,68 @@ UNLOCK TABLES; drop table t1; set global time_zone=default; set time_zone=default; +DROP TABLE IF EXISTS `t1 test`; +CREATE TABLE `t1 test` ( +`a1` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `t2 test`; +CREATE TABLE `t2 test` ( +`a2` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END // +INSERT INTO `t1 test` VALUES (1); +INSERT INTO `t1 test` VALUES (2); +INSERT INTO `t1 test` VALUES (3); +SELECT * FROM `t2 test`; +a2 +1 +2 +3 +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS "t1 test"; +CREATE TABLE "t1 test" ( + "a1" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t1 test" DISABLE KEYS */; +LOCK TABLES "t1 test" WRITE; +INSERT INTO "t1 test" VALUES (1),(2),(3); +UNLOCK TABLES; +/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */; + +/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; +DELIMITER ;; +/*!50003 SET SESSION SQL_MODE="" */;; +/*!50003 CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END */;; + +DELIMITER ; +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */; +DROP TABLE IF EXISTS "t2 test"; +CREATE TABLE "t2 test" ( + "a2" int(11) default NULL +); + + +/*!40000 ALTER TABLE "t2 test" DISABLE KEYS */; +LOCK TABLES "t2 test" WRITE; +INSERT INTO "t2 test" VALUES (1),(2),(3); +UNLOCK TABLES; +/*!40000 ALTER TABLE "t2 test" ENABLE KEYS */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TRIGGER `test trig`; +DROP TABLE `t1 test`; +DROP TABLE `t2 test`; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 6898dbe7a8d..377a8c8179e 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -928,3 +928,37 @@ set global time_zone='Europe/Moscow'; drop table t1; set global time_zone=default; set time_zone=default; + +# +# Test of fix to BUG 13146 - ansi quotes break loading of triggers +# +--disable_warnings +DROP TABLE IF EXISTS `t1 test`; +CREATE TABLE `t1 test` ( + `a1` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `t2 test`; +CREATE TABLE `t2 test` ( + `a2` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +--enable_warnings + +DELIMITER //; +CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN +INSERT INTO `t2 test` SET a2 = NEW.a1; END // +DELIMITER ;// + +INSERT INTO `t1 test` VALUES (1); +INSERT INTO `t1 test` VALUES (2); +INSERT INTO `t1 test` VALUES (3); +SELECT * FROM `t2 test`; +# dump with compatible=ansi. Everything except triggers should be double +# quoted +--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test + +--disable_warnings +DROP TRIGGER `test trig`; +DROP TABLE `t1 test`; +DROP TABLE `t2 test`; +--enable_warnings -- cgit v1.2.1 From 6d6e107f1275c6e55b91bed29a75388c6b0a2706 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Fri, 14 Oct 2005 00:02:38 +0300 Subject: - set 'updating' in both tables list if we have two of them (because of subquery) (BUG#13236) - fixed test --- mysql-test/r/rpl_multi_update2.result | 13 +++++++++++++ mysql-test/t/rpl_multi_update2.test | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result index 99356ebf970..5bb262764fa 100644 --- a/mysql-test/r/rpl_multi_update2.result +++ b/mysql-test/r/rpl_multi_update2.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +drop table if exists t1,t2; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned @@ -40,3 +41,15 @@ SELECT * FROM t2 ORDER BY a; a b 1 0 2 1 +drop table t1,t2; +reset master; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (0); +UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; +select * from t1; +a +3 +select * from t1; +a +3 +drop table t1; diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test index f92c5504f43..a78b1901f51 100644 --- a/mysql-test/t/rpl_multi_update2.test +++ b/mysql-test/t/rpl_multi_update2.test @@ -4,6 +4,10 @@ source include/master-slave.inc; +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned @@ -32,4 +36,27 @@ sync_with_master; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; +connection master; +drop table t1,t2; +sync_slave_with_master; + +# +# BUG#13236 multi-update with subquery & --replicate-ignore-table +# +reset master; + +connection master; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (0); +UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b; +select * from t1; +sync_slave_with_master; + +connection slave; +select * from t1; + +connection master; +drop table t1; +sync_slave_with_master; + # End of 4.1 tests -- cgit v1.2.1 From 3da5f1c223cae7a20e2e5e2e15e32fa2c6bab03f Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 14 Oct 2005 00:04:52 +0300 Subject: Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects field::sort_key() now adds length last for varbinary/blob VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones Fixed issues in test cases from last merge --- mysql-test/r/select.result | 13 ++++---- mysql-test/r/type_blob.result | 70 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/select.test | 46 ++++++++++------------------ mysql-test/t/type_blob.test | 19 ++++++++++++ 4 files changed, 111 insertions(+), 37 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 31a6cbc675b..abf607dd438 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2668,10 +2668,9 @@ a c drop table t1; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); -CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); -INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), -(1,2,3); -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; a b c d 1 2 1 1 @@ -2679,14 +2678,14 @@ a b c d 1 2 3 1 1 10 2 1 11 2 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; a b c d 1 10 4 1 2 1 1 1 2 2 1 1 2 3 1 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; a b c d 1 2 1 1 @@ -2694,7 +2693,7 @@ a b c d 1 2 3 1 1 10 2 1 11 2 -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; a b c d 1 2 1 1 diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index fd478c916c9..b366b1ed755 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -718,3 +718,73 @@ t1 CREATE TABLE `t1` ( KEY `a` (`a`,`b`,`d`,`e`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE table t1 (a blob); +insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL); +select hex(a) from t1 order by a; +hex(a) +NULL +61 +6100 +6120 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +6100 +610000 +612000 +616100 +6200 +alter table t1 modify a varbinary(5); +select hex(a) from t1 order by a; +hex(a) +NULL +61 +6100 +6120 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +6100 +610000 +612000 +616100 +6200 +alter table t1 modify a char(5); +select hex(a) from t1 order by a; +hex(a) +NULL +6100 +61 +61 +6161 +62 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +610000 +6100 +6100 +616100 +6200 +alter table t1 modify a binary(5); +select hex(a) from t1 order by a; +hex(a) +NULL +6100000000 +6100000000 +6100000000 +6161000000 +6200000000 +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +b +NULL +610000000000 +610000000000 +610000000000 +616100000000 +620000000000 +drop table t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 50b5f42079d..6fc149e2e1f 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -7,7 +7,7 @@ # --disable_warnings -drop table if exists t1,t2,t3,t4; +drop table if exists t1,t2,t3,t4,t11; # The following may be left from older tests drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; drop view if exists v1; @@ -2232,16 +2232,15 @@ drop table t1; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); -CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, c INT ); -INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2), - (1,2,3); -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; -SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; DROP TABLE IF EXISTS t1, t2; @@ -2635,31 +2634,18 @@ drop view v1, v2, v3; # nested right join. # -create table a ( - id int(11) not null default '0' -) engine=myisam default charset=latin1; - -insert into a values (123),(191),(192); - -create table b ( - id char(16) character set utf8 not null default '' -) engine=myisam default charset=latin1; - -insert into b values ('58013'),('58014'),('58015'),('58016'); - -create table c ( - a_id int(11) not null default '0', - b_id char(16) character set utf8 default null -) engine=myisam default charset=latin1; - -insert into c values -(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +create table t1 (id int(11) not null default '0'); +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); -- both queries are equivalent select count(*) -from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id; +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; select count(*) -from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; -drop table a, b, c; +drop table t1,t2,t3; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 4f3c02b0465..503d7ffc0b9 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -404,3 +404,22 @@ alter table t1 add primary key (a,b,c(255),d); alter table t1 add key (a,b,d,e); show create table t1; drop table t1; + +# +# Test that blob's and varbinary are sorted according to length +# + +CREATE table t1 (a blob); +insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a varbinary(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a char(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +alter table t1 modify a binary(5); +select hex(a) from t1 order by a; +select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0'); +drop table t1; -- cgit v1.2.1 From aff8dbe130b08c167c0284c53713318c26da9558 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Fri, 14 Oct 2005 01:22:24 +0400 Subject: Fix bug #13855 select distinct with group by caused server crash DISTINCT wasn't optimized away and caused creation of tmp table in wrong case. This result in integer overrun and running out of memory. Fix backported from 4.1. Now if optimizer founds that in result be only 1 row it removes distinct. --- mysql-test/r/select.result | 8 ++++++++ mysql-test/t/select.test | 9 +++++++++ 2 files changed, 17 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 11a50d6cabc..98d474821c9 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2477,3 +2477,11 @@ a b c d 1 2 2 1 1 2 3 1 DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 2607a00bed4..984b467d435 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2013,3 +2013,12 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; DROP TABLE IF EXISTS t1, t2; +# +# Bug #13855 select distinct with group by caused server crash +# +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +drop table t1,t2; -- cgit v1.2.1 From bae115423598ae7019a18cb8a8377987c0faca30 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Oct 2005 15:32:31 -0700 Subject: Fix calculation of TIMESTAMPDIFF() of months and years. (Bug #13534) --- mysql-test/r/func_time.result | 51 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/func_time.test | 24 ++++++++++++++++++++ 2 files changed, 75 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 9275a893309..64dafa132b4 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -760,3 +760,54 @@ call t_sysdate(); @a != @b 1 drop procedure t_sysdate; +select timestampdiff(month,'2004-09-11','2004-09-11'); +timestampdiff(month,'2004-09-11','2004-09-11') +0 +select timestampdiff(month,'2004-09-11','2005-09-11'); +timestampdiff(month,'2004-09-11','2005-09-11') +12 +select timestampdiff(month,'2004-09-11','2006-09-11'); +timestampdiff(month,'2004-09-11','2006-09-11') +24 +select timestampdiff(month,'2004-09-11','2007-09-11'); +timestampdiff(month,'2004-09-11','2007-09-11') +36 +select timestampdiff(month,'2005-09-11','2004-09-11'); +timestampdiff(month,'2005-09-11','2004-09-11') +-12 +select timestampdiff(month,'2005-09-11','2003-09-11'); +timestampdiff(month,'2005-09-11','2003-09-11') +-24 +select timestampdiff(month,'2004-02-28','2005-02-28'); +timestampdiff(month,'2004-02-28','2005-02-28') +12 +select timestampdiff(month,'2004-02-29','2005-02-28'); +timestampdiff(month,'2004-02-29','2005-02-28') +11 +select timestampdiff(month,'2004-02-28','2005-02-28'); +timestampdiff(month,'2004-02-28','2005-02-28') +12 +select timestampdiff(month,'2004-03-29','2005-03-28'); +timestampdiff(month,'2004-03-29','2005-03-28') +11 +select timestampdiff(month,'2003-02-28','2004-02-29'); +timestampdiff(month,'2003-02-28','2004-02-29') +12 +select timestampdiff(month,'2003-02-28','2005-02-28'); +timestampdiff(month,'2003-02-28','2005-02-28') +24 +select timestampdiff(month,'1999-09-11','2001-10-10'); +timestampdiff(month,'1999-09-11','2001-10-10') +24 +select timestampdiff(month,'1999-09-11','2001-9-11'); +timestampdiff(month,'1999-09-11','2001-9-11') +24 +select timestampdiff(year,'1999-09-11','2001-9-11'); +timestampdiff(year,'1999-09-11','2001-9-11') +2 +select timestampdiff(year,'2004-02-28','2005-02-28'); +timestampdiff(year,'2004-02-28','2005-02-28') +1 +select timestampdiff(year,'2004-02-29','2005-02-28'); +timestampdiff(year,'2004-02-29','2005-02-28') +0 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 3dd7f7276fb..3a2eea59bed 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -404,4 +404,28 @@ delimiter ;// call t_sysdate(); drop procedure t_sysdate; +# +# Bug #13534: timestampdiff() returned incorrect results across leap years +# +select timestampdiff(month,'2004-09-11','2004-09-11'); +select timestampdiff(month,'2004-09-11','2005-09-11'); +select timestampdiff(month,'2004-09-11','2006-09-11'); +select timestampdiff(month,'2004-09-11','2007-09-11'); +select timestampdiff(month,'2005-09-11','2004-09-11'); +select timestampdiff(month,'2005-09-11','2003-09-11'); + +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-02-29','2005-02-28'); +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-03-29','2005-03-28'); +select timestampdiff(month,'2003-02-28','2004-02-29'); +select timestampdiff(month,'2003-02-28','2005-02-28'); + +select timestampdiff(month,'1999-09-11','2001-10-10'); +select timestampdiff(month,'1999-09-11','2001-9-11'); + +select timestampdiff(year,'1999-09-11','2001-9-11'); +select timestampdiff(year,'2004-02-28','2005-02-28'); +select timestampdiff(year,'2004-02-29','2005-02-28'); + # End of 5.0 tests -- cgit v1.2.1 From 25e40bd403d23277b5da3469d210803a22df5409 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 14 Oct 2005 13:24:21 +0500 Subject: ctype_utf8.result: after merge fix , --- mysql-test/r/ctype_utf8.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 44fb53ec77c..29133c53cf9 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1044,6 +1044,11 @@ hex(a) 5B E880BD drop table t1; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8; +select * from t1 where find_in_set('-1', a); +a +drop table t1; CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); SELECT id FROM t1; @@ -1126,8 +1131,3 @@ a i ã„ drop table t1,t2; -set names 'latin1'; -create table t1 (a varchar(255)) default charset=utf8; -select * from t1 where find_in_set('-1', a); -a -drop table t1; -- cgit v1.2.1 From 58f2a6aa6434f2ec11cf1220b41ce4a94964a46c Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 14 Oct 2005 13:35:36 +0200 Subject: Change the "Password" column type for the Perl suite running the tests. bug#14023 --- mysql-test/lib/init_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index b366a429ab2..fd7b035e038 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -62,7 +62,7 @@ comment='Host privileges; Merged with database privileges'; CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, - Password binary(41) DEFAULT '' NOT NULL, + Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -- cgit v1.2.1 From 3f76925d0670544b0e0be82fd7ef1ab39c285f7f Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 15 Oct 2005 21:57:32 +0500 Subject: Fix for bug #13573 (wrong data inserted for too big decimals) --- mysql-test/r/type_newdecimal.result | 28 +++++++++++++++++++++++++--- mysql-test/t/type_newdecimal.test | 15 +++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index be5e29ab662..a99e60e5780 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -846,15 +846,14 @@ select 0/0; NULL select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x; x -999999999999999999999999999999999999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999999999999999999999999999999999 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x -NULL +100000000000000000000000000000000000000000000000000000000000000000 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1019,3 +1018,26 @@ drop procedure wg2; select cast(@non_existing_user_var/2 as DECIMAL); cast(@non_existing_user_var/2 as DECIMAL) NULL +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values(1e100); +Warnings: +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +select * from t1; +c1 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 3f04aa931d2..bfebef6207a 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1044,3 +1044,18 @@ drop procedure wg2; # select cast(@non_existing_user_var/2 as DECIMAL); + + +# +# Bug #13573 (Wrong data inserted for too big values) +# + +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +insert into t1 values(1e100); +select * from t1; +drop table t1; -- cgit v1.2.1 From 9910198aafe774d6ad50b47339a127ebc43a5d2d Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Sat, 15 Oct 2005 22:23:13 +0500 Subject: Additional fix for bug #12267 (Can't use POINT for primary key) --- mysql-test/r/gis.result | 3 +++ mysql-test/t/gis.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 2748199efad..90857ecfc6d 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -682,6 +682,9 @@ POINT(1 1) drop function fn3; create table t1(pt POINT); alter table t1 add primary key pti(pt); +drop table t1; +create table t1(pt GEOMETRY); +alter table t1 add primary key pti(pt); ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length alter table t1 add primary key pti(pt(20)); drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 1f30407c2b7..142bd29fa2d 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -399,6 +399,9 @@ drop function fn3; # Bug #12267 (primary key over GIS) # create table t1(pt POINT); +alter table t1 add primary key pti(pt); +drop table t1; +create table t1(pt GEOMETRY); --error 1170 alter table t1 add primary key pti(pt); alter table t1 add primary key pti(pt(20)); -- cgit v1.2.1 From 85ab53357b005852b51c3b405b9c01cbf6214f5a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 06:49:19 +0200 Subject: thread_registry.h, thread_registry.cc: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX Makefile.am: Preserve executable mode on scripts make_binary_distribution.sh: Copy *.imtest files --- mysql-test/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 1fb5f82c475..f1194d7fc2f 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -53,7 +53,8 @@ dist-hook: -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data @@ -79,7 +80,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r -- cgit v1.2.1 From 00b535280da9fdf396b48a19bffed1cddc7528da Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 17:05:14 +0200 Subject: mysql-test-run.pl: Put socket files into $opt_tmpdir, to avoid problems with platforms that can't handle long socket paths. --- mysql-test/mysql-test-run.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 05e6169b4c7..92d8c8f1139 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -840,8 +840,8 @@ sub command_line_setup () { server_id => 1, port => $im_mysqld1_port, path_datadir => "$opt_vardir/im_mysqld_1.data", - path_sock => "$opt_vardir/mysqld_1.sock", - path_pid => "$opt_vardir/mysqld_1.pid", + path_sock => "$opt_tmpdir/mysqld_1.sock", + path_pid => "$opt_vardir/run/mysqld_1.pid", }; $instance_manager->{'instances'}->[1]= @@ -849,8 +849,8 @@ sub command_line_setup () { server_id => 2, port => $im_mysqld2_port, path_datadir => "$opt_vardir/im_mysqld_2.data", - path_sock => "$opt_vardir/mysqld_2.sock", - path_pid => "$opt_vardir/mysqld_2.pid", + path_sock => "$opt_tmpdir/mysqld_2.sock", + path_pid => "$opt_vardir/run/mysqld_2.pid", nonguarded => 1, }; -- cgit v1.2.1 From 1b0566c20b8ddb5ad9ef06d9d7241e1eb9be37ab Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Sun, 16 Oct 2005 19:30:10 +0400 Subject: portability fix: sh does not support "==". This resulted in IM tests failing on range of platforms. --- mysql-test/t/kill_n_check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/t/kill_n_check.sh index 7fe30c4774c..e722b3a180d 100755 --- a/mysql-test/t/kill_n_check.sh +++ b/mysql-test/t/kill_n_check.sh @@ -39,7 +39,7 @@ new_pid="" # echo "New PID: $new_pid" -if [ "$expected_result" == "restarted" ]; then +if [ "$expected_result" = "restarted" ]; then if [ -z "$new_pid" ]; then echo "Error: the process was killed." @@ -54,7 +54,7 @@ if [ "$expected_result" == "restarted" ]; then echo "Success: the process was restarted." exit 0 -else # $expected_result == killed +else # $expected_result = killed if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then echo "Error: the process was restarted." -- cgit v1.2.1 From 35e16842064d53093b86d18625721c95026455a3 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Sun, 16 Oct 2005 22:47:19 +0400 Subject: sp-security.result, sp.result, sp-security.test, sp.test: Test for bug#12812 moved from sp.test to sp-security.test --- mysql-test/r/sp-security.result | 12 ++++++++++++ mysql-test/r/sp.result | 12 ------------ mysql-test/t/sp-security.test | 24 ++++++++++++++++++++++++ mysql-test/t/sp.test | 22 ---------------------- 4 files changed, 36 insertions(+), 34 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index eb2e2ce334e..614e670f25d 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -251,3 +251,15 @@ drop procedure mysqltest_1.p1; drop database mysqltest_1; revoke usage on *.* from mysqltest_1@localhost; drop user mysqltest_1@localhost; +drop function if exists bug12812| +create function bug12812() returns char(2) +begin +return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +CREATE VIEW v1 AS SELECT test.bug12812()| +ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' +DROP USER user_bug12812@localhost| +drop function bug12812| diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index e3e379ac65d..8f1006b4fa1 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3206,18 +3206,6 @@ set f1= concat( 'hello', f1 ); return f1; end| drop function bug9048| -drop function if exists bug12812| -create function bug12812() returns char(2) -begin -return 'ok'; -end; -create user user_bug12812@localhost IDENTIFIED BY 'ABC'| -SELECT test.bug12812()| -ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' -CREATE VIEW v1 AS SELECT test.bug12812()| -ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812' -DROP USER user_bug12812@localhost| -drop function bug12812| drop procedure if exists bug12849_1| create procedure bug12849_1(inout x char) select x into x| set @var='a'| diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 6f1332f80d5..afbc383a17a 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -412,4 +412,28 @@ drop database mysqltest_1; revoke usage on *.* from mysqltest_1@localhost; drop user mysqltest_1@localhost; +# +# BUG#12812 create view calling a function works without execute right +# on function +delimiter |; +--disable_warnings +drop function if exists bug12812| +--enable_warnings +create function bug12812() returns char(2) +begin + return 'ok'; +end; +create user user_bug12812@localhost IDENTIFIED BY 'ABC'| +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (test_user_12812,localhost,user_bug12812,ABC,test)| +--error 1370 +SELECT test.bug12812()| +--error 1370 +CREATE VIEW v1 AS SELECT test.bug12812()| +# Cleanup +connection default| +disconnect test_user_12812| +DROP USER user_bug12812@localhost| +drop function bug12812| +delimiter ;| # End of 5.0 bugs. diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 1f4d5b6bad5..0faa303df54 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -4037,28 +4037,6 @@ begin end| drop function bug9048| -# -# BUG#12812 create view calling a function works without execute right -# on function ---disable_warnings -drop function if exists bug12812| ---enable_warnings -create function bug12812() returns char(2) -begin - return 'ok'; -end; -create user user_bug12812@localhost IDENTIFIED BY 'ABC'| ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (test_user_12812,localhost,user_bug12812,ABC,test)| ---error 1370 -SELECT test.bug12812()| ---error 1370 -CREATE VIEW v1 AS SELECT test.bug12812()| -# Cleanup -connection default| -disconnect test_user_12812| -DROP USER user_bug12812@localhost| -drop function bug12812| # Bug #12849 Stored Procedure: Crash on procedure call with CHAR type # 'INOUT' parameter # -- cgit v1.2.1 From 7635353bc8c7aa2cb5c3bc306674ca02a1be44f0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 20:51:19 +0200 Subject: mysql-test-run.pl: Added --skip-im option handling Don't terminate script if IM fails to create PID file mtr_cases.pl: Added --skip-im option handling mtr_process.pl: Kill left over 'mysqld' processes started by IM --- mysql-test/lib/mtr_cases.pl | 8 +++---- mysql-test/lib/mtr_process.pl | 11 +++++++++ mysql-test/mysql-test-run.pl | 55 ++++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 34 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index ca984d37ecf..fb622f2bbb3 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -68,7 +68,7 @@ sub collect_test_cases ($) { # # Otherwise, try to guess the target component. - if ( defined $component_id ) + if ( $component_id ) { if ( ! -f "$testdir/$elem") { @@ -80,11 +80,11 @@ sub collect_test_cases ($) { my $mysqld_test_exists = -f "$testdir/$tname.test"; my $im_test_exists = -f "$testdir/$tname.imtest"; - if ( $mysqld_test_exists && $im_test_exists ) + if ( $mysqld_test_exists and $im_test_exists ) { mtr_error("Ambiguos test case name ($tname)"); } - elsif ( ! $mysqld_test_exists && !$im_test_exists ) + elsif ( ! $mysqld_test_exists and ! $im_test_exists ) { mtr_error("Test case $tname is not found"); } @@ -405,7 +405,7 @@ sub collect_one_test_case($$$$$$$) { "Instance Manager tests are not run with --ps-protocol. " . "Test case '$tname' is skipped."); } - elsif ( !$::exe_im ) + elsif ( $::opt_skip_im ) { $tinfo->{'skip'}= 1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index eb60df4a5cb..b3a243444c1 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -360,9 +360,20 @@ sub mtr_kill_leftovers () { # First, kill all masters and slaves that would conflict with # this run. Make sure to remove the PID file, if any. + # FIXME kill IM manager first, else it will restart the servers, how?! my @args; + for ( my $idx; $idx < 2; $idx++ ) + { + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::instance_manager->{'instances'}->[$idx]->{'path_pid'}, + sockfile => $::instance_manager->{'instances'}->[$idx]->{'path_sock'}, + port => $::instance_manager->{'instances'}->[$idx]->{'port'}, + }); + } + for ( my $idx; $idx < 2; $idx++ ) { push(@args,{ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 92d8c8f1139..35f26199fc8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -233,6 +233,7 @@ our $opt_result_ext; our $opt_skip; our $opt_skip_rpl; our $opt_skip_test; +our $opt_skip_im; our $opt_sleep; our $opt_ps_protocol; @@ -490,6 +491,7 @@ sub command_line_setup () { 'do-test=s' => \$opt_do_test, 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, + 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, # Specify ports @@ -1118,7 +1120,7 @@ sub kill_and_cleanup () { foreach my $instance (@{$instance_manager->{'instances'}}) { - push (@data_dir_lst, $instance->{'path_datadir'}); + push(@data_dir_lst, $instance->{'path_datadir'}); } foreach my $data_dir (@data_dir_lst) @@ -1364,7 +1366,7 @@ sub mysql_install_db () { install_db('slave', $slave->[1]->{'path_myddir'}); install_db('slave', $slave->[2]->{'path_myddir'}); - if ( defined $exe_im) + if ( ! $opt_skip_im ) { im_prepare_env($instance_manager); } @@ -1513,12 +1515,7 @@ skip-ndbcluster EOF ; - if ( exists $instance->{nonguarded} and - defined $instance->{nonguarded} ) - { - print OUT "nonguarded\n"; - } - + print OUT "nonguarded\n" if $instance->{'nonguarded'}; print OUT "\n"; } @@ -1678,7 +1675,7 @@ sub run_testcase ($) { $master->[0]->{'running_master_is_special'}= 1; } } - elsif ( $tinfo->{'component_id'} eq 'im') + elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' ) { # We have to create defaults file every time, in order to ensure that it # will be the same for each test. The problem is that test can change the @@ -1776,7 +1773,8 @@ sub run_testcase ($) { # Stop Instance Manager if we are processing an IM-test case. # ---------------------------------------------------------------------- - if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' ) + if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' and + $instance_manager->{'pid'} ) { im_stop($instance_manager); } @@ -2195,7 +2193,7 @@ sub stop_masters_slaves () { print "Ending Tests\n"; - if (defined $instance_manager->{'pid'}) + if ( $instance_manager->{'pid'} ) { print "Shutting-down Instance Manager\n"; im_stop($instance_manager); @@ -2269,14 +2267,10 @@ sub im_start($$) { my $instance_manager = shift; my $opts = shift; - if ( ! defined $exe_im) - { - return; - } - my $args; mtr_init_args(\$args); - mtr_add_arg($args, "--defaults-file=" . $instance_manager->{'defaults_file'}); + mtr_add_arg($args, "--defaults-file=%s", + $instance_manager->{'defaults_file'}); foreach my $opt (@{$opts}) { @@ -2294,7 +2288,7 @@ sub im_start($$) { { append_log_file => 1 } # append log files ); - if ( ! defined $instance_manager->{'pid'} ) + if ( ! $instance_manager->{'pid'} ) { mtr_report('Could not start Instance Manager'); return; @@ -2304,10 +2298,14 @@ sub im_start($$) { # several processes and the parent process, created by mtr_spawn(), exits just # after start. So, we have to obtain Instance Manager PID from the PID file. - sleep_until_file_created( - $instance_manager->{'path_pid'}, - $instance_manager->{'start_timeout'}, - -1); # real PID is still unknown + if ( ! sleep_until_file_created( + $instance_manager->{'path_pid'}, + $instance_manager->{'start_timeout'}, + -1)) # real PID is still unknown + { + mtr_report("Instance Manager PID file is missing"); + return; + } $instance_manager->{'pid'} = mtr_get_pid_from_file($instance_manager->{'path_pid'}); @@ -2316,16 +2314,12 @@ sub im_start($$) { sub im_stop($) { my $instance_manager = shift; - if (! defined $instance_manager->{'pid'}) - { - return; - } - # Re-read pid from the file, since during tests Instance Manager could have # been restarted, so its pid could have been changed. $instance_manager->{'pid'} = - mtr_get_pid_from_file($instance_manager->{'path_pid'}); + mtr_get_pid_from_file($instance_manager->{'path_pid'}) + if -f $instance_manager->{'path_pid'}; # Inspired from mtr_stop_mysqld_servers(). @@ -2340,12 +2334,12 @@ sub im_stop($) { if ( -r $instances->[0]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'})); } if ( -r $instances->[1]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'})); } # Kill processes. @@ -2601,6 +2595,7 @@ Options to control what test suites or cases to run start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" skip-rpl Skip the replication test cases. + skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX Options that specify ports -- cgit v1.2.1 From 15fbd07a2215c0a93a47826e66b6c98199c125ea Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Mon, 17 Oct 2005 12:32:22 +0500 Subject: Fix for bug #13820 (No warning on log(NEGATIVE)) --- mysql-test/r/func_math.result | 27 +++++++++++++++++++++++++++ mysql-test/t/func_math.test | 12 ++++++++++++ 2 files changed, 39 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 5b6c29f87fb..b7ba2273956 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -170,3 +170,30 @@ insert into t1 values (1); select rand(i) from t1; ERROR HY000: Incorrect arguments to RAND drop table t1; +set sql_mode='traditional'; +select ln(-1); +ln(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log10(-1); +log10(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log2(-1); +log2(-1) +NULL +Warnings: +Error 1365 Division by 0 +select log(2,-1); +log(2,-1) +NULL +Warnings: +Error 1365 Division by 0 +select log(-2,1); +log(-2,1) +NULL +Warnings: +Error 1365 Division by 0 +set sql_mode=''; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 633e36f51ab..2935f24f2d7 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -117,3 +117,15 @@ select rand(i) from t1; drop table t1; # End of 4.1 tests + +# +# Bug #13820 (No warning on log(negative) +# +set sql_mode='traditional'; +select ln(-1); +select log10(-1); +select log2(-1); +select log(2,-1); +select log(-2,1); +set sql_mode=''; + -- cgit v1.2.1 From e58531570371b640e963d01e5714b636e7bad82b Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Mon, 17 Oct 2005 15:07:47 +0200 Subject: Additional fix for BUG#7049, after review. Make sure "select" aborts when finding a SP condition handler beyond the current scope. --- mysql-test/r/sp.result | 2 -- 1 file changed, 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1791cd385f4..19d5666dc5a 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3310,7 +3310,6 @@ select 1| 1 call bug12379_1()| bug12379() -NULL 42 42 select 2| @@ -3318,7 +3317,6 @@ select 2| 2 call bug12379_2()| bug12379() -NULL select 3| 3 3 -- cgit v1.2.1 From ee8e1637768f93bbb07ac6826e2496bd7d4c791a Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Tue, 18 Oct 2005 00:48:34 +0400 Subject: fix for im_life_cycle test: replace im instance port number with a constant string. The lack of this --replace resulted in the test failing on all build hosts --- mysql-test/r/im_life_cycle.result | 2 +- mysql-test/t/im_life_cycle.imtest | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result index 810953e0578..f8eaf0ccb46 100644 --- a/mysql-test/r/im_life_cycle.result +++ b/mysql-test/r/im_life_cycle.result @@ -21,7 +21,7 @@ instance_name status version mysqld2 online VERSION SHOW VARIABLES LIKE 'port'; Variable_name Value -port 9312 +port IM_MYSQLD1_PORT STOP INSTANCE mysqld2; SHOW INSTANCES; instance_name status diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest index fff57e16eab..c2b1c9a56ec 100644 --- a/mysql-test/t/im_life_cycle.imtest +++ b/mysql-test/t/im_life_cycle.imtest @@ -46,6 +46,7 @@ SHOW INSTANCE STATUS mysqld2; --connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK) --connection mysql_con +--replace_result $IM_MYSQLD1_PORT IM_MYSQLD1_PORT SHOW VARIABLES LIKE 'port'; --connection default -- cgit v1.2.1 From 31a79ee3d0fd8cde70bad857807c5053f06a938b Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 17 Oct 2005 17:00:42 -0700 Subject: Fix Item_func_abs::fix_length_and_dec() to set maybe_null properly. (Bug #14009) --- mysql-test/r/func_math.result | 6 ++++++ mysql-test/t/func_math.test | 10 ++++++++++ 2 files changed, 16 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index b36902d7872..11a3d14fb65 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -145,3 +145,9 @@ insert into t1 values (1); select rand(i) from t1; ERROR HY000: Incorrect arguments to RAND drop table t1; +create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; +insert into t1 values ('http://www.foo.com/', now()); +select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); +a +http://www.foo.com/ +drop table t1; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index c75454a96d4..a8f62e38e86 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -86,4 +86,14 @@ insert into t1 values (1); select rand(i) from t1; drop table t1; +# +# Bug #14009: use of abs() on null value causes problems with filesort +# +# InnoDB is required to reproduce the fault, but it is okay if we default to +# MyISAM when testing. +create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; +insert into t1 values ('http://www.foo.com/', now()); +select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); +drop table t1; + # End of 4.1 tests -- cgit v1.2.1 From 7ccf86124211e15ab62e9bc5e9637153a4d00ec5 Mon Sep 17 00:00:00 2001 From: "gluh@eagle.intranet.mysql.r18.ru" <> Date: Tue, 18 Oct 2005 14:25:03 +0500 Subject: Fix for bug#13783 mysqlcheck tries to optimize and analyze information_schema 'information_schema' is excluded from list of databases for mysqlcheck command --- mysql-test/mysql-test-run.pl | 13 +++++++++++++ mysql-test/mysql-test-run.sh | 14 ++++++++++++-- mysql-test/r/mysqlcheck.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/mysqlcheck.test | 11 +++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/mysqlcheck.result create mode 100644 mysql-test/t/mysqlcheck.test (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 35f26199fc8..d9874bf629f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -171,6 +171,7 @@ our $exe_mysqladmin; our $exe_mysqlbinlog; our $exe_mysql_client_test; our $exe_mysqld; +our $exe_mysqlcheck; # Called from test case our $exe_mysqldump; # Called from test case our $exe_mysqlshow; # Called from test case our $exe_mysql_fix_system_tables; @@ -911,6 +912,7 @@ sub executable_setup () { mtr_exe_exists("$glob_basedir/tests/mysql_client_test", "/usr/bin/false"); } + $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); @@ -926,6 +928,7 @@ sub executable_setup () { else { $path_client_bindir= mtr_path_exists("$glob_basedir/bin"); + $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); $exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow"); $exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog"); @@ -2354,6 +2357,15 @@ sub im_stop($) { sub run_mysqltest ($) { my $tinfo= shift; + my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqlcheck .= + " --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; + } + my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . "--port=$master->[0]->{'path_myport'} " . "--socket=$master->[0]->{'path_mysock'} --password="; @@ -2413,6 +2425,7 @@ sub run_mysqltest ($) { # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; $ENV{'MYSQL'}= $cmdline_mysql; + $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck; $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow; $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index aadf9080348..bd0851fa8b9 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -222,6 +222,7 @@ FAILED_CASES= EXTRA_MASTER_OPT="" EXTRA_MYSQL_TEST_OPT="" +EXTRA_MYSQLCHECK_OPT="" EXTRA_MYSQLDUMP_OPT="" EXTRA_MYSQLSHOW_OPT="" EXTRA_MYSQLBINLOG_OPT="" @@ -455,6 +456,8 @@ while test $# -gt 0; do --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace" + EXTRA_MYSQLCHECK_OPT="$EXTRA_MYSQLCHECK_OPT \ + --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlcheck.trace" EXTRA_MYSQLDUMP_OPT="$EXTRA_MYSQLDUMP_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace" EXTRA_MYSQLSHOW_OPT="$EXTRA_MYSQLSHOW_OPT \ @@ -557,6 +560,11 @@ if [ x$SOURCE_DIST = x1 ] ; then fi MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test" fi + if [ -f "$BASEDIR/client/.libs/mysqlcheck" ] ; then + MYSQL_CHECK="$BASEDIR/client/.libs/mysqlcheck" + else + MYSQL_CHECK="$BASEDIR/client/mysqlcheck" + fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" else @@ -635,6 +643,7 @@ else TESTS_BINDIR="$BASEDIR/bin" fi MYSQL_TEST="$CLIENT_BINDIR/mysqltest" + MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_SHOW="$CLIENT_BINDIR/mysqlshow" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" @@ -720,12 +729,13 @@ fi # Save path and name of mysqldump MYSQL_DUMP_DIR="$MYSQL_DUMP" export MYSQL_DUMP_DIR +MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES +export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS export NDB_TOOLS_DIR export NDB_MGM @@ -757,7 +767,7 @@ if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then XTERM=`which xterm` fi -export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK +export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK #++ # Function Definitions diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result new file mode 100644 index 00000000000..8c98e18aa9b --- /dev/null +++ b/mysql-test/r/mysqlcheck.result @@ -0,0 +1,34 @@ +mysql.columns_priv OK +mysql.db OK +mysql.func OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.proc OK +mysql.procs_priv OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +mysql.columns_priv OK +mysql.db OK +mysql.func OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.proc OK +mysql.procs_priv OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test new file mode 100644 index 00000000000..bc88be001ab --- /dev/null +++ b/mysql-test/t/mysqlcheck.test @@ -0,0 +1,11 @@ +# Embedded server doesn't support external clients +--source include/not_embedded.inc + +# +# Bug #13783 mysqlcheck tries to optimize and analyze information_schema +# +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --all-databases --analyze --optimize +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql +--exec $MYSQL_CHECK --analyze --optimize information_schema schemata -- cgit v1.2.1 From 05e63b96b08491e0838ee6dfe4447589baec5ef5 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 18 Oct 2005 15:38:32 +0200 Subject: Add file mysql-test/include/common-tests.inc --- mysql-test/include/common-tests.inc | 1832 +++++++++++++++++++++++++++++++++++ 1 file changed, 1832 insertions(+) create mode 100644 mysql-test/include/common-tests.inc (limited to 'mysql-test') diff --git a/mysql-test/include/common-tests.inc b/mysql-test/include/common-tests.inc new file mode 100644 index 00000000000..46d0182d17f --- /dev/null +++ b/mysql-test/include/common-tests.inc @@ -0,0 +1,1832 @@ +# +# This file contains a generic set of test that is run from +# different test scripts to test for example ssl encrypted +# and compressed connection +# +# + +# +# Simple select test +# + +--disable_warnings +drop table if exists t1,t2,t3,t4; +--enable_warnings + +CREATE TABLE t1 ( + Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, + Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); + +INSERT INTO t1 VALUES (9410,9412); + +select period from t1; +select * from t1; +select t1.* from t1; + +# +# Create test table +# + +CREATE TABLE t2 ( + auto int not null auto_increment, + fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, + companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, + fld3 char(30) DEFAULT '' NOT NULL, + fld4 char(35) DEFAULT '' NOT NULL, + fld5 char(35) DEFAULT '' NOT NULL, + fld6 char(4) DEFAULT '' NOT NULL, + UNIQUE fld1 (fld1), + KEY fld3 (fld3), + PRIMARY KEY (auto) +); + +# +# Populate table +# + +--disable_query_log +INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat',''); +INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); +INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); +INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); +INSERT INTO t2 VALUES (5,011501,37,'bewilderingly','wallet','balled',''); +INSERT INTO t2 VALUES (6,011701,37,'astound','parters','persist','W'); +INSERT INTO t2 VALUES (7,011702,37,'admonishing','eschew','attainments',''); +INSERT INTO t2 VALUES (8,011703,37,'sumac','quitter','fanatic',''); +INSERT INTO t2 VALUES (9,012001,37,'flanking','neat','measures','FAS'); +INSERT INTO t2 VALUES (10,012003,37,'combed','Steinberg','rightfulness',''); +INSERT INTO t2 VALUES (11,012004,37,'subjective','jarring','capably',''); +INSERT INTO t2 VALUES (12,012005,37,'scatterbrain','tinily','impulsive',''); +INSERT INTO t2 VALUES (13,012301,37,'Eulerian','balled','starlet',''); +INSERT INTO t2 VALUES (14,012302,36,'dubbed','persist','terminators',''); +INSERT INTO t2 VALUES (15,012303,37,'Kane','attainments','untying',''); +INSERT INTO t2 VALUES (16,012304,37,'overlay','fanatic','announces','FAS'); +INSERT INTO t2 VALUES (17,012305,37,'perturb','measures','featherweight','FAS'); +INSERT INTO t2 VALUES (18,012306,37,'goblins','rightfulness','pessimist','FAS'); +INSERT INTO t2 VALUES (19,012501,37,'annihilates','capably','daughter',''); +INSERT INTO t2 VALUES (20,012602,37,'Wotan','impulsive','decliner','FAS'); +INSERT INTO t2 VALUES (21,012603,37,'snatching','starlet','lawgiver',''); +INSERT INTO t2 VALUES (22,012604,37,'concludes','terminators','stated',''); +INSERT INTO t2 VALUES (23,012605,37,'laterally','untying','readable',''); +INSERT INTO t2 VALUES (24,012606,37,'yelped','announces','attrition',''); +INSERT INTO t2 VALUES (25,012701,37,'grazing','featherweight','cascade','FAS'); +INSERT INTO t2 VALUES (26,012702,37,'Baird','pessimist','motors','FAS'); +INSERT INTO t2 VALUES (27,012703,37,'celery','daughter','interrogate',''); +INSERT INTO t2 VALUES (28,012704,37,'misunderstander','decliner','pests','W'); +INSERT INTO t2 VALUES (29,013601,37,'handgun','lawgiver','stairway',''); +INSERT INTO t2 VALUES (30,013602,37,'foldout','stated','dopers','FAS'); +INSERT INTO t2 VALUES (31,013603,37,'mystic','readable','testicle','W'); +INSERT INTO t2 VALUES (32,013604,37,'succumbed','attrition','Parsifal','W'); +INSERT INTO t2 VALUES (33,013605,37,'Nabisco','cascade','leavings',''); +INSERT INTO t2 VALUES (34,013606,37,'fingerings','motors','postulation','W'); +INSERT INTO t2 VALUES (35,013607,37,'aging','interrogate','squeaking',''); +INSERT INTO t2 VALUES (36,013608,37,'afield','pests','contrasted',''); +INSERT INTO t2 VALUES (37,013609,37,'ammonium','stairway','leftover',''); +INSERT INTO t2 VALUES (38,013610,37,'boat','dopers','whiteners',''); +INSERT INTO t2 VALUES (39,013801,37,'intelligibility','testicle','erases','W'); +INSERT INTO t2 VALUES (40,013802,37,'Augustine','Parsifal','Punjab','W'); +INSERT INTO t2 VALUES (41,013803,37,'teethe','leavings','Merritt',''); +INSERT INTO t2 VALUES (42,013804,37,'dreaded','postulation','Quixotism',''); +INSERT INTO t2 VALUES (43,013901,37,'scholastics','squeaking','sweetish','FAS'); +INSERT INTO t2 VALUES (44,016001,37,'audiology','contrasted','dogging','FAS'); +INSERT INTO t2 VALUES (45,016201,37,'wallet','leftover','scornfully','FAS'); +INSERT INTO t2 VALUES (46,016202,37,'parters','whiteners','bellow',''); +INSERT INTO t2 VALUES (47,016301,37,'eschew','erases','bills',''); +INSERT INTO t2 VALUES (48,016302,37,'quitter','Punjab','cupboard','FAS'); +INSERT INTO t2 VALUES (49,016303,37,'neat','Merritt','sureties','FAS'); +INSERT INTO t2 VALUES (50,016304,37,'Steinberg','Quixotism','puddings',''); +INSERT INTO t2 VALUES (51,018001,37,'jarring','sweetish','tapestry',''); +INSERT INTO t2 VALUES (52,018002,37,'tinily','dogging','fetters',''); +INSERT INTO t2 VALUES (53,018003,37,'balled','scornfully','bivalves',''); +INSERT INTO t2 VALUES (54,018004,37,'persist','bellow','incurring',''); +INSERT INTO t2 VALUES (55,018005,37,'attainments','bills','Adolph',''); +INSERT INTO t2 VALUES (56,018007,37,'fanatic','cupboard','pithed',''); +INSERT INTO t2 VALUES (57,018008,37,'measures','sureties','emergency',''); +INSERT INTO t2 VALUES (58,018009,37,'rightfulness','puddings','Miles',''); +INSERT INTO t2 VALUES (59,018010,37,'capably','tapestry','trimmings',''); +INSERT INTO t2 VALUES (60,018012,37,'impulsive','fetters','tragedies','W'); +INSERT INTO t2 VALUES (61,018013,37,'starlet','bivalves','skulking','W'); +INSERT INTO t2 VALUES (62,018014,37,'terminators','incurring','flint',''); +INSERT INTO t2 VALUES (63,018015,37,'untying','Adolph','flopping','W'); +INSERT INTO t2 VALUES (64,018016,37,'announces','pithed','relaxing','FAS'); +INSERT INTO t2 VALUES (65,018017,37,'featherweight','emergency','offload','FAS'); +INSERT INTO t2 VALUES (66,018018,37,'pessimist','Miles','suites','W'); +INSERT INTO t2 VALUES (67,018019,37,'daughter','trimmings','lists','FAS'); +INSERT INTO t2 VALUES (68,018020,37,'decliner','tragedies','animized','FAS'); +INSERT INTO t2 VALUES (69,018021,37,'lawgiver','skulking','multilayer','W'); +INSERT INTO t2 VALUES (70,018022,37,'stated','flint','standardizes','FAS'); +INSERT INTO t2 VALUES (71,018023,37,'readable','flopping','Judas',''); +INSERT INTO t2 VALUES (72,018024,37,'attrition','relaxing','vacuuming','W'); +INSERT INTO t2 VALUES (73,018025,37,'cascade','offload','dentally','W'); +INSERT INTO t2 VALUES (74,018026,37,'motors','suites','humanness','W'); +INSERT INTO t2 VALUES (75,018027,37,'interrogate','lists','inch','W'); +INSERT INTO t2 VALUES (76,018028,37,'pests','animized','Weissmuller','W'); +INSERT INTO t2 VALUES (77,018029,37,'stairway','multilayer','irresponsibly','W'); +INSERT INTO t2 VALUES (78,018030,37,'dopers','standardizes','luckily','FAS'); +INSERT INTO t2 VALUES (79,018032,37,'testicle','Judas','culled','W'); +INSERT INTO t2 VALUES (80,018033,37,'Parsifal','vacuuming','medical','FAS'); +INSERT INTO t2 VALUES (81,018034,37,'leavings','dentally','bloodbath','FAS'); +INSERT INTO t2 VALUES (82,018035,37,'postulation','humanness','subschema','W'); +INSERT INTO t2 VALUES (83,018036,37,'squeaking','inch','animals','W'); +INSERT INTO t2 VALUES (84,018037,37,'contrasted','Weissmuller','Micronesia',''); +INSERT INTO t2 VALUES (85,018038,37,'leftover','irresponsibly','repetitions',''); +INSERT INTO t2 VALUES (86,018039,37,'whiteners','luckily','Antares',''); +INSERT INTO t2 VALUES (87,018040,37,'erases','culled','ventilate','W'); +INSERT INTO t2 VALUES (88,018041,37,'Punjab','medical','pityingly',''); +INSERT INTO t2 VALUES (89,018042,37,'Merritt','bloodbath','interdependent',''); +INSERT INTO t2 VALUES (90,018043,37,'Quixotism','subschema','Graves','FAS'); +INSERT INTO t2 VALUES (91,018044,37,'sweetish','animals','neonatal',''); +INSERT INTO t2 VALUES (92,018045,37,'dogging','Micronesia','scribbled','FAS'); +INSERT INTO t2 VALUES (93,018046,37,'scornfully','repetitions','chafe','W'); +INSERT INTO t2 VALUES (94,018048,37,'bellow','Antares','honoring',''); +INSERT INTO t2 VALUES (95,018049,37,'bills','ventilate','realtor',''); +INSERT INTO t2 VALUES (96,018050,37,'cupboard','pityingly','elite',''); +INSERT INTO t2 VALUES (97,018051,37,'sureties','interdependent','funereal',''); +INSERT INTO t2 VALUES (98,018052,37,'puddings','Graves','abrogating',''); +INSERT INTO t2 VALUES (99,018053,50,'tapestry','neonatal','sorters',''); +INSERT INTO t2 VALUES (100,018054,37,'fetters','scribbled','Conley',''); +INSERT INTO t2 VALUES (101,018055,37,'bivalves','chafe','lectured',''); +INSERT INTO t2 VALUES (102,018056,37,'incurring','honoring','Abraham',''); +INSERT INTO t2 VALUES (103,018057,37,'Adolph','realtor','Hawaii','W'); +INSERT INTO t2 VALUES (104,018058,37,'pithed','elite','cage',''); +INSERT INTO t2 VALUES (105,018059,36,'emergency','funereal','hushes',''); +INSERT INTO t2 VALUES (106,018060,37,'Miles','abrogating','Simla',''); +INSERT INTO t2 VALUES (107,018061,37,'trimmings','sorters','reporters',''); +INSERT INTO t2 VALUES (108,018101,37,'tragedies','Conley','Dutchman','FAS'); +INSERT INTO t2 VALUES (109,018102,37,'skulking','lectured','descendants','FAS'); +INSERT INTO t2 VALUES (110,018103,37,'flint','Abraham','groupings','FAS'); +INSERT INTO t2 VALUES (111,018104,37,'flopping','Hawaii','dissociate',''); +INSERT INTO t2 VALUES (112,018201,37,'relaxing','cage','coexist','W'); +INSERT INTO t2 VALUES (113,018202,37,'offload','hushes','Beebe',''); +INSERT INTO t2 VALUES (114,018402,37,'suites','Simla','Taoism',''); +INSERT INTO t2 VALUES (115,018403,37,'lists','reporters','Connally',''); +INSERT INTO t2 VALUES (116,018404,37,'animized','Dutchman','fetched','FAS'); +INSERT INTO t2 VALUES (117,018405,37,'multilayer','descendants','checkpoints','FAS'); +INSERT INTO t2 VALUES (118,018406,37,'standardizes','groupings','rusting',''); +INSERT INTO t2 VALUES (119,018409,37,'Judas','dissociate','galling',''); +INSERT INTO t2 VALUES (120,018601,37,'vacuuming','coexist','obliterates',''); +INSERT INTO t2 VALUES (121,018602,37,'dentally','Beebe','traitor',''); +INSERT INTO t2 VALUES (122,018603,37,'humanness','Taoism','resumes','FAS'); +INSERT INTO t2 VALUES (123,018801,37,'inch','Connally','analyzable','FAS'); +INSERT INTO t2 VALUES (124,018802,37,'Weissmuller','fetched','terminator','FAS'); +INSERT INTO t2 VALUES (125,018803,37,'irresponsibly','checkpoints','gritty','FAS'); +INSERT INTO t2 VALUES (126,018804,37,'luckily','rusting','firearm','W'); +INSERT INTO t2 VALUES (127,018805,37,'culled','galling','minima',''); +INSERT INTO t2 VALUES (128,018806,37,'medical','obliterates','Selfridge',''); +INSERT INTO t2 VALUES (129,018807,37,'bloodbath','traitor','disable',''); +INSERT INTO t2 VALUES (130,018808,37,'subschema','resumes','witchcraft','W'); +INSERT INTO t2 VALUES (131,018809,37,'animals','analyzable','betroth','W'); +INSERT INTO t2 VALUES (132,018810,37,'Micronesia','terminator','Manhattanize',''); +INSERT INTO t2 VALUES (133,018811,37,'repetitions','gritty','imprint',''); +INSERT INTO t2 VALUES (134,018812,37,'Antares','firearm','peeked',''); +INSERT INTO t2 VALUES (135,019101,37,'ventilate','minima','swelling',''); +INSERT INTO t2 VALUES (136,019102,37,'pityingly','Selfridge','interrelationships','W'); +INSERT INTO t2 VALUES (137,019103,37,'interdependent','disable','riser',''); +INSERT INTO t2 VALUES (138,019201,37,'Graves','witchcraft','Gandhian','W'); +INSERT INTO t2 VALUES (139,030501,37,'neonatal','betroth','peacock','A'); +INSERT INTO t2 VALUES (140,030502,50,'scribbled','Manhattanize','bee','A'); +INSERT INTO t2 VALUES (141,030503,37,'chafe','imprint','kanji',''); +INSERT INTO t2 VALUES (142,030504,37,'honoring','peeked','dental',''); +INSERT INTO t2 VALUES (143,031901,37,'realtor','swelling','scarf','FAS'); +INSERT INTO t2 VALUES (144,036001,37,'elite','interrelationships','chasm','A'); +INSERT INTO t2 VALUES (145,036002,37,'funereal','riser','insolence','A'); +INSERT INTO t2 VALUES (146,036004,37,'abrogating','Gandhian','syndicate',''); +INSERT INTO t2 VALUES (147,036005,37,'sorters','peacock','alike',''); +INSERT INTO t2 VALUES (148,038001,37,'Conley','bee','imperial','A'); +INSERT INTO t2 VALUES (149,038002,37,'lectured','kanji','convulsion','A'); +INSERT INTO t2 VALUES (150,038003,37,'Abraham','dental','railway','A'); +INSERT INTO t2 VALUES (151,038004,37,'Hawaii','scarf','validate','A'); +INSERT INTO t2 VALUES (152,038005,37,'cage','chasm','normalizes','A'); +INSERT INTO t2 VALUES (153,038006,37,'hushes','insolence','comprehensive',''); +INSERT INTO t2 VALUES (154,038007,37,'Simla','syndicate','chewing',''); +INSERT INTO t2 VALUES (155,038008,37,'reporters','alike','denizen',''); +INSERT INTO t2 VALUES (156,038009,37,'Dutchman','imperial','schemer',''); +INSERT INTO t2 VALUES (157,038010,37,'descendants','convulsion','chronicle',''); +INSERT INTO t2 VALUES (158,038011,37,'groupings','railway','Kline',''); +INSERT INTO t2 VALUES (159,038012,37,'dissociate','validate','Anatole',''); +INSERT INTO t2 VALUES (160,038013,37,'coexist','normalizes','partridges',''); +INSERT INTO t2 VALUES (161,038014,37,'Beebe','comprehensive','brunch',''); +INSERT INTO t2 VALUES (162,038015,37,'Taoism','chewing','recruited',''); +INSERT INTO t2 VALUES (163,038016,37,'Connally','denizen','dimensions','W'); +INSERT INTO t2 VALUES (164,038017,37,'fetched','schemer','Chicana','W'); +INSERT INTO t2 VALUES (165,038018,37,'checkpoints','chronicle','announced',''); +INSERT INTO t2 VALUES (166,038101,37,'rusting','Kline','praised','FAS'); +INSERT INTO t2 VALUES (167,038102,37,'galling','Anatole','employing',''); +INSERT INTO t2 VALUES (168,038103,37,'obliterates','partridges','linear',''); +INSERT INTO t2 VALUES (169,038104,37,'traitor','brunch','quagmire',''); +INSERT INTO t2 VALUES (170,038201,37,'resumes','recruited','western','A'); +INSERT INTO t2 VALUES (171,038202,37,'analyzable','dimensions','relishing',''); +INSERT INTO t2 VALUES (172,038203,37,'terminator','Chicana','serving','A'); +INSERT INTO t2 VALUES (173,038204,37,'gritty','announced','scheduling',''); +INSERT INTO t2 VALUES (174,038205,37,'firearm','praised','lore',''); +INSERT INTO t2 VALUES (175,038206,37,'minima','employing','eventful',''); +INSERT INTO t2 VALUES (176,038208,37,'Selfridge','linear','arteriole','A'); +INSERT INTO t2 VALUES (177,042801,37,'disable','quagmire','disentangle',''); +INSERT INTO t2 VALUES (178,042802,37,'witchcraft','western','cured','A'); +INSERT INTO t2 VALUES (179,046101,37,'betroth','relishing','Fenton','W'); +INSERT INTO t2 VALUES (180,048001,37,'Manhattanize','serving','avoidable','A'); +INSERT INTO t2 VALUES (181,048002,37,'imprint','scheduling','drains','A'); +INSERT INTO t2 VALUES (182,048003,37,'peeked','lore','detectably','FAS'); +INSERT INTO t2 VALUES (183,048004,37,'swelling','eventful','husky',''); +INSERT INTO t2 VALUES (184,048005,37,'interrelationships','arteriole','impelling',''); +INSERT INTO t2 VALUES (185,048006,37,'riser','disentangle','undoes',''); +INSERT INTO t2 VALUES (186,048007,37,'Gandhian','cured','evened',''); +INSERT INTO t2 VALUES (187,048008,37,'peacock','Fenton','squeezes',''); +INSERT INTO t2 VALUES (188,048101,37,'bee','avoidable','destroyer','FAS'); +INSERT INTO t2 VALUES (189,048102,37,'kanji','drains','rudeness',''); +INSERT INTO t2 VALUES (190,048201,37,'dental','detectably','beaner','FAS'); +INSERT INTO t2 VALUES (191,048202,37,'scarf','husky','boorish',''); +INSERT INTO t2 VALUES (192,048203,37,'chasm','impelling','Everhart',''); +INSERT INTO t2 VALUES (193,048204,37,'insolence','undoes','encompass','A'); +INSERT INTO t2 VALUES (194,048205,37,'syndicate','evened','mushrooms',''); +INSERT INTO t2 VALUES (195,048301,37,'alike','squeezes','Alison','A'); +INSERT INTO t2 VALUES (196,048302,37,'imperial','destroyer','externally','FAS'); +INSERT INTO t2 VALUES (197,048303,37,'convulsion','rudeness','pellagra',''); +INSERT INTO t2 VALUES (198,048304,37,'railway','beaner','cult',''); +INSERT INTO t2 VALUES (199,048305,37,'validate','boorish','creek','A'); +INSERT INTO t2 VALUES (200,048401,37,'normalizes','Everhart','Huffman',''); +INSERT INTO t2 VALUES (201,048402,37,'comprehensive','encompass','Majorca','FAS'); +INSERT INTO t2 VALUES (202,048403,37,'chewing','mushrooms','governing','A'); +INSERT INTO t2 VALUES (203,048404,37,'denizen','Alison','gadfly','FAS'); +INSERT INTO t2 VALUES (204,048405,37,'schemer','externally','reassigned','FAS'); +INSERT INTO t2 VALUES (205,048406,37,'chronicle','pellagra','intentness','W'); +INSERT INTO t2 VALUES (206,048407,37,'Kline','cult','craziness',''); +INSERT INTO t2 VALUES (207,048408,37,'Anatole','creek','psychic',''); +INSERT INTO t2 VALUES (208,048409,37,'partridges','Huffman','squabbled',''); +INSERT INTO t2 VALUES (209,048410,37,'brunch','Majorca','burlesque',''); +INSERT INTO t2 VALUES (210,048411,37,'recruited','governing','capped',''); +INSERT INTO t2 VALUES (211,048412,37,'dimensions','gadfly','extracted','A'); +INSERT INTO t2 VALUES (212,048413,37,'Chicana','reassigned','DiMaggio',''); +INSERT INTO t2 VALUES (213,048601,37,'announced','intentness','exclamation','FAS'); +INSERT INTO t2 VALUES (214,048602,37,'praised','craziness','subdirectory',''); +INSERT INTO t2 VALUES (215,048603,37,'employing','psychic','fangs',''); +INSERT INTO t2 VALUES (216,048604,37,'linear','squabbled','buyer','A'); +INSERT INTO t2 VALUES (217,048801,37,'quagmire','burlesque','pithing','A'); +INSERT INTO t2 VALUES (218,050901,37,'western','capped','transistorizing','A'); +INSERT INTO t2 VALUES (219,051201,37,'relishing','extracted','nonbiodegradable',''); +INSERT INTO t2 VALUES (220,056002,37,'serving','DiMaggio','dislocate',''); +INSERT INTO t2 VALUES (221,056003,37,'scheduling','exclamation','monochromatic','FAS'); +INSERT INTO t2 VALUES (222,056004,37,'lore','subdirectory','batting',''); +INSERT INTO t2 VALUES (223,056102,37,'eventful','fangs','postcondition','A'); +INSERT INTO t2 VALUES (224,056203,37,'arteriole','buyer','catalog','FAS'); +INSERT INTO t2 VALUES (225,056204,37,'disentangle','pithing','Remus',''); +INSERT INTO t2 VALUES (226,058003,37,'cured','transistorizing','devices','A'); +INSERT INTO t2 VALUES (227,058004,37,'Fenton','nonbiodegradable','bike','A'); +INSERT INTO t2 VALUES (228,058005,37,'avoidable','dislocate','qualify',''); +INSERT INTO t2 VALUES (229,058006,37,'drains','monochromatic','detained',''); +INSERT INTO t2 VALUES (230,058007,37,'detectably','batting','commended',''); +INSERT INTO t2 VALUES (231,058101,37,'husky','postcondition','civilize',''); +INSERT INTO t2 VALUES (232,058102,37,'impelling','catalog','Elmhurst',''); +INSERT INTO t2 VALUES (233,058103,37,'undoes','Remus','anesthetizing',''); +INSERT INTO t2 VALUES (234,058105,37,'evened','devices','deaf',''); +INSERT INTO t2 VALUES (235,058111,37,'squeezes','bike','Brigham',''); +INSERT INTO t2 VALUES (236,058112,37,'destroyer','qualify','title',''); +INSERT INTO t2 VALUES (237,058113,37,'rudeness','detained','coarse',''); +INSERT INTO t2 VALUES (238,058114,37,'beaner','commended','combinations',''); +INSERT INTO t2 VALUES (239,058115,37,'boorish','civilize','grayness',''); +INSERT INTO t2 VALUES (240,058116,37,'Everhart','Elmhurst','innumerable','FAS'); +INSERT INTO t2 VALUES (241,058117,37,'encompass','anesthetizing','Caroline','A'); +INSERT INTO t2 VALUES (242,058118,37,'mushrooms','deaf','fatty','FAS'); +INSERT INTO t2 VALUES (243,058119,37,'Alison','Brigham','eastbound',''); +INSERT INTO t2 VALUES (244,058120,37,'externally','title','inexperienced',''); +INSERT INTO t2 VALUES (245,058121,37,'pellagra','coarse','hoarder','A'); +INSERT INTO t2 VALUES (246,058122,37,'cult','combinations','scotch','W'); +INSERT INTO t2 VALUES (247,058123,37,'creek','grayness','passport','A'); +INSERT INTO t2 VALUES (248,058124,37,'Huffman','innumerable','strategic','FAS'); +INSERT INTO t2 VALUES (249,058125,37,'Majorca','Caroline','gated',''); +INSERT INTO t2 VALUES (250,058126,37,'governing','fatty','flog',''); +INSERT INTO t2 VALUES (251,058127,37,'gadfly','eastbound','Pipestone',''); +INSERT INTO t2 VALUES (252,058128,37,'reassigned','inexperienced','Dar',''); +INSERT INTO t2 VALUES (253,058201,37,'intentness','hoarder','Corcoran',''); +INSERT INTO t2 VALUES (254,058202,37,'craziness','scotch','flyers','A'); +INSERT INTO t2 VALUES (255,058303,37,'psychic','passport','competitions','W'); +INSERT INTO t2 VALUES (256,058304,37,'squabbled','strategic','suppliers','FAS'); +INSERT INTO t2 VALUES (257,058602,37,'burlesque','gated','skips',''); +INSERT INTO t2 VALUES (258,058603,37,'capped','flog','institutes',''); +INSERT INTO t2 VALUES (259,058604,37,'extracted','Pipestone','troop','A'); +INSERT INTO t2 VALUES (260,058605,37,'DiMaggio','Dar','connective','W'); +INSERT INTO t2 VALUES (261,058606,37,'exclamation','Corcoran','denies',''); +INSERT INTO t2 VALUES (262,058607,37,'subdirectory','flyers','polka',''); +INSERT INTO t2 VALUES (263,060401,36,'fangs','competitions','observations','FAS'); +INSERT INTO t2 VALUES (264,061701,36,'buyer','suppliers','askers',''); +INSERT INTO t2 VALUES (265,066201,36,'pithing','skips','homeless','FAS'); +INSERT INTO t2 VALUES (266,066501,36,'transistorizing','institutes','Anna',''); +INSERT INTO t2 VALUES (267,068001,36,'nonbiodegradable','troop','subdirectories','W'); +INSERT INTO t2 VALUES (268,068002,36,'dislocate','connective','decaying','FAS'); +INSERT INTO t2 VALUES (269,068005,36,'monochromatic','denies','outwitting','W'); +INSERT INTO t2 VALUES (270,068006,36,'batting','polka','Harpy','W'); +INSERT INTO t2 VALUES (271,068007,36,'postcondition','observations','crazed',''); +INSERT INTO t2 VALUES (272,068008,36,'catalog','askers','suffocate',''); +INSERT INTO t2 VALUES (273,068009,36,'Remus','homeless','provers','FAS'); +INSERT INTO t2 VALUES (274,068010,36,'devices','Anna','technically',''); +INSERT INTO t2 VALUES (275,068011,36,'bike','subdirectories','Franklinizations',''); +INSERT INTO t2 VALUES (276,068202,36,'qualify','decaying','considered',''); +INSERT INTO t2 VALUES (277,068302,36,'detained','outwitting','tinnily',''); +INSERT INTO t2 VALUES (278,068303,36,'commended','Harpy','uninterruptedly',''); +INSERT INTO t2 VALUES (279,068401,36,'civilize','crazed','whistled','A'); +INSERT INTO t2 VALUES (280,068501,36,'Elmhurst','suffocate','automate',''); +INSERT INTO t2 VALUES (281,068502,36,'anesthetizing','provers','gutting','W'); +INSERT INTO t2 VALUES (282,068503,36,'deaf','technically','surreptitious',''); +INSERT INTO t2 VALUES (283,068602,36,'Brigham','Franklinizations','Choctaw',''); +INSERT INTO t2 VALUES (284,068603,36,'title','considered','cooks',''); +INSERT INTO t2 VALUES (285,068701,36,'coarse','tinnily','millivolt','FAS'); +INSERT INTO t2 VALUES (286,068702,36,'combinations','uninterruptedly','counterpoise',''); +INSERT INTO t2 VALUES (287,068703,36,'grayness','whistled','Gothicism',''); +INSERT INTO t2 VALUES (288,076001,36,'innumerable','automate','feminine',''); +INSERT INTO t2 VALUES (289,076002,36,'Caroline','gutting','metaphysically','W'); +INSERT INTO t2 VALUES (290,076101,36,'fatty','surreptitious','sanding','A'); +INSERT INTO t2 VALUES (291,076102,36,'eastbound','Choctaw','contributorily',''); +INSERT INTO t2 VALUES (292,076103,36,'inexperienced','cooks','receivers','FAS'); +INSERT INTO t2 VALUES (293,076302,36,'hoarder','millivolt','adjourn',''); +INSERT INTO t2 VALUES (294,076303,36,'scotch','counterpoise','straggled','A'); +INSERT INTO t2 VALUES (295,076304,36,'passport','Gothicism','druggists',''); +INSERT INTO t2 VALUES (296,076305,36,'strategic','feminine','thanking','FAS'); +INSERT INTO t2 VALUES (297,076306,36,'gated','metaphysically','ostrich',''); +INSERT INTO t2 VALUES (298,076307,36,'flog','sanding','hopelessness','FAS'); +INSERT INTO t2 VALUES (299,076402,36,'Pipestone','contributorily','Eurydice',''); +INSERT INTO t2 VALUES (300,076501,36,'Dar','receivers','excitation','W'); +INSERT INTO t2 VALUES (301,076502,36,'Corcoran','adjourn','presumes','FAS'); +INSERT INTO t2 VALUES (302,076701,36,'flyers','straggled','imaginable','FAS'); +INSERT INTO t2 VALUES (303,078001,36,'competitions','druggists','concoct','W'); +INSERT INTO t2 VALUES (304,078002,36,'suppliers','thanking','peering','W'); +INSERT INTO t2 VALUES (305,078003,36,'skips','ostrich','Phelps','FAS'); +INSERT INTO t2 VALUES (306,078004,36,'institutes','hopelessness','ferociousness','FAS'); +INSERT INTO t2 VALUES (307,078005,36,'troop','Eurydice','sentences',''); +INSERT INTO t2 VALUES (308,078006,36,'connective','excitation','unlocks',''); +INSERT INTO t2 VALUES (309,078007,36,'denies','presumes','engrossing','W'); +INSERT INTO t2 VALUES (310,078008,36,'polka','imaginable','Ruth',''); +INSERT INTO t2 VALUES (311,078101,36,'observations','concoct','tying',''); +INSERT INTO t2 VALUES (312,078103,36,'askers','peering','exclaimers',''); +INSERT INTO t2 VALUES (313,078104,36,'homeless','Phelps','synergy',''); +INSERT INTO t2 VALUES (314,078105,36,'Anna','ferociousness','Huey','W'); +INSERT INTO t2 VALUES (315,082101,36,'subdirectories','sentences','merging',''); +INSERT INTO t2 VALUES (316,083401,36,'decaying','unlocks','judges','A'); +INSERT INTO t2 VALUES (317,084001,36,'outwitting','engrossing','Shylock','W'); +INSERT INTO t2 VALUES (318,084002,36,'Harpy','Ruth','Miltonism',''); +INSERT INTO t2 VALUES (319,086001,36,'crazed','tying','hen','W'); +INSERT INTO t2 VALUES (320,086102,36,'suffocate','exclaimers','honeybee','FAS'); +INSERT INTO t2 VALUES (321,086201,36,'provers','synergy','towers',''); +INSERT INTO t2 VALUES (322,088001,36,'technically','Huey','dilutes','W'); +INSERT INTO t2 VALUES (323,088002,36,'Franklinizations','merging','numerals','FAS'); +INSERT INTO t2 VALUES (324,088003,36,'considered','judges','democracy','FAS'); +INSERT INTO t2 VALUES (325,088004,36,'tinnily','Shylock','Ibero-',''); +INSERT INTO t2 VALUES (326,088101,36,'uninterruptedly','Miltonism','invalids',''); +INSERT INTO t2 VALUES (327,088102,36,'whistled','hen','behavior',''); +INSERT INTO t2 VALUES (328,088103,36,'automate','honeybee','accruing',''); +INSERT INTO t2 VALUES (329,088104,36,'gutting','towers','relics','A'); +INSERT INTO t2 VALUES (330,088105,36,'surreptitious','dilutes','rackets',''); +INSERT INTO t2 VALUES (331,088106,36,'Choctaw','numerals','Fischbein','W'); +INSERT INTO t2 VALUES (332,088201,36,'cooks','democracy','phony','W'); +INSERT INTO t2 VALUES (333,088203,36,'millivolt','Ibero-','cross','FAS'); +INSERT INTO t2 VALUES (334,088204,36,'counterpoise','invalids','cleanup',''); +INSERT INTO t2 VALUES (335,088302,37,'Gothicism','behavior','conspirator',''); +INSERT INTO t2 VALUES (336,088303,37,'feminine','accruing','label','FAS'); +INSERT INTO t2 VALUES (337,088305,37,'metaphysically','relics','university',''); +INSERT INTO t2 VALUES (338,088402,37,'sanding','rackets','cleansed','FAS'); +INSERT INTO t2 VALUES (339,088501,36,'contributorily','Fischbein','ballgown',''); +INSERT INTO t2 VALUES (340,088502,36,'receivers','phony','starlet',''); +INSERT INTO t2 VALUES (341,088503,36,'adjourn','cross','aqueous',''); +INSERT INTO t2 VALUES (342,098001,58,'straggled','cleanup','portrayal','A'); +INSERT INTO t2 VALUES (343,098002,58,'druggists','conspirator','despising','W'); +INSERT INTO t2 VALUES (344,098003,58,'thanking','label','distort','W'); +INSERT INTO t2 VALUES (345,098004,58,'ostrich','university','palmed',''); +INSERT INTO t2 VALUES (346,098005,58,'hopelessness','cleansed','faced',''); +INSERT INTO t2 VALUES (347,098006,58,'Eurydice','ballgown','silverware',''); +INSERT INTO t2 VALUES (348,141903,29,'excitation','starlet','assessor',''); +INSERT INTO t2 VALUES (349,098008,58,'presumes','aqueous','spiders',''); +INSERT INTO t2 VALUES (350,098009,58,'imaginable','portrayal','artificially',''); +INSERT INTO t2 VALUES (351,098010,58,'concoct','despising','reminiscence',''); +INSERT INTO t2 VALUES (352,098011,58,'peering','distort','Mexican',''); +INSERT INTO t2 VALUES (353,098012,58,'Phelps','palmed','obnoxious',''); +INSERT INTO t2 VALUES (354,098013,58,'ferociousness','faced','fragile',''); +INSERT INTO t2 VALUES (355,098014,58,'sentences','silverware','apprehensible',''); +INSERT INTO t2 VALUES (356,098015,58,'unlocks','assessor','births',''); +INSERT INTO t2 VALUES (357,098016,58,'engrossing','spiders','garages',''); +INSERT INTO t2 VALUES (358,098017,58,'Ruth','artificially','panty',''); +INSERT INTO t2 VALUES (359,098018,58,'tying','reminiscence','anteater',''); +INSERT INTO t2 VALUES (360,098019,58,'exclaimers','Mexican','displacement','A'); +INSERT INTO t2 VALUES (361,098020,58,'synergy','obnoxious','drovers','A'); +INSERT INTO t2 VALUES (362,098021,58,'Huey','fragile','patenting','A'); +INSERT INTO t2 VALUES (363,098022,58,'merging','apprehensible','far','A'); +INSERT INTO t2 VALUES (364,098023,58,'judges','births','shrieks',''); +INSERT INTO t2 VALUES (365,098024,58,'Shylock','garages','aligning','W'); +INSERT INTO t2 VALUES (366,098025,37,'Miltonism','panty','pragmatism',''); +INSERT INTO t2 VALUES (367,106001,36,'hen','anteater','fevers','W'); +INSERT INTO t2 VALUES (368,108001,36,'honeybee','displacement','reexamines','A'); +INSERT INTO t2 VALUES (369,108002,36,'towers','drovers','occupancies',''); +INSERT INTO t2 VALUES (370,108003,36,'dilutes','patenting','sweats','FAS'); +INSERT INTO t2 VALUES (371,108004,36,'numerals','far','modulators',''); +INSERT INTO t2 VALUES (372,108005,36,'democracy','shrieks','demand','W'); +INSERT INTO t2 VALUES (373,108007,36,'Ibero-','aligning','Madeira',''); +INSERT INTO t2 VALUES (374,108008,36,'invalids','pragmatism','Viennese','W'); +INSERT INTO t2 VALUES (375,108009,36,'behavior','fevers','chillier','W'); +INSERT INTO t2 VALUES (376,108010,36,'accruing','reexamines','wildcats','FAS'); +INSERT INTO t2 VALUES (377,108011,36,'relics','occupancies','gentle',''); +INSERT INTO t2 VALUES (378,108012,36,'rackets','sweats','Angles','W'); +INSERT INTO t2 VALUES (379,108101,36,'Fischbein','modulators','accuracies',''); +INSERT INTO t2 VALUES (380,108102,36,'phony','demand','toggle',''); +INSERT INTO t2 VALUES (381,108103,36,'cross','Madeira','Mendelssohn','W'); +INSERT INTO t2 VALUES (382,108111,50,'cleanup','Viennese','behaviorally',''); +INSERT INTO t2 VALUES (383,108105,36,'conspirator','chillier','Rochford',''); +INSERT INTO t2 VALUES (384,108106,36,'label','wildcats','mirror','W'); +INSERT INTO t2 VALUES (385,108107,36,'university','gentle','Modula',''); +INSERT INTO t2 VALUES (386,108108,50,'cleansed','Angles','clobbering',''); +INSERT INTO t2 VALUES (387,108109,36,'ballgown','accuracies','chronography',''); +INSERT INTO t2 VALUES (388,108110,36,'starlet','toggle','Eskimoizeds',''); +INSERT INTO t2 VALUES (389,108201,36,'aqueous','Mendelssohn','British','W'); +INSERT INTO t2 VALUES (390,108202,36,'portrayal','behaviorally','pitfalls',''); +INSERT INTO t2 VALUES (391,108203,36,'despising','Rochford','verify','W'); +INSERT INTO t2 VALUES (392,108204,36,'distort','mirror','scatter','FAS'); +INSERT INTO t2 VALUES (393,108205,36,'palmed','Modula','Aztecan',''); +INSERT INTO t2 VALUES (394,108301,36,'faced','clobbering','acuity','W'); +INSERT INTO t2 VALUES (395,108302,36,'silverware','chronography','sinking','W'); +INSERT INTO t2 VALUES (396,112101,36,'assessor','Eskimoizeds','beasts','FAS'); +INSERT INTO t2 VALUES (397,112102,36,'spiders','British','Witt','W'); +INSERT INTO t2 VALUES (398,113701,36,'artificially','pitfalls','physicists','FAS'); +INSERT INTO t2 VALUES (399,116001,36,'reminiscence','verify','folksong','A'); +INSERT INTO t2 VALUES (400,116201,36,'Mexican','scatter','strokes','FAS'); +INSERT INTO t2 VALUES (401,116301,36,'obnoxious','Aztecan','crowder',''); +INSERT INTO t2 VALUES (402,116302,36,'fragile','acuity','merry',''); +INSERT INTO t2 VALUES (403,116601,36,'apprehensible','sinking','cadenced',''); +INSERT INTO t2 VALUES (404,116602,36,'births','beasts','alimony','A'); +INSERT INTO t2 VALUES (405,116603,36,'garages','Witt','principled','A'); +INSERT INTO t2 VALUES (406,116701,36,'panty','physicists','golfing',''); +INSERT INTO t2 VALUES (407,116702,36,'anteater','folksong','undiscovered',''); +INSERT INTO t2 VALUES (408,118001,36,'displacement','strokes','irritates',''); +INSERT INTO t2 VALUES (409,118002,36,'drovers','crowder','patriots','A'); +INSERT INTO t2 VALUES (410,118003,36,'patenting','merry','rooms','FAS'); +INSERT INTO t2 VALUES (411,118004,36,'far','cadenced','towering','W'); +INSERT INTO t2 VALUES (412,118005,36,'shrieks','alimony','displease',''); +INSERT INTO t2 VALUES (413,118006,36,'aligning','principled','photosensitive',''); +INSERT INTO t2 VALUES (414,118007,36,'pragmatism','golfing','inking',''); +INSERT INTO t2 VALUES (415,118008,36,'fevers','undiscovered','gainers',''); +INSERT INTO t2 VALUES (416,118101,36,'reexamines','irritates','leaning','A'); +INSERT INTO t2 VALUES (417,118102,36,'occupancies','patriots','hydrant','A'); +INSERT INTO t2 VALUES (418,118103,36,'sweats','rooms','preserve',''); +INSERT INTO t2 VALUES (419,118202,36,'modulators','towering','blinded','A'); +INSERT INTO t2 VALUES (420,118203,36,'demand','displease','interactions','A'); +INSERT INTO t2 VALUES (421,118204,36,'Madeira','photosensitive','Barry',''); +INSERT INTO t2 VALUES (422,118302,36,'Viennese','inking','whiteness','A'); +INSERT INTO t2 VALUES (423,118304,36,'chillier','gainers','pastimes','W'); +INSERT INTO t2 VALUES (424,118305,36,'wildcats','leaning','Edenization',''); +INSERT INTO t2 VALUES (425,118306,36,'gentle','hydrant','Muscat',''); +INSERT INTO t2 VALUES (426,118307,36,'Angles','preserve','assassinated',''); +INSERT INTO t2 VALUES (427,123101,36,'accuracies','blinded','labeled',''); +INSERT INTO t2 VALUES (428,123102,36,'toggle','interactions','glacial','A'); +INSERT INTO t2 VALUES (429,123301,36,'Mendelssohn','Barry','implied','W'); +INSERT INTO t2 VALUES (430,126001,36,'behaviorally','whiteness','bibliographies','W'); +INSERT INTO t2 VALUES (431,126002,36,'Rochford','pastimes','Buchanan',''); +INSERT INTO t2 VALUES (432,126003,36,'mirror','Edenization','forgivably','FAS'); +INSERT INTO t2 VALUES (433,126101,36,'Modula','Muscat','innuendo','A'); +INSERT INTO t2 VALUES (434,126301,36,'clobbering','assassinated','den','FAS'); +INSERT INTO t2 VALUES (435,126302,36,'chronography','labeled','submarines','W'); +INSERT INTO t2 VALUES (436,126402,36,'Eskimoizeds','glacial','mouthful','A'); +INSERT INTO t2 VALUES (437,126601,36,'British','implied','expiring',''); +INSERT INTO t2 VALUES (438,126602,36,'pitfalls','bibliographies','unfulfilled','FAS'); +INSERT INTO t2 VALUES (439,126702,36,'verify','Buchanan','precession',''); +INSERT INTO t2 VALUES (440,128001,36,'scatter','forgivably','nullified',''); +INSERT INTO t2 VALUES (441,128002,36,'Aztecan','innuendo','affects',''); +INSERT INTO t2 VALUES (442,128003,36,'acuity','den','Cynthia',''); +INSERT INTO t2 VALUES (443,128004,36,'sinking','submarines','Chablis','A'); +INSERT INTO t2 VALUES (444,128005,36,'beasts','mouthful','betterments','FAS'); +INSERT INTO t2 VALUES (445,128007,36,'Witt','expiring','advertising',''); +INSERT INTO t2 VALUES (446,128008,36,'physicists','unfulfilled','rubies','A'); +INSERT INTO t2 VALUES (447,128009,36,'folksong','precession','southwest','FAS'); +INSERT INTO t2 VALUES (448,128010,36,'strokes','nullified','superstitious','A'); +INSERT INTO t2 VALUES (449,128011,36,'crowder','affects','tabernacle','W'); +INSERT INTO t2 VALUES (450,128012,36,'merry','Cynthia','silk','A'); +INSERT INTO t2 VALUES (451,128013,36,'cadenced','Chablis','handsomest','A'); +INSERT INTO t2 VALUES (452,128014,36,'alimony','betterments','Persian','A'); +INSERT INTO t2 VALUES (453,128015,36,'principled','advertising','analog','W'); +INSERT INTO t2 VALUES (454,128016,36,'golfing','rubies','complex','W'); +INSERT INTO t2 VALUES (455,128017,36,'undiscovered','southwest','Taoist',''); +INSERT INTO t2 VALUES (456,128018,36,'irritates','superstitious','suspend',''); +INSERT INTO t2 VALUES (457,128019,36,'patriots','tabernacle','relegated',''); +INSERT INTO t2 VALUES (458,128020,36,'rooms','silk','awesome','W'); +INSERT INTO t2 VALUES (459,128021,36,'towering','handsomest','Bruxelles',''); +INSERT INTO t2 VALUES (460,128022,36,'displease','Persian','imprecisely','A'); +INSERT INTO t2 VALUES (461,128023,36,'photosensitive','analog','televise',''); +INSERT INTO t2 VALUES (462,128101,36,'inking','complex','braking',''); +INSERT INTO t2 VALUES (463,128102,36,'gainers','Taoist','true','FAS'); +INSERT INTO t2 VALUES (464,128103,36,'leaning','suspend','disappointing','FAS'); +INSERT INTO t2 VALUES (465,128104,36,'hydrant','relegated','navally','W'); +INSERT INTO t2 VALUES (466,128106,36,'preserve','awesome','circus',''); +INSERT INTO t2 VALUES (467,128107,36,'blinded','Bruxelles','beetles',''); +INSERT INTO t2 VALUES (468,128108,36,'interactions','imprecisely','trumps',''); +INSERT INTO t2 VALUES (469,128202,36,'Barry','televise','fourscore','W'); +INSERT INTO t2 VALUES (470,128203,36,'whiteness','braking','Blackfoots',''); +INSERT INTO t2 VALUES (471,128301,36,'pastimes','true','Grady',''); +INSERT INTO t2 VALUES (472,128302,36,'Edenization','disappointing','quiets','FAS'); +INSERT INTO t2 VALUES (473,128303,36,'Muscat','navally','floundered','FAS'); +INSERT INTO t2 VALUES (474,128304,36,'assassinated','circus','profundity','W'); +INSERT INTO t2 VALUES (475,128305,36,'labeled','beetles','Garrisonian','W'); +INSERT INTO t2 VALUES (476,128307,36,'glacial','trumps','Strauss',''); +INSERT INTO t2 VALUES (477,128401,36,'implied','fourscore','cemented','FAS'); +INSERT INTO t2 VALUES (478,128502,36,'bibliographies','Blackfoots','contrition','A'); +INSERT INTO t2 VALUES (479,128503,36,'Buchanan','Grady','mutations',''); +INSERT INTO t2 VALUES (480,128504,36,'forgivably','quiets','exhibits','W'); +INSERT INTO t2 VALUES (481,128505,36,'innuendo','floundered','tits',''); +INSERT INTO t2 VALUES (482,128601,36,'den','profundity','mate','A'); +INSERT INTO t2 VALUES (483,128603,36,'submarines','Garrisonian','arches',''); +INSERT INTO t2 VALUES (484,128604,36,'mouthful','Strauss','Moll',''); +INSERT INTO t2 VALUES (485,128702,36,'expiring','cemented','ropers',''); +INSERT INTO t2 VALUES (486,128703,36,'unfulfilled','contrition','bombast',''); +INSERT INTO t2 VALUES (487,128704,36,'precession','mutations','difficultly','A'); +INSERT INTO t2 VALUES (488,138001,36,'nullified','exhibits','adsorption',''); +INSERT INTO t2 VALUES (489,138002,36,'affects','tits','definiteness','FAS'); +INSERT INTO t2 VALUES (490,138003,36,'Cynthia','mate','cultivation','A'); +INSERT INTO t2 VALUES (491,138004,36,'Chablis','arches','heals','A'); +INSERT INTO t2 VALUES (492,138005,36,'betterments','Moll','Heusen','W'); +INSERT INTO t2 VALUES (493,138006,36,'advertising','ropers','target','FAS'); +INSERT INTO t2 VALUES (494,138007,36,'rubies','bombast','cited','A'); +INSERT INTO t2 VALUES (495,138008,36,'southwest','difficultly','congresswoman','W'); +INSERT INTO t2 VALUES (496,138009,36,'superstitious','adsorption','Katherine',''); +INSERT INTO t2 VALUES (497,138102,36,'tabernacle','definiteness','titter','A'); +INSERT INTO t2 VALUES (498,138103,36,'silk','cultivation','aspire','A'); +INSERT INTO t2 VALUES (499,138104,36,'handsomest','heals','Mardis',''); +INSERT INTO t2 VALUES (500,138105,36,'Persian','Heusen','Nadia','W'); +INSERT INTO t2 VALUES (501,138201,36,'analog','target','estimating','FAS'); +INSERT INTO t2 VALUES (502,138302,36,'complex','cited','stuck','A'); +INSERT INTO t2 VALUES (503,138303,36,'Taoist','congresswoman','fifteenth','A'); +INSERT INTO t2 VALUES (504,138304,36,'suspend','Katherine','Colombo',''); +INSERT INTO t2 VALUES (505,138401,29,'relegated','titter','survey','A'); +INSERT INTO t2 VALUES (506,140102,29,'awesome','aspire','staffing',''); +INSERT INTO t2 VALUES (507,140103,29,'Bruxelles','Mardis','obtain',''); +INSERT INTO t2 VALUES (508,140104,29,'imprecisely','Nadia','loaded',''); +INSERT INTO t2 VALUES (509,140105,29,'televise','estimating','slaughtered',''); +INSERT INTO t2 VALUES (510,140201,29,'braking','stuck','lights','A'); +INSERT INTO t2 VALUES (511,140701,29,'true','fifteenth','circumference',''); +INSERT INTO t2 VALUES (512,141501,29,'disappointing','Colombo','dull','A'); +INSERT INTO t2 VALUES (513,141502,29,'navally','survey','weekly','A'); +INSERT INTO t2 VALUES (514,141901,29,'circus','staffing','wetness',''); +INSERT INTO t2 VALUES (515,141902,29,'beetles','obtain','visualized',''); +INSERT INTO t2 VALUES (516,142101,29,'trumps','loaded','Tannenbaum',''); +INSERT INTO t2 VALUES (517,142102,29,'fourscore','slaughtered','moribund',''); +INSERT INTO t2 VALUES (518,142103,29,'Blackfoots','lights','demultiplex',''); +INSERT INTO t2 VALUES (519,142701,29,'Grady','circumference','lockings',''); +INSERT INTO t2 VALUES (520,143001,29,'quiets','dull','thugs','FAS'); +INSERT INTO t2 VALUES (521,143501,29,'floundered','weekly','unnerves',''); +INSERT INTO t2 VALUES (522,143502,29,'profundity','wetness','abut',''); +INSERT INTO t2 VALUES (523,148001,29,'Garrisonian','visualized','Chippewa','A'); +INSERT INTO t2 VALUES (524,148002,29,'Strauss','Tannenbaum','stratifications','A'); +INSERT INTO t2 VALUES (525,148003,29,'cemented','moribund','signaled',''); +INSERT INTO t2 VALUES (526,148004,29,'contrition','demultiplex','Italianizes','A'); +INSERT INTO t2 VALUES (527,148005,29,'mutations','lockings','algorithmic','A'); +INSERT INTO t2 VALUES (528,148006,29,'exhibits','thugs','paranoid','FAS'); +INSERT INTO t2 VALUES (529,148007,29,'tits','unnerves','camping','A'); +INSERT INTO t2 VALUES (530,148009,29,'mate','abut','signifying','A'); +INSERT INTO t2 VALUES (531,148010,29,'arches','Chippewa','Patrice','W'); +INSERT INTO t2 VALUES (532,148011,29,'Moll','stratifications','search','A'); +INSERT INTO t2 VALUES (533,148012,29,'ropers','signaled','Angeles','A'); +INSERT INTO t2 VALUES (534,148013,29,'bombast','Italianizes','semblance',''); +INSERT INTO t2 VALUES (535,148023,36,'difficultly','algorithmic','taxed',''); +INSERT INTO t2 VALUES (536,148015,29,'adsorption','paranoid','Beatrice',''); +INSERT INTO t2 VALUES (537,148016,29,'definiteness','camping','retrace',''); +INSERT INTO t2 VALUES (538,148017,29,'cultivation','signifying','lockout',''); +INSERT INTO t2 VALUES (539,148018,29,'heals','Patrice','grammatic',''); +INSERT INTO t2 VALUES (540,148019,29,'Heusen','search','helmsman',''); +INSERT INTO t2 VALUES (541,148020,29,'target','Angeles','uniform','W'); +INSERT INTO t2 VALUES (542,148021,29,'cited','semblance','hamming',''); +INSERT INTO t2 VALUES (543,148022,29,'congresswoman','taxed','disobedience',''); +INSERT INTO t2 VALUES (544,148101,29,'Katherine','Beatrice','captivated','A'); +INSERT INTO t2 VALUES (545,148102,29,'titter','retrace','transferals','A'); +INSERT INTO t2 VALUES (546,148201,29,'aspire','lockout','cartographer','A'); +INSERT INTO t2 VALUES (547,148401,29,'Mardis','grammatic','aims','FAS'); +INSERT INTO t2 VALUES (548,148402,29,'Nadia','helmsman','Pakistani',''); +INSERT INTO t2 VALUES (549,148501,29,'estimating','uniform','burglarized','FAS'); +INSERT INTO t2 VALUES (550,148502,29,'stuck','hamming','saucepans','A'); +INSERT INTO t2 VALUES (551,148503,29,'fifteenth','disobedience','lacerating','A'); +INSERT INTO t2 VALUES (552,148504,29,'Colombo','captivated','corny',''); +INSERT INTO t2 VALUES (553,148601,29,'survey','transferals','megabytes','FAS'); +INSERT INTO t2 VALUES (554,148602,29,'staffing','cartographer','chancellor',''); +INSERT INTO t2 VALUES (555,150701,29,'obtain','aims','bulk','A'); +INSERT INTO t2 VALUES (556,152101,29,'loaded','Pakistani','commits','A'); +INSERT INTO t2 VALUES (557,152102,29,'slaughtered','burglarized','meson','W'); +INSERT INTO t2 VALUES (558,155202,36,'lights','saucepans','deputies',''); +INSERT INTO t2 VALUES (559,155203,29,'circumference','lacerating','northeaster','A'); +INSERT INTO t2 VALUES (560,155204,29,'dull','corny','dipole',''); +INSERT INTO t2 VALUES (561,155205,29,'weekly','megabytes','machining','0'); +INSERT INTO t2 VALUES (562,156001,29,'wetness','chancellor','therefore',''); +INSERT INTO t2 VALUES (563,156002,29,'visualized','bulk','Telefunken',''); +INSERT INTO t2 VALUES (564,156102,29,'Tannenbaum','commits','salvaging',''); +INSERT INTO t2 VALUES (565,156301,29,'moribund','meson','Corinthianizes','A'); +INSERT INTO t2 VALUES (566,156302,29,'demultiplex','deputies','restlessly','A'); +INSERT INTO t2 VALUES (567,156303,29,'lockings','northeaster','bromides',''); +INSERT INTO t2 VALUES (568,156304,29,'thugs','dipole','generalized','A'); +INSERT INTO t2 VALUES (569,156305,29,'unnerves','machining','mishaps',''); +INSERT INTO t2 VALUES (570,156306,29,'abut','therefore','quelling',''); +INSERT INTO t2 VALUES (571,156501,29,'Chippewa','Telefunken','spiritual','A'); +INSERT INTO t2 VALUES (572,158001,29,'stratifications','salvaging','beguiles','FAS'); +INSERT INTO t2 VALUES (573,158002,29,'signaled','Corinthianizes','Trobriand','FAS'); +INSERT INTO t2 VALUES (574,158101,29,'Italianizes','restlessly','fleeing','A'); +INSERT INTO t2 VALUES (575,158102,29,'algorithmic','bromides','Armour','A'); +INSERT INTO t2 VALUES (576,158103,29,'paranoid','generalized','chin','A'); +INSERT INTO t2 VALUES (577,158201,29,'camping','mishaps','provers','A'); +INSERT INTO t2 VALUES (578,158202,29,'signifying','quelling','aeronautic','A'); +INSERT INTO t2 VALUES (579,158203,29,'Patrice','spiritual','voltage','W'); +INSERT INTO t2 VALUES (580,158204,29,'search','beguiles','sash',''); +INSERT INTO t2 VALUES (581,158301,29,'Angeles','Trobriand','anaerobic','A'); +INSERT INTO t2 VALUES (582,158302,29,'semblance','fleeing','simultaneous','A'); +INSERT INTO t2 VALUES (583,158303,29,'taxed','Armour','accumulating','A'); +INSERT INTO t2 VALUES (584,158304,29,'Beatrice','chin','Medusan','A'); +INSERT INTO t2 VALUES (585,158305,29,'retrace','provers','shouted','A'); +INSERT INTO t2 VALUES (586,158306,29,'lockout','aeronautic','freakish',''); +INSERT INTO t2 VALUES (587,158501,29,'grammatic','voltage','index','FAS'); +INSERT INTO t2 VALUES (588,160301,29,'helmsman','sash','commercially',''); +INSERT INTO t2 VALUES (589,166101,50,'uniform','anaerobic','mistiness','A'); +INSERT INTO t2 VALUES (590,166102,50,'hamming','simultaneous','endpoint',''); +INSERT INTO t2 VALUES (591,168001,29,'disobedience','accumulating','straight','A'); +INSERT INTO t2 VALUES (592,168002,29,'captivated','Medusan','flurried',''); +INSERT INTO t2 VALUES (593,168003,29,'transferals','shouted','denotative','A'); +INSERT INTO t2 VALUES (594,168101,29,'cartographer','freakish','coming','FAS'); +INSERT INTO t2 VALUES (595,168102,29,'aims','index','commencements','FAS'); +INSERT INTO t2 VALUES (596,168103,29,'Pakistani','commercially','gentleman',''); +INSERT INTO t2 VALUES (597,168104,29,'burglarized','mistiness','gifted',''); +INSERT INTO t2 VALUES (598,168202,29,'saucepans','endpoint','Shanghais',''); +INSERT INTO t2 VALUES (599,168301,29,'lacerating','straight','sportswriting','A'); +INSERT INTO t2 VALUES (600,168502,29,'corny','flurried','sloping','A'); +INSERT INTO t2 VALUES (601,168503,29,'megabytes','denotative','navies',''); +INSERT INTO t2 VALUES (602,168601,29,'chancellor','coming','leaflet','A'); +INSERT INTO t2 VALUES (603,173001,40,'bulk','commencements','shooter',''); +INSERT INTO t2 VALUES (604,173701,40,'commits','gentleman','Joplin','FAS'); +INSERT INTO t2 VALUES (605,173702,40,'meson','gifted','babies',''); +INSERT INTO t2 VALUES (606,176001,40,'deputies','Shanghais','subdivision','FAS'); +INSERT INTO t2 VALUES (607,176101,40,'northeaster','sportswriting','burstiness','W'); +INSERT INTO t2 VALUES (608,176201,40,'dipole','sloping','belted','FAS'); +INSERT INTO t2 VALUES (609,176401,40,'machining','navies','assails','FAS'); +INSERT INTO t2 VALUES (610,176501,40,'therefore','leaflet','admiring','W'); +INSERT INTO t2 VALUES (611,176601,40,'Telefunken','shooter','swaying','0'); +INSERT INTO t2 VALUES (612,176602,40,'salvaging','Joplin','Goldstine','FAS'); +INSERT INTO t2 VALUES (613,176603,40,'Corinthianizes','babies','fitting',''); +INSERT INTO t2 VALUES (614,178001,40,'restlessly','subdivision','Norwalk','W'); +INSERT INTO t2 VALUES (615,178002,40,'bromides','burstiness','weakening','W'); +INSERT INTO t2 VALUES (616,178003,40,'generalized','belted','analogy','FAS'); +INSERT INTO t2 VALUES (617,178004,40,'mishaps','assails','deludes',''); +INSERT INTO t2 VALUES (618,178005,40,'quelling','admiring','cokes',''); +INSERT INTO t2 VALUES (619,178006,40,'spiritual','swaying','Clayton',''); +INSERT INTO t2 VALUES (620,178007,40,'beguiles','Goldstine','exhausts',''); +INSERT INTO t2 VALUES (621,178008,40,'Trobriand','fitting','causality',''); +INSERT INTO t2 VALUES (622,178101,40,'fleeing','Norwalk','sating','FAS'); +INSERT INTO t2 VALUES (623,178102,40,'Armour','weakening','icon',''); +INSERT INTO t2 VALUES (624,178103,40,'chin','analogy','throttles',''); +INSERT INTO t2 VALUES (625,178201,40,'provers','deludes','communicants','FAS'); +INSERT INTO t2 VALUES (626,178202,40,'aeronautic','cokes','dehydrate','FAS'); +INSERT INTO t2 VALUES (627,178301,40,'voltage','Clayton','priceless','FAS'); +INSERT INTO t2 VALUES (628,178302,40,'sash','exhausts','publicly',''); +INSERT INTO t2 VALUES (629,178401,40,'anaerobic','causality','incidentals','FAS'); +INSERT INTO t2 VALUES (630,178402,40,'simultaneous','sating','commonplace',''); +INSERT INTO t2 VALUES (631,178403,40,'accumulating','icon','mumbles',''); +INSERT INTO t2 VALUES (632,178404,40,'Medusan','throttles','furthermore','W'); +INSERT INTO t2 VALUES (633,178501,40,'shouted','communicants','cautioned','W'); +INSERT INTO t2 VALUES (634,186002,37,'freakish','dehydrate','parametrized','A'); +INSERT INTO t2 VALUES (635,186102,37,'index','priceless','registration','A'); +INSERT INTO t2 VALUES (636,186201,40,'commercially','publicly','sadly','FAS'); +INSERT INTO t2 VALUES (637,186202,40,'mistiness','incidentals','positioning',''); +INSERT INTO t2 VALUES (638,186203,40,'endpoint','commonplace','babysitting',''); +INSERT INTO t2 VALUES (639,186302,37,'straight','mumbles','eternal','A'); +INSERT INTO t2 VALUES (640,188007,37,'flurried','furthermore','hoarder',''); +INSERT INTO t2 VALUES (641,188008,37,'denotative','cautioned','congregates',''); +INSERT INTO t2 VALUES (642,188009,37,'coming','parametrized','rains',''); +INSERT INTO t2 VALUES (643,188010,37,'commencements','registration','workers','W'); +INSERT INTO t2 VALUES (644,188011,37,'gentleman','sadly','sags','A'); +INSERT INTO t2 VALUES (645,188012,37,'gifted','positioning','unplug','W'); +INSERT INTO t2 VALUES (646,188013,37,'Shanghais','babysitting','garage','A'); +INSERT INTO t2 VALUES (647,188014,37,'sportswriting','eternal','boulder','A'); +INSERT INTO t2 VALUES (648,188015,37,'sloping','hoarder','hollowly','A'); +INSERT INTO t2 VALUES (649,188016,37,'navies','congregates','specifics',''); +INSERT INTO t2 VALUES (650,188017,37,'leaflet','rains','Teresa',''); +INSERT INTO t2 VALUES (651,188102,37,'shooter','workers','Winsett',''); +INSERT INTO t2 VALUES (652,188103,37,'Joplin','sags','convenient','A'); +INSERT INTO t2 VALUES (653,188202,37,'babies','unplug','buckboards','FAS'); +INSERT INTO t2 VALUES (654,188301,40,'subdivision','garage','amenities',''); +INSERT INTO t2 VALUES (655,188302,40,'burstiness','boulder','resplendent','FAS'); +INSERT INTO t2 VALUES (656,188303,40,'belted','hollowly','priding','FAS'); +INSERT INTO t2 VALUES (657,188401,37,'assails','specifics','configurations',''); +INSERT INTO t2 VALUES (658,188402,37,'admiring','Teresa','untidiness','A'); +INSERT INTO t2 VALUES (659,188503,37,'swaying','Winsett','Brice','W'); +INSERT INTO t2 VALUES (660,188504,37,'Goldstine','convenient','sews','FAS'); +INSERT INTO t2 VALUES (661,188505,37,'fitting','buckboards','participated',''); +INSERT INTO t2 VALUES (662,190701,37,'Norwalk','amenities','Simon','FAS'); +INSERT INTO t2 VALUES (663,190703,50,'weakening','resplendent','certificates',''); +INSERT INTO t2 VALUES (664,191701,37,'analogy','priding','Fitzpatrick',''); +INSERT INTO t2 VALUES (665,191702,37,'deludes','configurations','Evanston','A'); +INSERT INTO t2 VALUES (666,191703,37,'cokes','untidiness','misted',''); +INSERT INTO t2 VALUES (667,196001,37,'Clayton','Brice','textures','A'); +INSERT INTO t2 VALUES (668,196002,37,'exhausts','sews','save',''); +INSERT INTO t2 VALUES (669,196003,37,'causality','participated','count',''); +INSERT INTO t2 VALUES (670,196101,37,'sating','Simon','rightful','A'); +INSERT INTO t2 VALUES (671,196103,37,'icon','certificates','chaperone',''); +INSERT INTO t2 VALUES (672,196104,37,'throttles','Fitzpatrick','Lizzy','A'); +INSERT INTO t2 VALUES (673,196201,37,'communicants','Evanston','clenched','A'); +INSERT INTO t2 VALUES (674,196202,37,'dehydrate','misted','effortlessly',''); +INSERT INTO t2 VALUES (675,196203,37,'priceless','textures','accessed',''); +INSERT INTO t2 VALUES (676,198001,37,'publicly','save','beaters','A'); +INSERT INTO t2 VALUES (677,198003,37,'incidentals','count','Hornblower','FAS'); +INSERT INTO t2 VALUES (678,198004,37,'commonplace','rightful','vests','A'); +INSERT INTO t2 VALUES (679,198005,37,'mumbles','chaperone','indulgences','FAS'); +INSERT INTO t2 VALUES (680,198006,37,'furthermore','Lizzy','infallibly','A'); +INSERT INTO t2 VALUES (681,198007,37,'cautioned','clenched','unwilling','FAS'); +INSERT INTO t2 VALUES (682,198008,37,'parametrized','effortlessly','excrete','FAS'); +INSERT INTO t2 VALUES (683,198009,37,'registration','accessed','spools','A'); +INSERT INTO t2 VALUES (684,198010,37,'sadly','beaters','crunches','FAS'); +INSERT INTO t2 VALUES (685,198011,37,'positioning','Hornblower','overestimating','FAS'); +INSERT INTO t2 VALUES (686,198012,37,'babysitting','vests','ineffective',''); +INSERT INTO t2 VALUES (687,198013,37,'eternal','indulgences','humiliation','A'); +INSERT INTO t2 VALUES (688,198014,37,'hoarder','infallibly','sophomore',''); +INSERT INTO t2 VALUES (689,198015,37,'congregates','unwilling','star',''); +INSERT INTO t2 VALUES (690,198017,37,'rains','excrete','rifles',''); +INSERT INTO t2 VALUES (691,198018,37,'workers','spools','dialysis',''); +INSERT INTO t2 VALUES (692,198019,37,'sags','crunches','arriving',''); +INSERT INTO t2 VALUES (693,198020,37,'unplug','overestimating','indulge',''); +INSERT INTO t2 VALUES (694,198021,37,'garage','ineffective','clockers',''); +INSERT INTO t2 VALUES (695,198022,37,'boulder','humiliation','languages',''); +INSERT INTO t2 VALUES (696,198023,50,'hollowly','sophomore','Antarctica','A'); +INSERT INTO t2 VALUES (697,198024,37,'specifics','star','percentage',''); +INSERT INTO t2 VALUES (698,198101,37,'Teresa','rifles','ceiling','A'); +INSERT INTO t2 VALUES (699,198103,37,'Winsett','dialysis','specification',''); +INSERT INTO t2 VALUES (700,198105,37,'convenient','arriving','regimented','A'); +INSERT INTO t2 VALUES (701,198106,37,'buckboards','indulge','ciphers',''); +INSERT INTO t2 VALUES (702,198201,37,'amenities','clockers','pictures','A'); +INSERT INTO t2 VALUES (703,198204,37,'resplendent','languages','serpents','A'); +INSERT INTO t2 VALUES (704,198301,53,'priding','Antarctica','allot','A'); +INSERT INTO t2 VALUES (705,198302,53,'configurations','percentage','realized','A'); +INSERT INTO t2 VALUES (706,198303,53,'untidiness','ceiling','mayoral','A'); +INSERT INTO t2 VALUES (707,198304,53,'Brice','specification','opaquely','A'); +INSERT INTO t2 VALUES (708,198401,37,'sews','regimented','hostess','FAS'); +INSERT INTO t2 VALUES (709,198402,37,'participated','ciphers','fiftieth',''); +INSERT INTO t2 VALUES (710,198403,37,'Simon','pictures','incorrectly',''); +INSERT INTO t2 VALUES (711,202101,37,'certificates','serpents','decomposition','FAS'); +INSERT INTO t2 VALUES (712,202301,37,'Fitzpatrick','allot','stranglings',''); +INSERT INTO t2 VALUES (713,202302,37,'Evanston','realized','mixture','FAS'); +INSERT INTO t2 VALUES (714,202303,37,'misted','mayoral','electroencephalography','FAS'); +INSERT INTO t2 VALUES (715,202304,37,'textures','opaquely','similarities','FAS'); +INSERT INTO t2 VALUES (716,202305,37,'save','hostess','charges','W'); +INSERT INTO t2 VALUES (717,202601,37,'count','fiftieth','freest','FAS'); +INSERT INTO t2 VALUES (718,202602,37,'rightful','incorrectly','Greenberg','FAS'); +INSERT INTO t2 VALUES (719,202605,37,'chaperone','decomposition','tinting',''); +INSERT INTO t2 VALUES (720,202606,37,'Lizzy','stranglings','expelled','W'); +INSERT INTO t2 VALUES (721,202607,37,'clenched','mixture','warm',''); +INSERT INTO t2 VALUES (722,202901,37,'effortlessly','electroencephalography','smoothed',''); +INSERT INTO t2 VALUES (723,202902,37,'accessed','similarities','deductions','FAS'); +INSERT INTO t2 VALUES (724,202903,37,'beaters','charges','Romano','W'); +INSERT INTO t2 VALUES (725,202904,37,'Hornblower','freest','bitterroot',''); +INSERT INTO t2 VALUES (726,202907,37,'vests','Greenberg','corset',''); +INSERT INTO t2 VALUES (727,202908,37,'indulgences','tinting','securing',''); +INSERT INTO t2 VALUES (728,203101,37,'infallibly','expelled','environing','FAS'); +INSERT INTO t2 VALUES (729,203103,37,'unwilling','warm','cute',''); +INSERT INTO t2 VALUES (730,203104,37,'excrete','smoothed','Crays',''); +INSERT INTO t2 VALUES (731,203105,37,'spools','deductions','heiress','FAS'); +INSERT INTO t2 VALUES (732,203401,37,'crunches','Romano','inform','FAS'); +INSERT INTO t2 VALUES (733,203402,37,'overestimating','bitterroot','avenge',''); +INSERT INTO t2 VALUES (734,203404,37,'ineffective','corset','universals',''); +INSERT INTO t2 VALUES (735,203901,37,'humiliation','securing','Kinsey','W'); +INSERT INTO t2 VALUES (736,203902,37,'sophomore','environing','ravines','FAS'); +INSERT INTO t2 VALUES (737,203903,37,'star','cute','bestseller',''); +INSERT INTO t2 VALUES (738,203906,37,'rifles','Crays','equilibrium',''); +INSERT INTO t2 VALUES (739,203907,37,'dialysis','heiress','extents','0'); +INSERT INTO t2 VALUES (740,203908,37,'arriving','inform','relatively',''); +INSERT INTO t2 VALUES (741,203909,37,'indulge','avenge','pressure','FAS'); +INSERT INTO t2 VALUES (742,206101,37,'clockers','universals','critiques','FAS'); +INSERT INTO t2 VALUES (743,206201,37,'languages','Kinsey','befouled',''); +INSERT INTO t2 VALUES (744,206202,37,'Antarctica','ravines','rightfully','FAS'); +INSERT INTO t2 VALUES (745,206203,37,'percentage','bestseller','mechanizing','FAS'); +INSERT INTO t2 VALUES (746,206206,37,'ceiling','equilibrium','Latinizes',''); +INSERT INTO t2 VALUES (747,206207,37,'specification','extents','timesharing',''); +INSERT INTO t2 VALUES (748,206208,37,'regimented','relatively','Aden',''); +INSERT INTO t2 VALUES (749,208001,37,'ciphers','pressure','embassies',''); +INSERT INTO t2 VALUES (750,208002,37,'pictures','critiques','males','FAS'); +INSERT INTO t2 VALUES (751,208003,37,'serpents','befouled','shapelessly','FAS'); +INSERT INTO t2 VALUES (752,208004,37,'allot','rightfully','genres','FAS'); +INSERT INTO t2 VALUES (753,208008,37,'realized','mechanizing','mastering',''); +INSERT INTO t2 VALUES (754,208009,37,'mayoral','Latinizes','Newtonian',''); +INSERT INTO t2 VALUES (755,208010,37,'opaquely','timesharing','finishers','FAS'); +INSERT INTO t2 VALUES (756,208011,37,'hostess','Aden','abates',''); +INSERT INTO t2 VALUES (757,208101,37,'fiftieth','embassies','teem',''); +INSERT INTO t2 VALUES (758,208102,37,'incorrectly','males','kiting','FAS'); +INSERT INTO t2 VALUES (759,208103,37,'decomposition','shapelessly','stodgy','FAS'); +INSERT INTO t2 VALUES (760,208104,37,'stranglings','genres','scalps','FAS'); +INSERT INTO t2 VALUES (761,208105,37,'mixture','mastering','feed','FAS'); +INSERT INTO t2 VALUES (762,208110,37,'electroencephalography','Newtonian','guitars',''); +INSERT INTO t2 VALUES (763,208111,37,'similarities','finishers','airships',''); +INSERT INTO t2 VALUES (764,208112,37,'charges','abates','store',''); +INSERT INTO t2 VALUES (765,208113,37,'freest','teem','denounces',''); +INSERT INTO t2 VALUES (766,208201,37,'Greenberg','kiting','Pyle','FAS'); +INSERT INTO t2 VALUES (767,208203,37,'tinting','stodgy','Saxony',''); +INSERT INTO t2 VALUES (768,208301,37,'expelled','scalps','serializations','FAS'); +INSERT INTO t2 VALUES (769,208302,37,'warm','feed','Peruvian','FAS'); +INSERT INTO t2 VALUES (770,208305,37,'smoothed','guitars','taxonomically','FAS'); +INSERT INTO t2 VALUES (771,208401,37,'deductions','airships','kingdom','A'); +INSERT INTO t2 VALUES (772,208402,37,'Romano','store','stint','A'); +INSERT INTO t2 VALUES (773,208403,37,'bitterroot','denounces','Sault','A'); +INSERT INTO t2 VALUES (774,208404,37,'corset','Pyle','faithful',''); +INSERT INTO t2 VALUES (775,208501,37,'securing','Saxony','Ganymede','FAS'); +INSERT INTO t2 VALUES (776,208502,37,'environing','serializations','tidiness','FAS'); +INSERT INTO t2 VALUES (777,208503,37,'cute','Peruvian','gainful','FAS'); +INSERT INTO t2 VALUES (778,208504,37,'Crays','taxonomically','contrary','FAS'); +INSERT INTO t2 VALUES (779,208505,37,'heiress','kingdom','Tipperary','FAS'); +INSERT INTO t2 VALUES (780,210101,37,'inform','stint','tropics','W'); +INSERT INTO t2 VALUES (781,210102,37,'avenge','Sault','theorizers',''); +INSERT INTO t2 VALUES (782,210103,37,'universals','faithful','renew','0'); +INSERT INTO t2 VALUES (783,210104,37,'Kinsey','Ganymede','already',''); +INSERT INTO t2 VALUES (784,210105,37,'ravines','tidiness','terminal',''); +INSERT INTO t2 VALUES (785,210106,37,'bestseller','gainful','Hegelian',''); +INSERT INTO t2 VALUES (786,210107,37,'equilibrium','contrary','hypothesizer',''); +INSERT INTO t2 VALUES (787,210401,37,'extents','Tipperary','warningly','FAS'); +INSERT INTO t2 VALUES (788,213201,37,'relatively','tropics','journalizing','FAS'); +INSERT INTO t2 VALUES (789,213203,37,'pressure','theorizers','nested',''); +INSERT INTO t2 VALUES (790,213204,37,'critiques','renew','Lars',''); +INSERT INTO t2 VALUES (791,213205,37,'befouled','already','saplings',''); +INSERT INTO t2 VALUES (792,213206,37,'rightfully','terminal','foothill',''); +INSERT INTO t2 VALUES (793,213207,37,'mechanizing','Hegelian','labeled',''); +INSERT INTO t2 VALUES (794,216101,37,'Latinizes','hypothesizer','imperiously','FAS'); +INSERT INTO t2 VALUES (795,216103,37,'timesharing','warningly','reporters','FAS'); +INSERT INTO t2 VALUES (796,218001,37,'Aden','journalizing','furnishings','FAS'); +INSERT INTO t2 VALUES (797,218002,37,'embassies','nested','precipitable','FAS'); +INSERT INTO t2 VALUES (798,218003,37,'males','Lars','discounts','FAS'); +INSERT INTO t2 VALUES (799,218004,37,'shapelessly','saplings','excises','FAS'); +INSERT INTO t2 VALUES (800,143503,50,'genres','foothill','Stalin',''); +INSERT INTO t2 VALUES (801,218006,37,'mastering','labeled','despot','FAS'); +INSERT INTO t2 VALUES (802,218007,37,'Newtonian','imperiously','ripeness','FAS'); +INSERT INTO t2 VALUES (803,218008,37,'finishers','reporters','Arabia',''); +INSERT INTO t2 VALUES (804,218009,37,'abates','furnishings','unruly',''); +INSERT INTO t2 VALUES (805,218010,37,'teem','precipitable','mournfulness',''); +INSERT INTO t2 VALUES (806,218011,37,'kiting','discounts','boom','FAS'); +INSERT INTO t2 VALUES (807,218020,37,'stodgy','excises','slaughter','A'); +INSERT INTO t2 VALUES (808,218021,50,'scalps','Stalin','Sabine',''); +INSERT INTO t2 VALUES (809,218022,37,'feed','despot','handy','FAS'); +INSERT INTO t2 VALUES (810,218023,37,'guitars','ripeness','rural',''); +INSERT INTO t2 VALUES (811,218024,37,'airships','Arabia','organizer',''); +INSERT INTO t2 VALUES (812,218101,37,'store','unruly','shipyard','FAS'); +INSERT INTO t2 VALUES (813,218102,37,'denounces','mournfulness','civics','FAS'); +INSERT INTO t2 VALUES (814,218103,37,'Pyle','boom','inaccuracy','FAS'); +INSERT INTO t2 VALUES (815,218201,37,'Saxony','slaughter','rules','FAS'); +INSERT INTO t2 VALUES (816,218202,37,'serializations','Sabine','juveniles','FAS'); +INSERT INTO t2 VALUES (817,218203,37,'Peruvian','handy','comprised','W'); +INSERT INTO t2 VALUES (818,218204,37,'taxonomically','rural','investigations',''); +INSERT INTO t2 VALUES (819,218205,37,'kingdom','organizer','stabilizes','A'); +INSERT INTO t2 VALUES (820,218301,37,'stint','shipyard','seminaries','FAS'); +INSERT INTO t2 VALUES (821,218302,37,'Sault','civics','Hunter','A'); +INSERT INTO t2 VALUES (822,218401,37,'faithful','inaccuracy','sporty','FAS'); +INSERT INTO t2 VALUES (823,218402,37,'Ganymede','rules','test','FAS'); +INSERT INTO t2 VALUES (824,218403,37,'tidiness','juveniles','weasels',''); +INSERT INTO t2 VALUES (825,218404,37,'gainful','comprised','CERN',''); +INSERT INTO t2 VALUES (826,218407,37,'contrary','investigations','tempering',''); +INSERT INTO t2 VALUES (827,218408,37,'Tipperary','stabilizes','afore','FAS'); +INSERT INTO t2 VALUES (828,218409,37,'tropics','seminaries','Galatean',''); +INSERT INTO t2 VALUES (829,218410,37,'theorizers','Hunter','techniques','W'); +INSERT INTO t2 VALUES (830,226001,37,'renew','sporty','error',''); +INSERT INTO t2 VALUES (831,226002,37,'already','test','veranda',''); +INSERT INTO t2 VALUES (832,226003,37,'terminal','weasels','severely',''); +INSERT INTO t2 VALUES (833,226004,37,'Hegelian','CERN','Cassites','FAS'); +INSERT INTO t2 VALUES (834,226005,37,'hypothesizer','tempering','forthcoming',''); +INSERT INTO t2 VALUES (835,226006,37,'warningly','afore','guides',''); +INSERT INTO t2 VALUES (836,226007,37,'journalizing','Galatean','vanish','FAS'); +INSERT INTO t2 VALUES (837,226008,37,'nested','techniques','lied','A'); +INSERT INTO t2 VALUES (838,226203,37,'Lars','error','sawtooth','FAS'); +INSERT INTO t2 VALUES (839,226204,37,'saplings','veranda','fated','FAS'); +INSERT INTO t2 VALUES (840,226205,37,'foothill','severely','gradually',''); +INSERT INTO t2 VALUES (841,226206,37,'labeled','Cassites','widens',''); +INSERT INTO t2 VALUES (842,226207,37,'imperiously','forthcoming','preclude',''); +INSERT INTO t2 VALUES (843,226208,37,'reporters','guides','Jobrel',''); +INSERT INTO t2 VALUES (844,226209,37,'furnishings','vanish','hooker',''); +INSERT INTO t2 VALUES (845,226210,37,'precipitable','lied','rainstorm',''); +INSERT INTO t2 VALUES (846,226211,37,'discounts','sawtooth','disconnects',''); +INSERT INTO t2 VALUES (847,228001,37,'excises','fated','cruelty',''); +INSERT INTO t2 VALUES (848,228004,37,'Stalin','gradually','exponentials','A'); +INSERT INTO t2 VALUES (849,228005,37,'despot','widens','affective','A'); +INSERT INTO t2 VALUES (850,228006,37,'ripeness','preclude','arteries',''); +INSERT INTO t2 VALUES (851,228007,37,'Arabia','Jobrel','Crosby','FAS'); +INSERT INTO t2 VALUES (852,228008,37,'unruly','hooker','acquaint',''); +INSERT INTO t2 VALUES (853,228009,37,'mournfulness','rainstorm','evenhandedly',''); +INSERT INTO t2 VALUES (854,228101,37,'boom','disconnects','percentage',''); +INSERT INTO t2 VALUES (855,228108,37,'slaughter','cruelty','disobedience',''); +INSERT INTO t2 VALUES (856,228109,37,'Sabine','exponentials','humility',''); +INSERT INTO t2 VALUES (857,228110,37,'handy','affective','gleaning','A'); +INSERT INTO t2 VALUES (858,228111,37,'rural','arteries','petted','A'); +INSERT INTO t2 VALUES (859,228112,37,'organizer','Crosby','bloater','A'); +INSERT INTO t2 VALUES (860,228113,37,'shipyard','acquaint','minion','A'); +INSERT INTO t2 VALUES (861,228114,37,'civics','evenhandedly','marginal','A'); +INSERT INTO t2 VALUES (862,228115,37,'inaccuracy','percentage','apiary','A'); +INSERT INTO t2 VALUES (863,228116,37,'rules','disobedience','measures',''); +INSERT INTO t2 VALUES (864,228117,37,'juveniles','humility','precaution',''); +INSERT INTO t2 VALUES (865,228118,37,'comprised','gleaning','repelled',''); +INSERT INTO t2 VALUES (866,228119,37,'investigations','petted','primary','FAS'); +INSERT INTO t2 VALUES (867,228120,37,'stabilizes','bloater','coverings',''); +INSERT INTO t2 VALUES (868,228121,37,'seminaries','minion','Artemia','A'); +INSERT INTO t2 VALUES (869,228122,37,'Hunter','marginal','navigate',''); +INSERT INTO t2 VALUES (870,228201,37,'sporty','apiary','spatial',''); +INSERT INTO t2 VALUES (871,228206,37,'test','measures','Gurkha',''); +INSERT INTO t2 VALUES (872,228207,37,'weasels','precaution','meanwhile','A'); +INSERT INTO t2 VALUES (873,228208,37,'CERN','repelled','Melinda','A'); +INSERT INTO t2 VALUES (874,228209,37,'tempering','primary','Butterfield',''); +INSERT INTO t2 VALUES (875,228210,37,'afore','coverings','Aldrich','A'); +INSERT INTO t2 VALUES (876,228211,37,'Galatean','Artemia','previewing','A'); +INSERT INTO t2 VALUES (877,228212,37,'techniques','navigate','glut','A'); +INSERT INTO t2 VALUES (878,228213,37,'error','spatial','unaffected',''); +INSERT INTO t2 VALUES (879,228214,37,'veranda','Gurkha','inmate',''); +INSERT INTO t2 VALUES (880,228301,37,'severely','meanwhile','mineral',''); +INSERT INTO t2 VALUES (881,228305,37,'Cassites','Melinda','impending','A'); +INSERT INTO t2 VALUES (882,228306,37,'forthcoming','Butterfield','meditation','A'); +INSERT INTO t2 VALUES (883,228307,37,'guides','Aldrich','ideas',''); +INSERT INTO t2 VALUES (884,228308,37,'vanish','previewing','miniaturizes','W'); +INSERT INTO t2 VALUES (885,228309,37,'lied','glut','lewdly',''); +INSERT INTO t2 VALUES (886,228310,37,'sawtooth','unaffected','title',''); +INSERT INTO t2 VALUES (887,228311,37,'fated','inmate','youthfulness',''); +INSERT INTO t2 VALUES (888,228312,37,'gradually','mineral','creak','FAS'); +INSERT INTO t2 VALUES (889,228313,37,'widens','impending','Chippewa',''); +INSERT INTO t2 VALUES (890,228314,37,'preclude','meditation','clamored',''); +INSERT INTO t2 VALUES (891,228401,65,'Jobrel','ideas','freezes',''); +INSERT INTO t2 VALUES (892,228402,65,'hooker','miniaturizes','forgivably','FAS'); +INSERT INTO t2 VALUES (893,228403,65,'rainstorm','lewdly','reduce','FAS'); +INSERT INTO t2 VALUES (894,228404,65,'disconnects','title','McGovern','W'); +INSERT INTO t2 VALUES (895,228405,65,'cruelty','youthfulness','Nazis','W'); +INSERT INTO t2 VALUES (896,228406,65,'exponentials','creak','epistle','W'); +INSERT INTO t2 VALUES (897,228407,65,'affective','Chippewa','socializes','W'); +INSERT INTO t2 VALUES (898,228408,65,'arteries','clamored','conceptions',''); +INSERT INTO t2 VALUES (899,228409,65,'Crosby','freezes','Kevin',''); +INSERT INTO t2 VALUES (900,228410,65,'acquaint','forgivably','uncovering',''); +INSERT INTO t2 VALUES (901,230301,37,'evenhandedly','reduce','chews','FAS'); +INSERT INTO t2 VALUES (902,230302,37,'percentage','McGovern','appendixes','FAS'); +INSERT INTO t2 VALUES (903,230303,37,'disobedience','Nazis','raining',''); +INSERT INTO t2 VALUES (904,018062,37,'humility','epistle','infest',''); +INSERT INTO t2 VALUES (905,230501,37,'gleaning','socializes','compartment',''); +INSERT INTO t2 VALUES (906,230502,37,'petted','conceptions','minting',''); +INSERT INTO t2 VALUES (907,230503,37,'bloater','Kevin','ducks',''); +INSERT INTO t2 VALUES (908,230504,37,'minion','uncovering','roped','A'); +INSERT INTO t2 VALUES (909,230505,37,'marginal','chews','waltz',''); +INSERT INTO t2 VALUES (910,230506,37,'apiary','appendixes','Lillian',''); +INSERT INTO t2 VALUES (911,230507,37,'measures','raining','repressions','A'); +INSERT INTO t2 VALUES (912,230508,37,'precaution','infest','chillingly',''); +INSERT INTO t2 VALUES (913,230509,37,'repelled','compartment','noncritical',''); +INSERT INTO t2 VALUES (914,230901,37,'primary','minting','lithograph',''); +INSERT INTO t2 VALUES (915,230902,37,'coverings','ducks','spongers',''); +INSERT INTO t2 VALUES (916,230903,37,'Artemia','roped','parenthood',''); +INSERT INTO t2 VALUES (917,230904,37,'navigate','waltz','posed',''); +INSERT INTO t2 VALUES (918,230905,37,'spatial','Lillian','instruments',''); +INSERT INTO t2 VALUES (919,230906,37,'Gurkha','repressions','filial',''); +INSERT INTO t2 VALUES (920,230907,37,'meanwhile','chillingly','fixedly',''); +INSERT INTO t2 VALUES (921,230908,37,'Melinda','noncritical','relives',''); +INSERT INTO t2 VALUES (922,230909,37,'Butterfield','lithograph','Pandora',''); +INSERT INTO t2 VALUES (923,230910,37,'Aldrich','spongers','watering','A'); +INSERT INTO t2 VALUES (924,230911,37,'previewing','parenthood','ungrateful',''); +INSERT INTO t2 VALUES (925,230912,37,'glut','posed','secures',''); +INSERT INTO t2 VALUES (926,230913,37,'unaffected','instruments','chastisers',''); +INSERT INTO t2 VALUES (927,230914,37,'inmate','filial','icon',''); +INSERT INTO t2 VALUES (928,231304,37,'mineral','fixedly','reuniting','A'); +INSERT INTO t2 VALUES (929,231305,37,'impending','relives','imagining','A'); +INSERT INTO t2 VALUES (930,231306,37,'meditation','Pandora','abiding','A'); +INSERT INTO t2 VALUES (931,231307,37,'ideas','watering','omnisciently',''); +INSERT INTO t2 VALUES (932,231308,37,'miniaturizes','ungrateful','Britannic',''); +INSERT INTO t2 VALUES (933,231309,37,'lewdly','secures','scholastics','A'); +INSERT INTO t2 VALUES (934,231310,37,'title','chastisers','mechanics','A'); +INSERT INTO t2 VALUES (935,231311,37,'youthfulness','icon','humidly','A'); +INSERT INTO t2 VALUES (936,231312,37,'creak','reuniting','masterpiece',''); +INSERT INTO t2 VALUES (937,231313,37,'Chippewa','imagining','however',''); +INSERT INTO t2 VALUES (938,231314,37,'clamored','abiding','Mendelian',''); +INSERT INTO t2 VALUES (939,231315,37,'freezes','omnisciently','jarred',''); +INSERT INTO t2 VALUES (940,232102,37,'forgivably','Britannic','scolds',''); +INSERT INTO t2 VALUES (941,232103,37,'reduce','scholastics','infatuate',''); +INSERT INTO t2 VALUES (942,232104,37,'McGovern','mechanics','willed','A'); +INSERT INTO t2 VALUES (943,232105,37,'Nazis','humidly','joyfully',''); +INSERT INTO t2 VALUES (944,232106,37,'epistle','masterpiece','Microsoft',''); +INSERT INTO t2 VALUES (945,232107,37,'socializes','however','fibrosities',''); +INSERT INTO t2 VALUES (946,232108,37,'conceptions','Mendelian','Baltimorean',''); +INSERT INTO t2 VALUES (947,232601,37,'Kevin','jarred','equestrian',''); +INSERT INTO t2 VALUES (948,232602,37,'uncovering','scolds','Goodrich',''); +INSERT INTO t2 VALUES (949,232603,37,'chews','infatuate','apish','A'); +INSERT INTO t2 VALUES (950,232605,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5950,1232605,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5951,1232606,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5952,1232607,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5953,1232608,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (5954,1232609,37,'appendixes','willed','Adlerian',''); +INSERT INTO t2 VALUES (951,232606,37,'raining','joyfully','Tropez',''); +INSERT INTO t2 VALUES (952,232607,37,'infest','Microsoft','nouns',''); +INSERT INTO t2 VALUES (953,232608,37,'compartment','fibrosities','distracting',''); +INSERT INTO t2 VALUES (954,232609,37,'minting','Baltimorean','mutton',''); +INSERT INTO t2 VALUES (955,236104,37,'ducks','equestrian','bridgeable','A'); +INSERT INTO t2 VALUES (956,236105,37,'roped','Goodrich','stickers','A'); +INSERT INTO t2 VALUES (957,236106,37,'waltz','apish','transcontinental','A'); +INSERT INTO t2 VALUES (958,236107,37,'Lillian','Adlerian','amateurish',''); +INSERT INTO t2 VALUES (959,236108,37,'repressions','Tropez','Gandhian',''); +INSERT INTO t2 VALUES (960,236109,37,'chillingly','nouns','stratified',''); +INSERT INTO t2 VALUES (961,236110,37,'noncritical','distracting','chamberlains',''); +INSERT INTO t2 VALUES (962,236111,37,'lithograph','mutton','creditably',''); +INSERT INTO t2 VALUES (963,236112,37,'spongers','bridgeable','philosophic',''); +INSERT INTO t2 VALUES (964,236113,37,'parenthood','stickers','ores',''); +INSERT INTO t2 VALUES (965,238005,37,'posed','transcontinental','Carleton',''); +INSERT INTO t2 VALUES (966,238006,37,'instruments','amateurish','tape','A'); +INSERT INTO t2 VALUES (967,238007,37,'filial','Gandhian','afloat','A'); +INSERT INTO t2 VALUES (968,238008,37,'fixedly','stratified','goodness','A'); +INSERT INTO t2 VALUES (969,238009,37,'relives','chamberlains','welcoming',''); +INSERT INTO t2 VALUES (970,238010,37,'Pandora','creditably','Pinsky','FAS'); +INSERT INTO t2 VALUES (971,238011,37,'watering','philosophic','halting',''); +INSERT INTO t2 VALUES (972,238012,37,'ungrateful','ores','bibliography',''); +INSERT INTO t2 VALUES (973,238013,37,'secures','Carleton','decoding',''); +INSERT INTO t2 VALUES (974,240401,41,'chastisers','tape','variance','A'); +INSERT INTO t2 VALUES (975,240402,41,'icon','afloat','allowed','A'); +INSERT INTO t2 VALUES (976,240901,41,'reuniting','goodness','dire','A'); +INSERT INTO t2 VALUES (977,240902,41,'imagining','welcoming','dub','A'); +INSERT INTO t2 VALUES (978,241801,41,'abiding','Pinsky','poisoning',''); +INSERT INTO t2 VALUES (979,242101,41,'omnisciently','halting','Iraqis','A'); +INSERT INTO t2 VALUES (980,242102,41,'Britannic','bibliography','heaving',''); +INSERT INTO t2 VALUES (981,242201,41,'scholastics','decoding','population','A'); +INSERT INTO t2 VALUES (982,242202,41,'mechanics','variance','bomb','A'); +INSERT INTO t2 VALUES (983,242501,41,'humidly','allowed','Majorca','A'); +INSERT INTO t2 VALUES (984,242502,41,'masterpiece','dire','Gershwins',''); +INSERT INTO t2 VALUES (985,246201,41,'however','dub','explorers',''); +INSERT INTO t2 VALUES (986,246202,41,'Mendelian','poisoning','libretto','A'); +INSERT INTO t2 VALUES (987,246203,41,'jarred','Iraqis','occurred',''); +INSERT INTO t2 VALUES (988,246204,41,'scolds','heaving','Lagos',''); +INSERT INTO t2 VALUES (989,246205,41,'infatuate','population','rats',''); +INSERT INTO t2 VALUES (990,246301,41,'willed','bomb','bankruptcies','A'); +INSERT INTO t2 VALUES (991,246302,41,'joyfully','Majorca','crying',''); +INSERT INTO t2 VALUES (992,248001,41,'Microsoft','Gershwins','unexpected',''); +INSERT INTO t2 VALUES (993,248002,41,'fibrosities','explorers','accessed','A'); +INSERT INTO t2 VALUES (994,248003,41,'Baltimorean','libretto','colorful','A'); +INSERT INTO t2 VALUES (995,248004,41,'equestrian','occurred','versatility','A'); +INSERT INTO t2 VALUES (996,248005,41,'Goodrich','Lagos','cosy',''); +INSERT INTO t2 VALUES (997,248006,41,'apish','rats','Darius','A'); +INSERT INTO t2 VALUES (998,248007,41,'Adlerian','bankruptcies','mastering','A'); +INSERT INTO t2 VALUES (999,248008,41,'Tropez','crying','Asiaticizations','A'); +INSERT INTO t2 VALUES (1000,248009,41,'nouns','unexpected','offerers','A'); +INSERT INTO t2 VALUES (1001,248010,41,'distracting','accessed','uncles','A'); +INSERT INTO t2 VALUES (1002,248011,41,'mutton','colorful','sleepwalk',''); +INSERT INTO t2 VALUES (1003,248012,41,'bridgeable','versatility','Ernestine',''); +INSERT INTO t2 VALUES (1004,248013,41,'stickers','cosy','checksumming',''); +INSERT INTO t2 VALUES (1005,248014,41,'transcontinental','Darius','stopped',''); +INSERT INTO t2 VALUES (1006,248015,41,'amateurish','mastering','sicker',''); +INSERT INTO t2 VALUES (1007,248016,41,'Gandhian','Asiaticizations','Italianization',''); +INSERT INTO t2 VALUES (1008,248017,41,'stratified','offerers','alphabetic',''); +INSERT INTO t2 VALUES (1009,248018,41,'chamberlains','uncles','pharmaceutic',''); +INSERT INTO t2 VALUES (1010,248019,41,'creditably','sleepwalk','creator',''); +INSERT INTO t2 VALUES (1011,248020,41,'philosophic','Ernestine','chess',''); +INSERT INTO t2 VALUES (1012,248021,41,'ores','checksumming','charcoal',''); +INSERT INTO t2 VALUES (1013,248101,41,'Carleton','stopped','Epiphany','A'); +INSERT INTO t2 VALUES (1014,248102,41,'tape','sicker','bulldozes','A'); +INSERT INTO t2 VALUES (1015,248201,41,'afloat','Italianization','Pygmalion','A'); +INSERT INTO t2 VALUES (1016,248202,41,'goodness','alphabetic','caressing','A'); +INSERT INTO t2 VALUES (1017,248203,41,'welcoming','pharmaceutic','Palestine','A'); +INSERT INTO t2 VALUES (1018,248204,41,'Pinsky','creator','regimented','A'); +INSERT INTO t2 VALUES (1019,248205,41,'halting','chess','scars','A'); +INSERT INTO t2 VALUES (1020,248206,41,'bibliography','charcoal','realest','A'); +INSERT INTO t2 VALUES (1021,248207,41,'decoding','Epiphany','diffusing','A'); +INSERT INTO t2 VALUES (1022,248208,41,'variance','bulldozes','clubroom','A'); +INSERT INTO t2 VALUES (1023,248209,41,'allowed','Pygmalion','Blythe','A'); +INSERT INTO t2 VALUES (1024,248210,41,'dire','caressing','ahead',''); +INSERT INTO t2 VALUES (1025,248211,50,'dub','Palestine','reviver',''); +INSERT INTO t2 VALUES (1026,250501,34,'poisoning','regimented','retransmitting','A'); +INSERT INTO t2 VALUES (1027,250502,34,'Iraqis','scars','landslide',''); +INSERT INTO t2 VALUES (1028,250503,34,'heaving','realest','Eiffel',''); +INSERT INTO t2 VALUES (1029,250504,34,'population','diffusing','absentee',''); +INSERT INTO t2 VALUES (1030,250505,34,'bomb','clubroom','aye',''); +INSERT INTO t2 VALUES (1031,250601,34,'Majorca','Blythe','forked','A'); +INSERT INTO t2 VALUES (1032,250602,34,'Gershwins','ahead','Peruvianizes',''); +INSERT INTO t2 VALUES (1033,250603,34,'explorers','reviver','clerked',''); +INSERT INTO t2 VALUES (1034,250604,34,'libretto','retransmitting','tutor',''); +INSERT INTO t2 VALUES (1035,250605,34,'occurred','landslide','boulevard',''); +INSERT INTO t2 VALUES (1036,251001,34,'Lagos','Eiffel','shuttered',''); +INSERT INTO t2 VALUES (1037,251002,34,'rats','absentee','quotes','A'); +INSERT INTO t2 VALUES (1038,251003,34,'bankruptcies','aye','Caltech',''); +INSERT INTO t2 VALUES (1039,251004,34,'crying','forked','Mossberg',''); +INSERT INTO t2 VALUES (1040,251005,34,'unexpected','Peruvianizes','kept',''); +INSERT INTO t2 VALUES (1041,251301,34,'accessed','clerked','roundly',''); +INSERT INTO t2 VALUES (1042,251302,34,'colorful','tutor','features','A'); +INSERT INTO t2 VALUES (1043,251303,34,'versatility','boulevard','imaginable','A'); +INSERT INTO t2 VALUES (1044,251304,34,'cosy','shuttered','controller',''); +INSERT INTO t2 VALUES (1045,251305,34,'Darius','quotes','racial',''); +INSERT INTO t2 VALUES (1046,251401,34,'mastering','Caltech','uprisings','A'); +INSERT INTO t2 VALUES (1047,251402,34,'Asiaticizations','Mossberg','narrowed','A'); +INSERT INTO t2 VALUES (1048,251403,34,'offerers','kept','cannot','A'); +INSERT INTO t2 VALUES (1049,251404,34,'uncles','roundly','vest',''); +INSERT INTO t2 VALUES (1050,251405,34,'sleepwalk','features','famine',''); +INSERT INTO t2 VALUES (1051,251406,34,'Ernestine','imaginable','sugars',''); +INSERT INTO t2 VALUES (1052,251801,34,'checksumming','controller','exterminated','A'); +INSERT INTO t2 VALUES (1053,251802,34,'stopped','racial','belays',''); +INSERT INTO t2 VALUES (1054,252101,34,'sicker','uprisings','Hodges','A'); +INSERT INTO t2 VALUES (1055,252102,34,'Italianization','narrowed','translatable',''); +INSERT INTO t2 VALUES (1056,252301,34,'alphabetic','cannot','duality','A'); +INSERT INTO t2 VALUES (1057,252302,34,'pharmaceutic','vest','recording','A'); +INSERT INTO t2 VALUES (1058,252303,34,'creator','famine','rouses','A'); +INSERT INTO t2 VALUES (1059,252304,34,'chess','sugars','poison',''); +INSERT INTO t2 VALUES (1060,252305,34,'charcoal','exterminated','attitude',''); +INSERT INTO t2 VALUES (1061,252306,34,'Epiphany','belays','dusted',''); +INSERT INTO t2 VALUES (1062,252307,34,'bulldozes','Hodges','encompasses',''); +INSERT INTO t2 VALUES (1063,252308,34,'Pygmalion','translatable','presentation',''); +INSERT INTO t2 VALUES (1064,252309,34,'caressing','duality','Kantian',''); +INSERT INTO t2 VALUES (1065,256001,34,'Palestine','recording','imprecision','A'); +INSERT INTO t2 VALUES (1066,256002,34,'regimented','rouses','saving',''); +INSERT INTO t2 VALUES (1067,256003,34,'scars','poison','maternal',''); +INSERT INTO t2 VALUES (1068,256004,34,'realest','attitude','hewed',''); +INSERT INTO t2 VALUES (1069,256005,34,'diffusing','dusted','kerosene',''); +INSERT INTO t2 VALUES (1070,258001,34,'clubroom','encompasses','Cubans',''); +INSERT INTO t2 VALUES (1071,258002,34,'Blythe','presentation','photographers',''); +INSERT INTO t2 VALUES (1072,258003,34,'ahead','Kantian','nymph','A'); +INSERT INTO t2 VALUES (1073,258004,34,'reviver','imprecision','bedlam','A'); +INSERT INTO t2 VALUES (1074,258005,34,'retransmitting','saving','north','A'); +INSERT INTO t2 VALUES (1075,258006,34,'landslide','maternal','Schoenberg','A'); +INSERT INTO t2 VALUES (1076,258007,34,'Eiffel','hewed','botany','A'); +INSERT INTO t2 VALUES (1077,258008,34,'absentee','kerosene','curs',''); +INSERT INTO t2 VALUES (1078,258009,34,'aye','Cubans','solidification',''); +INSERT INTO t2 VALUES (1079,258010,34,'forked','photographers','inheritresses',''); +INSERT INTO t2 VALUES (1080,258011,34,'Peruvianizes','nymph','stiller',''); +INSERT INTO t2 VALUES (1081,258101,68,'clerked','bedlam','t1','A'); +INSERT INTO t2 VALUES (1082,258102,68,'tutor','north','suite','A'); +INSERT INTO t2 VALUES (1083,258103,34,'boulevard','Schoenberg','ransomer',''); +INSERT INTO t2 VALUES (1084,258104,68,'shuttered','botany','Willy',''); +INSERT INTO t2 VALUES (1085,258105,68,'quotes','curs','Rena','A'); +INSERT INTO t2 VALUES (1086,258106,68,'Caltech','solidification','Seattle','A'); +INSERT INTO t2 VALUES (1087,258107,68,'Mossberg','inheritresses','relaxes','A'); +INSERT INTO t2 VALUES (1088,258108,68,'kept','stiller','exclaim',''); +INSERT INTO t2 VALUES (1089,258109,68,'roundly','t1','implicated','A'); +INSERT INTO t2 VALUES (1090,258110,68,'features','suite','distinguish',''); +INSERT INTO t2 VALUES (1091,258111,68,'imaginable','ransomer','assayed',''); +INSERT INTO t2 VALUES (1092,258112,68,'controller','Willy','homeowner',''); +INSERT INTO t2 VALUES (1093,258113,68,'racial','Rena','and',''); +INSERT INTO t2 VALUES (1094,258201,34,'uprisings','Seattle','stealth',''); +INSERT INTO t2 VALUES (1095,258202,34,'narrowed','relaxes','coinciding','A'); +INSERT INTO t2 VALUES (1096,258203,34,'cannot','exclaim','founder','A'); +INSERT INTO t2 VALUES (1097,258204,34,'vest','implicated','environing',''); +INSERT INTO t2 VALUES (1098,258205,34,'famine','distinguish','jewelry',''); +INSERT INTO t2 VALUES (1099,258301,34,'sugars','assayed','lemons','A'); +INSERT INTO t2 VALUES (1100,258401,34,'exterminated','homeowner','brokenness','A'); +INSERT INTO t2 VALUES (1101,258402,34,'belays','and','bedpost','A'); +INSERT INTO t2 VALUES (1102,258403,34,'Hodges','stealth','assurers','A'); +INSERT INTO t2 VALUES (1103,258404,34,'translatable','coinciding','annoyers',''); +INSERT INTO t2 VALUES (1104,258405,34,'duality','founder','affixed',''); +INSERT INTO t2 VALUES (1105,258406,34,'recording','environing','warbling',''); +INSERT INTO t2 VALUES (1106,258407,34,'rouses','jewelry','seriously',''); +INSERT INTO t2 VALUES (1107,228123,37,'poison','lemons','boasted',''); +INSERT INTO t2 VALUES (1108,250606,34,'attitude','brokenness','Chantilly',''); +INSERT INTO t2 VALUES (1109,208405,37,'dusted','bedpost','Iranizes',''); +INSERT INTO t2 VALUES (1110,212101,37,'encompasses','assurers','violinist',''); +INSERT INTO t2 VALUES (1111,218206,37,'presentation','annoyers','extramarital',''); +INSERT INTO t2 VALUES (1112,150401,37,'Kantian','affixed','spates',''); +INSERT INTO t2 VALUES (1113,248212,41,'imprecision','warbling','cloakroom',''); +INSERT INTO t2 VALUES (1114,128026,00,'saving','seriously','gazer',''); +INSERT INTO t2 VALUES (1115,128024,00,'maternal','boasted','hand',''); +INSERT INTO t2 VALUES (1116,128027,00,'hewed','Chantilly','tucked',''); +INSERT INTO t2 VALUES (1117,128025,00,'kerosene','Iranizes','gems',''); +INSERT INTO t2 VALUES (1118,128109,00,'Cubans','violinist','clinker',''); +INSERT INTO t2 VALUES (1119,128705,00,'photographers','extramarital','refiner',''); +INSERT INTO t2 VALUES (1120,126303,00,'nymph','spates','callus',''); +INSERT INTO t2 VALUES (1121,128308,00,'bedlam','cloakroom','leopards',''); +INSERT INTO t2 VALUES (1122,128204,00,'north','gazer','comfortingly',''); +INSERT INTO t2 VALUES (1123,128205,00,'Schoenberg','hand','generically',''); +INSERT INTO t2 VALUES (1124,128206,00,'botany','tucked','getters',''); +INSERT INTO t2 VALUES (1125,128207,00,'curs','gems','sexually',''); +INSERT INTO t2 VALUES (1126,118205,00,'solidification','clinker','spear',''); +INSERT INTO t2 VALUES (1127,116801,00,'inheritresses','refiner','serums',''); +INSERT INTO t2 VALUES (1128,116803,00,'stiller','callus','Italianization',''); +INSERT INTO t2 VALUES (1129,116804,00,'t1','leopards','attendants',''); +INSERT INTO t2 VALUES (1130,116802,00,'suite','comfortingly','spies',''); +INSERT INTO t2 VALUES (1131,128605,00,'ransomer','generically','Anthony',''); +INSERT INTO t2 VALUES (1132,118308,00,'Willy','getters','planar',''); +INSERT INTO t2 VALUES (1133,113702,00,'Rena','sexually','cupped',''); +INSERT INTO t2 VALUES (1134,113703,00,'Seattle','spear','cleanser',''); +INSERT INTO t2 VALUES (1135,112103,00,'relaxes','serums','commuters',''); +INSERT INTO t2 VALUES (1136,118009,00,'exclaim','Italianization','honeysuckle',''); +INSERT INTO t2 VALUES (5136,1118009,00,'exclaim','Italianization','honeysuckle',''); +INSERT INTO t2 VALUES (1137,138011,00,'implicated','attendants','orphanage',''); +INSERT INTO t2 VALUES (1138,138010,00,'distinguish','spies','skies',''); +INSERT INTO t2 VALUES (1139,138012,00,'assayed','Anthony','crushers',''); +INSERT INTO t2 VALUES (1140,068304,00,'homeowner','planar','Puritan',''); +INSERT INTO t2 VALUES (1141,078009,00,'and','cupped','squeezer',''); +INSERT INTO t2 VALUES (1142,108013,00,'stealth','cleanser','bruises',''); +INSERT INTO t2 VALUES (1143,084004,00,'coinciding','commuters','bonfire',''); +INSERT INTO t2 VALUES (1144,083402,00,'founder','honeysuckle','Colombo',''); +INSERT INTO t2 VALUES (1145,084003,00,'environing','orphanage','nondecreasing',''); +INSERT INTO t2 VALUES (1146,088504,00,'jewelry','skies','innocents',''); +INSERT INTO t2 VALUES (1147,088005,00,'lemons','crushers','masked',''); +INSERT INTO t2 VALUES (1148,088007,00,'brokenness','Puritan','file',''); +INSERT INTO t2 VALUES (1149,088006,00,'bedpost','squeezer','brush',''); +INSERT INTO t2 VALUES (1150,148025,00,'assurers','bruises','mutilate',''); +INSERT INTO t2 VALUES (1151,148024,00,'annoyers','bonfire','mommy',''); +INSERT INTO t2 VALUES (1152,138305,00,'affixed','Colombo','bulkheads',''); +INSERT INTO t2 VALUES (1153,138306,00,'warbling','nondecreasing','undeclared',''); +INSERT INTO t2 VALUES (1154,152701,00,'seriously','innocents','displacements',''); +INSERT INTO t2 VALUES (1155,148505,00,'boasted','masked','nieces',''); +INSERT INTO t2 VALUES (1156,158003,00,'Chantilly','file','coeducation',''); +INSERT INTO t2 VALUES (1157,156201,00,'Iranizes','brush','brassy',''); +INSERT INTO t2 VALUES (1158,156202,00,'violinist','mutilate','authenticator',''); +INSERT INTO t2 VALUES (1159,158307,00,'extramarital','mommy','Washoe',''); +INSERT INTO t2 VALUES (1160,158402,00,'spates','bulkheads','penny',''); +INSERT INTO t2 VALUES (1161,158401,00,'cloakroom','undeclared','Flagler',''); +INSERT INTO t2 VALUES (1162,068013,00,'gazer','displacements','stoned',''); +INSERT INTO t2 VALUES (1163,068012,00,'hand','nieces','cranes',''); +INSERT INTO t2 VALUES (1164,068203,00,'tucked','coeducation','masterful',''); +INSERT INTO t2 VALUES (1165,088205,00,'gems','brassy','biracial',''); +INSERT INTO t2 VALUES (1166,068704,00,'clinker','authenticator','steamships',''); +INSERT INTO t2 VALUES (1167,068604,00,'refiner','Washoe','windmills',''); +INSERT INTO t2 VALUES (1168,158502,00,'callus','penny','exploit',''); +INSERT INTO t2 VALUES (1169,123103,00,'leopards','Flagler','riverfront',''); +INSERT INTO t2 VALUES (1170,148026,00,'comfortingly','stoned','sisterly',''); +INSERT INTO t2 VALUES (1171,123302,00,'generically','cranes','sharpshoot',''); +INSERT INTO t2 VALUES (1172,076503,00,'getters','masterful','mittens',''); +INSERT INTO t2 VALUES (1173,126304,00,'sexually','biracial','interdependency',''); +INSERT INTO t2 VALUES (1174,068306,00,'spear','steamships','policy',''); +INSERT INTO t2 VALUES (1175,143504,00,'serums','windmills','unleashing',''); +INSERT INTO t2 VALUES (1176,160201,00,'Italianization','exploit','pretenders',''); +INSERT INTO t2 VALUES (1177,148028,00,'attendants','riverfront','overstatements',''); +INSERT INTO t2 VALUES (1178,148027,00,'spies','sisterly','birthed',''); +INSERT INTO t2 VALUES (1179,143505,00,'Anthony','sharpshoot','opportunism',''); +INSERT INTO t2 VALUES (1180,108014,00,'planar','mittens','showroom',''); +INSERT INTO t2 VALUES (1181,076104,00,'cupped','interdependency','compromisingly',''); +INSERT INTO t2 VALUES (1182,078106,00,'cleanser','policy','Medicare',''); +INSERT INTO t2 VALUES (1183,126102,00,'commuters','unleashing','corresponds',''); +INSERT INTO t2 VALUES (1184,128029,00,'honeysuckle','pretenders','hardware',''); +INSERT INTO t2 VALUES (1185,128028,00,'orphanage','overstatements','implant',''); +INSERT INTO t2 VALUES (1186,018410,00,'skies','birthed','Alicia',''); +INSERT INTO t2 VALUES (1187,128110,00,'crushers','opportunism','requesting',''); +INSERT INTO t2 VALUES (1188,148506,00,'Puritan','showroom','produced',''); +INSERT INTO t2 VALUES (1189,123303,00,'squeezer','compromisingly','criticizes',''); +INSERT INTO t2 VALUES (1190,123304,00,'bruises','Medicare','backer',''); +INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively',''); +INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky',''); +INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly',''); +--enable_query_log + +# +# Search with a key +# + +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +select fld3 from t2 where fld3 like "%cultivation" ; + +# +# Search with a key using sorting and limit the same time +# + +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +select fld3,companynr from t2 where companynr = 58 order by fld3; + +select fld3 from t2 order by fld3 desc limit 10; +select fld3 from t2 order by fld3 desc limit 5; +select fld3 from t2 order by fld3 desc limit 5,5; + +# +# Search with a key having a constant with each unique key. +# The table is read directly with read-next on fld3 +# + +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +select t2.fld3 from t2 where fld3 LIKE 'h%le'; + +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; + +# +# Test using INDEX and IGNORE INDEX +# + +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; + +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; + +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; + +# +# NOTE NOTE NOTE +# The next should give an error +# + +-- error 1072 +explain select fld3 from t2 ignore index (fld3,not_used); +-- error 1072 +explain select fld3 from t2 use index (not_used); + +# +# Test sorting with a used key (there is no need for sorting) +# + +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; + +# +# Search with a key having a constant with many occurrences +# The table is read directly with read-next having fld3 to get the +# occurrences +# + +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; + +# +# Search with bunched 'or's. +# If one can limit the key to a certain interval only the possible +# alternatives will be gone through +# + +select fld1 from t2 where fld1=250501 or fld1="250502"; +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; + +# +# Search with a key with LIKE constant +# If the like starts with a certain letter key will be used. +# + +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +select fld1,fld3 from t2 where fld1 like "25050%"; +select fld1,fld3 from t2 where fld1 like "25050_"; + +# +# Search using distinct. An automatic grouping will be done over all the fields, +# if only distinct is used. In any other case a temporary table will always +# be created. If only the field used for sorting is from the main register, +# it will be sorted first before the distinct table is created. +# + +select distinct companynr from t2; +select distinct companynr from t2 order by companynr; +select distinct companynr from t2 order by companynr desc; +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%"; + +select distinct fld3 from t2 where companynr = 34 order by fld3; +select distinct fld3 from t2 limit 10; +select distinct fld3 from t2 having fld3 like "A%" limit 10; +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; + +# make a big table. + +create table t3 ( + period int not null, + name char(32) not null, + companynr int not null, + price double(11,0), + price2 double(11,0), + key (period), + key (name) +); + +--disable_query_log +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1001,"Iranizes",37,5987435,234724); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1002,"violinist",37,28357832,8723648); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1003,"extramarital",37,39654943,235872); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1004,"spates",78,726498,72987523); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1005,"cloakroom",78,98439034,823742); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1006,"gazer",101,834598,27348324); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1007,"hand",154,983543950,29837423); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1008,"tucked",311,234298,3275892); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1009,"gems",447,2374834,9872392); +INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1010,"clinker",512,786542,76234234); +--enable_query_log + +create temporary table tmp engine = myisam select * from t3; + +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +#insert into tmp select * from t3; +#insert into t3 select * from tmp; + +alter table t3 add t2nr int not null auto_increment primary key first; + +drop table tmp; + +# big table done + +SET SQL_BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +SET SQL_BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +select distinct fld5 from t2 limit 10; + +# +# Force use of remove_dupp +# + +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +SET SQL_BIG_TABLES=1; # Force use of MyISAM +select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10; +SET SQL_BIG_TABLES=0; +select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10; + +# +# A big order by that should trigger a merge in filesort +# + +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; + +# +# Search with distinct and order by with many table. +# + +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; + +# +# Here the last fld3 is optimized away from the order by +# + +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; + +# +# Some test with ORDER BY and limit +# + +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; + +# +# Search with a constant table. +# + +select period from t1; +select period from t1 where period=1900; +select fld3,period from t1,t2 where fld1 = 011401 order by period; + +# +# Search with a constant table and several keyparts. (Rows are read only once +# in the beginning of the search) +# + +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; + +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; + +# +# Search with a constant table and several rows from another table +# + +select fld3,period from t2,t1 where companynr*10 = 37*10; + +# +# Search with a table reference and without a key. +# t3 will be the main table. +# + +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; + +# +# Search with an interval on a table with full key on reference table. +# Here t2 will be the main table and only records matching the +# t2nr will be checked. +# + +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; + +# +# We need another table for join stuff.. +# + +create table t4 ( + companynr tinyint(2) unsigned zerofill NOT NULL default '00', + companyname char(30) NOT NULL default '', + PRIMARY KEY (companynr), + UNIQUE KEY companyname(companyname) +) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; + +--disable_query_log +INSERT INTO t4 (companynr, companyname) VALUES (29,'company 1'); +INSERT INTO t4 (companynr, companyname) VALUES (34,'company 2'); +INSERT INTO t4 (companynr, companyname) VALUES (36,'company 3'); +INSERT INTO t4 (companynr, companyname) VALUES (37,'company 4'); +INSERT INTO t4 (companynr, companyname) VALUES (40,'company 5'); +INSERT INTO t4 (companynr, companyname) VALUES (41,'company 6'); +INSERT INTO t4 (companynr, companyname) VALUES (53,'company 7'); +INSERT INTO t4 (companynr, companyname) VALUES (58,'company 8'); +INSERT INTO t4 (companynr, companyname) VALUES (65,'company 9'); +INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10'); +INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11'); +INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown'); +--enable_query_log + +# +# Test of stright join to force a full join. +# + +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; + +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; + +# +# Full join (same alias) +# + +select * from t1,t1 t12; +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; + +# +# Test of left join. +# +insert into t2 (fld1, companynr) values (999999,99); + +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; + +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +delete from t2 where fld1=999999; + +# +# Test left join optimization + +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; + +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +# Following can't be optimized +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; + +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; + +# +# Joins with forms. +# + +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; + +# +# Search using 'or' with the same referens group. +# An interval search will be done first with the first table and after that +# the other table is referenced with a key with a 'test if key in use' for +# each record +# + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; + +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; + +# +# Test of many parenthesis levels +# + +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); + +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; + +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); + +select fld1 from t2 where fld1 between 250502 and 250504; + +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; + +# +# Group on one table. +# optimizer: sort table by group and send rows. +# + +select count(*) from t1; +select companynr,count(*),sum(fld1) from t2 group by companynr; +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +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; +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +select distinct mod(companynr,10) from t4 group by companynr; +select distinct 1 from t4 group by companynr; +select count(distinct fld1) from t2; +select companynr,count(distinct fld1) from t2 group by companynr; +select companynr,count(*) from t2 group by companynr; +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; + +# +# group with where on a key field +# + +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +select name,count(*) from t3 where name='cloakroom' group by name; +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +select count(*) from t3 where name='cloakroom' and price2=823742; +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; + +# +# Group with extra not group fields. +# + +select companynr|0,companyname from t4 group by 1; +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; + +# +# Calculation with group functions +# + +select sum(Period)/count(*) from t1; +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; + +# +# Group with order on not first table +# optimizer: sort table by group and write group records to tmp table. +# sort tmp_table and send rows. +# + +select companynr,count(*) from t2 group by companynr order by 2 desc; +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; + +# +# group by with many tables +# optimizer: create tmp table with group-by uniq index. +# write with update to tmp table. +# sort tmp table according to order (or group if no order) +# send rows +# + +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; + +# +# group with many tables and long group on many tables. group on formula +# optimizer: create tmp table with neaded fields +# sort tmp table by group and calculate sums to new table +# if different order by than group, sort tmp table +# send rows +# + +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; + +# +# WHERE const folding +# optimize: If there is a "field = const" part in the where, change all +# instances of field in the and level to const. +# All instances of const = const are checked once and removed. +# + +# +# Where -> t3.t2nr = 98005 and t2.fld1 = 98005 +# + +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; + +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; + +explain select fld3 from t2 where 1>2 or 2>3; +explain select fld3 from t2 where fld1=fld1; + +# +# HAVING +# + +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; + +# +# MIN(), MAX() and COUNT() optimizing +# + +select count(*) from t2; +select count(*) from t2 where fld1 < 098024; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol +select min(fld1) from t2 where fld1>= 098024; +--enable_ps_protocol +select max(fld1) from t2 where fld1>= 098024; +select count(*) from t3 where price2=76234234; +select count(*) from t3 where companynr=512 and price2=76234234; +explain select min(fld1),max(fld1),count(*) from t2; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol +select min(fld1),max(fld1),count(*) from t2; +--enable_ps_protocol +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +select max(t2nr) from t3 where price=983543950; + +# +# Test of alias +# + +select t1.period from t3 = t1 limit 1; +select t1.period from t1 as t1 limit 1; +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +select period as ok_period from t1 limit 1; +select period as ok_period from t1 group by ok_period limit 1; +select 1+1 as summa from t1 group by summa limit 1; +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; + +# +# Some simple show commands +# + +show tables; +show tables from test like "s%"; +show tables from test like "t?"; +# We mask out the Privileges column because it differs with embedded server +--replace_column 8 # +show full columns from t2; +--replace_column 8 # +show full columns from t2 from test like 'f%'; +--replace_column 8 # +show full columns from t2 from test like 's%'; +show keys from t2; + +drop table t4, t3, t2, t1; + + +CREATE TABLE t1 ( + cont_nr int(11) NOT NULL auto_increment, + ver_nr int(11) NOT NULL default '0', + aufnr int(11) NOT NULL default '0', + username varchar(50) NOT NULL default '', + hdl_nr int(11) NOT NULL default '0', + eintrag date NOT NULL default '0000-00-00', + st_klasse varchar(40) NOT NULL default '', + st_wert varchar(40) NOT NULL default '', + st_zusatz varchar(40) NOT NULL default '', + st_bemerkung varchar(255) NOT NULL default '', + kunden_art varchar(40) NOT NULL default '', + mcbs_knr int(11) default NULL, + mcbs_aufnr int(11) NOT NULL default '0', + schufa_status char(1) default '?', + bemerkung text, + wirknetz text, + wf_igz int(11) NOT NULL default '0', + tarifcode varchar(80) default NULL, + recycle char(1) default NULL, + sim varchar(30) default NULL, + mcbs_tpl varchar(30) default NULL, + emp_nr int(11) NOT NULL default '0', + laufzeit int(11) default NULL, + hdl_name varchar(30) default NULL, + prov_hdl_nr int(11) NOT NULL default '0', + auto_wirknetz varchar(50) default NULL, + auto_billing varchar(50) default NULL, + touch timestamp NOT NULL, + kategorie varchar(50) default NULL, + kundentyp varchar(20) NOT NULL default '', + sammel_rech_msisdn varchar(30) NOT NULL default '', + p_nr varchar(9) NOT NULL default '', + suffix char(3) NOT NULL default '', + PRIMARY KEY (cont_nr), + KEY idx_aufnr(aufnr), + KEY idx_hdl_nr(hdl_nr), + KEY idx_st_klasse(st_klasse), + KEY ver_nr(ver_nr), + KEY eintrag_idx(eintrag), + KEY emp_nr_idx(emp_nr), + KEY wf_igz(wf_igz), + KEY touch(touch), + KEY hdl_tag(eintrag,hdl_nr), + KEY prov_hdl_nr(prov_hdl_nr), + KEY mcbs_aufnr(mcbs_aufnr), + KEY kundentyp(kundentyp), + KEY p_nr(p_nr,suffix) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007'); +INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); +INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','',''); + +--disable_ps_protocol +SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie; +--enable_ps_protocol +drop table t1; -- cgit v1.2.1 From 8e1dac44b4636c7f8dd97fe9417c70c1894515c3 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 18 Oct 2005 18:03:26 +0300 Subject: Some fixes to avoid compiler warnings. --- mysql-test/my_manage.c | 5 ++++- mysql-test/mysql_test_run_new.c | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 88e68dfc27e..919d3bd0529 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -230,7 +230,10 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)), char *user, char *password, int port,char *tmp_dir) { arg_list_t al; - int err= 0, i; + int err= 0; +#ifndef __WIN__ + int i; +#endif char trash[FN_REFLEN]; /* mysqladmin file */ diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 40e45a92851..8beebefd298 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1716,7 +1716,6 @@ int main(int argc, char **argv) int* handle; char test[FN_LEN]; char mask[FN_REFLEN]; - char *p; int position; /* single test */ -- cgit v1.2.1 From 366b7017e4ba3d35aaa8ddcc72f3054e8a5a6533 Mon Sep 17 00:00:00 2001 From: "ranger@regul.home.lan" <> Date: Tue, 18 Oct 2005 19:26:31 +0300 Subject: Added initial support of stress testing. Now it is possible to start stress test from mysql-test-run script. For details see README.stress --- mysql-test/README.stress | 116 ++++ mysql-test/mysql-stress-test.pl | 1148 +++++++++++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.sh | 187 ++++++- 3 files changed, 1447 insertions(+), 4 deletions(-) create mode 100644 mysql-test/README.stress create mode 100755 mysql-test/mysql-stress-test.pl (limited to 'mysql-test') diff --git a/mysql-test/README.stress b/mysql-test/README.stress new file mode 100644 index 00000000000..001ecceef1b --- /dev/null +++ b/mysql-test/README.stress @@ -0,0 +1,116 @@ + +Overview +-------- + +Stress script is designed to perform testsing of mysql server in +multi-thread environment. + +Stress script allows: + + - to use for stress testing mysqltest binary as test engine + - to use for stress testing both regular test suite and any + additional test suites (e.g. mysql-test-extra-5.0) + - to specify files with lists of tests both for initialization of + stress db and for further testing itself + - to define number of threads that will be concurrently used in testing + - to define limitations for test run. e.g. number of tests or loops + for execution or duration of testing, delay between test executions, etc. + - to get readable log file which can be used for identification of + errors arose during testing + +All functionality regarding stress testing was implemeted in +mysql-stress-test.pl script and there are two ways to run stress test: + + - for most cases it is enough to use options below for starting of + stress test from mysql-test-run wrapper. In this case server will + be run automatically, all preparation steps will be performed + and after that stress test will be started. + + - in advanced case one can run mysql-stress-test.pl script directly. + But it requires to perform some preparation steps and to specify a + bunch of options as well so this way may look a bit complicate. + +Usage +----- + +Below is list of stress test specific options for mysql-test-run: + +--stress + Enable stress mode + +--stress-suite= + Test suite name that will be used in stress testing. + We assume that all suites are located in mysql-test/suite directory + There is one special suite name - that corresponds + to regular test suite located in mysql-test directory. + +--stress-threads= + Number of threads that will be used in stress testing + +--stress-tests-file= + Filename with list of tests(without .test suffix) that will be used in + stress testing. Default filename is stress_tests.txt and default + location of this file is suite//stress_tests.txt + +--stress-init-file= + Filename with list of tests(without .test suffix) that will be used in + stress testing for initialization of stress db. These tests will be + executed only once before starting of test itself. Default filename + is stress_init.txt and default location of this file is + suite//stress_init.txt + +--stress-mode= + Possible values are: random(default), seq + + There are two possible modes which affect order of selecting of tests + from the list: + - in random mode tests will be selected in random order + - in seq mode each thread will execute tests in the loop one by one as + they specified in the list file. + +--stress-test-count= + Total number of tests that will be executed concurrently by all threads + +--stress-loop-count= + Total number of loops in seq mode that will be executed concurrently + by all threads + +--stress-test-duration= + Duration of stress testing in seconds + +Examples +-------- + +1. Example of simple command line to start stress test: + + mysql-test-run --stress alias + +Runs stress test with default values for number of threads and number of tests, +with test 'alias' from suite 'main'. + +2. Using in stress testing tests from other suites: + + - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \ + --stress-suite=example --stress-tests-file=testslist.txt + + Will run stress test with 10 threads, will execute 1000 tests by all + threads, test will be used from suite 'example', list of test will be + taken from file 'testslist.txt' + + - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \ + --stress-suite=example sum_distinct + + Will run stress test with 10 threads, will execute 1000 tests by all + threads, test will be used from suite 'example', list of test contains + only one test 'sum_distinct' + +3. Debugging of issues found with stress test + + Right now stress test is not fully integrated in mysql-test-run + and does not support --gdb option so to debug issue found with stress + test you have to start separately mysql server under debuger and then + run stress test as: + + - mysql-test-run --extern --stress --stress-threads=10 \ + --stress-test-count=1000 --stress-suite=example \ + sum_distinct diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl new file mode 100755 index 00000000000..899dd06a746 --- /dev/null +++ b/mysql-test/mysql-stress-test.pl @@ -0,0 +1,1148 @@ +#!/usr/bin/perl +# ====================================================================== +# MySQL server stress test system +# ====================================================================== +# +########################################################################## +# +# SCENARIOS AND REQUIREMENTS +# +# The system should perform stress testing of MySQL server with +# following requirements and basic scenarios: +# +# Basic requirements: +# +# Design of stress script should allow one: +# +# - to use for stress testing mysqltest binary as test engine +# - to use for stress testing both regular test suite and any +# additional test suites (e.g. mysql-test-extra-5.0) +# - to specify files with lists of tests both for initialization of +# stress db and for further testing itself +# - to define number of threads that will be concurrently used in testing +# - to define limitations for test run. e.g. number of tests or loops +# for execution or duration of testing, delay between test executions, etc. +# - to get readable log file which can be used for identification of +# errors arose during testing +# +# Basic scenarios: +# +# * It should be possible to run stress script in standalone mode +# which will allow to create various scenarios of stress workloads: +# +# simple ones: +# +# box #1: +# - one instance of script with list of tests #1 +# +# and more advanced ones: +# +# box #1: +# - one instance of script with list of tests #1 +# - another instance of script with list of tests #2 +# box #2: +# - one instance of script with list of tests #3 +# - another instance of script with list of tests #4 +# that will recreate whole database to back it to clean +# state +# +# One kind of such complex scenarios maybe continued testing +# when we want to run stress tests from many boxes with various +# lists of tests that will last very long time. And in such case +# we need some wrapper for MySQL server that will restart it in +# case of crashes. +# +# * It should be possible to run stress script in ad-hoc mode from +# shell or perl versions of mysql-test-run. This allows developers +# to reproduce and debug errors that was found in continued stress +# testing +# +######################################################################## + +use Config; + +if (!defined($Config{useithreads})) +{ + die < {mtime => 0, data => []}, + initdb => {mtime => 0, data => []}); + +# Error codes and sub-strings with corresponding severity +# +# S1 - Critical errors - cause immediately abort of testing. These errors +# could be caused by server crash or impossibility +# of test execution +# +# S2 - Serious errors - these errors are bugs for sure as it knowns that +# they shouldn't appear during stress testing +# +# S3 - Non-seriuos errros - these errors could be caused by fact that +# we execute simultaneously statements that +# affect tests executed by other threads + +%error_strings = ( 'Failed in mysql_real_connect()' => S1, + 'not found (Errcode: 2)' => S1 ); + +%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2, + 1027 => S2, 1037 => S2, 1038 => S2, + 1039 => S2, 1040 => S2, 1046 => S2, + 1180 => S2, 1181 => S2, 1203 => S2, + 1205 => S2, 1206 => S2, 1207 => S2, + 1223 => S2, 2013 => S1); + +share(%test_counters); +%test_counters=( loop_count => 0, test_count=>0); + +share($exiting); +$exiting=0; + +share($test_counters_lock); +$test_counters_lock=0; +share($log_file_lock); +$log_file_lock=0; + +$SIG{INT}= \&sig_INT_handler; +$SIG{TERM}= \&sig_TERM_handler; + + +GetOptions("server-host=s", "server-logs-dir=s", "server-port=s", + "server-socket=s", "server-user=s", "server-password=s", + "server-database=s", + "stress-suite-basedir=s", "suite=s", "stress-init-file:s", + "stress-tests-file:s", "stress-basedir=s", "stress-mode=s", + "stress-datadir=s", + "threads=s", "sleep-time=s", "loop-count=i", "test-count=i", + "test-duration=i", "test-suffix=s", "check-tests-file", + "verbose", "log-error-details", "cleanup", "mysqltest=s", + "abort-on-error", "help") || usage(); + +usage() if ($opt_help); + +#$opt_abort_on_error=1; + +$test_dirname=get_timestamp(); +$test_dirname.="-$opt_test_suffix" if ($opt_test_suffix ne ''); + +print <rel2abs($opt_stress_basedir); +$opt_stress_suite_basedir=File::Spec->rel2abs($opt_stress_suite_basedir); +$opt_server_logs_dir=File::Spec->rel2abs($opt_server_logs_dir); + +if ($opt_stress_datadir ne '') +{ + $opt_stress_datadir=File::Spec->rel2abs($opt_stress_datadir); +} + +if (! -d "$opt_stress_basedir") +{ + die <catdir($opt_server_logs_dir, $test_dirname), 0, 0755); + #Define filename of global session log file + $stress_log_file=File::Spec->catfile($opt_server_logs_dir, $test_dirname, + "mysql-stress-test.log"); +} + +if ($opt_suite ne '' && $opt_suite ne 'main' && $opt_suite ne 'default') +{ + $test_suite_dir=File::Spec->catdir($opt_stress_suite_basedir, "suite", $opt_suite); +} +else +{ + $test_suite_dir= $opt_stress_suite_basedir; +} + +if (!-d $test_suite_dir) +{ + die <catdir($test_suite_dir,'t'); +$test_suite_r_path=File::Spec->catdir($test_suite_dir,'r'); + +foreach my $suite_dir ($test_suite_t_path, $test_suite_r_path) +{ + if (!-d $suite_dir) + { + die <catdir($opt_stress_basedir,'t'); +$test_r_path=File::Spec->catdir($opt_stress_basedir,'r'); + +foreach $test_dir ($test_t_path, $test_r_path) +{ + if (-d $test_dir) + { + if ($opt_cleanup) + { + #Delete existing 't', 'r', 'r/*' subfolders in $stress_basedir + rmtree("$test_dir", 0, 0); + print "Cleanup $test_dir\n"; + } + else + { + die <{filename}= File::Spec->catfile($opt_stress_suite_basedir, + "testslist_client.txt"); + } + else + { + $tests_files{client}->{filename}= $opt_stress_tests_file; + } + + if (!-f $tests_files{client}->{filename}) + { + die <{filename}' with list of tests not exists. +Please ensure that this file exists, readable or specify another one with +--stress-tests-file option. + +EOF + } +} + +if (defined($opt_stress_init_file)) +{ + if ($opt_stress_init_file eq '') + { + #Default location of file with set of tests for current test run + $tests_files{initdb}->{filename}= File::Spec->catfile($opt_stress_suite_basedir, + "testslist_initdb.txt"); + } + else + { + $tests_files{initdb}->{filename}= $opt_stress_init_file; + } + + if (!-f $tests_files{initdb}->{filename}) + { + die <{filename}' with list of tests for initialization of database +for stress test not exists. +Please ensure that this file exists, readable or specify another one with +--stress-init-file option. + +EOF + } +} + +if ($opt_stress_mode !~ /^(random|seq)$/) +{ + die <); + close(TEST); + print "FOUND MYSQLTEST BINARY: ", $mysqltest_version,"\n"; +} +else +{ + die <\©_test_files, bydepth=>1}, "$test_suite_t_path"); + print "Done\n"; + + #$test_r_path/r0 dir reserved for initdb + $count_start= defined($opt_stress_init_file) ? 0 : 1; + + our $r_folder=''; + print "\nCreating 'r' folder and copying Protocol files to each 'r#' sub-folder..."; + for($count=$count_start; $count <= $opt_threads; $count++) + { + $r_folder = File::Spec->catdir($test_r_path, "r".$count); + mkpath("$r_folder", 0, 0777); + + find(\©_result_files,"$test_suite_r_path"); + } + print "Done\n\n"; +} + +if (defined($opt_stress_init_file)) +{ + print < 1, test_count => undef); + + #Read list of tests from $opt_stress_init_file + read_tests_names($tests_files{initdb}); + test_loop($client_ip, 0, 'seq', $tests_files{initdb}); + #print Dumper($tests_files{initdb}),"\n"; + print <{filename} file. + +EOF +} + +if (defined($opt_stress_tests_file)) +{ + print < 0, test_count=>0); + %limits=(loop_count => $opt_loop_count, test_count => $opt_test_count); + + if (($opt_loop_count && $opt_threads > $opt_loop_count) || + ($opt_test_count && $opt_threads > $opt_test_count)) + { + warn <create("test_loop", $client_ip, $id, + $opt_stress_mode, $tests_files{client}); + + print "main: Thread ID $id TID ",$thrd[$id]->tid," started\n"; + select(undef, undef, undef, 0.5); + } + + if ($opt_test_duration) + { + sleep($opt_test_duration); + kill INT, $$; #Interrupt child threads + } + + #Let other threads to process INT signal + sleep(1); + + for ($id=1; $id<=$opt_threads;$id++) + { + if (defined($thrd[$id])) + { + $thrd[$id]->join(); + } + } + print "EXIT\n"; +} + +sub test_init +{ + my ($env)=@_; + + $env->{session_id}=$env->{ip}."_".$env->{thread_id}; + $env->{r_folder}='r'.$env->{thread_id}; + $env->{screen_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname, + "screen_logs", $env->{session_id}); + $env->{reject_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname, + "reject_logs", $env->{session_id}); + + mkpath($env->{screen_logs}, 0, 0755) unless (-d $env->{screen_logs}); + mkpath($env->{reject_logs}, 0, 0755) unless (-d $env->{reject_logs}); + + $env->{session_log}= File::Spec->catfile($env->{screen_logs}, $env->{session_id}.".log"); +} + +sub test_execute +{ + my $env= shift; + my $test_name= shift; + + my $g_start= ""; + my $g_end= ""; + my $mysqltest_cmd= ""; + my @mysqltest_test_args=(); + my @stderr=(); + + #Get time stamp + $g_start = get_timestamp(); + $env->{errors}={}; + @{$env->{test_status}}=(); + + my $test_file= $test_name.".test"; + my $result_file= $test_name.".result"; + my $reject_file = $test_name.'.reject'; + my $output_file = $env->{session_id}.'_'.$test_name.'_'.$g_start."_".$env->{test_count}.'.txt'; + + my $test_filename = File::Spec->catfile($test_t_path, $test_file); + my $result_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $result_file); + my $reject_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $reject_file); + my $output_filename = File::Spec->catfile($env->{screen_logs}, $output_file); + + + push @mysqltest_test_args, "--basedir=$opt_stress_suite_basedir/", + "--tmpdir=$opt_stress_basedir", + "-x $test_filename", + "-R $result_filename", + "2>$output_filename"; + + $cmd= "$opt_mysqltest --no-defaults ".join(" ", @mysqltest_args)." ". + join(" ", @mysqltest_test_args); + + system($cmd); + + $exit_value = $? >> 8; + $signal_num = $? & 127; + $dumped_core = $? & 128; + + my $tid= threads->self->tid; + + if (-s $output_filename > 0) + { + #Read stderr for further analysis + open (STDERR_LOG, $output_filename) or + warn "Can't open file $output_filename"; + @stderr=; + close(STDERR_LOG); + + if ($opt_verbose) + { + $session_debug_file="$opt_stress_basedir/error$tid.txt"; + + stress_log($session_debug_file, + "Something wrong happened during execution of this command line:"); + stress_log($session_debug_file, "MYSQLTEST CMD - $cmd"); + stress_log($session_debug_file, "STDERR:".join("",@stderr)); + + stress_log($session_debug_file, "EXIT STATUS:\n1. EXIT: $exit_value \n". + "2. SIGNAL: $signal_num\n". + "3. CORE: $dumped_core\n"); + } + } + + #If something wrong trying to analyse stderr + if ($exit_value || $signal_num) + { + if (@stderr) + { + foreach my $line (@stderr) + { + #FIXME: we should handle case when for one sub-string/code + # we have several different error messages + # Now for both codes/substrings we assume that + # first found message will represent error + + #Check line for error codes + if (($err_msg, $err_code)= $line=~/failed: ((\d+):.+?$)/) + { + if (!exists($error_codes{$err_code})) + { + $severity="S3"; + $err_code=0; + } + else + { + $severity=$error_codes{$err_code}; + } + + if (!exists($env->{errors}->{$severity}->{$err_code})) + { + $env->{errors}->{$severity}->{$err_code}=[0, $err_msg]; + } + $env->{errors}->{$severity}->{$err_code}->[0]++; + $env->{errors}->{$severity}->{total}++; + } + + #Check line for error patterns + foreach $err_string (keys %error_strings) + { + $pattern= quotemeta $err_string; + if ($line =~ /$pattern/i) + { + my $severity= $error_strings{$err_string}; + if (!exists($env->{errors}->{$severity}->{$err_string})) + { + $env->{errors}->{$severity}->{$err_string}=[0, $line]; + } + $env->{errors}->{$severity}->{$err_string}->[0]++; + $env->{errors}->{$severity}->{total}++; + } + } + } + } + else + { + $env->{errors}->{S3}->{'Unknown error'}= + [1,"Unknown error. Nothing was output to STDERR"]; + $env->{errors}->{S3}->{total}=1; + } + } + + # + #FIXME: Here we can perform further analysis of recognized + # error codes + # + + foreach my $severity (sort {$a cmp $b} keys %{$env->{errors}}) + { + my $total=$env->{errors}->{$severity}->{total}; + if ($total) + { + push @{$env->{test_status}}, "Severity $severity: $total"; + $env->{errors}->{total}=+$total; + } + } + + #FIXME: Should we take into account $exit_value here? + # Now we assume that all stringified errors(i.e. errors without + # error codes) which are not exist in %error_string structure + # are OK + if (!$env->{errors}->{total}) + { + push @{$env->{test_status}},"No Errors. Test Passed OK"; + } + + log_session_errors($env, $test_file); + + if (!$exiting && ($signal_num == 2 || $signal_num == 15 || + ($opt_abort_on_error && $env->{errors}->{S1} > 0))) + { + #mysqltest was interrupted with INT or TERM signals or test was + #ran with --abort-on-error option and we got errors with severity S1 + #so we assume that we should cancel testing and exit + $exiting=1; + print STDERR<{reject_logs}, $reject_filename, $reject_file); + } + + if (-e $output_filename) + { + move_to_logs($env->{screen_logs}, $output_filename, $output_file); + } + +} + +sub test_loop +{ + my %client_env=(); + my $test_name=""; + + # KEY for session identification: IP-THREAD_ID + $client_env{ip} = shift; + $client_env{thread_id} = shift; + + $client_env{mode} = shift; + $client_env{tests_file}=shift; + + $client_env{test_seq_idx}=0; + + #Initialize session variables + test_init(\%client_env); + +LOOP: + + while(!$exiting) + { + if ($opt_check_tests_file) + { + #Check if tests_file was modified and reread it in this case + read_tests_names($client_env{tests_file}, 0); + } + + { + lock($test_counters_lock); + + if (($limits{loop_count} && $limits{loop_count} <= $test_counters{loop_count}*1) || + ($limits{test_count} && $limits{test_count} <= $test_counters{test_count}*1) ) + { + $exiting=1; + next LOOP; + } + } + + #Get random file name + if (($test_name = get_test(\%client_env)) ne '') + { + { + lock($test_counters_lock); + + #Save current counters values + $client_env{loop_count}=$test_counters{loop_count}; + $client_env{test_count}=$test_counters{test_count}; + } + #Run test and analyze results + test_execute(\%client_env, $test_name); + + print "test_loop[".$limits{loop_count}.":". + $limits{test_count}." ". + $client_env{loop_count}.":". + $client_env{test_count}."]:". + " TID ".$client_env{thread_id}. + " test: '$test_name' ". + " Errors: ".join(" ",@{$client_env{test_status}}),"\n"; + print "\n"; + } + + sleep($opt_sleep_time) if($opt_sleep_time); + + } +} + +sub move_to_logs ($$$) +{ + my $path_to_logs = shift; + my $src_file = shift; + my $random_filename = shift; + + my $dst_file = File::Spec->catfile($path_to_logs, $random_filename); + + move ($src_file, $dst_file) or warn<catfile($test_t_path, $test_filename); + + copy($src_file, $dst_file) or die "ERROR: copy_test_files: File cannot be copied. $!"; + } + } +} + +sub copy_result_files () +{ + if (/\.result$/) + { + $src_file = $File::Find::name; + + if ($File::Find::topdir eq $File::Find::dir && $src_file !~ /SCCS/) + { + $result_filename = basename($src_file) ; + $dst_file = File::Spec->catfile($r_folder, $result_filename); + + copy($src_file, $dst_file) or die "ERROR: copy_result_files: File cannot be copied. $!"; + } + } +} + +sub get_timestamp +{ + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst) = localtime(); + + return sprintf("%04d%02d%02d%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec); +} + +sub read_tests_names +{ + my $tests_file = shift; + my $force_load = shift; + + if ($force_load || ( (stat($tests_file->{filename}))[9] != $tests_file->{mtime}) ) + { + open (TEST, $tests_file->{filename}) || die ("Could not open file <". + $tests_file->{filename}."> $!"); + @{$tests_file->{data}}= grep {!/^[#\r\n]|^$/} map { s/[\r\n]//g; $_ } ; + + close (TEST); + $tests_file->{mtime}=(stat(_))[9]; + } +} + +sub get_random_test +{ + my $envt=shift; + my $tests= $envt->{tests_file}->{data}; + + my $random = int(rand(@{$tests})); + my $test = $tests->[$random]; + + return $test; +} + +sub get_next_test +{ + my $envt=shift; + my $test; + + if (@{$envt->{tests_file}->{data}}) + { + $test=${$envt->{tests_file}->{data}}[$envt->{test_seq_idx}]; + $envt->{test_seq_idx}++; + } + + #If we reach bound of array, reset seq index and increment loop counter + if ($envt->{test_seq_idx} == scalar(@{$envt->{tests_file}->{data}})) + { + $envt->{test_seq_idx}=0; + { + lock($test_counters_lock); + $test_counters{loop_count}++; + } + } + + return $test; +} + +sub get_test +{ + my $envt=shift; + + { + lock($test_counters_lock); + $test_counters{test_count}++; + } + + if ($envt->{mode} eq 'seq') + { + return get_next_test($envt); + } + elsif ($envt->{mode} eq 'random') + { + return get_random_test($envt); + } +} + +sub stress_log +{ + my ($log_file, $line)=@_; + + { + open(SLOG,">>$log_file") or warn "Error during opening log file $log_file"; + print SLOG $line,"\n"; + close(SLOG); + } +} + +sub log_session_errors +{ + my ($env, $test_name) = @_; + my $line=''; + + { + lock ($log_file_lock); + + #header in the begining of log file + if (!-e $stress_log_file) + { + stress_log($stress_log_file, + "TestID TID Suite TestFileName Found Errors"); + stress_log($stress_log_file, + "======================================================="); + } + + $line=sprintf('%6d %3d %10s %20s %s', $env->{test_count}, threads->self->tid, + $opt_suite, $test_name, + join(",", @{$env->{test_status}})); + + stress_log($stress_log_file, $line); + #stress_log_with_lock($stress_log_file, "\n"); + + if ($opt_log_error_details) + { + foreach $severity (sort {$a cmp $b} keys %{$env->{errors}}) + { + stress_log($stress_log_file, ""); + foreach $error (keys %{$env->{errors}->{$severity}}) + { + if ($error ne 'total') + { + stress_log($stress_log_file, "$severity: Count:". + $env->{errors}->{$severity}->{$error}->[0]. + " Error:". $env->{errors}->{$severity}->{$error}->[1]); + } + } + } + } + } +} + +sub sig_INT_handler +{ + $SIG{INT}= \&sig_INT_handler; + $exiting=1; + print STDERR "$$: Got INT signal-------------------------------------------\n"; + +} + +sub sig_TERM_handler +{ + $SIG{TERM}= \&sig_TERM_handler; + $exiting=1; + print STDERR "$$: Got TERM signal\n"; +} + +sub usage +{ + print < --stress-suite-basedir= --server-logs-dir= + +--server-host +--server-port +--server-socket +--server-user +--server-password +--server-logs-dir + Directory where all clients session logs will be stored. Usually + this is shared directory associated with server that used + in testing + + Required option. + +--stress-suite-basedir= + Directory that has r/ t/ subfolders with test/result files + which will be used for testing. Also by default we are looking + in this directory for 'stress-tests.txt' file which contains + list of tests. It is possible to specify other location of this + file with --stress-tests-file option. + + Required option. + +--stress-basedir= + Working directory for this test run. This directory will be used + as temporary location for results tracking during testing + + Required option. + +--stress-datadir= + Location of data files used which will be used in testing. + By default we search for these files in /data where dir + is value of --stress-suite-basedir option. + +--stress-init-file[=/path/to/file with tests for initialization of stress db] + Using of this option allows to perform initialization of database + by execution of test files. List of tests will be taken either from + specified file or if it omited from default file 'stress-init.txt' + located in <--stress-suite-basedir/--suite> dir + +--stress-tests-file[=/path/to/file with tests] + Using of this option allows to run stress test itself. Tests for testing + will be taken either from specified file or if it omited from default + file 'stress-tests.txt' located in <--stress-suite-basedir/--suite> dir + +--stress-mode= [random|seq] + There are two possible modes which affect order of selecting tests + from the list: + - in random mode tests will be selected in random order + - in seq mode each thread will execute tests in the loop one by one as + they specified in the list file. + +--sleep-time=