From a0993098ee921918e5cf6034cfb78e5d3d381afb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Aug 2004 14:44:35 +0200 Subject: Added test for fix of bug#5072 --- mysql-test/r/ndb_blob.result | 35 +++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_blob.test | 8 ++++++++ 2 files changed, 43 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 89b53aea7d1..91102cd37c8 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -220,6 +220,41 @@ a b c d 7 7xb7 777 7xdd7 8 8xb8 888 8xdd8 9 9xb9 999 9xdd9 +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 1xb1 111 1xdd1 NULL +2 2xb2 222 2xdd2 NULL +3 3xb3 333 3xdd3 NULL +4 4xb4 444 4xdd4 NULL +5 5xb5 555 5xdd5 NULL +6 6xb6 666 6xdd6 NULL +7 7xb7 777 7xdd7 NULL +8 8xb8 888 8xdd8 NULL +9 9xb9 999 9xdd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 delete from t1 where c >= 100; commit; select count(*) from t1; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index c1166a7a90c..391d2a2ec23 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -203,6 +203,14 @@ where c >= 100; commit; select * from t1 where c >= 100 order by a; +# alter table + +select * from t1 order by a; +alter table t1 add x int; +select * from t1 order by a; +alter table t1 drop x; +select * from t1 order by a; + # range scan delete delete from t1 where c >= 100; commit; -- cgit v1.2.1 From 28985a752483b24d2bb28e4038e321b281e8f1a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Aug 2004 16:29:04 +0000 Subject: further simplifications of ndb config and aligned usage of mysql datadir in ndb acinclude.m4: added configure switch for ndb base port configure.in: ndb gcc compile now works with -fno-implicit-templates mysql-test/ndb/ndb_config_2_node.ini: further simplifications of config, removed need for [COMPUTER] section ndb/include/ndb_global.h: moved this to configure option ndb/src/common/mgmcommon/ConfigInfo.cpp: changed config to take to take strings instead of ints ndb/src/common/mgmcommon/ConfigInfo.hpp: changed config to take to take strings instead of ints ndb/src/common/mgmcommon/InitConfigFileParser.cpp: string to number convert to accept "0x" prefix on numbers ndb/src/common/mgmcommon/InitConfigFileParser.hpp: movet convert function to public and static ndb/src/common/mgmcommon/LocalConfig.cpp: define NDB_BASE_PORT now string instead of number ndb/src/common/mgmcommon/Makefile.am: added mysqld defines in mgmcommon to be able to configure default data dir to be the same as for mysqld --- mysql-test/ndb/ndb_config_2_node.ini | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 259a1741710..03a94bf5a94 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -7,19 +7,11 @@ Diskless: CHOOSE_Diskless TimeBetweenWatchDogCheck: 30000 FileSystemPath: CHOOSE_FILESYSTEM -[COMPUTER] -Id: 1 -HostName: CHOOSE_HOSTNAME_1 - -[COMPUTER] -Id: 2 -HostName: CHOOSE_HOSTNAME_2 - [DB] -ExecuteOnComputer: 1 +HostName: CHOOSE_HOSTNAME_1 [DB] -ExecuteOnComputer: 2 +HostName: CHOOSE_HOSTNAME_2 [MGM] PortNumber: CHOOSE_PORT_MGM -- cgit v1.2.1 From 192d562b29b4197caba3eb65a3a9240910577bc5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Aug 2004 22:27:33 +0000 Subject: ndb config ability/naming changes, see respective file mysql-test/ndb/ndb_config_2_node.ini: using new naming capabilities ndb/src/common/mgmcommon/ConfigInfo.cpp: fixes case insensitive + removed abort from config handling ndb/src/common/mgmcommon/InitConfigFileParser.cpp: fixed alias handling some requires in config handling ndb/src/mgmclient/CommandInterpreter.cpp: new printout to reflect new naming in config --- mysql-test/ndb/ndb_config_2_node.ini | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index bf5c67cd1d6..7b3548ae303 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -1,36 +1,36 @@ -[DB DEFAULT] -NoOfReplicas: 2 -MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations -DataMemory: CHOOSE_DataMemory -IndexMemory: CHOOSE_IndexMemory -Diskless: CHOOSE_Diskless -TimeBetweenWatchDogCheck: 30000 -FileSystemPath: CHOOSE_FILESYSTEM +[ndbd default] +NoOfReplicas= 2 +MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations +DataMemory= CHOOSE_DataMemory +IndexMemory= CHOOSE_IndexMemory +Diskless= CHOOSE_Diskless +TimeBetweenWatchDogCheck= 30000 +FileSystemPath= CHOOSE_FILESYSTEM -[COMPUTER] -Id: 1 -HostName: CHOOSE_HOSTNAME_1 +[computer] +Id= 1 +HostName= CHOOSE_HOSTNAME_1 -[COMPUTER] -Id: 2 -HostName: CHOOSE_HOSTNAME_2 +[computer] +Id= 2 +HostName= CHOOSE_HOSTNAME_2 -[DB] -ExecuteOnComputer: 1 +[ndbd] +ExecuteOnComputer= 1 -[DB] -ExecuteOnComputer: 2 +[ndbd] +ExecuteOnComputer= 2 -[MGM] -PortNumber: CHOOSE_PORT_MGM +[ndb_mgmd] +PortNumber= CHOOSE_PORT_MGM -[MYSQLD] +[mysqld] -[MYSQLD] +[mysqld] -[MYSQLD] +[mysqld] -[MYSQLD] +[mysqld] -[TCP DEFAULT] -PortNumber: CHOOSE_PORT_TRANSPORTER +[tcp default] +PortNumber= CHOOSE_PORT_TRANSPORTER -- cgit v1.2.1 From 4fc0b21ab1a3718c9c8f74cd9c02d031b41e8f8b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Aug 2004 23:31:47 +0000 Subject: minor fixes mysql-test/r/ndb_blob.result: fixed result for ndb_blob.test ndb/src/ndbapi/Ndb.cpp: added some debug calls --- mysql-test/r/ndb_blob.result | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 0e99c939ea7..d0148d214dd 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -270,6 +270,41 @@ a b c d a b c 2 2xb2 222 2xdd2 2 2 2 drop table t2; use test; +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 1xb1 111 1xdd1 NULL +2 2xb2 222 2xdd2 NULL +3 3xb3 333 3xdd3 NULL +4 4xb4 444 4xdd4 NULL +5 5xb5 555 5xdd5 NULL +6 6xb6 666 6xdd6 NULL +7 7xb7 777 7xdd7 NULL +8 8xb8 888 8xdd8 NULL +9 9xb9 999 9xdd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 1xb1 111 1xdd1 +2 2xb2 222 2xdd2 +3 3xb3 333 3xdd3 +4 4xb4 444 4xdd4 +5 5xb5 555 5xdd5 +6 6xb6 666 6xdd6 +7 7xb7 777 7xdd7 +8 8xb8 888 8xdd8 +9 9xb9 999 9xdd9 delete from t1 where c >= 100; commit; select count(*) from t1; -- cgit v1.2.1 From 99a371f681394a5077dfae5398ad11cfa5478846 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Aug 2004 14:35:33 +0000 Subject: ndb cluster config fixes, se respective files mysql-test/ndb/ndb_config_2_node.ini: added new config parameter datadir ndb/include/mgmapi/mgmapi_config_parameters.h: added new config parameter datadir and backup data dir ndb/include/mgmcommon/ConfigRetriever.hpp: changed verify config so that it can be used by mgmt srvr ndb/include/mgmcommon/NdbConfig.h: added option to set path for ndb files ndb/src/common/mgmcommon/ConfigInfo.cpp: changed token names for DB, MGM and API added config parametsers for datadir and backup data dir ndb/src/common/mgmcommon/ConfigRetriever.cpp: changed verify config so that it can be used by mgmt srvr ndb/src/common/mgmcommon/InitConfigFileParser.cpp: no need anymore to make uppercase ndb/src/common/mgmcommon/NdbConfig.c: bugfix+ added method to set datadir ndb/src/kernel/Makefile.am: added debug libs to ndbd ndb/src/kernel/vm/Configuration.cpp: added debug libs to ndbd ndb/src/mgmsrv/MgmtSrvr.cpp: added verify config to mgmt srvr ndb/src/mgmsrv/main.cpp: . --- mysql-test/ndb/ndb_config_2_node.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index a395b300df4..cc0f940efe3 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -5,15 +5,16 @@ DataMemory= CHOOSE_DataMemory IndexMemory= CHOOSE_IndexMemory Diskless= CHOOSE_Diskless TimeBetweenWatchDogCheck= 30000 -FileSystemPath= CHOOSE_FILESYSTEM +DataDir= CHOOSE_FILESYSTEM [ndbd] -HostName: CHOOSE_HOSTNAME_1 +HostName= CHOOSE_HOSTNAME_1 [ndbd] -HostName: CHOOSE_HOSTNAME_2 +HostName= CHOOSE_HOSTNAME_2 [ndb_mgmd] +DataDir= CHOOSE_FILESYSTEM PortNumber= CHOOSE_PORT_MGM [mysqld] -- cgit v1.2.1 From 622651983fbd68d1095b187ad4aca08a7c3a7a64 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Aug 2004 12:11:49 +0000 Subject: small fixes mysql-test/ndb/ndbcluster.sh: use new shutdown command ndb/src/common/mgmcommon/Makefile.am: compile error fix --- mysql-test/ndb/ndbcluster.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index bbd3fa3257a..e04e22f1434 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -193,8 +193,7 @@ stop_default_ndbcluster() { exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" -echo "all stop" | $exec_mgmtclient 2>&1 | cat > /dev/null -echo "3 stop" | $exec_mgmtclient 2>&1 | cat > /dev/null +echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null if [ -f "$fs_ndb/$pidfile" ] ; then kill -9 `cat "$fs_ndb/$pidfile"` 2> /dev/null -- cgit v1.2.1 From e948c2ee3e43a8992280c5ef84d7ae05d1419751 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Sep 2004 12:42:03 +0200 Subject: ha_ndbcluster.cc, ndb_blob.test, ndb_blob.result: bug-5013 fix mysql-test/r/ndb_blob.result: bug-5013 fix mysql-test/t/ndb_blob.test: bug-5013 fix sql/ha_ndbcluster.cc: bug-5013 fix --- mysql-test/r/ndb_blob.result | 23 ++++++++++++++++++++--- mysql-test/t/ndb_blob.test | 29 ++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index d0148d214dd..a9731f97d6b 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -1,5 +1,25 @@ drop table if exists t1; drop database if exists test2; +create table t1 ( +a int not null primary key, +b tinytext +) engine=ndbcluster; +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +a b +1 y +delete from t1; +drop table t1; +create table t1 ( +a int not null primary key, +b text not null +) engine=ndbcluster; +insert into t1 values(1, ''); +select * from t1; +a b +1 +drop table t1; set autocommit=0; create table t1 ( a int not null primary key, @@ -73,9 +93,6 @@ a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3) 2 4512 b1 6000 dd1 update t1 set d=null where a=1; commit; -select a from t1 where d is null; -a -1 delete from t1 where a=1; delete from t1 where a=2; commit; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 3671c7fd07a..8a21e4c371a 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -12,6 +12,32 @@ drop database if exists test2; # A prerequisite for this handler test is that "testBlobs" succeeds. # +# -- bug-5252 tinytext crashes -- + +create table t1 ( + a int not null primary key, + b tinytext +) engine=ndbcluster; + +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +delete from t1; +drop table t1; + +# -- bug-5013 insert empty string to text -- + +create table t1 ( + a int not null primary key, + b text not null +) engine=ndbcluster; + +insert into t1 values(1, ''); +select * from t1; +drop table t1; + +-- general test starts -- + # make test harder with autocommit off set autocommit=0; @@ -91,7 +117,8 @@ from t1 where a=2; # pk update to null update t1 set d=null where a=1; commit; -select a from t1 where d is null; +# FIXME now fails at random due to weird mixup between the 2 rows +#select a from t1 where d is null; # pk delete delete from t1 where a=1; -- cgit v1.2.1 From d5479c2122d26979d1d5a9219dcfb96180ff8d30 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Sep 2004 15:02:46 +0000 Subject: see resp file mysql-test/ndb/ndbcluster.sh: added better/safer shutdown --- mysql-test/ndb/ndbcluster.sh | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index e04e22f1434..c84d9e36979 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -57,6 +57,10 @@ while test $# -gt 0; do flags_ndb="$flags_ndb -i" initial_ndb=1 ;; + --debug*) + f=`echo "$1" | sed -e "s;--debug=;;"` + flags_ndb="$flags_ndb $f" + ;; --status) status_ndb=1 ;; @@ -180,15 +184,6 @@ status_ndbcluster() { stop_default_ndbcluster() { -#if [ ! -f $pidfile ] ; then -# exit 0 -#fi - -#if [ ! -f $cfgfile ] ; then -# echo "$cfgfile missing" -# exit 1 -#fi - # Start management client exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" @@ -196,10 +191,29 @@ exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null if [ -f "$fs_ndb/$pidfile" ] ; then - kill -9 `cat "$fs_ndb/$pidfile"` 2> /dev/null + kill_pids=`cat "$fs_ndb/$pidfile"` + attempt=0 + while [ $attempt -lt 10 ] ; do + new_kill_pid="" + for p in $kill_pids ; do + kill -0 $p 2> /dev/null + if [ $? -eq 0 ] ; then + new_kill_pid="$p $new_kill_pid" + fi + done + kill_pids=$new_kill_pid + if [ "$kill_pids" == "" ] ; then + break + fi + sleep 1 + attempt=`expr $attempt + 1` + done + if [ "$kill_pids" != "" ] ; then + echo "Failed to shutdown ndbcluster, executing kill -9 "$kill_pids + kill -9 $kill_pids + fi rm "$fs_ndb/$pidfile" fi - } if [ $status_ndb ] ; then -- cgit v1.2.1 From 7a4493b7d2a1b9e99b5a439711100fc30c163ff9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Sep 2004 15:51:44 +0000 Subject: fixed wrong initial auto increment value bug#5369 ndb/tools/waiter.cpp: added option to set timeout to ndb_waiter --- mysql-test/r/ndb_alter_table.result | 2 +- mysql-test/r/ndb_index_unique.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 4e7f4b2a72b..f55f680e972 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -18,7 +18,7 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, col6 int not null, to_be_deleted int) ENGINE=ndbcluster; show table status; 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 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 0 NULL NULL NULL latin1_swedish_ci NULL +t1 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 1 NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); show table status; diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index 4362de94b48..f1407dfe78d 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -242,7 +242,7 @@ select * from t1 where cv = 'test'; cid cv select * from t2 where cap = 'another dummy'; cid cap -0 another dummy +1 another dummy select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4; uid gid rid cid 1 1 2 4 -- cgit v1.2.1 From 76936acef507d98c35dfb0500ea2bd7a02f2f83f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Sep 2004 22:06:30 -0700 Subject: select.result, select.test: Added a test case for bug #5333. null_key.result, key_primary.result: Made covering index usable for const tables. sql_select.cc: Made covering index usable for const tables: downported the corresponding code from 4.1. Simultaneously fixed bug #5333 reported for 4.1. The bug was due to the fact that field index in join structures was always set to 0 for const tables. sql/sql_select.cc: Made covering index usable for const tables: downported the corresponding code from 4.1. Simultaneously fixed bug #5333 reported for 4.1. The bug was due to the fact that field index in join structures was always set to 0 for const tables. mysql-test/t/select.test: Added a test case for bug #5333. mysql-test/r/key_primary.result: Made covering index usable for const tables. mysql-test/r/null_key.result: Made covering index usable for const tables. mysql-test/r/select.result: Added a test case for bug #5333. --- mysql-test/r/key_primary.result | 2 +- mysql-test/r/null_key.result | 2 +- mysql-test/r/select.result | 16 ++++++++++++++++ mysql-test/t/select.test | 21 +++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/key_primary.result b/mysql-test/r/key_primary.result index 87289f1cf54..3216ead667b 100644 --- a/mysql-test/r/key_primary.result +++ b/mysql-test/r/key_primary.result @@ -13,7 +13,7 @@ t1 AB% describe select * from t1 where t1="ABC"; table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 3 const 1 +t1 const PRIMARY PRIMARY 3 const 1 Using index describe select * from t1 where t1="ABCD"; Comment Impossible WHERE noticed after reading const tables diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 009a3e06eb2..41b0ae26617 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -12,7 +12,7 @@ table type possible_keys key key_len ref rows Extra t1 ref a,b a 9 const,const 1 Using where; Using index explain select * from t1 where a=2 and b = 2; table type possible_keys key key_len ref rows Extra -t1 const a,b a 9 const,const 1 +t1 const a,b a 9 const,const 1 Using index explain select * from t1 where a<=>b limit 2; table type possible_keys key key_len ref rows Extra t1 index NULL a 9 NULL 12 Using where; Using index diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 206fa507615..ce5ea94a08e 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2327,3 +2327,19 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) TYPE=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; +table type possible_keys key key_len ref rows Extra +t1 const PRIMARY PRIMARY 4 const 1 Using index +EXPLAIN SELECT i FROM t1 WHERE i=1; +table type possible_keys key key_len ref rows Extra +t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 7cb157f194e..dae44159683 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1874,3 +1874,24 @@ select * from t3 where s = 'one'; select * from t1,t2 where t1.s = t2.s; select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; + +# +# Covering index is mentioned in EXPLAIN output for const tables (bug #5333) +# + +CREATE TABLE t1 ( + i int(11) NOT NULL default '0', + c char(10) NOT NULL default '', + PRIMARY KEY (i), + UNIQUE KEY c (c) +) TYPE=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; + +EXPLAIN SELECT i FROM t1 WHERE i=1; + +DROP TABLE t1; \ No newline at end of file -- cgit v1.2.1 From dc704231c2b8e02c9da1701500b160fe41aa8581 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 15:26:29 +0300 Subject: Fixed unique prefix key bug for multibyte character sets (BUG #4521) for InnoDB. This fixes also a second part of the same problem with prefix keys on a multibyte string column for InnoDB. innobase/btr/btr0btr.c: Multibyte character set prefix indexes are not any more fixed size. Therefore, we have to chect that length of the index field in not greater than prefix length. innobase/rem/rem0cmp.c: Remove unnecessary changes. innobase/row/row0ins.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0row.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0sel.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0upd.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. mysql-test/r/ctype_utf8.result: Added utf8 character test cases for InnoDB. mysql-test/t/ctype_utf8.test: Added utf8 character expected test results for InnoDB. sql/ha_innodb.cc: Added function innobase_get_at_most_n_mbchars to return position of the nth character in the multibyte character string. sql/ha_innodb.h: Remove unnecessary changes. --- mysql-test/r/ctype_utf8.result | 66 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_utf8.test | 61 +++++++++++++++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index f3be539251a..7fb7a508a4e 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -316,6 +316,39 @@ select c cb20 from t1 where c=repeat('b',20); cb20 bbbbbbbbbbbbbbbbbbbb drop table t1; +create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 1 +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 1 +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; create table t1 (c char(3) character set utf8, unique (c(2))); insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); @@ -339,6 +372,29 @@ insert into t1 values ('ꪪꪪ'); insert into t1 values ('ꪪꪪꪪ'); ERROR 23000: Duplicate entry 'ꪪꪪ' for key 1 drop table t1; +create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bbb' for key 1 +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'ааа' for key 1 +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'ббб' for key 1 +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 1 +drop table t1; create table t1 ( c char(10) character set utf8, unique key a using hash (c(1)) @@ -611,6 +667,16 @@ str drop table t1; create table t1 ( str varchar(255) character set utf8 not null, +key str (str(2)) +) engine=innodb; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8 not null, key str using btree (str(2)) ) engine=heap; INSERT INTO t1 VALUES ('str'); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 2c531d4e5d2..97cdfedca99 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -217,6 +217,27 @@ select c ca10 from t1 where c='aaaaaaaaaa'; select c cb20 from t1 where c=repeat('b',20); drop table t1; +# +# Bug 4521: unique key prefix interacts poorly with utf8 +# InnoDB: keys with prefix compression, case insensitive collation. +# +create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +--error 1062 +insert into t1 values ('aaaaaaaaaaa'); +--error 1062 +insert into t1 values ('aaaaaaaaaaaa'); +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +select c c2 from t1 where c='2'; +select c c3 from t1 where c='3'; +select c cx from t1 where c='x'; +select c cy from t1 where c='y'; +select c cz from t1 where c='z'; +select c ca10 from t1 where c='aaaaaaaaaa'; +select c cb20 from t1 where c=repeat('b',20); +drop table t1; # # Bug 4521: unique key prefix interacts poorly with utf8 # MYISAM: fixed length keys, case insensitive collation @@ -244,7 +265,33 @@ insert into t1 values ('ꪪꪪ'); --error 1062 insert into t1 values ('ꪪꪪꪪ'); drop table t1; - +# +# Bug 4521: unique key prefix interacts poorly with utf8 +# InnoDB: fixed length keys, case insensitive collation +# +create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +--error 1062 +insert into t1 values ('aaa'); +insert into t1 values ('b'); +insert into t1 values ('bb'); +--error 1062 +insert into t1 values ('bbb'); +insert into t1 values ('а'); +insert into t1 values ('аа'); +--error 1062 +insert into t1 values ('ааа'); +insert into t1 values ('б'); +insert into t1 values ('бб'); +--error 1062 +insert into t1 values ('ббб'); +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +--error 1062 +insert into t1 values ('ꪪꪪꪪ'); +drop table t1; # # Bug 4531: unique key prefix interacts poorly with utf8 # Check HEAP+HASH, case insensitive collation @@ -454,6 +501,18 @@ INSERT INTO t1 VALUES ('str2'); select * from t1 where str='str'; drop table t1; +# Bug#4594: column index make = failed for gbk, but like works +# Check InnoDB +# +create table t1 ( + str varchar(255) character set utf8 not null, + key str (str(2)) +) engine=innodb; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +drop table t1; + # the same for HEAP+BTREE # -- cgit v1.2.1 From aaf5af7c06af815685ea768860befc384b797fdd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 14:46:39 +0200 Subject: Remove usage of row count (as it trashes _all_ explain & table status) Use order by mysql-test/r/ndb_index_ordered.result: Use order by mysql-test/t/ndb_index_ordered.test: Use order by sql/ha_ndbcluster.cc: Remove usage of row count (as it trashes _all_ explain & table status) --- mysql-test/r/ndb_index_ordered.result | 4 ++-- mysql-test/t/ndb_index_ordered.test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 2f1ad251e40..2a3050e5dea 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -219,10 +219,10 @@ c int unsigned, KEY bc(b,c) ) engine = ndb; insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); -select * from t1 use index (bc) where b IS NULL; +select * from t1 use index (bc) where b IS NULL order by a; a b c -3 NULL NULL 2 NULL 2 +3 NULL NULL select * from t1 use index (bc)order by a; a b c 1 1 1 diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 00807bfcb98..2a94475df13 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -130,7 +130,7 @@ CREATE TABLE t1 ( ) engine = ndb; insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); -select * from t1 use index (bc) where b IS NULL; +select * from t1 use index (bc) where b IS NULL order by a; select * from t1 use index (bc)order by a; select * from t1 use index (bc) order by a; -- cgit v1.2.1 From 14890566000c658f0c6388b1a9aa9a7488d24d65 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 19:38:16 +0500 Subject: A fix (Bug #5291: float -> string, truncation, sometimes without warning). --- mysql-test/r/type_float.result | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 843bdc2bdc5..75f0298797a 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -137,6 +137,8 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (c20 char); insert into t1 values (5000.0); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' -- cgit v1.2.1 From 158e674597b292b2fd2a1b2632c2ca8674b991cd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 15:11:09 +0000 Subject: renamed ha_recovery_logging to ha_enable_transaction added tests to alter table for "large" alter tables and truncates in ndbcluster added debug printout in restart() in ndbcluster added flag THD::transaction.on to enable/disable transaction mysql-test/r/ndb_alter_table.result: added tests to alter table for "large" alter tables and truncates mysql-test/t/ndb_alter_table.test: added tests to alter table for "large" alter tables and truncates ndb/src/ndbapi/NdbConnection.cpp: added debug printout in restart() sql/ha_ndbcluster.cc: added support for large alter table and truncate sql/handler.cc: renamed ha_recovery_logging to ha_enable_transaction sql/handler.h: renamed ha_recovery_logging to ha_enable_transaction sql/sql_class.cc: added flag THD::transaction.on to enable/disable transaction sql/sql_class.h: added flag THD::transaction.on to enable/disable transaction sql/sql_delete.cc: added disable transaction for mysql_truncate sql/sql_table.cc: renamed ha_recovery_logging to ha_enable_transaction --- mysql-test/r/ndb_alter_table.result | 11 +++++++++++ mysql-test/t/ndb_alter_table.test | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index f55f680e972..8a5fdfaf6a7 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -72,3 +72,14 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 101 3 4 5 PENDING 0000-00-00 00:00:00 2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 drop table t1; +DROP TABLE IF EXISTS t2; +create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; +alter table t2 engine=ndbcluster; +select count(*) from t2; +count(*) +15001 +truncate table t2; +select count(*) from t2; +count(*) +0 +drop table t2; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index ffcd0b99745..e2fbf829cc0 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -48,4 +48,21 @@ show table status; select * from t1 order by col1; drop table t1; +--disable_warnings +DROP TABLE IF EXISTS t2; +--enable_warnings +create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; +let $1=15001; +disable_query_log; +while ($1) +{ + eval insert into t2 values($1); + dec $1; +} +enable_query_log; +alter table t2 engine=ndbcluster; +select count(*) from t2; +truncate table t2; +select count(*) from t2; +drop table t2; -- cgit v1.2.1 From f6b5313ea662575eaa201e5a4947612824ffb09e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 5 Sep 2004 11:27:31 +0200 Subject: union.test: drop table added BitKeeper/etc/ignore: Added support-files/my-innodb-heavy-4G.cnf to the ignore list mysql-test/r/union.result: drop table added mysql-test/t/union.test: drop table added --- mysql-test/r/union.result | 1 + mysql-test/t/union.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 4b9555c334b..45866cdf495 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -420,6 +420,7 @@ a (SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; Wrong usage/placement of 'SQL_CALC_FOUND_ROWS' create temporary table t1 select a from t1 union select a from t2; +drop table t1; create table t1 select a from t1 union select a from t2; INSERT TABLE 't1' isn't allowed in FROM table list select a from t1 union select a from t2 order by t2.a; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index c978aef9ce0..2bcd50b11de 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -224,6 +224,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1; (SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; create temporary table t1 select a from t1 union select a from t2; +drop table t1; --error 1093 create table t1 select a from t1 union select a from t2; --error 1054 -- cgit v1.2.1 From f8bf7d7e23608f0d9d3190611316d974f5317388 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 10:05:55 +0200 Subject: merge --- mysql-test/r/ndb_blob.result | 6 +++--- mysql-test/t/ndb_blob.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 4244c05e446..45b003e6967 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -1,5 +1,5 @@ drop table if exists t1; -drop database if exists test2; +drop database if exists mysqltest; create table t1 ( a int not null primary key, b tinytext @@ -276,8 +276,8 @@ a b c d 7 7xb7 777 7xdd7 8 8xb8 888 8xdd8 9 9xb9 999 9xdd9 -create database test2; -use test2; +create database mysqltest; +use mysqltest; CREATE TABLE t2 ( a bigint unsigned NOT NULL PRIMARY KEY, b int unsigned not null, diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 0df13eefe10..e5a9f7446d4 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -118,7 +118,7 @@ from t1 where a=2; update t1 set d=null where a=1; commit; # FIXME now fails at random due to weird mixup between the 2 rows -#select a from t1 where d is null; +select a from t1 where d is null; # pk delete delete from t1 where a=1; -- cgit v1.2.1 From d6be282604e7ad591410428dd1828173871fb112 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 13:00:24 +0300 Subject: fixed temporary table processing expresions of subqueries and removed wrong restrictions of field resolving (BUG#5326) mysql-test/r/subselect.result: tests of fields resolving mysql-test/t/subselect.test: tests of fields resolving sql/item.cc: fixed fild resolving sql/item_subselect.cc: removed aneed call sql/sql_base.cc: fixed case whan we scan un-fixfielded fields sql/sql_select.cc: fixed temporary table processing expresions of subqueries --- mysql-test/r/subselect.result | 10 +++++++++- mysql-test/t/subselect.test | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ff5c9dfe813..7826f5e452d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1966,5 +1966,13 @@ howmanyvalues mycount 3 3 4 4 SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; -ERROR 42S22: Unknown column 'a.avalue' in 'where clause' +howmanyvalues mycount +1 1 +2 1 +3 1 +4 1 +drop table t1; +create table t1 (x int); +select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; +(select b.x from t1 as b where b.x=a.x) drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 7fcd0565ae7..2dc28479ee9 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1264,6 +1264,9 @@ SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.how CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues); SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues; SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; --- error 1054 SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; drop table t1; + +create table t1 (x int); +select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; +drop table t1; -- cgit v1.2.1 From ce4541fef42ee75c49622a6c1785ce4fc740ad9d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 15:03:43 +0500 Subject: Bug #5397: Crash with varchar binary and LIKE --- mysql-test/r/ctype_utf8.result | 5 +++++ mysql-test/t/ctype_utf8.test | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index f3be539251a..c7d015da9dc 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -639,3 +639,8 @@ select * from t1 where str='str'; str str drop table t1; +CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8; +INSERT INTO t1 VALUES ('test'); +SELECT a FROM t1 WHERE a LIKE '%te'; +a +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 2c531d4e5d2..f5bd9ede673 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -492,3 +492,10 @@ INSERT INTO t1 VALUES ('str2'); select * from t1 where str='str'; drop table t1; +# +# Bug #5397: Crash with varchar binary and LIKE +# +CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8; +INSERT INTO t1 VALUES ('test'); +SELECT a FROM t1 WHERE a LIKE '%te'; +DROP TABLE t1; -- cgit v1.2.1 From 4948bf486cf8601aeb16ff4ea6d1c2d7825fa809 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 12:36:01 +0000 Subject: -d default on ndb_mgmd and ndbd -i depricated on ndbd fixed bug in shutdown command in ndb_mgm ndb/src/mgmsrv/main.cpp: added config.ini as default configuration file -d default on ndb_mgmd and ndbd -i depricated on ndbd fixed bug in shutdown command in ndb_mgm --- mysql-test/ndb/ndbcluster.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index c84d9e36979..f143242371f 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -54,7 +54,7 @@ while test $# -gt 0; do stop_ndb=1 ;; --initial) - flags_ndb="$flags_ndb -i" + flags_ndb="$flags_ndb --initial" initial_ndb=1 ;; --debug*) @@ -143,7 +143,7 @@ fi rm -f "$cfgfile" 2>&1 | cat > /dev/null rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null -if ( cd "$fs_ndb" ; $exec_mgmtsrvr -d -c config.ini ) ; then :; else +if ( cd "$fs_ndb" ; $exec_mgmtsrvr -c config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi @@ -153,14 +153,14 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" -( cd "$fs_ndb" ; $exec_ndb -d $flags_ndb & ) +( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" -( cd "$fs_ndb" ; $exec_ndb -d $flags_ndb & ) +( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" -- cgit v1.2.1 From 2da0fdea232b05741a28093f26622eff8318fdbc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 20:04:22 +0500 Subject: Bug #5324 Bug in UCA collations with LIKE comparisons and INDEX --- mysql-test/r/ctype_uca.result | 39 +++++++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_uca.test | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 94fe15fed26..da4b5bfb663 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -1872,3 +1872,42 @@ Z,z,Ź,ź,Ż,ż,Ž,ž ǁ ǂ ǃ +drop table t1; +SET NAMES utf8; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 +COLLATE ucs2_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 187d21f9ab7..d9181b19992 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -180,3 +180,40 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +drop table t1; + +# +# Bug#5324 +# +SET NAMES utf8; +#test1 +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +#Check one row +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci; +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +#Check two rows +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci ORDER BY c; +DROP TABLE t1; +#test2 +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +#Check one row +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); +#Check two rows +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 +COLLATE ucs2_unicode_ci ORDER BY c; +DROP TABLE t1; +#test 3 +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +#Check one row row +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +#Check two rows +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_unicode_ci ORDER BY c; +DROP TABLE t1; -- cgit v1.2.1 From 6822a4b1886f63e0f3ac1372388f1e7a5ca9d1d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 18:30:57 +0000 Subject: fixed so that ndbcluster and mysqld can be started independently fixed some error codes in Ndb so that 4009-cluster failure is returned when cluster is not up --- mysql-test/t/ndb_autodiscover2.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index 297795d909e..6a3f2092148 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -5,6 +5,7 @@ # The previous step has simply removed the frm file # from disk, but left the table in NDB # +--sleep 3; select * from t9 order by a; # handler_discover should be zero -- cgit v1.2.1 From b7269f4ebf6127eca406b1dd14f2078af2df485c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2004 22:20:40 +0200 Subject: bug#5389 merge.test fails on qnx - uninitalized variable in myrg_open() myisammrg/myrg_open.c: backport from 4.1 mysql-test/r/union.result: after merge fix mysql-test/t/union.test: after merge fix sql/log.cc: backward compatibility: inhibit severity labels in error log --- mysql-test/r/union.result | 1 - mysql-test/t/union.test | 1 - 2 files changed, 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 79c589774d8..0db18b090bc 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -424,7 +424,6 @@ create table t1 select a from t1 union select a from t2; INSERT TABLE 't1' isn't allowed in FROM table list select a from t1 union select a from t2 order by t2.a; Unknown column 't2.a' in 'ORDER BY' -drop table t1; drop table t1,t2; select length(version()) > 1 as `*` UNION select 2; * diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index e55cb3ea272..eb2d8dd6efa 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -229,7 +229,6 @@ drop table t1; create table t1 select a from t1 union select a from t2; --error 1054 select a from t1 union select a from t2 order by t2.a; -drop table t1; # Drop temporary table drop table t1,t2; # -- cgit v1.2.1 From 9e9255e1a0478a018877c95f19ba16b66d435a81 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 13:33:35 +0500 Subject: A fix (Bug #5428 small max_sort_length crash server). --- mysql-test/r/order_by.result | 13 +++++++++++++ mysql-test/t/order_by.test | 13 +++++++++++++ 2 files changed, 26 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index b3bc4a18a40..69ce69ad499 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -723,3 +723,16 @@ col2 col col 2 2 2 1 3 3 drop table t1, t2; +create table t1 (a char(25)); +insert into t1 set a = repeat('x', 20); +insert into t1 set a = concat(repeat('x', 19), 'z'); +insert into t1 set a = concat(repeat('x', 19), 'ab'); +insert into t1 set a = concat(repeat('x', 19), 'aa'); +set max_sort_length=20; +select a from t1 order by a; +a +xxxxxxxxxxxxxxxxxxxab +xxxxxxxxxxxxxxxxxxxaa +xxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxz +drop table t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 5131bb8c8b8..1d65ce9003a 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -486,3 +486,16 @@ select t2.col2 as col, t2.col from t2 order by t2.col; select t2.col2, t2.col, t2.col from t2 order by t2.col; drop table t1, t2; + +# +# Bug #5428: a problem with small max_sort_length value +# + +create table t1 (a char(25)); +insert into t1 set a = repeat('x', 20); +insert into t1 set a = concat(repeat('x', 19), 'z'); +insert into t1 set a = concat(repeat('x', 19), 'ab'); +insert into t1 set a = concat(repeat('x', 19), 'aa'); +set max_sort_length=20; +select a from t1 order by a; +drop table t1; -- cgit v1.2.1 From 9c14253ac847654134e09d976c0cee909736357e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 11:15:23 +0200 Subject: A new test for the fix for BUG#4500 ("SET CHARACTER SET replicates incorrectly"). As I cannot be 100% sure that there won't be issues with some of our exotic platforms (who knows if the charset of will play fair?), I'll send an email to the build guys. Well, this holds if bk does not crash on binary chars of this cset. --- mysql-test/r/rpl_set_charset.result | 51 +++++++++++++++++++++++++++++++++++++ mysql-test/t/rpl_set_charset.test | 40 +++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 mysql-test/r/rpl_set_charset.result create mode 100644 mysql-test/t/rpl_set_charset.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/r/rpl_set_charset.result new file mode 100644 index 00000000000..b2bfa3678a9 --- /dev/null +++ b/mysql-test/r/rpl_set_charset.result @@ -0,0 +1,51 @@ +slave stop; +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; +slave start; +drop database if exists mysqltest1; +create database mysqltest1 /*!40100 character set latin2 */; +use mysqltest1; +drop table if exists t1; +create table t1 (a varchar(255) character set latin2, b varchar(4)); +SET CHARACTER SET cp1250_latin2; +INSERT INTO t1 VALUES ('','80'); +INSERT INTO t1 VALUES ('','90'); +INSERT INTO t1 VALUES ('','A0'); +INSERT INTO t1 VALUES ('','B0'); +INSERT INTO t1 VALUES ('','C0'); +INSERT INTO t1 VALUES ('','D0'); +INSERT INTO t1 VALUES ('','E0'); +INSERT INTO t1 VALUES ('','F0'); +select "--- on master ---"; +--- on master --- +--- on master --- +select hex(a),b from t1 order by b; +hex(a) b +A9A6ABAEAC 80 +B9B6BBBEBC 90 +A3A1AAAF A0 +B3B1BAA5B5BF B0 +C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0 +D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 +E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 +F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 +show binlog events from 1979; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 1979 Query 1 1979 use `mysqltest1`; SET CHARACTER SET DEFAULT +use mysqltest1; +select "--- on slave ---"; +--- on slave --- +--- on slave --- +select hex(a),b from t1 order by b; +hex(a) b +A9A6ABAEAC 80 +B9B6BBBEBC 90 +A3A1AAAF A0 +B3B1BAA5B5BF B0 +C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0 +D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 +E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 +F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 +drop table t1; diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test new file mode 100644 index 00000000000..6aa864b1008 --- /dev/null +++ b/mysql-test/t/rpl_set_charset.test @@ -0,0 +1,40 @@ +source include/master-slave.inc; +--disable_warnings +drop database if exists mysqltest1; +# 4.1 bases its conversion on the db's charset, +# while 4.0 uses the part of "SET CHARACTER SET" after "_". +# So for 4.1 we add a clause to CREATE DATABASE. +create database mysqltest1 /*!40100 character set latin2 */; +use mysqltest1; +drop table if exists t1; +--enable_warnings +create table t1 (a varchar(255) character set latin2, b varchar(4)); +SET CHARACTER SET cp1250_latin2; +INSERT INTO t1 VALUES ('','80'); +INSERT INTO t1 VALUES ('','90'); +INSERT INTO t1 VALUES ('','A0'); +INSERT INTO t1 VALUES ('','B0'); +INSERT INTO t1 VALUES ('','C0'); +INSERT INTO t1 VALUES ('','D0'); +INSERT INTO t1 VALUES ('','E0'); +INSERT INTO t1 VALUES ('','F0'); +select "--- on master ---"; +select hex(a),b from t1 order by b; +# It's complicated to verify that the charset is reset to default in +# the binlog after each query, except by checking the binlog. When you +# merge this into 4.1/5.0, the 1979 will have to be changed; all you have +# to do is read the var/log/master-bin.0*01 with mysqlbinlog, verify +# that a SET CHARACTER SET DEFAULT is just after the last INSERT, and +# replace 1979 by its position (the "# at" line above the SET). +show binlog events from 1979; +save_master_pos; +connection slave; +sync_with_master; +use mysqltest1; +select "--- on slave ---"; +select hex(a),b from t1 order by b; +connection master; +drop table t1; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From cf7be838677739ee7d06abf1a6f6ea5f0fb780ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 15:42:19 +0500 Subject: Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions --- mysql-test/r/cast.result | 23 +++++++++++++++++++++++ mysql-test/t/cast.test | 13 +++++++++++++ 2 files changed, 36 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 6564a3e392b..ccf75f68e88 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -155,3 +155,26 @@ NULL select cast(NULL as BINARY); cast(NULL as BINARY) NULL +CREATE TABLE t1 (a enum ('aac','aab','aaa') not null); +INSERT INTO t1 VALUES ('aaa'),('aab'),('aac'); +SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ; +a CAST(a AS CHAR) +aac aac +aab aab +aaa aaa +SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a; +a CAST(a AS CHAR(3)) +aac aac +aab aab +aaa aaa +SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ; +a CAST(a AS UNSIGNED) +aaa 3 +aab 2 +aac 1 +SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a; +a CAST(a AS CHAR(2)) +aaa aa +aab aa +aac aa +DROP TABLE t1; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index e2deb792d47..e5681dedbac 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -95,3 +95,16 @@ select cast("2001-1-1" as datetime) = "2001-01-01 00:00:00"; select cast("1:2:3" as TIME) = "1:02:03"; select cast(NULL as DATE); select cast(NULL as BINARY); + +# +# Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions +# +CREATE TABLE t1 (a enum ('aac','aab','aaa') not null); +INSERT INTO t1 VALUES ('aaa'),('aab'),('aac'); +# these two should be in enum order +SELECT a, CAST(a AS CHAR) FROM t1 ORDER BY CAST(a AS UNSIGNED) ; +SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a; +# these two should be in alphabetic order +SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ; +SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a; +DROP TABLE t1; -- cgit v1.2.1 From 460ac23994e42ed46b89da7129935baf58e06693 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 12:45:19 +0200 Subject: Fix for INSERT with multiple values and start/end_bulk_insert mysql-test/r/ndb_insert.result: Add tests for duplicate keys in combination with start/end_bulk_insert mysql-test/t/ndb_insert.test: Add tests for duplicate keys in combination with start/end_bulk_insert sql/ha_ndbcluster.cc: Set my_errno if error occurs in end_bulk_insert --- mysql-test/r/ndb_insert.result | 12 ++++++++++++ mysql-test/t/ndb_insert.test | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 93f46c85499..87f27518ea3 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -416,4 +416,16 @@ INSERT INTO t1 VALUES SELECT COUNT(*) FROM t1; COUNT(*) 2000 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +begin; +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +commit; +insert into t1 select * from t1 where b < 10 order by pk1; +ERROR 23000: Duplicate entry '9' for key 1 DROP TABLE t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index c55a925dca2..a448e413f1d 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -429,5 +429,34 @@ INSERT INTO t1 VALUES SELECT COUNT(*) FROM t1; +# +# Insert duplicate rows +# +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + + + +begin; + +# +# Insert duplicate rows, inside transaction +# +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + +commit; + +# +# Insert duplicate rows using "insert .. select" + +# +--error 1062 +insert into t1 select * from t1 where b < 10 order by pk1; + DROP TABLE t1; -- cgit v1.2.1 From 941e2c7ef7a5988b8bb46772357673cee4c5c3e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 10:54:31 +0000 Subject: fixed and added test case for bug#5431 + fix for support of multiple mgmt servers mysql-test/r/ndb_alter_table.result: added test case for bug #5431 mysql-test/t/ndb_alter_table.test: added test case for bug #5431 ndb/src/common/mgmcommon/ConfigRetriever.cpp: fix to make multiple mgmt srvrs work sql/ha_ndbcluster.cc: fixed and added test case for bug#5431 --- mysql-test/r/ndb_alter_table.result | 6 ++++-- mysql-test/t/ndb_alter_table.test | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 8a5fdfaf6a7..365879fb99b 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -75,9 +75,11 @@ drop table t1; DROP TABLE IF EXISTS t2; create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; alter table t2 engine=ndbcluster; -select count(*) from t2; +delete from t2; +ERROR HY000: Got temporary error 1217 '1217' from ndbcluster +select count(*) from t2 where a+0 > 0; count(*) -15001 +12001 truncate table t2; select count(*) from t2; count(*) diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index e2fbf829cc0..6057eff4fca 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -53,7 +53,7 @@ DROP TABLE IF EXISTS t2; --enable_warnings create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; -let $1=15001; +let $1=12001; disable_query_log; while ($1) { @@ -62,7 +62,10 @@ while ($1) } enable_query_log; alter table t2 engine=ndbcluster; -select count(*) from t2; +--error 1297 +delete from t2; +#to make sure we do a full table scan +select count(*) from t2 where a+0 > 0; truncate table t2; select count(*) from t2; drop table t2; -- cgit v1.2.1 From c42a054a778f6dc8af4dc2bc470c3467e0b9fd1b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 13:36:27 +0200 Subject: cleanup --- mysql-test/r/rpl_set_charset.result | 1 + mysql-test/t/rpl_set_charset.test | 2 ++ 2 files changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/r/rpl_set_charset.result index b2bfa3678a9..7297d80865b 100644 --- a/mysql-test/r/rpl_set_charset.result +++ b/mysql-test/r/rpl_set_charset.result @@ -49,3 +49,4 @@ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 drop table t1; +drop database mysqltest1; diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test index 6aa864b1008..dcfc11bf25e 100644 --- a/mysql-test/t/rpl_set_charset.test +++ b/mysql-test/t/rpl_set_charset.test @@ -38,3 +38,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; +connection master; +drop database mysqltest1; -- cgit v1.2.1 From 80b0cc09cc36113c2fadbf7b288dd742da2f99b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 14:20:48 +0200 Subject: clean up at end of test (thanks serg) mysql-test/r/rpl_set_charset.result: result update mysql-test/t/rpl_set_charset.test: clean up on slave too. --- mysql-test/r/rpl_set_charset.result | 1 - mysql-test/t/rpl_set_charset.test | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/r/rpl_set_charset.result index 7297d80865b..9c7ea73c741 100644 --- a/mysql-test/r/rpl_set_charset.result +++ b/mysql-test/r/rpl_set_charset.result @@ -48,5 +48,4 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0 D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 -drop table t1; drop database mysqltest1; diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test index dcfc11bf25e..bd68ce17bbc 100644 --- a/mysql-test/t/rpl_set_charset.test +++ b/mysql-test/t/rpl_set_charset.test @@ -34,9 +34,7 @@ use mysqltest1; select "--- on slave ---"; select hex(a),b from t1 order by b; connection master; -drop table t1; +drop database mysqltest1; save_master_pos; connection slave; sync_with_master; -connection master; -drop database mysqltest1; -- cgit v1.2.1 From 8eb0c4a4c24b525b626d694f082521b288f6acf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 12:30:11 +0000 Subject: fixed NdbConnection::restart and made use of it in ha_ndbcluster added testcase --- mysql-test/r/ndb_alter_table.result | 1 + mysql-test/t/ndb_alter_table.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 365879fb99b..75b52848a86 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -75,6 +75,7 @@ drop table t1; DROP TABLE IF EXISTS t2; create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; alter table t2 engine=ndbcluster; +alter table t2 add c int; delete from t2; ERROR HY000: Got temporary error 1217 '1217' from ndbcluster select count(*) from t2 where a+0 > 0; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 6057eff4fca..793dfd177cd 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -62,6 +62,7 @@ while ($1) } enable_query_log; alter table t2 engine=ndbcluster; +alter table t2 add c int; --error 1297 delete from t2; #to make sure we do a full table scan -- cgit v1.2.1 From b8ff1ebceb9a6d72e6f3ef211cd343f33b801543 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 16:56:31 +0200 Subject: after merge fixes --- mysql-test/r/rpl_set_charset.result | 7 ++----- mysql-test/t/rpl_set_charset.test | 7 ------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/r/rpl_set_charset.result index 7297d80865b..fd9c99d35d8 100644 --- a/mysql-test/r/rpl_set_charset.result +++ b/mysql-test/r/rpl_set_charset.result @@ -1,9 +1,9 @@ -slave stop; +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; -slave start; +start slave; drop database if exists mysqltest1; create database mysqltest1 /*!40100 character set latin2 */; use mysqltest1; @@ -31,9 +31,6 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0 D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0 E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0 -show binlog events from 1979; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 1979 Query 1 1979 use `mysqltest1`; SET CHARACTER SET DEFAULT use mysqltest1; select "--- on slave ---"; --- on slave --- diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test index dcfc11bf25e..1c0bd62fa55 100644 --- a/mysql-test/t/rpl_set_charset.test +++ b/mysql-test/t/rpl_set_charset.test @@ -20,13 +20,6 @@ INSERT INTO t1 VALUES (' INSERT INTO t1 VALUES ('','F0'); select "--- on master ---"; select hex(a),b from t1 order by b; -# It's complicated to verify that the charset is reset to default in -# the binlog after each query, except by checking the binlog. When you -# merge this into 4.1/5.0, the 1979 will have to be changed; all you have -# to do is read the var/log/master-bin.0*01 with mysqlbinlog, verify -# that a SET CHARACTER SET DEFAULT is just after the last INSERT, and -# replace 1979 by its position (the "# at" line above the SET). -show binlog events from 1979; save_master_pos; connection slave; sync_with_master; -- cgit v1.2.1 From c0717b745054735fd1f52224e06cb76cf1442d22 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 10:03:46 -0700 Subject: select.test: Added newline at the end of file. mysql-test/t/select.test: Added newline at the end of file. --- mysql-test/t/select.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index dae44159683..03490360b35 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1894,4 +1894,4 @@ EXPLAIN SELECT i FROM t1 WHERE i=1; EXPLAIN SELECT i FROM t1 WHERE i=1; -DROP TABLE t1; \ No newline at end of file +DROP TABLE t1; -- cgit v1.2.1 From 5567d3fe358999790f79c49974b9c8c65b534f88 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 22:10:15 +0200 Subject: after merge --- mysql-test/r/select.result | 10 +++++----- mysql-test/t/select.test | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 09bcfbb0e7f..f0618c0f153 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2353,14 +2353,14 @@ i int(11) NOT NULL default '0', c char(10) NOT NULL default '', PRIMARY KEY (i), UNIQUE KEY c (c) -) TYPE=MyISAM; +) 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; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index EXPLAIN SELECT i FROM t1 WHERE i=1; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index +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; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 8228371142a..4490f97765b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1890,7 +1890,7 @@ CREATE TABLE t1 ( c char(10) NOT NULL default '', PRIMARY KEY (i), UNIQUE KEY c (c) -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'a'); INSERT INTO t1 VALUES (2,'b'); -- cgit v1.2.1 From ed24f6d4c6ca35a5372b44f4844b6cc21b68e602 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 19:46:09 -0700 Subject: func_group.test, func_group.result: Added test case for bug #5406. opt_sum.cc: Fixed bug #5406. sql/opt_sum.cc: Fixed bug #5406. mysql-test/r/func_group.result: Added test case for bug #5406. mysql-test/t/func_group.test: Added test case for bug #5406. --- mysql-test/r/func_group.result | 9 +++++++++ mysql-test/t/func_group.test | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 06259ff4931..011a47874c2 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -684,3 +684,12 @@ max(a) 2 deallocate prepare stmt1; drop table t1; +CREATE TABLE t1 (a int primary key); +INSERT INTO t1 VALUES (1),(2),(3),(4); +SELECT MAX(a) FROM t1 WHERE a > 5; +MAX(a) +NULL +SELECT MIN(a) FROM t1 WHERE a < 0; +MIN(a) +NULL +DROP TABLE t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 74f4c1bad44..7f48f2b92bd 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -418,3 +418,19 @@ execute stmt1; execute stmt1; deallocate prepare stmt1; drop table t1; + +# +# Bug #5406 min/max optimization for empty set +# + +CREATE TABLE t1 (a int primary key); +INSERT INTO t1 VALUES (1),(2),(3),(4); + +SELECT MAX(a) FROM t1 WHERE a > 5; +SELECT MIN(a) FROM t1 WHERE a < 0; + +DROP TABLE t1; + + + + -- cgit v1.2.1 From eebf51f325574e6958a42ddd2fee7da239e55e1e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 13:39:15 +0300 Subject: check that table used in multi-update is unique added (BUG#5455) mysql-test/r/multi_update.result: multi* unique updating table check mysql-test/t/multi_update.test: multi* unique updating table check sql/sql_lex.cc: new method to check table only in subqueries sql/sql_lex.h: new method to check table only in subqueries sql/sql_parse.cc: used new method to check table only in subqueries sql/sql_update.cc: check that table is unique added --- mysql-test/r/multi_update.result | 7 +++++++ mysql-test/t/multi_update.test | 11 +++++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 39ec9ff4eb9..780ceb36ad6 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -455,3 +455,10 @@ create table t3 (a int, primary key (a)); delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a); ERROR 42S02: Unknown table 't3' in MULTI DELETE drop table t1, t2, t3; +create table t1 (col1 int); +create table t2 (col1 int); +update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +drop table t1,t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index c2814606aa2..40e742679f8 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -417,3 +417,14 @@ create table t3 (a int, primary key (a)); -- error 1109 delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a); drop table t1, t2, t3; + +# +# multi* unique updating table check +# +create table t1 (col1 int); +create table t2 (col1 int); +-- error 1093 +update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +-- error 1093 +delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; +drop table t1,t2; -- cgit v1.2.1 From 9d7e57791f254ab6905bc59f7398c567d35d2ed8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 22:43:37 +0400 Subject: Fix for bug#5400 "GROUP_CONCAT returns everything twice": Don't evaluate the value of GROUP_CONCAT several times for the same 'group', reuse the value instead. mysql-test/r/group_by.result: Testcase for bug#5400 mysql-test/t/group_by.test: Testcase for bug#5400 --- mysql-test/r/group_by.result | 9 +++++++++ mysql-test/t/group_by.test | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9af7304c167..022b8eff7e8 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -629,3 +629,12 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; +create table t1 ( col1 int, col2 int ); +insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); +select group_concat( distinct col1 ) as alias from t1 +group by col2 having alias like '%'; +alias +1,2 +1,2 +1 +drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index d6d1922c10f..59983594c32 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -456,3 +456,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5); SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; + +# Test for BUG#5400: GROUP_CONCAT returns everything twice. +create table t1 ( col1 int, col2 int ); +insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); +select group_concat( distinct col1 ) as alias from t1 + group by col2 having alias like '%'; + +drop table t1; + -- cgit v1.2.1 From dcfca68fbbe6495041711de17b08cb0200ad1790 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 21:54:01 +0300 Subject: test case of bug#5220 --- mysql-test/r/subselect_innodb.result | 8 ++++++++ mysql-test/t/subselect_innodb.test | 14 ++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index bbbc607b6f8..e8f6426f51b 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -106,3 +106,11 @@ a b 2 12 4 105 drop table t1, t2; +CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES ('xx','yy'); +INSERT INTO `t2` VALUES ('yy','xx'); +SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); +unit ingredient +xx yy +drop table t1, t2; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 8c13171d221..5f4badb3624 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -111,3 +111,17 @@ create table t2 (a int) engine=innodb; insert into t2 values (1),(2),(3),(4); select a, sum(b) as b from t1 group by a having b > (select max(a) from t2); drop table t1, t2; + +# +# bug #5220 test suite +# +CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO `t1` VALUES ('xx','yy'); +INSERT INTO `t2` VALUES ('yy','xx'); + +SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); + +drop table t1, t2; -- cgit v1.2.1 From 3c1f414812cf11751638f0a6a16f0e58112df2d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Sep 2004 12:23:10 +0500 Subject: Bug #5447 Select does not find records Note, there is no need to propagate this change into 4.1. mysql-test/r/ctype_latin1_de.result: Bug #5447 Select does not find records mysql-test/t/ctype_latin1_de.test: Bug #5447 Select does not find records strings/ctype-latin1_de.c: Bug #5447 Select does not find records --- mysql-test/r/ctype_latin1_de.result | 15 +++++++++++++++ mysql-test/t/ctype_latin1_de.test | 14 ++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 28394d9533a..c4bf6b5a3a9 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -267,3 +267,18 @@ select * from t1 where word like CAST(0xDF as CHAR); word word2 drop table t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +autor varchar(80) NOT NULL default '', +PRIMARY KEY (autor) +); +INSERT INTO t1 VALUES ('Powell, B.'),('Powell, Bud.'),('Powell, L. H.'),('Power, H.'), +('Poynter, M. A. L. Lane'),('Poynting, J. H. und J. J. Thomson.'),('Pozzi, S(amuel-Jean).'), +('Pozzi, Samuel-Jean.'),('Pozzo, A.'),('Pozzoli, Serge.'); +SELECT * FROM t1 WHERE autor LIKE 'Poz%' ORDER BY autor; +autor +Pozzi, S(amuel-Jean). +Pozzi, Samuel-Jean. +Pozzo, A. +Pozzoli, Serge. +DROP TABLE t1; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 3a0f2658969..d6c12683d94 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -72,3 +72,17 @@ select * from t1 where word like 'AE'; select * from t1 where word like 0xDF; select * from t1 where word like CAST(0xDF as CHAR); drop table t1; + +# +# Bug #5447 Select does not find records +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + autor varchar(80) NOT NULL default '', + PRIMARY KEY (autor) +); +INSERT INTO t1 VALUES ('Powell, B.'),('Powell, Bud.'),('Powell, L. H.'),('Power, H.'), +('Poynter, M. A. L. Lane'),('Poynting, J. H. und J. J. Thomson.'),('Pozzi, S(amuel-Jean).'), +('Pozzi, Samuel-Jean.'),('Pozzo, A.'),('Pozzoli, Serge.'); +SELECT * FROM t1 WHERE autor LIKE 'Poz%' ORDER BY autor; +DROP TABLE t1; -- cgit v1.2.1 From 262b305071ea94cd1fb91591055a4325c0c19352 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Sep 2004 18:44:53 +0500 Subject: Bug #5430 ctype_tis620 test failure BitKeeper/deleted/.del-ctype_tis620-master.opt~38b79f80b9348a14: Delete: mysql-test/t/ctype_tis620-master.opt --- mysql-test/r/ctype_tis620.result | 4 ++-- mysql-test/t/ctype_tis620-master.opt | 1 - mysql-test/t/ctype_tis620.test | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 mysql-test/t/ctype_tis620-master.opt (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 94c4b295713..1fece515f9f 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -116,7 +116,7 @@ CREATE TABLE t1 ( recid int(11) NOT NULL auto_increment, dyninfo text, PRIMARY KEY (recid) -) ENGINE=MyISAM; +) ENGINE=MyISAM CHARACTER SET tis620; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -2890,7 +2890,7 @@ SELECT 'a\t' < 'a'; SELECT 'a\t' < 'a '; 'a\t' < 'a ' 1 -CREATE TABLE t1 (a char(10) not null); +CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620; INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; hex(a) STRCMP(a,'a') STRCMP(a,'a ') diff --git a/mysql-test/t/ctype_tis620-master.opt b/mysql-test/t/ctype_tis620-master.opt deleted file mode 100644 index 69d47c06e42..00000000000 --- a/mysql-test/t/ctype_tis620-master.opt +++ /dev/null @@ -1 +0,0 @@ ---default-character-set=tis620 diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 9bffc2b7ab8..92a9eada05f 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -69,7 +69,7 @@ CREATE TABLE t1 ( recid int(11) NOT NULL auto_increment, dyninfo text, PRIMARY KEY (recid) -) ENGINE=MyISAM; +) ENGINE=MyISAM CHARACTER SET tis620; show create table t1; @@ -112,7 +112,7 @@ SELECT 'a\0' < 'a '; SELECT 'a\t' < 'a'; SELECT 'a\t' < 'a '; -CREATE TABLE t1 (a char(10) not null); +CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620; INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; -- cgit v1.2.1 From 5709400353db4ab4d7036c967a9b7c7bfe3ccd87 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Sep 2004 11:22:23 -0500 Subject: mysql_protocols.result: fix test result. mysql-test/r/mysql_protocols.result: fix test result. --- mysql-test/r/mysql_protocols.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysql_protocols.result b/mysql-test/r/mysql_protocols.result index 272e3bda6f0..cbead9254a2 100644 --- a/mysql-test/r/mysql_protocols.result +++ b/mysql-test/r/mysql_protocols.result @@ -4,6 +4,6 @@ TCP ok SOCKET ok -ERROR 2047: Wrong or unknown protocol -ERROR 2047: Wrong or unknown protocol +ERROR 2047 (HY000): Wrong or unknown protocol +ERROR 2047 (HY000): Wrong or unknown protocol Unknown option to protocol: NullS -- cgit v1.2.1 From 7cdf27164d401e712ea5579d8b8d6023ae19c484 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2004 16:28:18 +0300 Subject: information about different variables agged to query cache (BUG#5515, BUG#5394) mysql-test/r/query_cache.result: test of QC with different variables mysql-test/t/query_cache.test: test of QC with different variables sql/mysql_priv.h: new information for query key calculation sql/sql_cache.cc: new information for query key calculation sql/sql_cache.h: removed unused definitions --- mysql-test/r/query_cache.result | 56 +++++++++++++++++++++++++++++++++++++++++ mysql-test/t/query_cache.test | 34 +++++++++++++++++++++++++ 2 files changed, 90 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index a93ea1aa7fe..ee4b97b8ea8 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -851,4 +851,60 @@ select @@character_set_results; @@character_set_results NULL set character_set_results=default; +set GLOBAL query_cache_size=1355776; +create table t1 (id int auto_increment primary key, c char(25)); +insert into t1 set c = repeat('x',24); +insert into t1 set c = concat(repeat('x',24),'x'); +insert into t1 set c = concat(repeat('x',24),'w'); +insert into t1 set c = concat(repeat('x',24),'y'); +set max_sort_length=200; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxy +reset query cache; +set max_sort_length=20; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxy +set max_sort_length=200; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxy +set max_sort_length=default; +select '1' || '3' from t1; +'1' || '3' +1 +1 +1 +1 +set SQL_MODE=oracle; +select '1' || '3' from t1; +'1' || '3' +13 +13 +13 +13 +set SQL_MODE=default; +drop table t1; +create table t1 (a varchar(20), b int); +insert into t1 values ('12345678901234567890', 1); +set group_concat_max_len=10; +select group_concat(a) FROM t1 group by b; +group_concat(a) +1234567890 +set group_concat_max_len=1024; +select group_concat(a) FROM t1 group by b; +group_concat(a) +12345678901234567890 +set group_concat_max_len=default; +drop table t1; SET GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index b3111b614c6..66e9f31823a 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -627,4 +627,38 @@ set character_set_results=null; select @@character_set_results; set character_set_results=default; +# +# query cache and environment variables +# +# max_sort_length +set GLOBAL query_cache_size=1355776; +create table t1 (id int auto_increment primary key, c char(25)); +insert into t1 set c = repeat('x',24); +insert into t1 set c = concat(repeat('x',24),'x'); +insert into t1 set c = concat(repeat('x',24),'w'); +insert into t1 set c = concat(repeat('x',24),'y'); +set max_sort_length=200; +select c from t1 order by c, id; +reset query cache; +set max_sort_length=20; +select c from t1 order by c, id; +set max_sort_length=200; +select c from t1 order by c, id; +set max_sort_length=default; +# sql_mode +select '1' || '3' from t1; +set SQL_MODE=oracle; +select '1' || '3' from t1; +set SQL_MODE=default; +drop table t1; +# group_concat_max_len +create table t1 (a varchar(20), b int); +insert into t1 values ('12345678901234567890', 1); +set group_concat_max_len=10; +select group_concat(a) FROM t1 group by b; +set group_concat_max_len=1024; +select group_concat(a) FROM t1 group by b; +set group_concat_max_len=default; +drop table t1; + SET GLOBAL query_cache_size=0; -- cgit v1.2.1 From c882f80c18758c53070e0b030dcb4029cf4c7e29 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2004 18:56:47 +0200 Subject: BUG#4788 - show create table provides incorrect statement. Added code to adjust the field_length of user variables in dependence on the field type. Aded new constants for numeric field widths. include/mysql_com.h: BUG#4788 - show create table provides incorrect statement. Introduced definitions for default field width of numeric types. So common values can be used at different places in the code. mysql-test/r/variables.result: BUG#4788 - show create table provides incorrect statement. New test results. mysql-test/t/variables.test: BUG#4788 - show create table provides incorrect statement. Added a test for the bug. sql/item_func.cc: BUG#4788 - show create table provides incorrect statement. Added code to adjust the field_length of user variables in dependence on the field type. sql/sql_parse.cc: BUG#4788 - show create table provides incorrect statement. Changed numeric literals to the new constants. --- mysql-test/r/variables.result | 26 ++++++++++++++++++++++++++ mysql-test/t/variables.test | 19 +++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5d3f32cdd55..b2a97ce3e48 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -452,3 +452,29 @@ set global log_warnings = @tstlw; show global variables like 'log_warnings'; Variable_name Value log_warnings 1 +create table t1 ( +c1 tinyint, +c2 smallint, +c3 mediumint, +c4 int, +c5 bigint); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` tinyint(4) default NULL, + `c2` smallint(6) default NULL, + `c3` mediumint(9) default NULL, + `c4` int(11) default NULL, + `c5` bigint(20) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +set @arg00= 8, @arg01= 8.8, @arg02= 'a string'; +create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) default NULL, + `c2` double default NULL, + `c3` longtext +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a480ecb570a..fd6ab4d6405 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -335,3 +335,22 @@ show global variables like 'log_warnings'; set global log_warnings = @tstlw; show global variables like 'log_warnings'; +# +# BUG#4788 show create table provides incorrect statement +# +# What default width have numeric types? +create table t1 ( + c1 tinyint, + c2 smallint, + c3 mediumint, + c4 int, + c5 bigint); +show create table t1; +drop table t1; +# +# What types and widths have variables? +set @arg00= 8, @arg01= 8.8, @arg02= 'a string'; +create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; +show create table t1; +drop table t1; + -- cgit v1.2.1 From 950348843b6b4ea21edb151ab6f02fdc99576d49 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Sep 2004 17:40:02 +0000 Subject: removed shaky test case --- mysql-test/r/ndb_alter_table.result | 14 ------------- mysql-test/t/ndb_alter_table.test | 40 ++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 34 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 75b52848a86..f55f680e972 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -72,17 +72,3 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 101 3 4 5 PENDING 0000-00-00 00:00:00 2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 drop table t1; -DROP TABLE IF EXISTS t2; -create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; -alter table t2 engine=ndbcluster; -alter table t2 add c int; -delete from t2; -ERROR HY000: Got temporary error 1217 '1217' from ndbcluster -select count(*) from t2 where a+0 > 0; -count(*) -12001 -truncate table t2; -select count(*) from t2; -count(*) -0 -drop table t2; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 793dfd177cd..f3b1de6f1e6 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -48,25 +48,25 @@ show table status; select * from t1 order by col1; drop table t1; ---disable_warnings -DROP TABLE IF EXISTS t2; ---enable_warnings +#--disable_warnings +#DROP TABLE IF EXISTS t2; +#--enable_warnings -create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; -let $1=12001; -disable_query_log; -while ($1) -{ - eval insert into t2 values($1); - dec $1; -} -enable_query_log; -alter table t2 engine=ndbcluster; -alter table t2 add c int; ---error 1297 -delete from t2; +#create table t2 (a int NOT NULL PRIMARY KEY) engine=myisam; +#let $1=12001; +#disable_query_log; +#while ($1) +#{ +# eval insert into t2 values($1); +# dec $1; +#} +#enable_query_log; +#alter table t2 engine=ndbcluster; +#alter table t2 add c int; +#--error 1297 +#delete from t2; #to make sure we do a full table scan -select count(*) from t2 where a+0 > 0; -truncate table t2; -select count(*) from t2; -drop table t2; +#select count(*) from t2 where a+0 > 0; +#truncate table t2; +#select count(*) from t2; +#drop table t2; -- cgit v1.2.1 From 95f13739da3da9e8684f81decf2341faad8dc494 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Sep 2004 15:48:23 +0400 Subject: Fix for bug #5513: FIND_IN_SET fails if set ends with a comma --- mysql-test/r/func_set.result | 3 +++ mysql-test/t/func_set.test | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 2431406c128..ca6e0a8c319 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -64,3 +64,6 @@ find_in_set('a',binary 'A,B,C') select find_in_set(binary 'a', 'A,B,C'); find_in_set(binary 'a', 'A,B,C') 0 +select find_in_set('1','3,1,'); +find_in_set('1','3,1,') +2 diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index d669739bcb4..98ef1e07bfe 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -47,3 +47,8 @@ select find_in_set(binary 'a',binary 'A,B,C'); select find_in_set('a',binary 'A,B,C'); select find_in_set(binary 'a', 'A,B,C'); +# +# Bug5513:FIND_IN_SET fails if set ends with a comma +# +select find_in_set('1','3,1,'); + -- cgit v1.2.1 From b953a7a9a943a54fa001435502369bd677e9fc5d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Sep 2004 12:07:01 +0500 Subject: Persian collation, contibuted by Jody McIntyre --- mysql-test/r/ctype_uca.result | 374 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_uca.test | 191 +++++++++++++++++++++ 2 files changed, 565 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index da4b5bfb663..7e4a03e96cc 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -1911,3 +1911,377 @@ c Μωδ Μωδαί̈ DROP TABLE t1; +CREATE TABLE t1 ( +col1 CHAR(32) CHARACTER SET utf8 NOT NULL +); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); +SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; +HEX(CONVERT(col1 USING ucs2)) +0041004100410627 +0041004100410628 +0041004100410648 +0041004100410647 +0622063A06270632 +062206410631064A06420627064A064A +06220644064506270646064A +06220645062F0647 +06220646 +06220646060C +06220646062C0627 +0622064606860647 +062206480631062F +0627062D063306270646 +0627062F0628064A +0627062F064806270631062F +06270632 +06270633062A +06270634 +0627064206270645062A +062706A9062A06280631 +0627064506480631 +06270646062F +062706460642064406270628 +0627064606AF0644064A0633 +06270648 +06270648060C +0627064806510644 +0627064A +0627064A063106270646 +0627064A063106270646060C +0627064A0631062706460650 +0627064A063106270646064A +0627064A0646 +0628 +06280627 +0628062706310632 +06280627063206AF0634062A +0628062D062B +06280631062706480646200C06310627 +062806310627064A +0628063106310633064A +06280639062F0627064B +06280648062C0648062F +06280648062F +06280648062F060C +06280648062F0646062F +06280647 +0628064A0633062A +0628064A0646 +067E0631062F0627062E062A0647 +067E0631062F062706320645 +067E0633 +067E064A06480633062A +062A0627 +062A06270631064A062E +062A0623062B064A0631 +062A06280631064A0632 +062A062D062A +062A0631 +062A0634062E064A0635 +062A064106270648062A +062A064106A906510631 +062A0642064A +062A0642064A200C06320627062F0647 +062A0645062F06510646 +062A064606470627 +062A064806270646 +062C064606AF +062C064706270646 +068606340645 +0686064706310647 +062D06270644062A +062D062F0651 +062D062F0648062F +062D06330646 +062D064806320647 +062E0627064606480627062F06AF064A +062E064806270646062F0647 +062E06480631062F +062F0627062F +062F06270631062F +062F062706460634 +062F062706460634062C0648064A06270646064A +062F06270646063406AF06270647 +062F0631 +062F0633062A +062F06390648062A0650 +062F064406280633062A0647 +062F0646064A0633064F0646 +062F0648 +062F06480628062706310647 +062F064806310647 +062F06480644062A +062F064806510645 +062F064A06AF0631 +06310627 +063106270633 +06310641062A +063106470628063106270646 +06320627062F0647 +0698062706460648064A0647 +063306500631 +063306270644 +06330627064406AF064A060C +06330641064A0631 +0633064A06270633064A +0633064A0651062F +06340627064A062F +0634062E0635064A0651062A064A +0634062F +0634062F0647 +063406470631 +06350641062D0627062A +0637063106270632 +0639063106350647 +063906A90633 +063906440645 +063906440645064A +0639064406480645200C063406310642064A +06390645064400BB +063906480636060C +063A064406280647 +064106310647064606AF +0642063106270631 +06420648064A +06A90627063106470627064A +06A906270631064A +06A90627064506440627064B +06A90627064606480646 +06A9062A06270628 +06A90631062F0646062F +06A9064506280631064A062C +06A9064806340634 +06A90647 +06AF +06AF06310641062A0647 +06AF06310645064A +06440646062F0646 +064506270646062F +0645062C06440633 +0645062D064206510642 +0645062E062A06270631 +0645062F063106330647 +0645063306270639062F +064506340631064806370647 +06450635064506510645 +06450642062706440627062A +06450646 +06450646062A06340631 +06450646062A06420644 +064506480631062F +064506470645 +06450647064506270646 +0645064A +0645064A200C062F0647062F060C +0646062706450647 +064606280648062F060C +064606330628062A +0646063406270646 +064606380631 +064606450627064A0646062F0647 +064606480634062A0647 +064606470636062A +0646064A0632 +0648 +0648067E0646062C +06480632064A0631 +06480644064A +0648064A +0648064A06980647 +064706500646064A064606AF +0647063106860646062F +06470645 +0647064506270646 +0647064506330631 +06470645063306310634 +064706450647 +0647064606AF06270645064A +0647064A0626062A +064A062706310634062706370631 +064A06A9 +064A06A9062F064A06AF0631 +064A06A9064A +DROP TABLE t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index d9181b19992..cbb2bd7ba4b 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -217,3 +217,194 @@ INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci ORDER BY c; DROP TABLE t1; + +CREATE TABLE t1 ( + col1 CHAR(32) CHARACTER SET utf8 NOT NULL +); + +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); +SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; +DROP TABLE t1; -- cgit v1.2.1 From b31eb6975794e11e6930f7c6259378b4a5323044 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Sep 2004 14:25:43 +0500 Subject: A fix (bug #5498 TRIM fails with LEADING or TRAILING if remstr = str). --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 12c1cf78f7c..b4d1be5bd54 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -282,3 +282,9 @@ NULL NULL 1 1 n two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1; +select trim(trailing 'foo' from 'foo'); +trim(trailing 'foo' from 'foo') + +select trim(leading 'foo' from 'foo'); +trim(leading 'foo' from 'foo') + diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 9b0c076f23e..ba6a8b55236 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -172,3 +172,10 @@ create table t1(a char(4)); insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; drop table t1; + +# +# Bug #5498: TRIM fails with LEADING or TRAILING if remstr = str +# + +select trim(trailing 'foo' from 'foo'); +select trim(leading 'foo' from 'foo'); -- cgit v1.2.1 From dcc78f93b09d946f359a591ee1dad073679b8f65 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Sep 2004 14:27:58 +0200 Subject: Make it possible to run ndb tools in the mysql-test(s) mysql-test/mysql-test-run.sh: Added environment variable NDB_TOOLS_DIR --- mysql-test/mysql-test-run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 41dc3c419f0..baf05d53174 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -496,6 +496,7 @@ if [ x$SOURCE_DIST = x1 ] ; then CHARSETSDIR="$BASEDIR/sql/share/charsets" INSTALL_DB="./install_test_db" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" + NDB_TOOLS_DIR="$BASEDIR/ndb/tools" else if test -x "$BASEDIR/libexec/mysqld" then @@ -515,6 +516,7 @@ else MYSQL="$CLIENT_BINDIR/mysql" INSTALL_DB="./install_test_db --bin" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" + NDB_TOOLS_DIR="$CLIENT_BINDIR" if test -d "$BASEDIR/share/mysql/english" then LANGUAGE="$BASEDIR/share/mysql/english/" @@ -561,7 +563,8 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password= MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $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 --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR +export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR +export NDB_TOOLS_DIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ -- cgit v1.2.1 From 692b1e6958b72c82f14f7c950b54101a3e7bf96d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Sep 2004 14:46:38 +0200 Subject: WL1424 Multiple MySQL Servers: SHOW TABLES etc. should detect new and delete old tables. include/my_base.h: Added new bit to table create options Removed old error code HA_ERR_OLD_METADAT and reused it for HA_ERR_NO_SUCH_TABLE. mysql-test/r/ndb_autodiscover.result: Updated test cases mysql-test/t/ndb_autodiscover.test: Updated test cases mysql-test/t/ndb_autodiscover2.test: Updated test cases sql/discover.cc: Moved function create_table_from_handler to handler.cc sql/ha_ndbcluster.cc: Improved discover functionality Added .ndb file Changed error code mappings for a table that does not exist in engine Check for ndb object in THD Updated ndbcluster_discover, ndbcluster_list_tables and ndbcluster_can_discover sql/ha_ndbcluster.h: Improved discover sql/handler.cc: Added new error message mapping. Moved function ha_create_table_from_engine to handler level Added new functions ha_can_discover, ha_list_tables and ha_table_exists sql/handler.h: Added new error message mapping. Moved function ha_create_table_from_engine to handler level Added new functions ha_can_discover, ha_list_tables and ha_table_exists sql/mysql_priv.h: Removed create_table_from_handler, moved to handler.h sql/sql_base.cc: Renamed function create_table_from_handler sql/sql_show.cc: Added new function mysql_discover_files and mysql_list_files. Modified mysql_find_files to discover new and delete "old" files/tables. sql/sql_table.cc: Renamed create_table_from_handler Call ha_create_table_from_engine, in order to discover the the frm file before it can be dropped. sql/table.cc: Added mapping of the error code HA_ERR_NO_SUCH_TABLE --- mysql-test/r/ndb_autodiscover.result | 38 +++++++++++-- mysql-test/t/ndb_autodiscover.test | 101 +++++++++++++++++++++++------------ mysql-test/t/ndb_autodiscover2.test | 6 ++- 3 files changed, 107 insertions(+), 38 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index f5b908c39e2..7f5c4aecaa2 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3,t4,t5,t6,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t9; flush status; create table t1( id int not null primary key, @@ -94,8 +94,6 @@ ERROR 42S01: Table 't3' already exists show status like 'handler_discover%'; Variable_name Value Handler_discover 1 -SHOW TABLES FROM test; -Tables_in_test create table IF NOT EXISTS t3( id int not null primary key, id2 int not null, @@ -119,6 +117,40 @@ Variable_name Value Handler_discover 2 drop table t3; flush status; +create table t7( +id int not null primary key, +name char(255) +) engine=ndb; +create table t6( +id int not null primary key, +name char(255) +) engine=MyISAM; +insert into t7 values (1, "Explorer"); +insert into t6 values (2, "MyISAM table"); +select * from t7; +id name +1 Explorer +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +flush tables; +show tables from test; +Tables_in_test +t6 +t7 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +flush tables; +show table status; +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 +t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL +t7 ndbcluster 9 Fixed 100 0 # # # 0 NULL # # NULL # NULL +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +drop table t6, t7; +flush status; show status like 'handler_discover%'; Variable_name Value Handler_discover 0 diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 371a130291b..ddb8b6ed47a 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t9; --enable_warnings ################################################ @@ -122,7 +122,6 @@ create table t3( # IF NOT EXISTS wasn't specified show status like 'handler_discover%'; -SHOW TABLES FROM test; # now it should be discovered create table IF NOT EXISTS t3( @@ -145,38 +144,76 @@ show status like 'handler_discover%'; drop table t3; -####################################################### -# Test that a table that already exists as frm file -# but not in NDB can be deleted from disk. +################################################## +# Test that a table that already exists in NDB +# is discovered when SHOW TABLES +# is used # -# Manual test -#flush status; -# -#create table t4( -# id int not null primary key, -# name char(27) -#) engine=ndb; -#insert into t4 values (1, "Automatic"); -#select * from t4; +flush status; + +create table t7( + id int not null primary key, + name char(255) +) engine=ndb; +create table t6( + id int not null primary key, + name char(255) +) engine=MyISAM; +insert into t7 values (1, "Explorer"); +insert into t6 values (2, "MyISAM table"); +select * from t7; +show status like 'handler_discover%'; + +# Remove the frm file from disk +flush tables; +system rm var/master-data/test/t7.frm ; + +show tables from test; +show status like 'handler_discover%'; + +# Remove the frm file from disk again +flush tables; +system rm var/master-data/test/t7.frm ; + +--replace_column 7 # 8 # 9 # 12 # 13 # 15 # +show table status; +show status like 'handler_discover%'; + +drop table t6, t7; + + +####################################################### +# Test that a table that has been dropped from NDB +# but still exists on disk, get a consistent error message +# saying "No such table existed" # + +flush status; + +create table t4( + id int not null primary key, + name char(27) +) engine=ndb; +insert into t4 values (1, "Automatic"); +select * from t4; + # Remove the table from NDB -#system drop_tab -c "$NDB_CONNECTSTRING2" -d test t4 > /dev/null ; -#system drop_tab -c "host=localhost:2200;nodeid=5" -d test t4 > /dev/null ; -# -#--error 1296 -#select * from t4; -# -#flush table t4; -#--error 1016 -#select * from t4; -# -#show status like 'handler_discover%'; -#drop table t4; -#flush tables; -#show tables; -#--error 1146 -#select * from t4; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4; + +system exec ../ndb/tools/ndb_show_tables > show_tables.log; + +# Test that correct error is returned +--error 1146 +select * from t4; +--error 1146 +select * from t4; + +show status like 'handler_discover%'; +drop table t4; + +show tables; + ######################################################### @@ -241,7 +278,6 @@ show status like 'handler_discover%'; drop table t6; ###################################################### -# Simple test to show use of discover on startup # Note! This should always be the last step in this # file, the table t9 will be used and dropped # by ndb_autodiscover2 @@ -259,8 +295,7 @@ system rm var/master-data/test/t9.frm ; # Now leave test case, when ndb_autodiscover2 will run, this # MySQL Server will have been restarted because it has a -# ndb_autodiscover2-master.opt file. And thus the table should -# have been discovered by the "discover on startup" function. +# ndb_autodiscover2-master.opt file. #TODO #SLECT * FROM t1, t2, t4; diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index 6a3f2092148..cce75d5ca4f 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -1,14 +1,16 @@ -- source include/have_ndb.inc # -# Simple test to show use of discover on startup +# Simple test to show use of discover when the server has been restarted # The previous step has simply removed the frm file # from disk, but left the table in NDB # --sleep 3; select * from t9 order by a; -# handler_discover should be zero +# handler_discover should be 1 show status like 'handler_discover%'; drop table t9; + + -- cgit v1.2.1 From 1c5f4e69b89318e5b998a8e477e8ba2a368c4201 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Sep 2004 18:43:59 +0500 Subject: A fix (bug #5497: COMPRESS() returns NULL for large strings). --- mysql-test/r/func_compress.result | 4 ++++ mysql-test/t/func_compress.test | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index a3d28471993..4ff72d63144 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -68,3 +68,7 @@ Warnings: Error 1259 ZLIB: Input data corrupted Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; +set @@max_allowed_packet=1048576*100; +select length(compress(repeat('aaaaaaaaaa', 10000000))); +length(compress(repeat('aaaaaaaaaa', 10000000))) +97214 diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 79de99276a6..1384ef27cd2 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -35,3 +35,10 @@ select length(a) from t1; select length(uncompress(a)) from t1; drop table t1; + +# +# Bug #5497: a problem with large strings +# + +set @@max_allowed_packet=1048576*100; +select length(compress(repeat('aaaaaaaaaa', 10000000))); -- cgit v1.2.1 From 81e97da38b287f1e4c62e451306e9106e25cd0bb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2004 08:52:21 +0000 Subject: moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization new methods to keep "records" up to datecorrect record field in ndbcluster handler new method for ndbcluster handler to store/retrieve table and thread specific data changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl hanged deleteKey to return ponter to deleted object moved heavy global cache fetch from inline to separate method mysql-test/r/ndb_alter_table.result: correct record field in ndbcluster handler mysql-test/r/ndb_blob.result: correct record field in ndbcluster handler ndb/include/ndbapi/NdbDictionary.hpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/DictCache.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/DictCache.hpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl ndb/src/ndbapi/Ndb.cpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbDictionary.cpp: new method for ndbcluster handler to store/retrieve table and thread specific data ndb/src/ndbapi/NdbDictionaryImpl.cpp: changed local hash to store new table_info object, with placeholders for local data, instead of TableImpl moved heavy global cache fetch from inline to separate method ndb/src/ndbapi/NdbDictionaryImpl.hpp: replaced method DictionaryImpl::getTable with DictionaryImpl::get_local_table_info ndb/src/ndbapi/NdbLinHash.hpp: changed deleteKey to return ponter to deleted object sql/ha_ndbcluster.cc: moved all ndb thread specific data into new placeholder new methods to keep "records" up to date unset flag HA_NOT_EXACT_COUNT to make handler read "records" field, for count() optim and join optimization sql/ha_ndbcluster.h: new methods to keep "records" up to date sql/sql_class.h: moved all ndb thread specific data into new placeholder --- mysql-test/r/ndb_alter_table.result | 8 ++++---- mysql-test/r/ndb_blob.result | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index f55f680e972..43a4d5d561c 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -18,12 +18,12 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, col6 int not null, to_be_deleted int) ENGINE=ndbcluster; show table status; 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 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 1 NULL NULL NULL latin1_swedish_ci NULL +t1 ndbcluster 9 Dynamic 0 0 0 NULL 0 0 1 NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); show table status; 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 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL +t1 ndbcluster 9 Dynamic 9 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL select * from t1 order by col1; col1 col2 col3 col4 col5 col6 to_be_deleted 0 4 3 5 PENDING 1 7 @@ -43,7 +43,7 @@ change column col2 fourth varchar(30) not null after col3, modify column col6 int not null first; show table status; 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 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL +t1 ndbcluster 9 Dynamic 9 0 0 NULL 0 0 102 NULL NULL NULL latin1_swedish_ci NULL select * from t1 order by col1; col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 0 3 4 5 PENDING 0000-00-00 00:00:00 @@ -58,7 +58,7 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); show table status; 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 ndbcluster 9 Dynamic 100 0 0 NULL 0 0 103 NULL NULL NULL latin1_swedish_ci NULL +t1 ndbcluster 9 Dynamic 10 0 0 NULL 0 0 103 NULL NULL NULL latin1_swedish_ci NULL select * from t1 order by col1; col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 0 3 4 5 PENDING 0000-00-00 00:00:00 diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 45b003e6967..004713be718 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -150,7 +150,7 @@ insert into t1 values(9,'b9',999,'dd9'); commit; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 +1 SIMPLE t1 ALL NULL NULL NULL NULL 9 select * from t1 order by a; a b c d 1 b1 111 dd1 @@ -185,7 +185,7 @@ insert into t1 values(2,@b2,222,@d2); commit; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 100 +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) from t1 order by a; a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) -- cgit v1.2.1 From efba222560d45765eea9660ac71c038432e47817 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2004 13:49:08 +0200 Subject: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added a check to recover from IGNORE_SPACE in this situation: The ignored space led to the false identification of the dot as an ident separator (like "db.table"). mysql-test/r/sql_mode.result: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added the test results. mysql-test/t/sql_mode.test: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added new tests for the bug. sql/sql_lex.cc: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added code to recover from skipped spaces in mode IGNORE_SPACES, when testing for an ident separator (which happens to be a dot). --- mysql-test/r/sql_mode.result | 23 +++++++++++++++++++++++ mysql-test/t/sql_mode.test | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 77fe5d06bb0..e54dd217f8c 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -85,3 +85,26 @@ t1 CREATE TABLE "t1" ( UNIQUE KEY "email" ("email") ) drop table t1; +set session sql_mode = ''; +create table t1 ( min_num dec(6,6) default .000001); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `min_num` decimal(7,6) default '0.000001' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1 ; +set session sql_mode = 'IGNORE_SPACE'; +create table t1 ( min_num dec(6,6) default 0.000001); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `min_num` decimal(7,6) default '0.000001' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1 ; +create table t1 ( min_num dec(6,6) default .000001); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `min_num` decimal(7,6) default '0.000001' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1 ; diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 95e83b4b9e2..63a5d6d3671 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -28,3 +28,24 @@ set sql_mode="postgresql,oracle,mssql,db2,maxdb"; select @@sql_mode; show create table t1; drop table t1; + +# +# BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT +# +# Force the usage of the default +set session sql_mode = ''; +# statement for comparison, value starts with '.' +create table t1 ( min_num dec(6,6) default .000001); +show create table t1; +drop table t1 ; +# +set session sql_mode = 'IGNORE_SPACE'; +# statement for comparison, value starts with '0' +create table t1 ( min_num dec(6,6) default 0.000001); +show create table t1; +drop table t1 ; +# This statement fails, value starts with '.' +create table t1 ( min_num dec(6,6) default .000001); +show create table t1; +drop table t1 ; + -- cgit v1.2.1 From ccddfc8eaab46975e46182ef3a81b78d1c7f3ece Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Sep 2004 15:51:57 +0000 Subject: Added testcase for select count() during transaction with failures added fix for keeping "records" up to date when execute() fails mysql-test/r/ndb_insert.result: Added testcase for select count() during transaction with failures mysql-test/t/ndb_insert.test: Added testcase for select count() during transaction with failures sql/ha_ndbcluster.cc: added fix for keeping "records" up to date when execute() fails sql/ha_ndbcluster.h: added fix for keeping "records" up to date when execute() fails --- mysql-test/r/ndb_insert.result | 14 ++++++++++++++ mysql-test/t/ndb_insert.test | 11 +++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 87f27518ea3..2944230deef 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -421,11 +421,25 @@ INSERT INTO t1 VALUES (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); ERROR 23000: Duplicate entry '10' for key 1 begin; +SELECT COUNT(*) FROM t1; +COUNT(*) +2000 +INSERT INTO t1 VALUES +(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005); +SELECT COUNT(*) FROM t1; +COUNT(*) +2005 INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); ERROR 23000: Duplicate entry '10' for key 1 +SELECT COUNT(*) FROM t1; +COUNT(*) +2000 commit; +SELECT COUNT(*) FROM t1; +COUNT(*) +2000 insert into t1 select * from t1 where b < 10 order by pk1; ERROR 23000: Duplicate entry '9' for key 1 DROP TABLE t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index a448e413f1d..1a8103924a4 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -443,13 +443,20 @@ begin; # # Insert duplicate rows, inside transaction -# +# since failing inserts rollbacks whole transaction +# all select count (except second) return same value +# +SELECT COUNT(*) FROM t1; +INSERT INTO t1 VALUES +(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005); +SELECT COUNT(*) FROM t1; --error 1062 INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); - +SELECT COUNT(*) FROM t1; commit; +SELECT COUNT(*) FROM t1; # # Insert duplicate rows using "insert .. select" -- cgit v1.2.1 From 5eb1bc3951578faa39db5aba1397cf1d89b0807e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 15:13:17 +0500 Subject: A fix (bug #5540: CONCAT function and 'double' type). --- mysql-test/r/func_concat.result | 6 ++++++ mysql-test/t/func_concat.test | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index 17afd49b54c..ec53d6d87b0 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -26,3 +26,9 @@ FROM t1 GROUP BY new LIMIT 1; number alpha new 1413006 idlfmv 1413006<------------------>idlfmv drop table t1; +create table t1 (a char(4), b double, c date, d tinyint(4)); +insert into t1 values ('AAAA', 105, '2003-03-01', 1); +select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; +a b c d +AAAA 105 2003-03-01 1 +drop table t1; diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 147367a6d27..0cf1502b10e 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -25,3 +25,12 @@ FROM t1 GROUP BY new LIMIT 1; SELECT number, alpha, CONCAT_WS('<------------------>',number,alpha) AS new FROM t1 GROUP BY new LIMIT 1; drop table t1; + +# +# Bug #5540: a problem with double type +# + +create table t1 (a char(4), b double, c date, d tinyint(4)); +insert into t1 values ('AAAA', 105, '2003-03-01', 1); +select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; +drop table t1; -- cgit v1.2.1 From 057f6b6f143d19a956dcbe649062d83acbebef90 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 14:25:58 +0400 Subject: Fix the test case to make it more predictable (cause: 4.1.5 test failure on intelxeon3 (Solaris x86)) mysql-test/r/ps_2myisam.result: Test results fixed (order by for a couple of statements in the PS test). mysql-test/r/ps_3innodb.result: Test results fixed (order by for a couple of statements in the PS test). mysql-test/r/ps_4heap.result: Test results fixed (order by for a couple of statements in the PS test). mysql-test/r/ps_5merge.result: Test results fixed (order by for a couple of statements in the PS test). mysql-test/r/ps_6bdb.result: Test results fixed (order by for a couple of statements in the PS test). --- mysql-test/include/ps_query.inc | 6 ++++-- mysql-test/r/ps_2myisam.result | 6 ++++-- mysql-test/r/ps_3innodb.result | 6 ++++-- mysql-test/r/ps_4heap.result | 6 ++++-- mysql-test/r/ps_5merge.result | 12 ++++++++---- mysql-test/r/ps_6bdb.result | 6 ++++-- 6 files changed, 28 insertions(+), 14 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index bc5d3eb6ed1..9c80c7a040c 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -294,9 +294,11 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index b49eedb4067..ff0b7d65433 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -395,7 +395,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -407,7 +408,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 3a2708376fa..6e18e3e5ec9 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -395,7 +395,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -407,7 +408,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 4228d95677d..13bb3b26311 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -396,7 +396,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -408,7 +409,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 03020ccc0f3..6f8109d64de 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -438,7 +438,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -450,7 +451,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 @@ -1631,7 +1633,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -1643,7 +1646,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index b8730cce101..5481ee6b4f2 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -395,7 +395,8 @@ set @arg00='ABC'; set @arg01='two'; set @arg02='one'; select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02; +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; a @arg00 a 1 ABC 1 2 ABC 1 @@ -407,7 +408,8 @@ a @arg00 a 2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? '; + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 -- cgit v1.2.1 From 9504e0b49a251d7b296de0d81784317bc2331abc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 14:44:21 +0200 Subject: BUG#4775 "Duplicate key requires rollback of transaction" - Improved error message telling that transaction is aborted BUG#4312 "wrong behaviour on insert .. on duplicate key" functionality disabled mysql-test/r/ndb_insert.result: New tests for fduplicate inserts in combination with transaction New tests for INSERT IGNORE and REPLACE mysql-test/t/ndb_insert.test: New tests for fduplicate inserts in combination with transaction New tests for INSERT IGNORE and REPLACE ndb/src/ndbapi/NdbConnection.cpp: Return error 4350 "Transaction already aborted" if execute(Commit) is called when theCommitStatus==Aborted Add DBUG_PRINT's ndb/src/ndbapi/ndberror.c: Add new error message indicating that the transaction already has been aborted. sql/ha_ndbcluster.cc: Map all error code 0 to 1 in order to catch errors caused by NdbApi returning -1 without having set an error code. Use ndb object in THD in get_error_message BUG# 4312 Return HA_ERR_WRONG_COMMAND if extra(HA_EXTRA_IGNORE_DUP_KEY) is called Only use writeTuple if command is REPLACE sql/ha_ndbcluster.h: Added member variable to keep track of when HA_EXTRA_IGNORE_DUP_KEY is used, but NDB can't support it. --- mysql-test/r/ndb_insert.result | 118 +++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_insert.test | 116 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 233 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 87f27518ea3..179be627384 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -420,12 +420,130 @@ INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); ERROR 23000: Duplicate entry '10' for key 1 +select count(*) from t1; +count(*) +2000 begin; INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); ERROR 23000: Duplicate entry '10' for key 1 commit; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +commit; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +ERROR 23000: Duplicate entry '10' for key 1 +INSERT INTO t1 values (4000, 40, 44); +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 insert into t1 select * from t1 where b < 10 order by pk1; ERROR 23000: Duplicate entry '9' for key 1 +begin; +INSERT IGNORE INTO t1 VALUES(1,2,3); +ERROR HY000: Table storage engine for 't1' doesn't have this option +commit; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +INSERT IGNORE INTO t1 VALUES(1,2,3); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1 where pk1=1; +pk1 b c +1 1 1 +REPLACE INTO t1 values(1, 2, 3); +select * from t1 where pk1=1; +pk1 b c +1 2 3 +INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1 where pk1=1; +pk1 b c +1 2 3 DROP TABLE t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index a448e413f1d..129962c0295 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -437,20 +437,117 @@ INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +select count(*) from t1; +# +# Insert duplicate rows, inside transaction +# try to commit +# begin; +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + +--error 1296 +commit; + +select * from t1 where pk1=1; +select * from t1 where pk1=10; +select count(*) from t1 where pk1 <= 10 order by pk1; +select count(*) from t1; + + # # Insert duplicate rows, inside transaction -# +# rollback +# +begin; + +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + +rollback; + +select * from t1 where pk1=1; +select * from t1 where pk1=10; +select count(*) from t1 where pk1 <= 10 order by pk1; +select count(*) from t1; + + +# +# Insert duplicate rows, inside transaction +# then try to select, finally rollback +# +begin; + +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + +--error 1296 +SELECT * FROM t1 WHERE pk1=10; + +rollback; + +select * from t1 where pk1=1; +select * from t1 where pk1=10; +select count(*) from t1 where pk1 <= 10 order by pk1; +select count(*) from t1; + + +# +# Insert duplicate rows, inside transaction +# then try to select, finally commit +# +begin; + --error 1062 INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +--error 1296 +SELECT * FROM t1 WHERE pk1=10; + +--error 1296 +SELECT * FROM t1 WHERE pk1=10; + +--error 1296 commit; +select * from t1 where pk1=1; +select * from t1 where pk1=10; +select count(*) from t1 where pk1 <= 10 order by pk1; +select count(*) from t1; + + +# +# Insert duplicate rows, inside transaction +# then try to do another insert +# +begin; + +--error 1062 +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); + +--error 1296 +INSERT INTO t1 values (4000, 40, 44); + +rollback; + +select * from t1 where pk1=1; +select * from t1 where pk1=10; +select count(*) from t1 where pk1 <= 10 order by pk1; +select count(*) from t1; + # # Insert duplicate rows using "insert .. select" @@ -459,4 +556,21 @@ commit; insert into t1 select * from t1 where b < 10 order by pk1; +begin; +--error 1031 +INSERT IGNORE INTO t1 VALUES(1,2,3); +commit; +select * from t1 where pk1=1; + +--error 1031 +INSERT IGNORE INTO t1 VALUES(1,2,3); +select * from t1 where pk1=1; + +REPLACE INTO t1 values(1, 2, 3); +select * from t1 where pk1=1; + +--error 1031 +INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; +select * from t1 where pk1=1; + DROP TABLE t1; -- cgit v1.2.1 From 12d8ec6e9d06d6ac197a64d23fffbdb591fe882c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 19:46:42 +0500 Subject: Fix for bug #5532 (error 22 inserting GIS data) This bug is the result of weird error happening with mi_float8get and double arythmetic. I described that in 'Bug that looks potentially dangerous' email myisam/rt_mbr.c: *ab_area was changed with the local variable just to make the function working without errors mysql-test/r/gis.result: appropriate test result mysql-test/t/gis.test: Test case --- mysql-test/r/gis.result | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/gis.test | 90 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 9f5dd286cf9..65a4c7df342 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -485,3 +485,92 @@ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); AsText(a) POINT(1 1) drop table t1; +CREATE TABLE t1 (Coordinates POINT NOT NULL, SPATIAL INDEX(Coordinates)); +INSERT INTO t1 VALUES(GeomFromText('POINT(383293632 1754448)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(564952612 157516260)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(98128178 141127631)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(862547902 799334546)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(341989013 850270906)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(803302376 93039099)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(857439153 817431356)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(319757546 343162742)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(826341972 717484432)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(305066789 201736238)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(626068992 616241497)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(55789424 755830108)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(802874458 312435220)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(153795660 551723671)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(242207428 537089292)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(553478119 807160039)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(694605552 457472733)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(987886554 792733729)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(598600363 850434457)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(592068275 940589376)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(700705362 395370650)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(33628474 558144514)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(212802006 353386020)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(901307256 39143977)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(70870451 206374045)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(240880214 696939443)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(822615542 296669638)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(452769551 625489999)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(609104858 606565210)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(177213669 851312285)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(143654501 730691787)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(658472325 838260052)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(188164520 646358878)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(630993781 786764883)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(496793334 223062055)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(727354258 197498696)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(618432704 760982731)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(755643210 831234710)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(114368751 656950466)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(870378686 185239202)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(863324511 111258900)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(882178645 685940052)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(407928538 334948195)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(311430051 17033395)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(941513405 488643719)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(868345680 85167906)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(219335507 526818004)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(923427958 407500026)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(173176882 554421738)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(194264908 669970217)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(777483793 921619165)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(867468912 395916497)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(682601897 623112122)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(227151206 796970647)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(280062588 97529892)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(982209849 143387099)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(208788792 864388493)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(829327151 616717329)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(199336688 140757201)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(633750724 140850093)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(629400920 502096404)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(226017998 848736426)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(28914408 149445955)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(256236452 202091290)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(703867693 450501360)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(872061506 481351486)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(372120524 739530418)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(877267982 54722420)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(362642540 104419188)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(851693067 642705127)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(201949080 833902916)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(786092225 410737872)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(698291409 615419376)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(27455201 897628096)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(756176576 661205925)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(38478189 385577496)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(163302328 264496186)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(234313922 192216735)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(413942141 490550373)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(394308025 117809834)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(941051732 266369530)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(599161319 313172256)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(5899948 476429301)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)')); +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index e35b9996a44..e44f09c1d8d 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -190,3 +190,93 @@ select AsText(a) from t1 where and MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); drop table t1; + +CREATE TABLE t1 (Coordinates POINT NOT NULL, SPATIAL INDEX(Coordinates)); +INSERT INTO t1 VALUES(GeomFromText('POINT(383293632 1754448)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(564952612 157516260)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(903994614 180726515)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(98128178 141127631)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(862547902 799334546)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(341989013 850270906)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(803302376 93039099)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(857439153 817431356)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(319757546 343162742)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(826341972 717484432)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(305066789 201736238)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(626068992 616241497)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(55789424 755830108)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(802874458 312435220)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(153795660 551723671)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(242207428 537089292)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(553478119 807160039)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(694605552 457472733)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(987886554 792733729)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(598600363 850434457)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(592068275 940589376)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(700705362 395370650)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(33628474 558144514)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(212802006 353386020)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(901307256 39143977)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(70870451 206374045)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(240880214 696939443)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(822615542 296669638)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(452769551 625489999)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(609104858 606565210)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(177213669 851312285)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(143654501 730691787)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(658472325 838260052)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(188164520 646358878)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(630993781 786764883)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(496793334 223062055)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(727354258 197498696)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(618432704 760982731)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(755643210 831234710)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(114368751 656950466)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(870378686 185239202)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(863324511 111258900)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(882178645 685940052)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(407928538 334948195)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(311430051 17033395)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(941513405 488643719)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(868345680 85167906)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(219335507 526818004)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(923427958 407500026)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(173176882 554421738)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(194264908 669970217)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(777483793 921619165)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(867468912 395916497)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(682601897 623112122)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(227151206 796970647)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(280062588 97529892)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(982209849 143387099)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(208788792 864388493)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(829327151 616717329)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(199336688 140757201)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(633750724 140850093)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(629400920 502096404)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(226017998 848736426)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(28914408 149445955)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(256236452 202091290)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(703867693 450501360)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(872061506 481351486)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(372120524 739530418)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(877267982 54722420)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(362642540 104419188)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(851693067 642705127)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(201949080 833902916)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(786092225 410737872)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(698291409 615419376)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(27455201 897628096)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(756176576 661205925)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(38478189 385577496)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(163302328 264496186)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(234313922 192216735)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(413942141 490550373)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(394308025 117809834)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(941051732 266369530)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(599161319 313172256)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(5899948 476429301)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)')); +INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)')); +drop table t1; -- cgit v1.2.1 From c5387ade5039d6191fedf9de5ce1eef98fe8f738 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 18:44:18 +0200 Subject: Fixed handling of NO_AUTO_VALUE_ON_ZERO --- mysql-test/r/ndb_alter_table.result | 1 + mysql-test/t/ndb_alter_table.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 43a4d5d561c..8143e34ecc2 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -19,6 +19,7 @@ col6 int not null, to_be_deleted int) ENGINE=ndbcluster; show table status; 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 ndbcluster 9 Dynamic 0 0 0 NULL 0 0 1 NULL NULL NULL latin1_swedish_ci NULL +SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; insert into t1 values (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); show table status; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index f3b1de6f1e6..3cdddfa8dce 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -31,6 +31,7 @@ col4 varchar(4) not null, col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, col6 int not null, to_be_deleted int) ENGINE=ndbcluster; show table status; +SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; insert into t1 values (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); show table status; -- cgit v1.2.1 From 23f5fdad66ae87dbb929b0103066a5895742214a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Sep 2004 14:47:39 +0500 Subject: Return character strings in table, type, possible_keys, key fields of EXPLAIN SELECT, rather than binary strings. --- mysql-test/r/ps_1general.result | 28 ++++++++++----------- mysql-test/r/ps_2myisam.result | 28 ++++++++++----------- mysql-test/r/ps_3innodb.result | 28 ++++++++++----------- mysql-test/r/ps_4heap.result | 28 ++++++++++----------- mysql-test/r/ps_5merge.result | 56 ++++++++++++++++++++--------------------- mysql-test/r/ps_6bdb.result | 28 ++++++++++----------- 6 files changed, 98 insertions(+), 98 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index e9a5f705fa7..2561caa3759 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -414,15 +414,15 @@ prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 63 -def table 253 64 2 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 14 N 1 31 63 +def Extra 253 255 14 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort SET @arg00=1 ; @@ -430,15 +430,15 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 63 -def table 253 64 2 N 1 31 63 -def type 253 10 5 N 1 31 63 -def possible_keys 253 4096 7 Y 0 31 63 -def key 253 64 7 Y 0 31 63 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 5 N 1 31 8 +def possible_keys 253 4096 7 Y 0 31 8 +def key 253 64 7 Y 0 31 8 def key_len 8 3 1 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 27 N 1 31 63 +def Extra 253 255 27 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort test_sequence diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index ff0b7d65433..16d3cdbbb47 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 6e18e3e5ec9..865b108d7ed 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 13bb3b26311..1cc18575dd1 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -575,15 +575,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -646,15 +646,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 6f8109d64de..2d67635cc10 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -617,15 +617,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -688,15 +688,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -1812,15 +1812,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -1883,15 +1883,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5481ee6b4f2..8fe76dae3ab 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -- cgit v1.2.1 From f317aae78f9e1e220d53c5fd6913229567774db4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Sep 2004 15:01:12 +0500 Subject: Clean-up. The length of compress() may depend on zlib version, etc. mysql-test/r/func_compress.result: clean-up. The length of compress() may depend on zlib version, etc. mysql-test/t/func_compress.test: clean-up. The length of compress() may depend on zlib version, etc. --- mysql-test/r/func_compress.result | 6 +++--- mysql-test/t/func_compress.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 4ff72d63144..11dbcca9431 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -69,6 +69,6 @@ Error 1259 ZLIB: Input data corrupted Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; set @@max_allowed_packet=1048576*100; -select length(compress(repeat('aaaaaaaaaa', 10000000))); -length(compress(repeat('aaaaaaaaaa', 10000000))) -97214 +select compress(repeat('aaaaaaaaaa', 10000000)) is null; +compress(repeat('aaaaaaaaaa', 10000000)) is null +0 diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 1384ef27cd2..7b70289d2c0 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -41,4 +41,4 @@ drop table t1; # set @@max_allowed_packet=1048576*100; -select length(compress(repeat('aaaaaaaaaa', 10000000))); +select compress(repeat('aaaaaaaaaa', 10000000)) is null; -- cgit v1.2.1 From 408ef495756d54292939f3b25a50e710b9c86f70 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Sep 2004 22:13:24 +0400 Subject: A quick fix for bug#5556: replace a column of SHOW TABLE STATUS result with a fixed constant to pass on QNX: max_data_file_length is calculated depending on max possible value of record pointer. It's different on QNX, so the difference in results is OK. mysql-test/t/ps.test: A quick fix for bug#5556: replace a column of SHOW TABLE STATUS result with a fixed constant to pass on QNX: max_data_file_length is calculated depending on max value of record pointer. It's different on QNX, so the result difference is intentional. --- mysql-test/t/ps.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index cbc76e02b42..c739e28849e 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -200,9 +200,9 @@ drop table t1; # create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; prepare stmt1 from ' show table status from test like ''t1%'' '; ---replace_column 12 # 13 # 14 # +--replace_column 8 4294967295 12 # 13 # 14 # execute stmt1; ---replace_column 12 # 13 # 14 # +--replace_column 8 4294967295 12 # 13 # 14 # show table status from test like 't1%' ; deallocate prepare stmt1 ; drop table t1; -- cgit v1.2.1 From 0e53aad72b38e7004f42fdb6b926a70a0fe03214 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Sep 2004 13:23:57 +0300 Subject: Do not try use fields examples is expression and fiend used or SET/ENUM field used in types merging procedure (BUG#5618) mysql-test/r/union.result: merging ENUM and SET fields in one UNION mysql-test/t/union.test: merging ENUM and SET fields in one UNION --- mysql-test/r/union.result | 37 +++++++++++++++++++++++++++++++++++++ mysql-test/t/union.test | 20 ++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 2f42bedf67a..fbd4f8e11dc 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -996,3 +996,40 @@ PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1); ID1 ID2 DATA1 DATA2 DATA3 ID DATA1 drop table t1,t2; +create table t1 (a ENUM('Yes', 'No') NOT NULL); +create table t2 (a ENUM('aaa', 'bbb') NOT NULL); +insert into t1 values ('No'); +insert into t2 values ('bbb'); +create table t3 (a SET('Yes', 'No') NOT NULL); +create table t4 (a SET('aaa', 'bbb') NOT NULL); +insert into t3 values (1); +insert into t4 values (3); +select "1" as a union select a from t1; +a +1 +No +select a as a from t1 union select "1"; +a +No +1 +select a as a from t2 union select a from t1; +a +bbb +No +select "1" as a union select a from t3; +a +1 +Yes +select a as a from t3 union select "1"; +a +Yes +1 +select a as a from t4 union select a from t3; +a +aaa,bbb +Yes +select a as a from t1 union select a from t4; +a +No +aaa,bbb +drop table t1,t2,t3,t4; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 263f631a65f..c5e72e85835 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -575,3 +575,23 @@ PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION (SELECT * FROM t1 AS PARTITIONED, t2 AS PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1); drop table t1,t2; + +# +# merging ENUM and SET fields in one UNION +# +create table t1 (a ENUM('Yes', 'No') NOT NULL); +create table t2 (a ENUM('aaa', 'bbb') NOT NULL); +insert into t1 values ('No'); +insert into t2 values ('bbb'); +create table t3 (a SET('Yes', 'No') NOT NULL); +create table t4 (a SET('aaa', 'bbb') NOT NULL); +insert into t3 values (1); +insert into t4 values (3); +select "1" as a union select a from t1; +select a as a from t1 union select "1"; +select a as a from t2 union select a from t1; +select "1" as a union select a from t3; +select a as a from t3 union select "1"; +select a as a from t4 union select a from t3; +select a as a from t1 union select a from t4; +drop table t1,t2,t3,t4; -- cgit v1.2.1 From e8bc5611260300f75710ce7064adfd0f003bf824 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Sep 2004 12:07:59 +0100 Subject: Bug#5553 - Multi table UPDATE IGNORE fails on dup key We don't want the update to abort when IGNORE is specified mysql-test/r/update.result: Bug#5553 - UPDATE IGNORE fails on dup key New test mysql-test/t/update.test: Bug#5553 - UPDATE IGNORE fails on dup key New test BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/r/update.result | 37 +++++++++++++++++++++++++++++++++++++ mysql-test/t/update.test | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 11aff8fe50a..c9405d71237 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -166,3 +166,40 @@ F1 F2 F3 cnt groupid 2 0 1 2 4 2 2 0 1 7 drop table t1; +CREATE TABLE t1 ( +`colA` int(10) unsigned NOT NULL auto_increment, +`colB` int(11) NOT NULL default '0', +PRIMARY KEY (`colA`) +); +INSERT INTO t1 VALUES (4433,5424); +CREATE TABLE t2 ( +`colC` int(10) unsigned NOT NULL default '0', +`colA` int(10) unsigned NOT NULL default '0', +`colD` int(10) unsigned NOT NULL default '0', +`colE` int(10) unsigned NOT NULL default '0', +`colF` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`colC`,`colA`,`colD`,`colE`) +); +INSERT INTO t2 VALUES (3,4433,10005,495,500); +INSERT INTO t2 VALUES (3,4433,10005,496,500); +INSERT INTO t2 VALUES (3,4433,10009,494,500); +INSERT INTO t2 VALUES (3,4433,10011,494,500); +INSERT INTO t2 VALUES (3,4433,10005,497,500); +INSERT INTO t2 VALUES (3,4433,10013,489,500); +INSERT INTO t2 VALUES (3,4433,10005,494,500); +INSERT INTO t2 VALUES (3,4433,10005,493,500); +INSERT INTO t2 VALUES (3,4433,10005,492,500); +UPDATE IGNORE t2,t1 set t2.colE = t2.colE + 1,colF=0 WHERE t1.colA = t2.colA AND (t1.colB & 4096) > 0 AND (colE + 1) < colF; +SELECT * FROM t2; +colC colA colD colE colF +3 4433 10005 495 500 +3 4433 10005 496 500 +3 4433 10009 495 0 +3 4433 10011 495 0 +3 4433 10005 498 0 +3 4433 10013 490 0 +3 4433 10005 494 500 +3 4433 10005 493 500 +3 4433 10005 492 500 +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 2e739dd927d..1850564418c 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -122,3 +122,36 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6), delete from t1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3); select * from t1; drop table t1; + +# +# Bug#5553 - Multi table UPDATE IGNORE fails on duplicate keys +# + +CREATE TABLE t1 ( + `colA` int(10) unsigned NOT NULL auto_increment, + `colB` int(11) NOT NULL default '0', + PRIMARY KEY (`colA`) +); +INSERT INTO t1 VALUES (4433,5424); +CREATE TABLE t2 ( + `colC` int(10) unsigned NOT NULL default '0', + `colA` int(10) unsigned NOT NULL default '0', + `colD` int(10) unsigned NOT NULL default '0', + `colE` int(10) unsigned NOT NULL default '0', + `colF` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`colC`,`colA`,`colD`,`colE`) +); +INSERT INTO t2 VALUES (3,4433,10005,495,500); +INSERT INTO t2 VALUES (3,4433,10005,496,500); +INSERT INTO t2 VALUES (3,4433,10009,494,500); +INSERT INTO t2 VALUES (3,4433,10011,494,500); +INSERT INTO t2 VALUES (3,4433,10005,497,500); +INSERT INTO t2 VALUES (3,4433,10013,489,500); +INSERT INTO t2 VALUES (3,4433,10005,494,500); +INSERT INTO t2 VALUES (3,4433,10005,493,500); +INSERT INTO t2 VALUES (3,4433,10005,492,500); +UPDATE IGNORE t2,t1 set t2.colE = t2.colE + 1,colF=0 WHERE t1.colA = t2.colA AND (t1.colB & 4096) > 0 AND (colE + 1) < colF; +SELECT * FROM t2; +DROP TABLE t1; +DROP TABLE t2; + -- cgit v1.2.1 From a0072f41bf096a5bea61d76a6ca1eee0bceedd49 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Sep 2004 14:09:21 +0200 Subject: ndb charsets (wl-1732) final part: use strxfrm + strcoll ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: oops ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: jamEntry ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: jamEntry mysql-test/r/ndb_index.result: ndb charsets: minimal fix to make test pass mysql-test/t/ndb_index.test: ndb charsets: minimal fix to make test pass --- mysql-test/r/ndb_charset.result | 191 ++++++++++++++++++++++++++++++++++++++++ mysql-test/r/ndb_index.result | 2 +- mysql-test/t/ndb_charset.test | 159 +++++++++++++++++++++++++++++++++ mysql-test/t/ndb_index.test | 2 +- 4 files changed, 352 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/ndb_charset.result create mode 100644 mysql-test/t/ndb_charset.test (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/r/ndb_charset.result new file mode 100644 index 00000000000..93429a1fcb0 --- /dev/null +++ b/mysql-test/r/ndb_charset.result @@ -0,0 +1,191 @@ +drop table if exists t1; +create table t1 ( +a char(3) character set latin1 collate latin1_bin primary key +) engine=ndb; +insert into t1 values('aAa'); +insert into t1 values('aaa'); +insert into t1 values('AAA'); +select * from t1 order by a; +a +AAA +aAa +aaa +select * from t1 where a = 'aAa'; +a +aAa +select * from t1 where a = 'aaa'; +a +aaa +select * from t1 where a = 'AaA'; +a +select * from t1 where a = 'AAA'; +a +AAA +drop table t1; +create table t1 ( +a char(3) character set latin1 collate latin1_swedish_ci primary key +) engine=ndb; +insert into t1 values('aAa'); +insert into t1 values('aaa'); +ERROR 23000: Duplicate entry 'aaa' for key 1 +insert into t1 values('AAA'); +ERROR 23000: Duplicate entry 'AAA' for key 1 +select * from t1 order by a; +a +aAa +select * from t1 where a = 'aAa'; +a +aAa +select * from t1 where a = 'aaa'; +a +aAa +select * from t1 where a = 'AaA'; +a +aAa +select * from t1 where a = 'AAA'; +a +aAa +drop table t1; +create table t1 ( +p int primary key, +a char(3) character set latin1 collate latin1_bin not null, +unique key(a) +) engine=ndb; +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +select * from t1 order by p; +p a +1 aAa +2 aaa +3 AAA +select * from t1 where a = 'aAa'; +p a +1 aAa +select * from t1 where a = 'aaa'; +p a +2 aaa +select * from t1 where a = 'AaA'; +p a +select * from t1 where a = 'AAA'; +p a +3 AAA +drop table t1; +create table t1 ( +p int primary key, +a char(3) character set latin1 collate latin1_swedish_ci not null, +unique key(a) +) engine=ndb; +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +ERROR 23000: Can't write, because of unique constraint, to table 't1' +insert into t1 values(3, 'AAA'); +ERROR 23000: Can't write, because of unique constraint, to table 't1' +select * from t1 order by p; +p a +1 aAa +select * from t1 where a = 'aAa'; +p a +1 aAa +select * from t1 where a = 'aaa'; +p a +1 aAa +select * from t1 where a = 'AaA'; +p a +1 aAa +select * from t1 where a = 'AAA'; +p a +1 aAa +drop table t1; +create table t1 ( +p int primary key, +a char(3) character set latin1 collate latin1_bin not null, +index(a) +) engine=ndb; +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +insert into t1 values(4, 'aAa'); +insert into t1 values(5, 'aaa'); +insert into t1 values(6, 'AAA'); +select * from t1 order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +explain select * from t1 where a = 'zZz' order by p; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 3 const 10 Using where; Using filesort +select * from t1 where a = 'aAa' order by p; +p a +1 aAa +4 aAa +select * from t1 where a = 'aaa' order by p; +p a +2 aaa +5 aaa +select * from t1 where a = 'AaA' order by p; +p a +select * from t1 where a = 'AAA' order by p; +p a +3 AAA +6 AAA +drop table t1; +create table t1 ( +p int primary key, +a char(3) character set latin1 collate latin1_swedish_ci not null, +index(a) +) engine=ndb; +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +insert into t1 values(4, 'aAa'); +insert into t1 values(5, 'aaa'); +insert into t1 values(6, 'AAA'); +select * from t1 order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +explain select * from t1 where a = 'zZz' order by p; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 3 const 10 Using where; Using filesort +select * from t1 where a = 'aAa' order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +select * from t1 where a = 'aaa' order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +select * from t1 where a = 'AaA' order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +select * from t1 where a = 'AAA' order by p; +p a +1 aAa +2 aaa +3 AAA +4 aAa +5 aaa +6 AAA +drop table t1; diff --git a/mysql-test/r/ndb_index.result b/mysql-test/r/ndb_index.result index dd92c237ace..5702552b0b5 100644 --- a/mysql-test/r/ndb_index.result +++ b/mysql-test/r/ndb_index.result @@ -4,7 +4,7 @@ PORT varchar(16) NOT NULL, ACCESSNODE varchar(16) NOT NULL, POP varchar(48) NOT NULL, ACCESSTYPE int unsigned NOT NULL, -CUSTOMER_ID varchar(20) NOT NULL, +CUSTOMER_ID varchar(20) collate latin1_bin NOT NULL, PROVIDER varchar(16), TEXPIRE int unsigned, NUM_IP int unsigned, diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test new file mode 100644 index 00000000000..b9f28ed0faf --- /dev/null +++ b/mysql-test/t/ndb_charset.test @@ -0,0 +1,159 @@ +--source include/have_ndb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Minimal NDB charset test. +# + +# pk - binary + +create table t1 ( + a char(3) character set latin1 collate latin1_bin primary key +) engine=ndb; +# ok +insert into t1 values('aAa'); +insert into t1 values('aaa'); +insert into t1 values('AAA'); +# 3 +select * from t1 order by a; +# 1 +select * from t1 where a = 'aAa'; +# 1 +select * from t1 where a = 'aaa'; +# 0 +select * from t1 where a = 'AaA'; +# 1 +select * from t1 where a = 'AAA'; +drop table t1; + +# pk - case insensitive + +create table t1 ( + a char(3) character set latin1 collate latin1_swedish_ci primary key +) engine=ndb; +# ok +insert into t1 values('aAa'); +# fail +--error 1062 +insert into t1 values('aaa'); +--error 1062 +insert into t1 values('AAA'); +# 1 +select * from t1 order by a; +# 1 +select * from t1 where a = 'aAa'; +# 1 +select * from t1 where a = 'aaa'; +# 1 +select * from t1 where a = 'AaA'; +# 1 +select * from t1 where a = 'AAA'; +drop table t1; + +# unique hash index - binary + +create table t1 ( + p int primary key, + a char(3) character set latin1 collate latin1_bin not null, + unique key(a) +) engine=ndb; +# ok +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +# 3 +select * from t1 order by p; +# 1 +select * from t1 where a = 'aAa'; +# 1 +select * from t1 where a = 'aaa'; +# 0 +select * from t1 where a = 'AaA'; +# 1 +select * from t1 where a = 'AAA'; +drop table t1; + +# unique hash index - case insensitive + +create table t1 ( + p int primary key, + a char(3) character set latin1 collate latin1_swedish_ci not null, + unique key(a) +) engine=ndb; +# ok +insert into t1 values(1, 'aAa'); +# fail +--error 1169 +insert into t1 values(2, 'aaa'); +--error 1169 +insert into t1 values(3, 'AAA'); +# 1 +select * from t1 order by p; +# 1 +select * from t1 where a = 'aAa'; +# 1 +select * from t1 where a = 'aaa'; +# 1 +select * from t1 where a = 'AaA'; +# 1 +select * from t1 where a = 'AAA'; +drop table t1; + +# ordered index - binary + +create table t1 ( + p int primary key, + a char(3) character set latin1 collate latin1_bin not null, + index(a) +) engine=ndb; +# ok +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +insert into t1 values(4, 'aAa'); +insert into t1 values(5, 'aaa'); +insert into t1 values(6, 'AAA'); +# 6 +select * from t1 order by p; +# plan +explain select * from t1 where a = 'zZz' order by p; +# 2 +select * from t1 where a = 'aAa' order by p; +# 2 +select * from t1 where a = 'aaa' order by p; +# 0 +select * from t1 where a = 'AaA' order by p; +# 2 +select * from t1 where a = 'AAA' order by p; +drop table t1; + +# ordered index - case insensitive + +create table t1 ( + p int primary key, + a char(3) character set latin1 collate latin1_swedish_ci not null, + index(a) +) engine=ndb; +# ok +insert into t1 values(1, 'aAa'); +insert into t1 values(2, 'aaa'); +insert into t1 values(3, 'AAA'); +insert into t1 values(4, 'aAa'); +insert into t1 values(5, 'aaa'); +insert into t1 values(6, 'AAA'); +# 6 +select * from t1 order by p; +# plan +explain select * from t1 where a = 'zZz' order by p; +# 6 +select * from t1 where a = 'aAa' order by p; +# 6 +select * from t1 where a = 'aaa' order by p; +# 6 +select * from t1 where a = 'AaA' order by p; +# 6 +select * from t1 where a = 'AAA' order by p; +drop table t1; diff --git a/mysql-test/t/ndb_index.test b/mysql-test/t/ndb_index.test index d3977dc3ea4..e65b24a9b20 100644 --- a/mysql-test/t/ndb_index.test +++ b/mysql-test/t/ndb_index.test @@ -9,7 +9,7 @@ CREATE TABLE t1 ( ACCESSNODE varchar(16) NOT NULL, POP varchar(48) NOT NULL, ACCESSTYPE int unsigned NOT NULL, - CUSTOMER_ID varchar(20) NOT NULL, + CUSTOMER_ID varchar(20) collate latin1_bin NOT NULL, PROVIDER varchar(16), TEXPIRE int unsigned, NUM_IP int unsigned, -- cgit v1.2.1 From cba2feb88b9ad826dd9dac63c098f14ee66059d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Sep 2004 19:08:46 +0300 Subject: fixed error handling if creating derived table failed single row subquery always can return NULL (no rows found) (BUG#5590) mysql-test/r/subselect.result: maybe_null flag returning by subquwery for temporary table creation mysql-test/t/subselect.test: maybe_null flag returning by subquwery for temporary table creation sql/item.cc: storing maybe_null in type holder sql/item_subselect.cc: single row subquery always can return NULL (no rows found) sql/sql_derived.cc: fixed error handling if creating derived table failed --- mysql-test/r/subselect.result | 15 +++++++++++++-- mysql-test/t/subselect.test | 13 +++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 7826f5e452d..8bcf7f9bff2 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1084,7 +1084,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL default '0', - `(SELECT a)` bigint(20) NOT NULL default '0' + `(SELECT a)` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; @@ -1102,7 +1102,7 @@ a SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) NOT NULL default '0' + `a` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); @@ -1976,3 +1976,14 @@ create table t1 (x int); select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; (select b.x from t1 as b where b.x=a.x) drop table t1; +CREATE TABLE `t1` ( `master` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `slave` int(10) unsigned NOT NULL default '0', `access` int(10) unsigned NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`)); +INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400); +CREATE TABLE `t2` ( `id` int(10) unsigned NOT NULL default '0', `pid` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `level` tinyint(4) unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ; +INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a'); +SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +ERROR 42S22: Unknown column 'b.sc' in 'field list' +SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +ac +700 +NULL +drop tables t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 2dc28479ee9..5e3aa4064e4 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1270,3 +1270,16 @@ drop table t1; create table t1 (x int); select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; drop table t1; + +# +# Test of correct maybe_null flag returning by subquwery for temporary table +# creation +# +CREATE TABLE `t1` ( `master` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `slave` int(10) unsigned NOT NULL default '0', `access` int(10) unsigned NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`)); +INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400); +CREATE TABLE `t2` ( `id` int(10) unsigned NOT NULL default '0', `pid` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `level` tinyint(4) unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ; +INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a'); +-- error 1054 +SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +drop tables t1,t2; -- cgit v1.2.1 From 4148c9f9f60b3a813e3ee0e7423fa83b711d0a66 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Sep 2004 01:10:09 +0400 Subject: A fix and test case for bug#5510 "inserting Null in AutoIncrement primary key Column Fails". mysql-test/r/ps.result: Test results updated: a test case for Bug#5510 "inserting Null in AutoIncrement primary key Column Fails". mysql-test/r/ps_2myisam.result: Bug#5510: a different warning in case of NULL->default truncation.This is OK, the new warning is the same as produced by conventional execution. mysql-test/r/ps_3innodb.result: Bug#5510: a different warning in case of NULL->default truncation.This is OK, the new warning is the same as produced by conventional execution. mysql-test/r/ps_4heap.result: Bug#5510: a different warning in case of NULL->default truncation.This is OK, the new warning is the same as produced by conventional execution. mysql-test/r/ps_5merge.result: Bug#5510: a different warning in case of NULL->default truncation.This is OK, the new warning is the same as produced by conventional execution. mysql-test/r/ps_6bdb.result: Bug#5510: a different warning in case of NULL->default truncation.This is OK, the new warning is the same as produced by conventional execution. mysql-test/t/ps.test: A test case for Bug#5510 "inserting Null in AutoIncrement primary key Column Fails". sql/item.cc: A fix for bug#5510 "inserting Null in AutoIncrement primary key Column Fails": use proper Field API function for NULL placholeders. --- mysql-test/r/ps.result | 19 +++++++++++++++++++ mysql-test/r/ps_2myisam.result | 2 +- mysql-test/r/ps_3innodb.result | 2 +- mysql-test/r/ps_4heap.result | 2 +- mysql-test/r/ps_5merge.result | 4 ++-- mysql-test/r/ps_6bdb.result | 2 +- mysql-test/t/ps.test | 26 ++++++++++++++++++++++++++ 7 files changed, 51 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 321b8894796..8742ac29989 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -270,3 +270,22 @@ execute stmt using @var; a deallocate prepare stmt; drop table t1; +create table t1 (a bigint(20) not null primary key auto_increment); +insert into t1 (a) values (null); +select * from t1; +a +1 +prepare stmt from "insert into t1 (a) values (?)"; +set @var=null; +execute stmt using @var; +select * from t1; +a +1 +2 +drop table t1; +create table t1 (a timestamp not null); +prepare stmt from "insert into t1 (a) values (?)"; +execute stmt using @var; +select * from t1; +deallocate prepare stmt; +drop table t1; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 16d3cdbbb47..7e183118e61 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1015,7 +1015,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 1 one diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 865b108d7ed..d33e3c610c0 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1015,7 +1015,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 0 two diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 1cc18575dd1..b5888795666 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1016,7 +1016,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 1 one diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 2d67635cc10..7d78f4b9e1c 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1058,7 +1058,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 3 three @@ -2253,7 +2253,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 3 three diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 8fe76dae3ab..c5cde1b755a 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1015,7 +1015,7 @@ set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: -Warning 1265 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1; a b 0 two diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index c739e28849e..af356ca2a09 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -278,3 +278,29 @@ execute stmt using @var; deallocate prepare stmt; drop table t1; +# +# BUG#5510 "inserting Null in AutoIncrement primary key Column Fails" +# (prepared statements) +# The cause: misuse of internal MySQL 'Field' API. +# + +create table t1 (a bigint(20) not null primary key auto_increment); +insert into t1 (a) values (null); +select * from t1; +prepare stmt from "insert into t1 (a) values (?)"; +set @var=null; +execute stmt using @var; +select * from t1; +drop table t1; +# +# check the same for timestamps +# +create table t1 (a timestamp not null); +prepare stmt from "insert into t1 (a) values (?)"; +execute stmt using @var; +--disable_result_log +select * from t1; +--enable_result_log +deallocate prepare stmt; +drop table t1; + -- cgit v1.2.1 From 6b5f9d4fa8a825ae8825e201ef20f61547047ca6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Sep 2004 13:06:44 +0400 Subject: Fix for bug #5595: NULLIF() IS NULL returns false if NULLIF() returns NULL --- mysql-test/r/func_if.result | 3 +++ mysql-test/t/func_if.test | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index aee54ede324..72226588de3 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -64,3 +64,6 @@ select if(1>2,a,avg(a)) from t1; if(1>2,a,avg(a)) 1.5000 drop table t1; +SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; +NULLIF(5,5) IS NULL NULLIF(5,5) IS NOT NULL +1 0 diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 5e605dbe97b..f78cb5ade55 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -47,3 +47,7 @@ insert t1 values (1),(2); select if(1>2,a,avg(a)) from t1; drop table t1; +# +# Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL +# +SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; -- cgit v1.2.1 From a58986942ce4782a539c3a9467267a1270bfeaa1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Sep 2004 12:40:53 +0200 Subject: Ues buf pointer in get_ndb_value Merge fixes mysql-test/r/ndb_insert.result: Correct test cases and result after merge mysql-test/t/ndb_insert.test: Correct test cases and result after merge sql/ha_ndbcluster.cc: Correct get_error_message after merge Use buf pointer in get_ndb_value --- mysql-test/r/ndb_insert.result | 5 ++--- mysql-test/t/ndb_insert.test | 11 ++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 3ee6780cc46..cdc445558b9 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -432,13 +432,12 @@ INSERT INTO t1 VALUES SELECT COUNT(*) FROM t1; COUNT(*) 2005 +rollback; +begin; INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); ERROR 23000: Duplicate entry '10' for key 1 -SELECT COUNT(*) FROM t1; -COUNT(*) -2000 commit; ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster select * from t1 where pk1=1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 7ea25554ce3..310c16de3d8 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -440,6 +440,16 @@ INSERT INTO t1 VALUES select count(*) from t1; +# +# Test that select count(*) can see inserts made in the same transaction +# +begin; +SELECT COUNT(*) FROM t1; +INSERT INTO t1 VALUES +(2001,2001,2001),(2002,2002,2002),(2003,2003,2003),(2004,2004,2004),(2005,2005,2005); +SELECT COUNT(*) FROM t1; +rollback; + # # Insert duplicate rows, inside transaction # try to commit @@ -519,7 +529,6 @@ SELECT * FROM t1 WHERE pk1=10; --error 1296 commit; -SELECT COUNT(*) FROM t1; select * from t1 where pk1=1; select * from t1 where pk1=10; -- cgit v1.2.1 From 40d6c6e2727453ec5de5393a2a67f6480efc4ef7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Sep 2004 13:10:47 +0200 Subject: These modifications were part of WL#1856 Conversion of client_test.c tests cases to mysqltest if possible They are separated from the other WL#1856 stuff, because they improve the behaviour of the current tests. Make the result sets (order of rows) more predictable by using ORDER BY. mysql-test/include/ps_modify.inc: Make the result sets more predictable by using ORDER BY mysql-test/include/ps_modify1.inc: Make the result sets more predictable by using ORDER BY mysql-test/r/ps_2myisam.result: updated results mysql-test/r/ps_3innodb.result: updated results mysql-test/r/ps_4heap.result: updated results mysql-test/r/ps_5merge.result: updated results mysql-test/r/ps_6bdb.result: updated results BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/include/ps_modify.inc | 14 ++++---- mysql-test/include/ps_modify1.inc | 10 +++--- mysql-test/r/ps_2myisam.result | 62 +++++++++++++++++------------------ mysql-test/r/ps_3innodb.result | 24 +++++++------- mysql-test/r/ps_4heap.result | 64 ++++++++++++++++++------------------ mysql-test/r/ps_5merge.result | 68 +++++++++++++++++++-------------------- mysql-test/r/ps_6bdb.result | 24 +++++++------- 7 files changed, 133 insertions(+), 133 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 04c5cbaad6b..ba7ccefdd98 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -110,10 +110,10 @@ select a,b from t1 where a=@arg00; set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; -select a,b from t1; +select a,b from t1 order by a; set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; ## update with subquery and several parameters set @arg00=23; @@ -134,7 +134,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; drop table t2 ; ## update with parameters in limit @@ -202,7 +202,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; set @arg00=81 ; set @arg01=1 ; --error 1062 @@ -221,17 +221,17 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; ## replace diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index 0b192a52625..da3bea80669 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -45,19 +45,19 @@ set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; --enable_info insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; --disable_info -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; --enable_info execute stmt1 using @1000, @duplicate, @5; --disable_info -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; set @float=1.00; @@ -78,7 +78,7 @@ select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); --disable_info -select a,b from t2; +select a,b from t2 order by a ; delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) select ?, sum(first.a) @@ -93,5 +93,5 @@ select b, a + ? from t1 --enable_info execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; --disable_info -select a,b from t2; +select a,b from t2 order by a ; drop table t2; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 7e183118e61..13b54973b8d 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1016,15 +1016,15 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -1 one 0 two +1 one 3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,19 +1142,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b +0 NULL 1 one 2 two 3 three 4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,37 +1195,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b +0 NULL 1 one 2 two 3 three 4 four -0 NULL insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b +1000 NULL 1001 duplicate one 1002 duplicate two 1003 duplicate three 1004 duplicate four -1000 NULL delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1004 duplicate four -1003 duplicate three -1002 duplicate two -1001 duplicate one 1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four delete from t1 where a >= 1000 ; set @float=1.00; set @five='five' ; @@ -1243,15 +1243,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b -81 duplicate -82 duplicate -8 duplicate +3 duplicate 4 duplicate -9 duplicate 7 duplicate -3 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1267,15 +1267,15 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b -81 duplicate -82 duplicate -8 duplicate +3 duplicate 4 duplicate -9 duplicate 7 duplicate -3 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate 103 three drop table t2; drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index d33e3c610c0..17e56b8e001 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1016,7 +1016,7 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b 0 two 1 one @@ -1024,7 +1024,7 @@ a b 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,7 +1142,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b 0 NULL 1 one @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b 0 NULL 1 one @@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1219,7 +1219,7 @@ where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate @@ -1267,7 +1267,7 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index b5888795666..afca7c9f143 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1017,15 +1017,15 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -1 one 0 two +1 one 3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1049,7 +1049,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1143,19 +1143,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b +0 NULL 1 one 2 two 3 three 4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1171,23 +1171,23 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1100 x1000_1updated 1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1196,37 +1196,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b +0 NULL 1 one 2 two 3 three 4 four -0 NULL insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1002 duplicate two +1000 NULL 1001 duplicate one +1002 duplicate two 1003 duplicate three 1004 duplicate four -1000 NULL delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL -1004 duplicate four -1003 duplicate three -1002 duplicate two 1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four delete from t1 where a >= 1000 ; set @float=1.00; set @five='five' ; @@ -1244,15 +1244,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b -81 duplicate -82 duplicate -8 duplicate +3 duplicate 4 duplicate -9 duplicate 7 duplicate -3 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1268,15 +1268,15 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b -81 duplicate -82 duplicate -8 duplicate +3 duplicate 4 duplicate -9 duplicate 7 duplicate -3 duplicate +8 duplicate +9 duplicate +81 duplicate +82 duplicate 103 three drop table t2; drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 7d78f4b9e1c..cb894df53d2 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1059,19 +1059,19 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -3 three 0 two 1 one +3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four set @arg00=23; set @arg01='two'; @@ -1091,11 +1091,11 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four drop table t2 ; set @arg00=1; @@ -1185,19 +1185,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b -4 four -3 three -2 two +0 NULL 1 one +2 two +3 three +4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1213,7 +1213,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1222,14 +1222,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -2254,19 +2254,19 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -3 three 0 two 1 one +3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four set @arg00=23; set @arg01='two'; @@ -2286,11 +2286,11 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four drop table t2 ; set @arg00=1; @@ -2380,19 +2380,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b -4 four -3 three -2 two +0 NULL 1 one +2 two +3 three +4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -2408,7 +2408,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -2417,14 +2417,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index c5cde1b755a..0ff2025ee2a 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1016,7 +1016,7 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b 0 two 1 one @@ -1024,7 +1024,7 @@ a b 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,7 +1142,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b 0 NULL 1 one @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b 0 NULL 1 one @@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1219,7 +1219,7 @@ where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate @@ -1267,7 +1267,7 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -- cgit v1.2.1 From ba1b4bfca8fd7e57211b3683bee551d181dcdf29 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Sep 2004 03:33:22 +0200 Subject: The major change for this changeset is the addition of code to handle: OPTIMIZE TABLE This recompresses the table, thus removing any additional gzip headers caused by opening/closing or flushing the table. mysql-test/r/archive.result: Added optimize test case for archive engine. mysql-test/t/archive.test: Added test case for OPTIMIZE table sql/examples/ha_archive.cc: The big change was the addition of optimize() call to allow tables to be recompressed (so if you have been reading/writing/reading/writing and ending up with larger files then you should, this will solve it). Though adding this feature is going to make it a real headache to add row level locking. Also fixed bug reported by JD where storage engine code was not functioning (this of course was because I didn't check for the propper return value for hash_init). Removed BROKEN_GZIP ifdef since there was no way to enable it. sql/examples/ha_archive.h: Added optimize() method. --- mysql-test/r/archive.result | 1208 +++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/archive.test | 2 + 2 files changed, 1210 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index b380ea910de..4adb8a5410e 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -1393,4 +1393,1212 @@ auto fld1 companynr fld3 fld4 fld5 fld6 2 011401 37 breaking dreaded Steinberg W 3 011402 37 Romans scholastics jarring 4 011403 37 intercepted audiology tinily +OPTIMIZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +SELECT * FROM t2; +auto fld1 companynr fld3 fld4 fld5 fld6 +1 000001 00 Omaha teethe neat +2 011401 37 breaking dreaded Steinberg W +3 011402 37 Romans scholastics jarring +4 011403 37 intercepted audiology tinily +5 011501 37 bewilderingly wallet balled +6 011701 37 astound parters persist W +7 011702 37 admonishing eschew attainments +8 011703 37 sumac quitter fanatic +9 012001 37 flanking neat measures FAS +10 012003 37 combed Steinberg rightfulness +11 012004 37 subjective jarring capably +12 012005 37 scatterbrain tinily impulsive +13 012301 37 Eulerian balled starlet +14 012302 36 dubbed persist terminators +15 012303 37 Kane attainments untying +16 012304 37 overlay fanatic announces FAS +17 012305 37 perturb measures featherweight FAS +18 012306 37 goblins rightfulness pessimist FAS +19 012501 37 annihilates capably daughter +20 012602 37 Wotan impulsive decliner FAS +21 012603 37 snatching starlet lawgiver +22 012604 37 concludes terminators stated +23 012605 37 laterally untying readable +24 012606 37 yelped announces attrition +25 012701 37 grazing featherweight cascade FAS +26 012702 37 Baird pessimist motors FAS +27 012703 37 celery daughter interrogate +28 012704 37 misunderstander decliner pests W +29 013601 37 handgun lawgiver stairway +30 013602 37 foldout stated dopers FAS +31 013603 37 mystic readable testicle W +32 013604 37 succumbed attrition Parsifal W +33 013605 37 Nabisco cascade leavings +34 013606 37 fingerings motors postulation W +35 013607 37 aging interrogate squeaking +36 013608 37 afield pests contrasted +37 013609 37 ammonium stairway leftover +38 013610 37 boat dopers whiteners +39 013801 37 intelligibility testicle erases W +40 013802 37 Augustine Parsifal Punjab W +41 013803 37 teethe leavings Merritt +42 013804 37 dreaded postulation Quixotism +43 013901 37 scholastics squeaking sweetish FAS +44 016001 37 audiology contrasted dogging FAS +45 016201 37 wallet leftover scornfully FAS +46 016202 37 parters whiteners bellow +47 016301 37 eschew erases bills +48 016302 37 quitter Punjab cupboard FAS +49 016303 37 neat Merritt sureties FAS +50 016304 37 Steinberg Quixotism puddings +51 018001 37 jarring sweetish tapestry +52 018002 37 tinily dogging fetters +53 018003 37 balled scornfully bivalves +54 018004 37 persist bellow incurring +55 018005 37 attainments bills Adolph +56 018007 37 fanatic cupboard pithed +57 018008 37 measures sureties emergency +58 018009 37 rightfulness puddings Miles +59 018010 37 capably tapestry trimmings +60 018012 37 impulsive fetters tragedies W +61 018013 37 starlet bivalves skulking W +62 018014 37 terminators incurring flint +63 018015 37 untying Adolph flopping W +64 018016 37 announces pithed relaxing FAS +65 018017 37 featherweight emergency offload FAS +66 018018 37 pessimist Miles suites W +67 018019 37 daughter trimmings lists FAS +68 018020 37 decliner tragedies animized FAS +69 018021 37 lawgiver skulking multilayer W +70 018022 37 stated flint standardizes FAS +71 018023 37 readable flopping Judas +72 018024 37 attrition relaxing vacuuming W +73 018025 37 cascade offload dentally W +74 018026 37 motors suites humanness W +75 018027 37 interrogate lists inch W +76 018028 37 pests animized Weissmuller W +77 018029 37 stairway multilayer irresponsibly W +78 018030 37 dopers standardizes luckily FAS +79 018032 37 testicle Judas culled W +80 018033 37 Parsifal vacuuming medical FAS +81 018034 37 leavings dentally bloodbath FAS +82 018035 37 postulation humanness subschema W +83 018036 37 squeaking inch animals W +84 018037 37 contrasted Weissmuller Micronesia +85 018038 37 leftover irresponsibly repetitions +86 018039 37 whiteners luckily Antares +87 018040 37 erases culled ventilate W +88 018041 37 Punjab medical pityingly +89 018042 37 Merritt bloodbath interdependent +90 018043 37 Quixotism subschema Graves FAS +91 018044 37 sweetish animals neonatal +92 018045 37 dogging Micronesia scribbled FAS +93 018046 37 scornfully repetitions chafe W +94 018048 37 bellow Antares honoring +95 018049 37 bills ventilate realtor +96 018050 37 cupboard pityingly elite +97 018051 37 sureties interdependent funereal +98 018052 37 puddings Graves abrogating +99 018053 50 tapestry neonatal sorters +100 018054 37 fetters scribbled Conley +101 018055 37 bivalves chafe lectured +102 018056 37 incurring honoring Abraham +103 018057 37 Adolph realtor Hawaii W +104 018058 37 pithed elite cage +105 018059 36 emergency funereal hushes +106 018060 37 Miles abrogating Simla +107 018061 37 trimmings sorters reporters +108 018101 37 tragedies Conley Dutchman FAS +109 018102 37 skulking lectured descendants FAS +110 018103 37 flint Abraham groupings FAS +111 018104 37 flopping Hawaii dissociate +112 018201 37 relaxing cage coexist W +113 018202 37 offload hushes Beebe +114 018402 37 suites Simla Taoism +115 018403 37 lists reporters Connally +116 018404 37 animized Dutchman fetched FAS +117 018405 37 multilayer descendants checkpoints FAS +118 018406 37 standardizes groupings rusting +119 018409 37 Judas dissociate galling +120 018601 37 vacuuming coexist obliterates +121 018602 37 dentally Beebe traitor +122 018603 37 humanness Taoism resumes FAS +123 018801 37 inch Connally analyzable FAS +124 018802 37 Weissmuller fetched terminator FAS +125 018803 37 irresponsibly checkpoints gritty FAS +126 018804 37 luckily rusting firearm W +127 018805 37 culled galling minima +128 018806 37 medical obliterates Selfridge +129 018807 37 bloodbath traitor disable +130 018808 37 subschema resumes witchcraft W +131 018809 37 animals analyzable betroth W +132 018810 37 Micronesia terminator Manhattanize +133 018811 37 repetitions gritty imprint +134 018812 37 Antares firearm peeked +135 019101 37 ventilate minima swelling +136 019102 37 pityingly Selfridge interrelationships W +137 019103 37 interdependent disable riser +138 019201 37 Graves witchcraft Gandhian W +139 030501 37 neonatal betroth peacock A +140 030502 50 scribbled Manhattanize bee A +141 030503 37 chafe imprint kanji +142 030504 37 honoring peeked dental +143 031901 37 realtor swelling scarf FAS +144 036001 37 elite interrelationships chasm A +145 036002 37 funereal riser insolence A +146 036004 37 abrogating Gandhian syndicate +147 036005 37 sorters peacock alike +148 038001 37 Conley bee imperial A +149 038002 37 lectured kanji convulsion A +150 038003 37 Abraham dental railway A +151 038004 37 Hawaii scarf validate A +152 038005 37 cage chasm normalizes A +153 038006 37 hushes insolence comprehensive +154 038007 37 Simla syndicate chewing +155 038008 37 reporters alike denizen +156 038009 37 Dutchman imperial schemer +157 038010 37 descendants convulsion chronicle +158 038011 37 groupings railway Kline +159 038012 37 dissociate validate Anatole +160 038013 37 coexist normalizes partridges +161 038014 37 Beebe comprehensive brunch +162 038015 37 Taoism chewing recruited +163 038016 37 Connally denizen dimensions W +164 038017 37 fetched schemer Chicana W +165 038018 37 checkpoints chronicle announced +166 038101 37 rusting Kline praised FAS +167 038102 37 galling Anatole employing +168 038103 37 obliterates partridges linear +169 038104 37 traitor brunch quagmire +170 038201 37 resumes recruited western A +171 038202 37 analyzable dimensions relishing +172 038203 37 terminator Chicana serving A +173 038204 37 gritty announced scheduling +174 038205 37 firearm praised lore +175 038206 37 minima employing eventful +176 038208 37 Selfridge linear arteriole A +177 042801 37 disable quagmire disentangle +178 042802 37 witchcraft western cured A +179 046101 37 betroth relishing Fenton W +180 048001 37 Manhattanize serving avoidable A +181 048002 37 imprint scheduling drains A +182 048003 37 peeked lore detectably FAS +183 048004 37 swelling eventful husky +184 048005 37 interrelationships arteriole impelling +185 048006 37 riser disentangle undoes +186 048007 37 Gandhian cured evened +187 048008 37 peacock Fenton squeezes +188 048101 37 bee avoidable destroyer FAS +189 048102 37 kanji drains rudeness +190 048201 37 dental detectably beaner FAS +191 048202 37 scarf husky boorish +192 048203 37 chasm impelling Everhart +193 048204 37 insolence undoes encompass A +194 048205 37 syndicate evened mushrooms +195 048301 37 alike squeezes Alison A +196 048302 37 imperial destroyer externally FAS +197 048303 37 convulsion rudeness pellagra +198 048304 37 railway beaner cult +199 048305 37 validate boorish creek A +200 048401 37 normalizes Everhart Huffman +201 048402 37 comprehensive encompass Majorca FAS +202 048403 37 chewing mushrooms governing A +203 048404 37 denizen Alison gadfly FAS +204 048405 37 schemer externally reassigned FAS +205 048406 37 chronicle pellagra intentness W +206 048407 37 Kline cult craziness +207 048408 37 Anatole creek psychic +208 048409 37 partridges Huffman squabbled +209 048410 37 brunch Majorca burlesque +210 048411 37 recruited governing capped +211 048412 37 dimensions gadfly extracted A +212 048413 37 Chicana reassigned DiMaggio +213 048601 37 announced intentness exclamation FAS +214 048602 37 praised craziness subdirectory +215 048603 37 employing psychic fangs +216 048604 37 linear squabbled buyer A +217 048801 37 quagmire burlesque pithing A +218 050901 37 western capped transistorizing A +219 051201 37 relishing extracted nonbiodegradable +220 056002 37 serving DiMaggio dislocate +221 056003 37 scheduling exclamation monochromatic FAS +222 056004 37 lore subdirectory batting +223 056102 37 eventful fangs postcondition A +224 056203 37 arteriole buyer catalog FAS +225 056204 37 disentangle pithing Remus +226 058003 37 cured transistorizing devices A +227 058004 37 Fenton nonbiodegradable bike A +228 058005 37 avoidable dislocate qualify +229 058006 37 drains monochromatic detained +230 058007 37 detectably batting commended +231 058101 37 husky postcondition civilize +232 058102 37 impelling catalog Elmhurst +233 058103 37 undoes Remus anesthetizing +234 058105 37 evened devices deaf +235 058111 37 squeezes bike Brigham +236 058112 37 destroyer qualify title +237 058113 37 rudeness detained coarse +238 058114 37 beaner commended combinations +239 058115 37 boorish civilize grayness +240 058116 37 Everhart Elmhurst innumerable FAS +241 058117 37 encompass anesthetizing Caroline A +242 058118 37 mushrooms deaf fatty FAS +243 058119 37 Alison Brigham eastbound +244 058120 37 externally title inexperienced +245 058121 37 pellagra coarse hoarder A +246 058122 37 cult combinations scotch W +247 058123 37 creek grayness passport A +248 058124 37 Huffman innumerable strategic FAS +249 058125 37 Majorca Caroline gated +250 058126 37 governing fatty flog +251 058127 37 gadfly eastbound Pipestone +252 058128 37 reassigned inexperienced Dar +253 058201 37 intentness hoarder Corcoran +254 058202 37 craziness scotch flyers A +255 058303 37 psychic passport competitions W +256 058304 37 squabbled strategic suppliers FAS +257 058602 37 burlesque gated skips +258 058603 37 capped flog institutes +259 058604 37 extracted Pipestone troop A +260 058605 37 DiMaggio Dar connective W +261 058606 37 exclamation Corcoran denies +262 058607 37 subdirectory flyers polka +263 060401 36 fangs competitions observations FAS +264 061701 36 buyer suppliers askers +265 066201 36 pithing skips homeless FAS +266 066501 36 transistorizing institutes Anna +267 068001 36 nonbiodegradable troop subdirectories W +268 068002 36 dislocate connective decaying FAS +269 068005 36 monochromatic denies outwitting W +270 068006 36 batting polka Harpy W +271 068007 36 postcondition observations crazed +272 068008 36 catalog askers suffocate +273 068009 36 Remus homeless provers FAS +274 068010 36 devices Anna technically +275 068011 36 bike subdirectories Franklinizations +276 068202 36 qualify decaying considered +277 068302 36 detained outwitting tinnily +278 068303 36 commended Harpy uninterruptedly +279 068401 36 civilize crazed whistled A +280 068501 36 Elmhurst suffocate automate +281 068502 36 anesthetizing provers gutting W +282 068503 36 deaf technically surreptitious +283 068602 36 Brigham Franklinizations Choctaw +284 068603 36 title considered cooks +285 068701 36 coarse tinnily millivolt FAS +286 068702 36 combinations uninterruptedly counterpoise +287 068703 36 grayness whistled Gothicism +288 076001 36 innumerable automate feminine +289 076002 36 Caroline gutting metaphysically W +290 076101 36 fatty surreptitious sanding A +291 076102 36 eastbound Choctaw contributorily +292 076103 36 inexperienced cooks receivers FAS +293 076302 36 hoarder millivolt adjourn +294 076303 36 scotch counterpoise straggled A +295 076304 36 passport Gothicism druggists +296 076305 36 strategic feminine thanking FAS +297 076306 36 gated metaphysically ostrich +298 076307 36 flog sanding hopelessness FAS +299 076402 36 Pipestone contributorily Eurydice +300 076501 36 Dar receivers excitation W +301 076502 36 Corcoran adjourn presumes FAS +302 076701 36 flyers straggled imaginable FAS +303 078001 36 competitions druggists concoct W +304 078002 36 suppliers thanking peering W +305 078003 36 skips ostrich Phelps FAS +306 078004 36 institutes hopelessness ferociousness FAS +307 078005 36 troop Eurydice sentences +308 078006 36 connective excitation unlocks +309 078007 36 denies presumes engrossing W +310 078008 36 polka imaginable Ruth +311 078101 36 observations concoct tying +312 078103 36 askers peering exclaimers +313 078104 36 homeless Phelps synergy +314 078105 36 Anna ferociousness Huey W +315 082101 36 subdirectories sentences merging +316 083401 36 decaying unlocks judges A +317 084001 36 outwitting engrossing Shylock W +318 084002 36 Harpy Ruth Miltonism +319 086001 36 crazed tying hen W +320 086102 36 suffocate exclaimers honeybee FAS +321 086201 36 provers synergy towers +322 088001 36 technically Huey dilutes W +323 088002 36 Franklinizations merging numerals FAS +324 088003 36 considered judges democracy FAS +325 088004 36 tinnily Shylock Ibero- +326 088101 36 uninterruptedly Miltonism invalids +327 088102 36 whistled hen behavior +328 088103 36 automate honeybee accruing +329 088104 36 gutting towers relics A +330 088105 36 surreptitious dilutes rackets +331 088106 36 Choctaw numerals Fischbein W +332 088201 36 cooks democracy phony W +333 088203 36 millivolt Ibero- cross FAS +334 088204 36 counterpoise invalids cleanup +335 088302 37 Gothicism behavior conspirator +336 088303 37 feminine accruing label FAS +337 088305 37 metaphysically relics university +338 088402 37 sanding rackets cleansed FAS +339 088501 36 contributorily Fischbein ballgown +340 088502 36 receivers phony starlet +341 088503 36 adjourn cross aqueous +342 098001 58 straggled cleanup portrayal A +343 098002 58 druggists conspirator despising W +344 098003 58 thanking label distort W +345 098004 58 ostrich university palmed +346 098005 58 hopelessness cleansed faced +347 098006 58 Eurydice ballgown silverware +348 141903 29 excitation starlet assessor +349 098008 58 presumes aqueous spiders +350 098009 58 imaginable portrayal artificially +351 098010 58 concoct despising reminiscence +352 098011 58 peering distort Mexican +353 098012 58 Phelps palmed obnoxious +354 098013 58 ferociousness faced fragile +355 098014 58 sentences silverware apprehensible +356 098015 58 unlocks assessor births +357 098016 58 engrossing spiders garages +358 098017 58 Ruth artificially panty +359 098018 58 tying reminiscence anteater +360 098019 58 exclaimers Mexican displacement A +361 098020 58 synergy obnoxious drovers A +362 098021 58 Huey fragile patenting A +363 098022 58 merging apprehensible far A +364 098023 58 judges births shrieks +365 098024 58 Shylock garages aligning W +366 098025 37 Miltonism panty pragmatism +367 106001 36 hen anteater fevers W +368 108001 36 honeybee displacement reexamines A +369 108002 36 towers drovers occupancies +370 108003 36 dilutes patenting sweats FAS +371 108004 36 numerals far modulators +372 108005 36 democracy shrieks demand W +373 108007 36 Ibero- aligning Madeira +374 108008 36 invalids pragmatism Viennese W +375 108009 36 behavior fevers chillier W +376 108010 36 accruing reexamines wildcats FAS +377 108011 36 relics occupancies gentle +378 108012 36 rackets sweats Angles W +379 108101 36 Fischbein modulators accuracies +380 108102 36 phony demand toggle +381 108103 36 cross Madeira Mendelssohn W +382 108111 50 cleanup Viennese behaviorally +383 108105 36 conspirator chillier Rochford +384 108106 36 label wildcats mirror W +385 108107 36 university gentle Modula +386 108108 50 cleansed Angles clobbering +387 108109 36 ballgown accuracies chronography +388 108110 36 starlet toggle Eskimoizeds +389 108201 36 aqueous Mendelssohn British W +390 108202 36 portrayal behaviorally pitfalls +391 108203 36 despising Rochford verify W +392 108204 36 distort mirror scatter FAS +393 108205 36 palmed Modula Aztecan +394 108301 36 faced clobbering acuity W +395 108302 36 silverware chronography sinking W +396 112101 36 assessor Eskimoizeds beasts FAS +397 112102 36 spiders British Witt W +398 113701 36 artificially pitfalls physicists FAS +399 116001 36 reminiscence verify folksong A +400 116201 36 Mexican scatter strokes FAS +401 116301 36 obnoxious Aztecan crowder +402 116302 36 fragile acuity merry +403 116601 36 apprehensible sinking cadenced +404 116602 36 births beasts alimony A +405 116603 36 garages Witt principled A +406 116701 36 panty physicists golfing +407 116702 36 anteater folksong undiscovered +408 118001 36 displacement strokes irritates +409 118002 36 drovers crowder patriots A +410 118003 36 patenting merry rooms FAS +411 118004 36 far cadenced towering W +412 118005 36 shrieks alimony displease +413 118006 36 aligning principled photosensitive +414 118007 36 pragmatism golfing inking +415 118008 36 fevers undiscovered gainers +416 118101 36 reexamines irritates leaning A +417 118102 36 occupancies patriots hydrant A +418 118103 36 sweats rooms preserve +419 118202 36 modulators towering blinded A +420 118203 36 demand displease interactions A +421 118204 36 Madeira photosensitive Barry +422 118302 36 Viennese inking whiteness A +423 118304 36 chillier gainers pastimes W +424 118305 36 wildcats leaning Edenization +425 118306 36 gentle hydrant Muscat +426 118307 36 Angles preserve assassinated +427 123101 36 accuracies blinded labeled +428 123102 36 toggle interactions glacial A +429 123301 36 Mendelssohn Barry implied W +430 126001 36 behaviorally whiteness bibliographies W +431 126002 36 Rochford pastimes Buchanan +432 126003 36 mirror Edenization forgivably FAS +433 126101 36 Modula Muscat innuendo A +434 126301 36 clobbering assassinated den FAS +435 126302 36 chronography labeled submarines W +436 126402 36 Eskimoizeds glacial mouthful A +437 126601 36 British implied expiring +438 126602 36 pitfalls bibliographies unfulfilled FAS +439 126702 36 verify Buchanan precession +440 128001 36 scatter forgivably nullified +441 128002 36 Aztecan innuendo affects +442 128003 36 acuity den Cynthia +443 128004 36 sinking submarines Chablis A +444 128005 36 beasts mouthful betterments FAS +445 128007 36 Witt expiring advertising +446 128008 36 physicists unfulfilled rubies A +447 128009 36 folksong precession southwest FAS +448 128010 36 strokes nullified superstitious A +449 128011 36 crowder affects tabernacle W +450 128012 36 merry Cynthia silk A +451 128013 36 cadenced Chablis handsomest A +452 128014 36 alimony betterments Persian A +453 128015 36 principled advertising analog W +454 128016 36 golfing rubies complex W +455 128017 36 undiscovered southwest Taoist +456 128018 36 irritates superstitious suspend +457 128019 36 patriots tabernacle relegated +458 128020 36 rooms silk awesome W +459 128021 36 towering handsomest Bruxelles +460 128022 36 displease Persian imprecisely A +461 128023 36 photosensitive analog televise +462 128101 36 inking complex braking +463 128102 36 gainers Taoist true FAS +464 128103 36 leaning suspend disappointing FAS +465 128104 36 hydrant relegated navally W +466 128106 36 preserve awesome circus +467 128107 36 blinded Bruxelles beetles +468 128108 36 interactions imprecisely trumps +469 128202 36 Barry televise fourscore W +470 128203 36 whiteness braking Blackfoots +471 128301 36 pastimes true Grady +472 128302 36 Edenization disappointing quiets FAS +473 128303 36 Muscat navally floundered FAS +474 128304 36 assassinated circus profundity W +475 128305 36 labeled beetles Garrisonian W +476 128307 36 glacial trumps Strauss +477 128401 36 implied fourscore cemented FAS +478 128502 36 bibliographies Blackfoots contrition A +479 128503 36 Buchanan Grady mutations +480 128504 36 forgivably quiets exhibits W +481 128505 36 innuendo floundered tits +482 128601 36 den profundity mate A +483 128603 36 submarines Garrisonian arches +484 128604 36 mouthful Strauss Moll +485 128702 36 expiring cemented ropers +486 128703 36 unfulfilled contrition bombast +487 128704 36 precession mutations difficultly A +488 138001 36 nullified exhibits adsorption +489 138002 36 affects tits definiteness FAS +490 138003 36 Cynthia mate cultivation A +491 138004 36 Chablis arches heals A +492 138005 36 betterments Moll Heusen W +493 138006 36 advertising ropers target FAS +494 138007 36 rubies bombast cited A +495 138008 36 southwest difficultly congresswoman W +496 138009 36 superstitious adsorption Katherine +497 138102 36 tabernacle definiteness titter A +498 138103 36 silk cultivation aspire A +499 138104 36 handsomest heals Mardis +500 138105 36 Persian Heusen Nadia W +501 138201 36 analog target estimating FAS +502 138302 36 complex cited stuck A +503 138303 36 Taoist congresswoman fifteenth A +504 138304 36 suspend Katherine Colombo +505 138401 29 relegated titter survey A +506 140102 29 awesome aspire staffing +507 140103 29 Bruxelles Mardis obtain +508 140104 29 imprecisely Nadia loaded +509 140105 29 televise estimating slaughtered +510 140201 29 braking stuck lights A +511 140701 29 true fifteenth circumference +512 141501 29 disappointing Colombo dull A +513 141502 29 navally survey weekly A +514 141901 29 circus staffing wetness +515 141902 29 beetles obtain visualized +516 142101 29 trumps loaded Tannenbaum +517 142102 29 fourscore slaughtered moribund +518 142103 29 Blackfoots lights demultiplex +519 142701 29 Grady circumference lockings +520 143001 29 quiets dull thugs FAS +521 143501 29 floundered weekly unnerves +522 143502 29 profundity wetness abut +523 148001 29 Garrisonian visualized Chippewa A +524 148002 29 Strauss Tannenbaum stratifications A +525 148003 29 cemented moribund signaled +526 148004 29 contrition demultiplex Italianizes A +527 148005 29 mutations lockings algorithmic A +528 148006 29 exhibits thugs paranoid FAS +529 148007 29 tits unnerves camping A +530 148009 29 mate abut signifying A +531 148010 29 arches Chippewa Patrice W +532 148011 29 Moll stratifications search A +533 148012 29 ropers signaled Angeles A +534 148013 29 bombast Italianizes semblance +535 148023 36 difficultly algorithmic taxed +536 148015 29 adsorption paranoid Beatrice +537 148016 29 definiteness camping retrace +538 148017 29 cultivation signifying lockout +539 148018 29 heals Patrice grammatic +540 148019 29 Heusen search helmsman +541 148020 29 target Angeles uniform W +542 148021 29 cited semblance hamming +543 148022 29 congresswoman taxed disobedience +544 148101 29 Katherine Beatrice captivated A +545 148102 29 titter retrace transferals A +546 148201 29 aspire lockout cartographer A +547 148401 29 Mardis grammatic aims FAS +548 148402 29 Nadia helmsman Pakistani +549 148501 29 estimating uniform burglarized FAS +550 148502 29 stuck hamming saucepans A +551 148503 29 fifteenth disobedience lacerating A +552 148504 29 Colombo captivated corny +553 148601 29 survey transferals megabytes FAS +554 148602 29 staffing cartographer chancellor +555 150701 29 obtain aims bulk A +556 152101 29 loaded Pakistani commits A +557 152102 29 slaughtered burglarized meson W +558 155202 36 lights saucepans deputies +559 155203 29 circumference lacerating northeaster A +560 155204 29 dull corny dipole +561 155205 29 weekly megabytes machining 0 +562 156001 29 wetness chancellor therefore +563 156002 29 visualized bulk Telefunken +564 156102 29 Tannenbaum commits salvaging +565 156301 29 moribund meson Corinthianizes A +566 156302 29 demultiplex deputies restlessly A +567 156303 29 lockings northeaster bromides +568 156304 29 thugs dipole generalized A +569 156305 29 unnerves machining mishaps +570 156306 29 abut therefore quelling +571 156501 29 Chippewa Telefunken spiritual A +572 158001 29 stratifications salvaging beguiles FAS +573 158002 29 signaled Corinthianizes Trobriand FAS +574 158101 29 Italianizes restlessly fleeing A +575 158102 29 algorithmic bromides Armour A +576 158103 29 paranoid generalized chin A +577 158201 29 camping mishaps provers A +578 158202 29 signifying quelling aeronautic A +579 158203 29 Patrice spiritual voltage W +580 158204 29 search beguiles sash +581 158301 29 Angeles Trobriand anaerobic A +582 158302 29 semblance fleeing simultaneous A +583 158303 29 taxed Armour accumulating A +584 158304 29 Beatrice chin Medusan A +585 158305 29 retrace provers shouted A +586 158306 29 lockout aeronautic freakish +587 158501 29 grammatic voltage index FAS +588 160301 29 helmsman sash commercially +589 166101 50 uniform anaerobic mistiness A +590 166102 50 hamming simultaneous endpoint +591 168001 29 disobedience accumulating straight A +592 168002 29 captivated Medusan flurried +593 168003 29 transferals shouted denotative A +594 168101 29 cartographer freakish coming FAS +595 168102 29 aims index commencements FAS +596 168103 29 Pakistani commercially gentleman +597 168104 29 burglarized mistiness gifted +598 168202 29 saucepans endpoint Shanghais +599 168301 29 lacerating straight sportswriting A +600 168502 29 corny flurried sloping A +601 168503 29 megabytes denotative navies +602 168601 29 chancellor coming leaflet A +603 173001 40 bulk commencements shooter +604 173701 40 commits gentleman Joplin FAS +605 173702 40 meson gifted babies +606 176001 40 deputies Shanghais subdivision FAS +607 176101 40 northeaster sportswriting burstiness W +608 176201 40 dipole sloping belted FAS +609 176401 40 machining navies assails FAS +610 176501 40 therefore leaflet admiring W +611 176601 40 Telefunken shooter swaying 0 +612 176602 40 salvaging Joplin Goldstine FAS +613 176603 40 Corinthianizes babies fitting +614 178001 40 restlessly subdivision Norwalk W +615 178002 40 bromides burstiness weakening W +616 178003 40 generalized belted analogy FAS +617 178004 40 mishaps assails deludes +618 178005 40 quelling admiring cokes +619 178006 40 spiritual swaying Clayton +620 178007 40 beguiles Goldstine exhausts +621 178008 40 Trobriand fitting causality +622 178101 40 fleeing Norwalk sating FAS +623 178102 40 Armour weakening icon +624 178103 40 chin analogy throttles +625 178201 40 provers deludes communicants FAS +626 178202 40 aeronautic cokes dehydrate FAS +627 178301 40 voltage Clayton priceless FAS +628 178302 40 sash exhausts publicly +629 178401 40 anaerobic causality incidentals FAS +630 178402 40 simultaneous sating commonplace +631 178403 40 accumulating icon mumbles +632 178404 40 Medusan throttles furthermore W +633 178501 40 shouted communicants cautioned W +634 186002 37 freakish dehydrate parametrized A +635 186102 37 index priceless registration A +636 186201 40 commercially publicly sadly FAS +637 186202 40 mistiness incidentals positioning +638 186203 40 endpoint commonplace babysitting +639 186302 37 straight mumbles eternal A +640 188007 37 flurried furthermore hoarder +641 188008 37 denotative cautioned congregates +642 188009 37 coming parametrized rains +643 188010 37 commencements registration workers W +644 188011 37 gentleman sadly sags A +645 188012 37 gifted positioning unplug W +646 188013 37 Shanghais babysitting garage A +647 188014 37 sportswriting eternal boulder A +648 188015 37 sloping hoarder hollowly A +649 188016 37 navies congregates specifics +650 188017 37 leaflet rains Teresa +651 188102 37 shooter workers Winsett +652 188103 37 Joplin sags convenient A +653 188202 37 babies unplug buckboards FAS +654 188301 40 subdivision garage amenities +655 188302 40 burstiness boulder resplendent FAS +656 188303 40 belted hollowly priding FAS +657 188401 37 assails specifics configurations +658 188402 37 admiring Teresa untidiness A +659 188503 37 swaying Winsett Brice W +660 188504 37 Goldstine convenient sews FAS +661 188505 37 fitting buckboards participated +662 190701 37 Norwalk amenities Simon FAS +663 190703 50 weakening resplendent certificates +664 191701 37 analogy priding Fitzpatrick +665 191702 37 deludes configurations Evanston A +666 191703 37 cokes untidiness misted +667 196001 37 Clayton Brice textures A +668 196002 37 exhausts sews save +669 196003 37 causality participated count +670 196101 37 sating Simon rightful A +671 196103 37 icon certificates chaperone +672 196104 37 throttles Fitzpatrick Lizzy A +673 196201 37 communicants Evanston clenched A +674 196202 37 dehydrate misted effortlessly +675 196203 37 priceless textures accessed +676 198001 37 publicly save beaters A +677 198003 37 incidentals count Hornblower FAS +678 198004 37 commonplace rightful vests A +679 198005 37 mumbles chaperone indulgences FAS +680 198006 37 furthermore Lizzy infallibly A +681 198007 37 cautioned clenched unwilling FAS +682 198008 37 parametrized effortlessly excrete FAS +683 198009 37 registration accessed spools A +684 198010 37 sadly beaters crunches FAS +685 198011 37 positioning Hornblower overestimating FAS +686 198012 37 babysitting vests ineffective +687 198013 37 eternal indulgences humiliation A +688 198014 37 hoarder infallibly sophomore +689 198015 37 congregates unwilling star +690 198017 37 rains excrete rifles +691 198018 37 workers spools dialysis +692 198019 37 sags crunches arriving +693 198020 37 unplug overestimating indulge +694 198021 37 garage ineffective clockers +695 198022 37 boulder humiliation languages +696 198023 50 hollowly sophomore Antarctica A +697 198024 37 specifics star percentage +698 198101 37 Teresa rifles ceiling A +699 198103 37 Winsett dialysis specification +700 198105 37 convenient arriving regimented A +701 198106 37 buckboards indulge ciphers +702 198201 37 amenities clockers pictures A +703 198204 37 resplendent languages serpents A +704 198301 53 priding Antarctica allot A +705 198302 53 configurations percentage realized A +706 198303 53 untidiness ceiling mayoral A +707 198304 53 Brice specification opaquely A +708 198401 37 sews regimented hostess FAS +709 198402 37 participated ciphers fiftieth +710 198403 37 Simon pictures incorrectly +711 202101 37 certificates serpents decomposition FAS +712 202301 37 Fitzpatrick allot stranglings +713 202302 37 Evanston realized mixture FAS +714 202303 37 misted mayoral electroencephalography FAS +715 202304 37 textures opaquely similarities FAS +716 202305 37 save hostess charges W +717 202601 37 count fiftieth freest FAS +718 202602 37 rightful incorrectly Greenberg FAS +719 202605 37 chaperone decomposition tinting +720 202606 37 Lizzy stranglings expelled W +721 202607 37 clenched mixture warm +722 202901 37 effortlessly electroencephalography smoothed +723 202902 37 accessed similarities deductions FAS +724 202903 37 beaters charges Romano W +725 202904 37 Hornblower freest bitterroot +726 202907 37 vests Greenberg corset +727 202908 37 indulgences tinting securing +728 203101 37 infallibly expelled environing FAS +729 203103 37 unwilling warm cute +730 203104 37 excrete smoothed Crays +731 203105 37 spools deductions heiress FAS +732 203401 37 crunches Romano inform FAS +733 203402 37 overestimating bitterroot avenge +734 203404 37 ineffective corset universals +735 203901 37 humiliation securing Kinsey W +736 203902 37 sophomore environing ravines FAS +737 203903 37 star cute bestseller +738 203906 37 rifles Crays equilibrium +739 203907 37 dialysis heiress extents 0 +740 203908 37 arriving inform relatively +741 203909 37 indulge avenge pressure FAS +742 206101 37 clockers universals critiques FAS +743 206201 37 languages Kinsey befouled +744 206202 37 Antarctica ravines rightfully FAS +745 206203 37 percentage bestseller mechanizing FAS +746 206206 37 ceiling equilibrium Latinizes +747 206207 37 specification extents timesharing +748 206208 37 regimented relatively Aden +749 208001 37 ciphers pressure embassies +750 208002 37 pictures critiques males FAS +751 208003 37 serpents befouled shapelessly FAS +752 208004 37 allot rightfully genres FAS +753 208008 37 realized mechanizing mastering +754 208009 37 mayoral Latinizes Newtonian +755 208010 37 opaquely timesharing finishers FAS +756 208011 37 hostess Aden abates +757 208101 37 fiftieth embassies teem +758 208102 37 incorrectly males kiting FAS +759 208103 37 decomposition shapelessly stodgy FAS +760 208104 37 stranglings genres scalps FAS +761 208105 37 mixture mastering feed FAS +762 208110 37 electroencephalography Newtonian guitars +763 208111 37 similarities finishers airships +764 208112 37 charges abates store +765 208113 37 freest teem denounces +766 208201 37 Greenberg kiting Pyle FAS +767 208203 37 tinting stodgy Saxony +768 208301 37 expelled scalps serializations FAS +769 208302 37 warm feed Peruvian FAS +770 208305 37 smoothed guitars taxonomically FAS +771 208401 37 deductions airships kingdom A +772 208402 37 Romano store stint A +773 208403 37 bitterroot denounces Sault A +774 208404 37 corset Pyle faithful +775 208501 37 securing Saxony Ganymede FAS +776 208502 37 environing serializations tidiness FAS +777 208503 37 cute Peruvian gainful FAS +778 208504 37 Crays taxonomically contrary FAS +779 208505 37 heiress kingdom Tipperary FAS +780 210101 37 inform stint tropics W +781 210102 37 avenge Sault theorizers +782 210103 37 universals faithful renew 0 +783 210104 37 Kinsey Ganymede already +784 210105 37 ravines tidiness terminal +785 210106 37 bestseller gainful Hegelian +786 210107 37 equilibrium contrary hypothesizer +787 210401 37 extents Tipperary warningly FAS +788 213201 37 relatively tropics journalizing FAS +789 213203 37 pressure theorizers nested +790 213204 37 critiques renew Lars +791 213205 37 befouled already saplings +792 213206 37 rightfully terminal foothill +793 213207 37 mechanizing Hegelian labeled +794 216101 37 Latinizes hypothesizer imperiously FAS +795 216103 37 timesharing warningly reporters FAS +796 218001 37 Aden journalizing furnishings FAS +797 218002 37 embassies nested precipitable FAS +798 218003 37 males Lars discounts FAS +799 218004 37 shapelessly saplings excises FAS +800 143503 50 genres foothill Stalin +801 218006 37 mastering labeled despot FAS +802 218007 37 Newtonian imperiously ripeness FAS +803 218008 37 finishers reporters Arabia +804 218009 37 abates furnishings unruly +805 218010 37 teem precipitable mournfulness +806 218011 37 kiting discounts boom FAS +807 218020 37 stodgy excises slaughter A +808 218021 50 scalps Stalin Sabine +809 218022 37 feed despot handy FAS +810 218023 37 guitars ripeness rural +811 218024 37 airships Arabia organizer +812 218101 37 store unruly shipyard FAS +813 218102 37 denounces mournfulness civics FAS +814 218103 37 Pyle boom inaccuracy FAS +815 218201 37 Saxony slaughter rules FAS +816 218202 37 serializations Sabine juveniles FAS +817 218203 37 Peruvian handy comprised W +818 218204 37 taxonomically rural investigations +819 218205 37 kingdom organizer stabilizes A +820 218301 37 stint shipyard seminaries FAS +821 218302 37 Sault civics Hunter A +822 218401 37 faithful inaccuracy sporty FAS +823 218402 37 Ganymede rules test FAS +824 218403 37 tidiness juveniles weasels +825 218404 37 gainful comprised CERN +826 218407 37 contrary investigations tempering +827 218408 37 Tipperary stabilizes afore FAS +828 218409 37 tropics seminaries Galatean +829 218410 37 theorizers Hunter techniques W +830 226001 37 renew sporty error +831 226002 37 already test veranda +832 226003 37 terminal weasels severely +833 226004 37 Hegelian CERN Cassites FAS +834 226005 37 hypothesizer tempering forthcoming +835 226006 37 warningly afore guides +836 226007 37 journalizing Galatean vanish FAS +837 226008 37 nested techniques lied A +838 226203 37 Lars error sawtooth FAS +839 226204 37 saplings veranda fated FAS +840 226205 37 foothill severely gradually +841 226206 37 labeled Cassites widens +842 226207 37 imperiously forthcoming preclude +843 226208 37 reporters guides Jobrel +844 226209 37 furnishings vanish hooker +845 226210 37 precipitable lied rainstorm +846 226211 37 discounts sawtooth disconnects +847 228001 37 excises fated cruelty +848 228004 37 Stalin gradually exponentials A +849 228005 37 despot widens affective A +850 228006 37 ripeness preclude arteries +851 228007 37 Arabia Jobrel Crosby FAS +852 228008 37 unruly hooker acquaint +853 228009 37 mournfulness rainstorm evenhandedly +854 228101 37 boom disconnects percentage +855 228108 37 slaughter cruelty disobedience +856 228109 37 Sabine exponentials humility +857 228110 37 handy affective gleaning A +858 228111 37 rural arteries petted A +859 228112 37 organizer Crosby bloater A +860 228113 37 shipyard acquaint minion A +861 228114 37 civics evenhandedly marginal A +862 228115 37 inaccuracy percentage apiary A +863 228116 37 rules disobedience measures +864 228117 37 juveniles humility precaution +865 228118 37 comprised gleaning repelled +866 228119 37 investigations petted primary FAS +867 228120 37 stabilizes bloater coverings +868 228121 37 seminaries minion Artemia A +869 228122 37 Hunter marginal navigate +870 228201 37 sporty apiary spatial +871 228206 37 test measures Gurkha +872 228207 37 weasels precaution meanwhile A +873 228208 37 CERN repelled Melinda A +874 228209 37 tempering primary Butterfield +875 228210 37 afore coverings Aldrich A +876 228211 37 Galatean Artemia previewing A +877 228212 37 techniques navigate glut A +878 228213 37 error spatial unaffected +879 228214 37 veranda Gurkha inmate +880 228301 37 severely meanwhile mineral +881 228305 37 Cassites Melinda impending A +882 228306 37 forthcoming Butterfield meditation A +883 228307 37 guides Aldrich ideas +884 228308 37 vanish previewing miniaturizes W +885 228309 37 lied glut lewdly +886 228310 37 sawtooth unaffected title +887 228311 37 fated inmate youthfulness +888 228312 37 gradually mineral creak FAS +889 228313 37 widens impending Chippewa +890 228314 37 preclude meditation clamored +891 228401 65 Jobrel ideas freezes +892 228402 65 hooker miniaturizes forgivably FAS +893 228403 65 rainstorm lewdly reduce FAS +894 228404 65 disconnects title McGovern W +895 228405 65 cruelty youthfulness Nazis W +896 228406 65 exponentials creak epistle W +897 228407 65 affective Chippewa socializes W +898 228408 65 arteries clamored conceptions +899 228409 65 Crosby freezes Kevin +900 228410 65 acquaint forgivably uncovering +901 230301 37 evenhandedly reduce chews FAS +902 230302 37 percentage McGovern appendixes FAS +903 230303 37 disobedience Nazis raining +904 018062 37 humility epistle infest +905 230501 37 gleaning socializes compartment +906 230502 37 petted conceptions minting +907 230503 37 bloater Kevin ducks +908 230504 37 minion uncovering roped A +909 230505 37 marginal chews waltz +910 230506 37 apiary appendixes Lillian +911 230507 37 measures raining repressions A +912 230508 37 precaution infest chillingly +913 230509 37 repelled compartment noncritical +914 230901 37 primary minting lithograph +915 230902 37 coverings ducks spongers +916 230903 37 Artemia roped parenthood +917 230904 37 navigate waltz posed +918 230905 37 spatial Lillian instruments +919 230906 37 Gurkha repressions filial +920 230907 37 meanwhile chillingly fixedly +921 230908 37 Melinda noncritical relives +922 230909 37 Butterfield lithograph Pandora +923 230910 37 Aldrich spongers watering A +924 230911 37 previewing parenthood ungrateful +925 230912 37 glut posed secures +926 230913 37 unaffected instruments chastisers +927 230914 37 inmate filial icon +928 231304 37 mineral fixedly reuniting A +929 231305 37 impending relives imagining A +930 231306 37 meditation Pandora abiding A +931 231307 37 ideas watering omnisciently +932 231308 37 miniaturizes ungrateful Britannic +933 231309 37 lewdly secures scholastics A +934 231310 37 title chastisers mechanics A +935 231311 37 youthfulness icon humidly A +936 231312 37 creak reuniting masterpiece +937 231313 37 Chippewa imagining however +938 231314 37 clamored abiding Mendelian +939 231315 37 freezes omnisciently jarred +940 232102 37 forgivably Britannic scolds +941 232103 37 reduce scholastics infatuate +942 232104 37 McGovern mechanics willed A +943 232105 37 Nazis humidly joyfully +944 232106 37 epistle masterpiece Microsoft +945 232107 37 socializes however fibrosities +946 232108 37 conceptions Mendelian Baltimorean +947 232601 37 Kevin jarred equestrian +948 232602 37 uncovering scolds Goodrich +949 232603 37 chews infatuate apish A +950 232605 37 appendixes willed Adlerian +5950 1232605 37 appendixes willed Adlerian +5951 1232606 37 appendixes willed Adlerian +5952 1232607 37 appendixes willed Adlerian +5953 1232608 37 appendixes willed Adlerian +5954 1232609 37 appendixes willed Adlerian +951 232606 37 raining joyfully Tropez +952 232607 37 infest Microsoft nouns +953 232608 37 compartment fibrosities distracting +954 232609 37 minting Baltimorean mutton +955 236104 37 ducks equestrian bridgeable A +956 236105 37 roped Goodrich stickers A +957 236106 37 waltz apish transcontinental A +958 236107 37 Lillian Adlerian amateurish +959 236108 37 repressions Tropez Gandhian +960 236109 37 chillingly nouns stratified +961 236110 37 noncritical distracting chamberlains +962 236111 37 lithograph mutton creditably +963 236112 37 spongers bridgeable philosophic +964 236113 37 parenthood stickers ores +965 238005 37 posed transcontinental Carleton +966 238006 37 instruments amateurish tape A +967 238007 37 filial Gandhian afloat A +968 238008 37 fixedly stratified goodness A +969 238009 37 relives chamberlains welcoming +970 238010 37 Pandora creditably Pinsky FAS +971 238011 37 watering philosophic halting +972 238012 37 ungrateful ores bibliography +973 238013 37 secures Carleton decoding +974 240401 41 chastisers tape variance A +975 240402 41 icon afloat allowed A +976 240901 41 reuniting goodness dire A +977 240902 41 imagining welcoming dub A +978 241801 41 abiding Pinsky poisoning +979 242101 41 omnisciently halting Iraqis A +980 242102 41 Britannic bibliography heaving +981 242201 41 scholastics decoding population A +982 242202 41 mechanics variance bomb A +983 242501 41 humidly allowed Majorca A +984 242502 41 masterpiece dire Gershwins +985 246201 41 however dub explorers +986 246202 41 Mendelian poisoning libretto A +987 246203 41 jarred Iraqis occurred +988 246204 41 scolds heaving Lagos +989 246205 41 infatuate population rats +990 246301 41 willed bomb bankruptcies A +991 246302 41 joyfully Majorca crying +992 248001 41 Microsoft Gershwins unexpected +993 248002 41 fibrosities explorers accessed A +994 248003 41 Baltimorean libretto colorful A +995 248004 41 equestrian occurred versatility A +996 248005 41 Goodrich Lagos cosy +997 248006 41 apish rats Darius A +998 248007 41 Adlerian bankruptcies mastering A +999 248008 41 Tropez crying Asiaticizations A +1000 248009 41 nouns unexpected offerers A +1001 248010 41 distracting accessed uncles A +1002 248011 41 mutton colorful sleepwalk +1003 248012 41 bridgeable versatility Ernestine +1004 248013 41 stickers cosy checksumming +1005 248014 41 transcontinental Darius stopped +1006 248015 41 amateurish mastering sicker +1007 248016 41 Gandhian Asiaticizations Italianization +1008 248017 41 stratified offerers alphabetic +1009 248018 41 chamberlains uncles pharmaceutic +1010 248019 41 creditably sleepwalk creator +1011 248020 41 philosophic Ernestine chess +1012 248021 41 ores checksumming charcoal +1013 248101 41 Carleton stopped Epiphany A +1014 248102 41 tape sicker bulldozes A +1015 248201 41 afloat Italianization Pygmalion A +1016 248202 41 goodness alphabetic caressing A +1017 248203 41 welcoming pharmaceutic Palestine A +1018 248204 41 Pinsky creator regimented A +1019 248205 41 halting chess scars A +1020 248206 41 bibliography charcoal realest A +1021 248207 41 decoding Epiphany diffusing A +1022 248208 41 variance bulldozes clubroom A +1023 248209 41 allowed Pygmalion Blythe A +1024 248210 41 dire caressing ahead +1025 248211 50 dub Palestine reviver +1026 250501 34 poisoning regimented retransmitting A +1027 250502 34 Iraqis scars landslide +1028 250503 34 heaving realest Eiffel +1029 250504 34 population diffusing absentee +1030 250505 34 bomb clubroom aye +1031 250601 34 Majorca Blythe forked A +1032 250602 34 Gershwins ahead Peruvianizes +1033 250603 34 explorers reviver clerked +1034 250604 34 libretto retransmitting tutor +1035 250605 34 occurred landslide boulevard +1036 251001 34 Lagos Eiffel shuttered +1037 251002 34 rats absentee quotes A +1038 251003 34 bankruptcies aye Caltech +1039 251004 34 crying forked Mossberg +1040 251005 34 unexpected Peruvianizes kept +1041 251301 34 accessed clerked roundly +1042 251302 34 colorful tutor features A +1043 251303 34 versatility boulevard imaginable A +1044 251304 34 cosy shuttered controller +1045 251305 34 Darius quotes racial +1046 251401 34 mastering Caltech uprisings A +1047 251402 34 Asiaticizations Mossberg narrowed A +1048 251403 34 offerers kept cannot A +1049 251404 34 uncles roundly vest +1050 251405 34 sleepwalk features famine +1051 251406 34 Ernestine imaginable sugars +1052 251801 34 checksumming controller exterminated A +1053 251802 34 stopped racial belays +1054 252101 34 sicker uprisings Hodges A +1055 252102 34 Italianization narrowed translatable +1056 252301 34 alphabetic cannot duality A +1057 252302 34 pharmaceutic vest recording A +1058 252303 34 creator famine rouses A +1059 252304 34 chess sugars poison +1060 252305 34 charcoal exterminated attitude +1061 252306 34 Epiphany belays dusted +1062 252307 34 bulldozes Hodges encompasses +1063 252308 34 Pygmalion translatable presentation +1064 252309 34 caressing duality Kantian +1065 256001 34 Palestine recording imprecision A +1066 256002 34 regimented rouses saving +1067 256003 34 scars poison maternal +1068 256004 34 realest attitude hewed +1069 256005 34 diffusing dusted kerosene +1070 258001 34 clubroom encompasses Cubans +1071 258002 34 Blythe presentation photographers +1072 258003 34 ahead Kantian nymph A +1073 258004 34 reviver imprecision bedlam A +1074 258005 34 retransmitting saving north A +1075 258006 34 landslide maternal Schoenberg A +1076 258007 34 Eiffel hewed botany A +1077 258008 34 absentee kerosene curs +1078 258009 34 aye Cubans solidification +1079 258010 34 forked photographers inheritresses +1080 258011 34 Peruvianizes nymph stiller +1081 258101 68 clerked bedlam t1 A +1082 258102 68 tutor north suite A +1083 258103 34 boulevard Schoenberg ransomer +1084 258104 68 shuttered botany Willy +1085 258105 68 quotes curs Rena A +1086 258106 68 Caltech solidification Seattle A +1087 258107 68 Mossberg inheritresses relaxes A +1088 258108 68 kept stiller exclaim +1089 258109 68 roundly t1 implicated A +1090 258110 68 features suite distinguish +1091 258111 68 imaginable ransomer assayed +1092 258112 68 controller Willy homeowner +1093 258113 68 racial Rena and +1094 258201 34 uprisings Seattle stealth +1095 258202 34 narrowed relaxes coinciding A +1096 258203 34 cannot exclaim founder A +1097 258204 34 vest implicated environing +1098 258205 34 famine distinguish jewelry +1099 258301 34 sugars assayed lemons A +1100 258401 34 exterminated homeowner brokenness A +1101 258402 34 belays and bedpost A +1102 258403 34 Hodges stealth assurers A +1103 258404 34 translatable coinciding annoyers +1104 258405 34 duality founder affixed +1105 258406 34 recording environing warbling +1106 258407 34 rouses jewelry seriously +1107 228123 37 poison lemons boasted +1108 250606 34 attitude brokenness Chantilly +1109 208405 37 dusted bedpost Iranizes +1110 212101 37 encompasses assurers violinist +1111 218206 37 presentation annoyers extramarital +1112 150401 37 Kantian affixed spates +1113 248212 41 imprecision warbling cloakroom +1114 128026 00 saving seriously gazer +1115 128024 00 maternal boasted hand +1116 128027 00 hewed Chantilly tucked +1117 128025 00 kerosene Iranizes gems +1118 128109 00 Cubans violinist clinker +1119 128705 00 photographers extramarital refiner +1120 126303 00 nymph spates callus +1121 128308 00 bedlam cloakroom leopards +1122 128204 00 north gazer comfortingly +1123 128205 00 Schoenberg hand generically +1124 128206 00 botany tucked getters +1125 128207 00 curs gems sexually +1126 118205 00 solidification clinker spear +1127 116801 00 inheritresses refiner serums +1128 116803 00 stiller callus Italianization +1129 116804 00 t1 leopards attendants +1130 116802 00 suite comfortingly spies +1131 128605 00 ransomer generically Anthony +1132 118308 00 Willy getters planar +1133 113702 00 Rena sexually cupped +1134 113703 00 Seattle spear cleanser +1135 112103 00 relaxes serums commuters +1136 118009 00 exclaim Italianization honeysuckle +5136 1118009 00 exclaim Italianization honeysuckle +1137 138011 00 implicated attendants orphanage +1138 138010 00 distinguish spies skies +1139 138012 00 assayed Anthony crushers +1140 068304 00 homeowner planar Puritan +1141 078009 00 and cupped squeezer +1142 108013 00 stealth cleanser bruises +1143 084004 00 coinciding commuters bonfire +1144 083402 00 founder honeysuckle Colombo +1145 084003 00 environing orphanage nondecreasing +1146 088504 00 jewelry skies innocents +1147 088005 00 lemons crushers masked +1148 088007 00 brokenness Puritan file +1149 088006 00 bedpost squeezer brush +1150 148025 00 assurers bruises mutilate +1151 148024 00 annoyers bonfire mommy +1152 138305 00 affixed Colombo bulkheads +1153 138306 00 warbling nondecreasing undeclared +1154 152701 00 seriously innocents displacements +1155 148505 00 boasted masked nieces +1156 158003 00 Chantilly file coeducation +1157 156201 00 Iranizes brush brassy +1158 156202 00 violinist mutilate authenticator +1159 158307 00 extramarital mommy Washoe +1160 158402 00 spates bulkheads penny +1161 158401 00 cloakroom undeclared Flagler +1162 068013 00 gazer displacements stoned +1163 068012 00 hand nieces cranes +1164 068203 00 tucked coeducation masterful +1165 088205 00 gems brassy biracial +1166 068704 00 clinker authenticator steamships +1167 068604 00 refiner Washoe windmills +1168 158502 00 callus penny exploit +1169 123103 00 leopards Flagler riverfront +1170 148026 00 comfortingly stoned sisterly +1171 123302 00 generically cranes sharpshoot +1172 076503 00 getters masterful mittens +1173 126304 00 sexually biracial interdependency +1174 068306 00 spear steamships policy +1175 143504 00 serums windmills unleashing +1176 160201 00 Italianization exploit pretenders +1177 148028 00 attendants riverfront overstatements +1178 148027 00 spies sisterly birthed +1179 143505 00 Anthony sharpshoot opportunism +1180 108014 00 planar mittens showroom +1181 076104 00 cupped interdependency compromisingly +1182 078106 00 cleanser policy Medicare +1183 126102 00 commuters unleashing corresponds +1184 128029 00 honeysuckle pretenders hardware +1185 128028 00 orphanage overstatements implant +1186 018410 00 skies birthed Alicia +1187 128110 00 crushers opportunism requesting +1188 148506 00 Puritan showroom produced +1189 123303 00 squeezer compromisingly criticizes +1190 123304 00 bruises Medicare backer +1191 068504 00 bonfire corresponds positively +1192 068305 00 Colombo hardware colicky +1193 000000 00 nondecreasing implant thrillingly +1 000001 00 Omaha teethe neat +2 011401 37 breaking dreaded Steinberg W +3 011402 37 Romans scholastics jarring +4 011403 37 intercepted audiology tinily drop table t1, t2; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 5c2e73e5af7..f55aea6e104 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1297,4 +1297,6 @@ 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',''); SELECT * FROM t2; +OPTIMIZE TABLE t2; +SELECT * FROM t2; drop table t1, t2; -- cgit v1.2.1 From 5108acd8e4d38a2a8708c98f3db980a7837c0094 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Sep 2004 12:13:58 +0200 Subject: Changed WL#1424 to use the function ha_find_files. This is a simpler implementation and all handler specific code is hidden in the appropriate handler. mysql-test/r/ndb_autodiscover.result: Update test result, number of rows is 1 mysql-test/t/ndb_autodiscover.test: Dont run the test where table is dropped in NDb with ndb_drop_table sql/ha_ndbcluster.cc: Implement function ndbcluster_find_files which will discover new tables and delete old tables sql/ha_ndbcluster.h: Implement function ndbcluster_find_files Remove function ndbcluster_list_tables and ndbcluster_can_discover sql/handler.cc: Add ha_find_files called from mysql_find_files Remove ha_can_discover and ha_list_tables sql/handler.h: Add ha_find_files called from mysql_find_files Remove ha_can_discover and ha_list_tables sql/sql_show.cc: Revert to original version of sql_show.cc Only changes to this version is that ha_find_files is called from mysql_find_files in order to give the handlers a possibility to find new files in engine --- mysql-test/r/ndb_autodiscover.result | 2 +- mysql-test/t/ndb_autodiscover.test | 43 +++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 21 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 7f5c4aecaa2..09ad82b7a6b 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -145,7 +145,7 @@ flush tables; show table status; 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 t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL -t7 ndbcluster 9 Fixed 100 0 # # # 0 NULL # # NULL # NULL +t7 ndbcluster 9 Fixed 1 0 # # # 0 NULL # # NULL # NULL show status like 'handler_discover%'; Variable_name Value Handler_discover 2 diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index ddb8b6ed47a..47a1155065b 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -189,30 +189,33 @@ drop table t6, t7; # saying "No such table existed" # -flush status; - -create table t4( - id int not null primary key, - name char(27) -) engine=ndb; -insert into t4 values (1, "Automatic"); -select * from t4; +# Commented out, to be fixed +# +#flush status; +# +#create table t4( +# id int not null primary key, +# name char(27) +#) engine=ndb; +#insert into t4 values (1, "Automatic"); +#select * from t4; +# # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4; - -system exec ../ndb/tools/ndb_show_tables > show_tables.log; +#system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; +# # Test that correct error is returned ---error 1146 -select * from t4; ---error 1146 -select * from t4; - -show status like 'handler_discover%'; -drop table t4; - -show tables; +#--error 1146 +#select * from t4; +#--error 1146 +#select * from t4; +# +#show status like 'handler_discover%'; +#drop table t4; +# +#show tables; -- cgit v1.2.1 From 57517f3aca11ead3d0890424d14d8c639552de78 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Sep 2004 22:36:53 +0500 Subject: Additional fix for bug #5136 (Geometry object is corrupted when queried) CREATE TABLE t1 SELECT POINT(1,2); fixed mysql-test/r/gis.result: Appropriate test result mysql-test/t/gis.test: test case sql/item_geofunc.cc: Item_geometry_func::fix_lengths_and_dec implementation several fix_length_and_dec's not needed now sql/item_geofunc.h: Item_geometry_func class presented --- mysql-test/r/gis.result | 7 +++++++ mysql-test/t/gis.test | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 9f5dd286cf9..fd71cad36a6 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -485,3 +485,10 @@ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); AsText(a) POINT(1 1) drop table t1; +create table t1 select POINT(1,3); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `POINT(1,3)` longblob NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index e35b9996a44..30da019be3e 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -190,3 +190,7 @@ select AsText(a) from t1 where and MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); drop table t1; + +create table t1 select POINT(1,3); +show create table t1; +drop table t1; -- cgit v1.2.1 From 8df3feadcdbc184a7218d8baf3652153f2b9a098 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Sep 2004 12:16:56 +0200 Subject: Fix for BUG#5705: "SET CHARATER_SET_SERVERetc will be lost if STOP SLAVE before following query": we do not increment rli->group_master_log_pos if we are just after a SET ONE_SHOT (it's not a standalone event) mysql-test/r/rpl_charset.result: testing interruption of slave SQL thread between SET CHARACTER_SET_SERVER... and the companion INSERT. mysql-test/t/rpl_charset.test: testing interruption of slave SQL thread between SET CHARACTER_SET_SERVER... and the companion INSERT. sql/log_event.cc: we do not increment rli->group_master_log_pos if we are just after a SET ONE_SHOT, because SET ONE_SHOT should not be separated from its following updating query. --- mysql-test/r/rpl_charset.result | 8 ++++++++ mysql-test/t/rpl_charset.test | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index a60c9269625..54cce23b301 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -198,4 +198,12 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +stop slave; +delete from t1; +change master to master_log_pos=5801; +start slave until master_log_file='master-bin.000001', master_log_pos=5937; +start slave; +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1; diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index 83e7d95e28c..9b9f53a94de 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -148,6 +148,24 @@ INSERT INTO t1 (c1, c2) VALUES (' select hex(c1), hex(c2) from t1; sync_slave_with_master; select hex(c1), hex(c2) from t1; + +# Now test for BUG##5705: SET CHARATER_SET_SERVERetc will be lost if +# STOP SLAVE before following query + +stop slave; +delete from t1; +change master to master_log_pos=5801; +start slave until master_log_file='master-bin.000001', master_log_pos=5937; +# Slave is supposed to stop _after_ the INSERT, even though 5937 is +# the position of the beginning of the INSERT; after SET slave is not +# supposed to increment position. +wait_for_slave_to_stop; +# When you merge this into 5.0 you will have to adjust positions +# above; the first master_log_pos above should be the one of the SET, +# the second should be the one of the INSERT. +start slave; +sync_with_master; +select hex(c1), hex(c2) from t1; connection master; drop table t1; sync_slave_with_master; -- cgit v1.2.1 From a99f67910931978d71b94da032721e00ba0561b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Sep 2004 18:01:55 +0400 Subject: A fix and test case for bug#5688 "Upgraded 4.1.5 Server seg faults" mysql-test/r/ps.result: Test results fixed: the test case for bug#5688 "Upgraded 4.1.5 Server seg faults" mysql-test/t/ps.test: Test case for bug#5688 "Upgraded 4.1.5 Server seg faults" sql/item_cmpfunc.cc: A fix for bug#5688 "Upgraded 4.1.5 Server seg faults": fix just another place where we use wrong memory root for an Item in statement prepare. In addition, make the check for charsets in Item_bool_func2 more generic (fixes the test case when we use LIKE to compare BLOBs with TEXT data). --- mysql-test/r/ps.result | 8 ++++++++ mysql-test/t/ps.test | 10 ++++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 8742ac29989..12337d358e1 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -289,3 +289,11 @@ execute stmt using @var; select * from t1; deallocate prepare stmt; drop table t1; +prepare stmt from "select 'abc' like convert('abc' using utf8)"; +execute stmt; +'abc' like convert('abc' using utf8) +1 +execute stmt; +'abc' like convert('abc' using utf8) +1 +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index af356ca2a09..4b63a7db95f 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -304,3 +304,13 @@ select * from t1; deallocate prepare stmt; drop table t1; +# +# BUG#5688 "Upgraded 4.1.5 Server seg faults" # (prepared statements) +# The test case speaks for itself. +# Just another place where we used wrong memory root for Items created +# during statement prepare. +# +prepare stmt from "select 'abc' like convert('abc' using utf8)"; +execute stmt; +execute stmt; +deallocate prepare stmt; -- cgit v1.2.1 From 15ef828bb92f81b78d90faeba1ebe4277c7b5109 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Sep 2004 13:14:44 +0500 Subject: logging_ok: Logging to logging@openlogging.org accepted sql_show.cc, type_enum.test, type_enum.result: Bug #5628 German characters in field-defs will be '?' with some table definitions mysql-test/r/type_enum.result: Bug #5628 German characters in field-defs will be '?' with some table definitions mysql-test/t/type_enum.test: Bug #5628 German characters in field-defs will be '?' with some table definitions sql/sql_show.cc: Bug #5628 German characters in field-defs will be '?' with some table definitions BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/r/type_enum.result | 16 ++++++++++++++++ mysql-test/t/type_enum.test | 14 ++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 976c484dabf..a94e90885db 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1661,3 +1661,19 @@ t1 CREATE TABLE `t1` ( `a` enum('','1','2') NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +set names latin1; +CREATE TABLE t1 ( +a INT default 1, +b ENUM('value','_value','') character set latin1 NOT NULL +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default '1', + `b` enum('value','_value','') NOT NULL default 'value' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show columns from t1; +Field Type Null Key Default Extra +a int(11) YES 1 +b enum('value','_value','') value +drop table t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index b8f32107892..2f1e11810af 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -45,3 +45,17 @@ create table t1 (a enum(0xE4, '1', '2') not null default 0xE4); show columns from t1; show create table t1; drop table t1; + + +# +# Bug #5628 German characters in field-defs will be '?' +# with some table definitions +# +set names latin1; +CREATE TABLE t1 ( + a INT default 1, + b ENUM('value','_value','') character set latin1 NOT NULL +); +show create table t1; +show columns from t1; +drop table t1; -- cgit v1.2.1 From 38464f67eaff7e524c41194a2ea66bd9cc3e747e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Sep 2004 19:45:27 +0500 Subject: Merging --- mysql-test/r/gis.result | 3 --- 1 file changed, 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index b0e1b59b5eb..2226c6e33c9 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -485,7 +485,6 @@ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a); AsText(a) POINT(1 1) drop table t1; - CREATE TABLE t1 (Coordinates POINT NOT NULL, SPATIAL INDEX(Coordinates)); INSERT INTO t1 VALUES(GeomFromText('POINT(383293632 1754448)')); INSERT INTO t1 VALUES(GeomFromText('POINT(564952612 157516260)')); @@ -575,12 +574,10 @@ INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)')); INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)')); INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)')); drop table t1; - create table t1 select POINT(1,3); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `POINT(1,3)` longblob NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 - drop table t1; -- cgit v1.2.1 From 387ac2e4544199e781700fa8c563f5640fef9098 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Sep 2004 18:39:25 +0200 Subject: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Reworked the HANDLER functions and interface. Using a HASH to store information on open tables that survives FLUSH TABLE. HANDLER tables alias names must now be unique, though it is allowed in 4.0 to qualify them with the database name of the base table. mysql-test/r/flush_table.result: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Moved pure handler test results to handler.result. Added the new test results. mysql-test/r/handler.result: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Moved pure handler test results from flush_table.result to here. mysql-test/t/flush_table.test: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Moved pure handler tests to handler.test. Added new tests. mysql-test/t/handler.test: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Moved pure handler tests from flush_table.test to here. sql/mysql_priv.h: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Reworked the handler interface. sql/sql_base.cc: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Replaced mysql_ha_close_list() by the better named function mysql_ha_flush() with readable options. sql/sql_class.cc: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Added initialization for the handler tables hash. Changed the handler tables clean-up code. Unreleted to bug: Changed the order of THD initialization to avoid warning messages on Linux with gcc. sql/sql_class.h: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Added the handler tables HASH to THD. sql/sql_handler.cc: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. Completely reworked the handler functions. Added an introducing comment, describing the new functionality. sql/sql_table.cc: BUG#4286 - HANDLER tables are closed by FLUSH TABLE(S). BUG#4335 - one name can be handler open'ed many times. replaced mysql_ha_close() by the better named function mysql_ha_flush() with readable options. --- mysql-test/r/flush_table.result | 101 +++++++---------- mysql-test/r/handler.result | 244 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/flush_table.test | 84 ++++---------- mysql-test/t/handler.test | 204 +++++++++++++++++++++++++++++++++ 4 files changed, 514 insertions(+), 119 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result index cfba428e2e8..ff69291193f 100644 --- a/mysql-test/r/flush_table.result +++ b/mysql-test/r/flush_table.result @@ -7,58 +7,6 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -drop database if exists test_test; -create database test_test; -use test_test; -create table t1(table_id char(20) primary key); -insert into t1 values ('test_test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -table_id -test_test.t1 - -create table t2(table_id char(20) primary key); -insert into t2 values ('test_test.t2'); -insert into t2 values (''); -handler t2 open; -handler t2 read first limit 9; -table_id -test_test.t2 - -use test; -drop table if exists t1; -create table t1(table_id char(20) primary key); -insert into t1 values ('test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -table_id -test.t1 - -use test; -handler test.t1 read first limit 9; -table_id -test.t1 - -handler test.t2 read first limit 9; -Unknown table 't2' in HANDLER -handler test_test.t1 read first limit 9; -table_id -test_test.t1 - -handler test_test.t2 read first limit 9; -table_id -test_test.t2 - -handler test_test.t1 close; -drop table test_test.t1; -handler test_test.t2 close; -drop table test_test.t2; -drop database test_test; -use test; -handler test.t1 close; -drop table test.t1; drop table if exists t1; drop table if exists t2; create table t1(table_id char(20) primary key); @@ -84,14 +32,23 @@ test.t2 flush tables; handler a1 read first limit 9; -Unknown table 'a1' in HANDLER +table_id +test.t1 + handler a2 read first limit 9; -Unknown table 'a2' in HANDLER +table_id +test.t1 + handler t2 read first limit 9; -Unknown table 't2' in HANDLER +table_id +test.t2 + handler t1 open as a1; +Not unique table/alias: 'a1' handler t1 open as a2; +Not unique table/alias: 'a2' handler t2 open; +Not unique table/alias: 't2' handler a1 read first limit 9; table_id test.t1 @@ -106,15 +63,43 @@ test.t2 flush table t1; handler a1 read first limit 9; -Unknown table 'a1' in HANDLER +table_id +test.t1 + handler a2 read first limit 9; -Unknown table 'a2' in HANDLER +table_id +test.t1 + handler t2 read first limit 9; table_id test.t2 flush table t2; handler t2 close; -Unknown table 't2' in HANDLER drop table t1; drop table t2; +create table t1(table_id char(20) primary key); +insert into t1 values ('Record-01'); +insert into t1 values ('Record-02'); +insert into t1 values ('Record-03'); +insert into t1 values ('Record-04'); +insert into t1 values ('Record-05'); +handler t1 open; +handler t1 read first limit 1; +table_id +Record-01 +handler t1 read next limit 1; +table_id +Record-02 +handler t1 read next limit 1; +table_id +Record-03 +flush table t1; +handler t1 read next limit 1; +table_id +Record-01 +handler t1 read next limit 1; +table_id +Record-02 +handler t1 close; +drop table t1; diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index 50d51cf14f4..5af153930d5 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -203,3 +203,247 @@ handler t1 read a=(1) where b=1; a b handler t1 close; drop table t1; +drop database if exists test_test; +create database test_test; +use test_test; +create table t1(table_id char(20) primary key); +insert into t1 values ('test_test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +table_id +test_test.t1 + +create table t2(table_id char(20) primary key); +insert into t2 values ('test_test.t2'); +insert into t2 values (''); +handler t2 open; +handler t2 read first limit 9; +table_id +test_test.t2 + +use test; +drop table if exists t1; +create table t1(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +handler t1 open; +Not unique table/alias: 't1' +use test; +handler test.t1 read first limit 9; +Unknown table 'test.t1' in HANDLER +handler test_test.t1 read first limit 9; +table_id +test_test.t1 + +handler t1 read first limit 9; +table_id +test_test.t1 + +handler test_test.t2 read first limit 9; +table_id +test_test.t2 + +handler t2 read first limit 9; +table_id +test_test.t2 + +handler test_test.t1 close; +handler t1 close; +Unknown table 't1' in HANDLER +drop table test_test.t1; +handler test_test.t2 close; +handler t2 close; +Unknown table 't2' in HANDLER +drop table test_test.t2; +drop database test_test; +use test; +handler test.t1 close; +Unknown table 'test.t1' in HANDLER +handler t1 close; +Unknown table 't1' in HANDLER +drop table test.t1; +drop database if exists test_test; +drop table if exists t1; +drop table if exists t2; +drop table if exists t3; +create database test_test; +use test_test; +create table t1 (c1 char(20)); +insert into t1 values ('test_test.t1'); +create table t3 (c1 char(20)); +insert into t3 values ('test_test.t3'); +handler t1 open; +handler t1 read first limit 9; +c1 +test_test.t1 +handler t1 open h1; +handler h1 read first limit 9; +c1 +test_test.t1 +use test; +create table t1 (c1 char(20)); +create table t2 (c1 char(20)); +create table t3 (c1 char(20)); +insert into t1 values ('t1'); +insert into t2 values ('t2'); +insert into t3 values ('t3'); +handler t1 open; +Not unique table/alias: 't1' +handler t2 open t1; +Not unique table/alias: 't1' +handler t3 open t1; +Not unique table/alias: 't1' +handler t1 read first limit 9; +c1 +test_test.t1 +handler test.t1 close; +Unknown table 'test.t1' in HANDLER +handler test.t1 open h1; +Not unique table/alias: 'h1' +handler test_test.t1 open h1; +Not unique table/alias: 'h1' +handler test_test.t3 open h3; +handler test.t1 open h2; +handler t1 read first limit 9; +c1 +test_test.t1 +handler h1 read first limit 9; +c1 +test_test.t1 +handler h2 read first limit 9; +c1 +t1 +handler h3 read first limit 9; +c1 +test_test.t3 +handler test.h2 read first limit 9; +c1 +t1 +handler test.h1 close; +Unknown table 'test.h1' in HANDLER +handler test_test.t1 close; +handler test_test.h1 close; +handler h2 close; +handler t1 read first limit 9; +Unknown table 't1' in HANDLER +handler h1 read first limit 9; +Unknown table 'h1' in HANDLER +handler h2 read first limit 9; +Unknown table 'h2' in HANDLER +handler h3 read first limit 9; +c1 +test_test.t3 +handler test_test.h3 read first limit 9; +c1 +test_test.t3 +use test_test; +handler h3 read first limit 9; +c1 +test_test.t3 +handler test.h3 read first limit 9; +Unknown table 'test.h3' in HANDLER +handler test_test.h3 close; +use test; +drop table t3; +drop table t2; +drop table t1; +drop database test_test; +create table t1 (c1 char(20)); +insert into t1 values ("t1"); +handler t1 open as h1; +handler h1 read first limit 9; +c1 +t1 +create table t2 (c1 char(20)); +insert into t2 values ("t2"); +handler t2 open as h2; +handler h2 read first limit 9; +c1 +t2 +create table t3 (c1 char(20)); +insert into t3 values ("t3"); +handler t3 open as h3; +handler h3 read first limit 9; +c1 +t3 +create table t4 (c1 char(20)); +insert into t4 values ("t4"); +handler t4 open as h4; +handler h4 read first limit 9; +c1 +t4 +create table t5 (c1 char(20)); +insert into t5 values ("t5"); +handler t5 open as h5; +handler h5 read first limit 9; +c1 +t5 +alter table t1 engine=MyISAM; +handler h1 read first limit 9; +Unknown table 'h1' in HANDLER +handler h2 read first limit 9; +c1 +t2 +handler h3 read first limit 9; +c1 +t3 +handler h4 read first limit 9; +c1 +t4 +handler h5 read first limit 9; +c1 +t5 +alter table t5 engine=MyISAM; +handler h1 read first limit 9; +Unknown table 'h1' in HANDLER +handler h2 read first limit 9; +c1 +t2 +handler h3 read first limit 9; +c1 +t3 +handler h4 read first limit 9; +c1 +t4 +handler h5 read first limit 9; +Unknown table 'h5' in HANDLER +alter table t3 engine=MyISAM; +handler h1 read first limit 9; +Unknown table 'h1' in HANDLER +handler h2 read first limit 9; +c1 +t2 +handler h3 read first limit 9; +Unknown table 'h3' in HANDLER +handler h4 read first limit 9; +c1 +t4 +handler h5 read first limit 9; +Unknown table 'h5' in HANDLER +handler h2 close; +handler h4 close; +handler t1 open as h1_1; +handler t1 open as h1_2; +handler t1 open as h1_3; +handler h1_1 read first limit 9; +c1 +t1 +handler h1_2 read first limit 9; +c1 +t1 +handler h1_3 read first limit 9; +c1 +t1 +alter table t1 engine=MyISAM; +handler h1_1 read first limit 9; +Unknown table 'h1_1' in HANDLER +handler h1_2 read first limit 9; +Unknown table 'h1_2' in HANDLER +handler h1_3 read first limit 9; +Unknown table 'h1_3' in HANDLER +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index ad81f266afc..58c12bad3fa 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -12,63 +12,10 @@ flush table t1; check table t1; drop table t1; -# -# Check if two database names beginning the same are seen as different. -# -# This database begins like the usual 'test' database. -# ---disable_warnings -drop database if exists test_test; ---enable_warnings -create database test_test; -use test_test; -create table t1(table_id char(20) primary key); -insert into t1 values ('test_test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -create table t2(table_id char(20) primary key); -insert into t2 values ('test_test.t2'); -insert into t2 values (''); -handler t2 open; -handler t2 read first limit 9; -# -# This is the usual 'test' database. -# -use test; ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1(table_id char(20) primary key); -insert into t1 values ('test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -# -# Check accesibility of all the tables. -# -use test; -handler test.t1 read first limit 9; ---error 1109; -handler test.t2 read first limit 9; -handler test_test.t1 read first limit 9; -handler test_test.t2 read first limit 9; -# -# Cleanup. -# -handler test_test.t1 close; -drop table test_test.t1; -handler test_test.t2 close; -drop table test_test.t2; -drop database test_test; -# -use test; -handler test.t1 close; -drop table test.t1; - # # In the following test FLUSH TABLES produces a deadlock -# (hang forever) if the fix for bug#3565 is missing. +# (hang forever) if the fix for BUG #3565 is missing. +# And it shows that handler tables are re-opened after flush (BUG #4286). # --disable_warnings drop table if exists t1; @@ -87,28 +34,43 @@ handler a1 read first limit 9; handler a2 read first limit 9; handler t2 read first limit 9; flush tables; ---error 1109; handler a1 read first limit 9; ---error 1109; handler a2 read first limit 9; ---error 1109; handler t2 read first limit 9; # +--error 1066 handler t1 open as a1; +--error 1066 handler t1 open as a2; +--error 1066 handler t2 open; handler a1 read first limit 9; handler a2 read first limit 9; handler t2 read first limit 9; flush table t1; ---error 1109; handler a1 read first limit 9; ---error 1109; handler a2 read first limit 9; handler t2 read first limit 9; flush table t2; ---error 1109; handler t2 close; drop table t1; drop table t2; +# +# The fix for BUG #4286 cannot restore the position after a flush. +# +create table t1(table_id char(20) primary key); +insert into t1 values ('Record-01'); +insert into t1 values ('Record-02'); +insert into t1 values ('Record-03'); +insert into t1 values ('Record-04'); +insert into t1 values ('Record-05'); +handler t1 open; +handler t1 read first limit 1; +handler t1 read next limit 1; +handler t1 read next limit 1; +flush table t1; +handler t1 read next limit 1; +handler t1 read next limit 1; +handler t1 close; +drop table t1; diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index 1f7f32c930a..53fe8c0a059 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -135,3 +135,207 @@ handler t1 read a=(1) where b=1; handler t1 close; drop table t1; +# +# Check if two database names beginning the same are seen as different. +# +# This database begins like the usual 'test' database. +# +--disable_warnings +drop database if exists test_test; +--enable_warnings +create database test_test; +use test_test; +create table t1(table_id char(20) primary key); +insert into t1 values ('test_test.t1'); +insert into t1 values (''); +handler t1 open; +handler t1 read first limit 9; +create table t2(table_id char(20) primary key); +insert into t2 values ('test_test.t2'); +insert into t2 values (''); +handler t2 open; +handler t2 read first limit 9; +# +# This is the usual 'test' database. +# +use test; +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +--error 1066 +handler t1 open; +# +# Check accesibility of all the tables. +# +use test; +--error 1109; +handler test.t1 read first limit 9; +handler test_test.t1 read first limit 9; +handler t1 read first limit 9; +handler test_test.t2 read first limit 9; +handler t2 read first limit 9; +# +# Cleanup. +# + +handler test_test.t1 close; +--error 1109; +handler t1 close; +drop table test_test.t1; +handler test_test.t2 close; +--error 1109; +handler t2 close; +drop table test_test.t2; +drop database test_test; +# +use test; +--error 1109; +handler test.t1 close; +--error 1109; +handler t1 close; +drop table test.t1; + +# +# BUG#4335 +# +--disable_warnings +drop database if exists test_test; +drop table if exists t1; +drop table if exists t2; +drop table if exists t3; +--enable_warnings +create database test_test; +use test_test; +create table t1 (c1 char(20)); +insert into t1 values ('test_test.t1'); +create table t3 (c1 char(20)); +insert into t3 values ('test_test.t3'); +handler t1 open; +handler t1 read first limit 9; +handler t1 open h1; +handler h1 read first limit 9; +use test; +create table t1 (c1 char(20)); +create table t2 (c1 char(20)); +create table t3 (c1 char(20)); +insert into t1 values ('t1'); +insert into t2 values ('t2'); +insert into t3 values ('t3'); +--error 1066 +handler t1 open; +--error 1066 +handler t2 open t1; +--error 1066 +handler t3 open t1; +handler t1 read first limit 9; +--error 1109 +handler test.t1 close; +--error 1066 +handler test.t1 open h1; +--error 1066 +handler test_test.t1 open h1; +handler test_test.t3 open h3; +handler test.t1 open h2; +handler t1 read first limit 9; +handler h1 read first limit 9; +handler h2 read first limit 9; +handler h3 read first limit 9; +handler test.h2 read first limit 9; +--error 1109 +handler test.h1 close; +handler test_test.t1 close; +handler test_test.h1 close; +handler h2 close; +--error 1109 +handler t1 read first limit 9; +--error 1109 +handler h1 read first limit 9; +--error 1109 +handler h2 read first limit 9; +handler h3 read first limit 9; +handler test_test.h3 read first limit 9; +use test_test; +handler h3 read first limit 9; +--error 1109 +handler test.h3 read first limit 9; +handler test_test.h3 close; +use test; +drop table t3; +drop table t2; +drop table t1; +drop database test_test; + +# +# Test if fix for BUG#4286 correctly closes handler tables. +# +create table t1 (c1 char(20)); +insert into t1 values ("t1"); +handler t1 open as h1; +handler h1 read first limit 9; +create table t2 (c1 char(20)); +insert into t2 values ("t2"); +handler t2 open as h2; +handler h2 read first limit 9; +create table t3 (c1 char(20)); +insert into t3 values ("t3"); +handler t3 open as h3; +handler h3 read first limit 9; +create table t4 (c1 char(20)); +insert into t4 values ("t4"); +handler t4 open as h4; +handler h4 read first limit 9; +create table t5 (c1 char(20)); +insert into t5 values ("t5"); +handler t5 open as h5; +handler h5 read first limit 9; +# close first +alter table t1 engine=MyISAM; +--error 1109; +handler h1 read first limit 9; +handler h2 read first limit 9; +handler h3 read first limit 9; +handler h4 read first limit 9; +handler h5 read first limit 9; +# close last +alter table t5 engine=MyISAM; +--error 1109; +handler h1 read first limit 9; +handler h2 read first limit 9; +handler h3 read first limit 9; +handler h4 read first limit 9; +--error 1109; +handler h5 read first limit 9; +# close middle +alter table t3 engine=MyISAM; +--error 1109; +handler h1 read first limit 9; +handler h2 read first limit 9; +--error 1109; +handler h3 read first limit 9; +handler h4 read first limit 9; +--error 1109; +handler h5 read first limit 9; +handler h2 close; +handler h4 close; +# close all depending handler tables +handler t1 open as h1_1; +handler t1 open as h1_2; +handler t1 open as h1_3; +handler h1_1 read first limit 9; +handler h1_2 read first limit 9; +handler h1_3 read first limit 9; +alter table t1 engine=MyISAM; +--error 1109; +handler h1_1 read first limit 9; +--error 1109; +handler h1_2 read first limit 9; +--error 1109; +handler h1_3 read first limit 9; +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; -- cgit v1.2.1 From c76c38308c4741b5527712da4c2eb37eb987aba0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Sep 2004 16:58:25 +0000 Subject: fix for invalidating table if mismatch with frm removed debug printout new test in alter table for dictionay update test with multiple connections added coice of setting MaxNoOfOrderedIndexes added option to run "--small-bench" mysql-test/mysql-test-run.sh: added option to run "--small-bench" mysql-test/ndb/ndb_config_2_node.ini: added coice of setting MaxNoOfOrderedIndexes mysql-test/ndb/ndbcluster.sh: added coice of setting MaxNoOfOrderedIndexes mysql-test/r/ndb_alter_table.result: new test in alter table for dictionay update test with multiple connections mysql-test/t/ndb_alter_table.test: new test in alter table for dictionay update test with multiple connections ndb/src/ndbapi/DictCache.cpp: removed debug printout sql/ha_ndbcluster.cc: fix for invalidating table if mismatch with frm --- mysql-test/mysql-test-run.sh | 22 +++++++++++++++++++--- mysql-test/ndb/ndb_config_2_node.ini | 1 + mysql-test/ndb/ndbcluster.sh | 5 ++++- mysql-test/r/ndb_alter_table.result | 19 +++++++++++++++++++ mysql-test/t/ndb_alter_table.test | 31 +++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 41dc3c419f0..1765bf4504b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -295,6 +295,11 @@ while test $# -gt 0; do --record) RECORD=1; EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; + --small-bench) + DO_SMALL_BENCH=1 + DO_BENCH=1 + NO_SLAVE=1 + ;; --bench) DO_BENCH=1 NO_SLAVE=1 @@ -1451,7 +1456,13 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" - ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + if [ "$DO_BENCH" = 1 ] + then + NDBCLUSTER_OPTS="" + else + NDBCLUSTER_OPTS="--small" + fi + ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" else USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" @@ -1485,9 +1496,14 @@ if [ "$DO_BENCH" = 1 ] then start_master + if [ "$DO_SMALL_BENCH" = 1 ] + then + EXTRA_BENCH_ARGS="--small-test --small-tables" + fi + if [ ! -z "$USE_NDBCLUSTER" ] then - EXTRA_BENCH_ARGS="--create-options=TYPE=ndb" + EXTRA_BENCH_ARGS="--create-options=TYPE=ndb $EXTRA_BENCH_ARGS" fi BENCHDIR=$BASEDIR/sql-bench/ @@ -1495,7 +1511,7 @@ then cd $BENCHDIR if [ -z "$1" ] then - ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS + ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS --log else if [ -x "./$1" ] then diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index cc0f940efe3..8c89d2aa2cc 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -6,6 +6,7 @@ IndexMemory= CHOOSE_IndexMemory Diskless= CHOOSE_Diskless TimeBetweenWatchDogCheck= 30000 DataDir= CHOOSE_FILESYSTEM +MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes [ndbd] HostName= CHOOSE_HOSTNAME_1 diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index f143242371f..a1b6400d753 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -44,7 +44,8 @@ initial_ndb= status_ndb= ndb_diskless=0 -ndb_con_op=100000 +ndb_no_ord=512 +ndb_con_op=10000 ndb_dmem=80M ndb_imem=24M @@ -65,6 +66,7 @@ while test $# -gt 0; do status_ndb=1 ;; --small) + ndb_no_ord=128 ndb_con_op=10000 ndb_dmem=40M ndb_imem=12M @@ -128,6 +130,7 @@ port_transporter=`expr $ndb_mgmd_port + 2` if [ $initial_ndb ] ; then sed \ + -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_DataMemory","$ndb_dmem",g \ -e s,"CHOOSE_IndexMemory","$ndb_imem",g \ diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 8143e34ecc2..a36536b878d 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -73,3 +73,22 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 101 3 4 5 PENDING 0000-00-00 00:00:00 2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 drop table t1; +CREATE TABLE t1 ( +a INT NOT NULL, +b INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (9410,9412); +ALTER TABLE t1 ADD COLUMN c int not null; +select * from t1; +a b c +9410 9412 0 +select * from t1; +a b c +9410 9412 0 +alter table t1 drop c; +select * from t1; +a b +9410 9412 +drop table t1; +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 3cdddfa8dce..96270d94dcb 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -49,6 +49,37 @@ show table status; select * from t1 order by col1; drop table t1; + +# +# Check that invalidating dictionary cache works +# + +CREATE TABLE t1 ( + a INT NOT NULL, + b INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (9410,9412); + +connect (con1,localhost,,,test); +connect (con2,localhost,,,test); + +connection con1; +ALTER TABLE t1 ADD COLUMN c int not null; +select * from t1; + +connection con2; +select * from t1; +alter table t1 drop c; + +connection con1; +select * from t1; +drop table t1; + +connection con2; +--error 1146 +select * from t1; + #--disable_warnings #DROP TABLE IF EXISTS t2; #--enable_warnings -- cgit v1.2.1 From c7b6603ec1fde73d867aa5d7e1668ea6069a8a6e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 25 Sep 2004 19:08:02 +0400 Subject: Results of WL#1856 "Conversion of client_test.c tests cases to mysqltest if possible" - many new test cases - more and improved comments New files: t/ps_7ndb.test test suite for NDB tables r/ps_7ndb.result expected results include/ps_conv.inc conversion test cases + review comments and fixes. mysql-test/include/ps_create.inc: Rename of t_many_col_types -> t9 mysql-test/include/ps_modify.inc: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Rename: t_many_col_types -> t9 Cleanups and comments. New test cases (derived from client_test.c) mysql-test/include/ps_modify1.inc: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Rename: t_many_col_types -> t9 Cleanups and comments. New test cases (derived from client_test.c) mysql-test/include/ps_query.inc: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Rename: t_many_col_types -> t9 Cleanups and comments. New test cases (derived from client_test.c) mysql-test/include/ps_renew.inc: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Rename: t_many_col_types -> t9 mysql-test/r/ps_1general.result: Results updated. mysql-test/r/ps_2myisam.result: Resutls updated. mysql-test/r/ps_3innodb.result: Results updated. mysql-test/r/ps_4heap.result: Results updated. mysql-test/r/ps_5merge.result: Results updated. mysql-test/r/ps_6bdb.result: Results updated. mysql-test/t/ps_1general.test: WL#1856 "Conversion of client_test.c tests cases to mysqltest if possible": new test cases added. mysql-test/t/ps_2myisam.test: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Call of file include/ps_conv.inc (with new test cases) and fulltext test case added. mysql-test/t/ps_3innodb.test: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Call of file include/ps_conv.inc (with new test cases) added. mysql-test/t/ps_4heap.test: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Call of file include/ps_conv.inc (with new test cases) added. mysql-test/t/ps_5merge.test: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible Call of file include/ps_conv.inc (with new test cases) added. mysql-test/t/ps_6bdb.test: WL#1856 Conversion of client_test.c tests cases to mysqltest if possible. Call of file include/ps_conv.inc (with new test cases) added. --- mysql-test/include/ps_conv.inc | 1202 +++++++++++ mysql-test/include/ps_create.inc | 4 +- mysql-test/include/ps_modify.inc | 128 +- mysql-test/include/ps_modify1.inc | 11 +- mysql-test/include/ps_query.inc | 203 +- mysql-test/include/ps_renew.inc | 9 +- mysql-test/r/ps_1general.result | 366 +++- mysql-test/r/ps_2myisam.result | 2109 ++++++++++++++++++- mysql-test/r/ps_3innodb.result | 2092 ++++++++++++++++++- mysql-test/r/ps_4heap.result | 2094 ++++++++++++++++++- mysql-test/r/ps_5merge.result | 4108 +++++++++++++++++++++++++++++++++++-- mysql-test/r/ps_6bdb.result | 2108 ++++++++++++++++++- mysql-test/r/ps_7ndb.result | 3170 ++++++++++++++++++++++++++++ mysql-test/t/ps_1general.test | 426 +++- mysql-test/t/ps_2myisam.test | 23 +- mysql-test/t/ps_3innodb.test | 3 +- mysql-test/t/ps_4heap.test | 9 +- mysql-test/t/ps_5merge.test | 20 +- mysql-test/t/ps_6bdb.test | 3 +- mysql-test/t/ps_7ndb.test | 377 ++++ 20 files changed, 17645 insertions(+), 820 deletions(-) create mode 100644 mysql-test/include/ps_conv.inc create mode 100644 mysql-test/r/ps_7ndb.result create mode 100644 mysql-test/t/ps_7ndb.test (limited to 'mysql-test') diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc new file mode 100644 index 00000000000..f61fb7db1c9 --- /dev/null +++ b/mysql-test/include/ps_conv.inc @@ -0,0 +1,1202 @@ +############################ ps_conv.inc ############################## +# # +# Tests for prepared statements: conversion of parameters # +# # +# Please don't # +# - try to execute this script in ANSI mode, because many statements # +# will fail due to the strict type checking # +# - reuse such ugly assignments like timestamp column = float value . # +# I included them only for controlling purposes. # +######################################################################## + +# +# NOTE: PLEASE SEE ps_1general.test (bottom) +# BEFORE ADDING NEW TEST CASES HERE !!! + +# +# Please be aware, that this file will be sourced by several test case files +# stored within the subdirectory 't'. So every change here will affect +# several test cases. + + +# The MySQL User Variables do not support the simulation of all +# C-API field types. +# +# - There is no method to make an explicit assignment of a type to a variable. +# - The type of the variable can be only influenced by the writing style +# of the value. +# +# The next tests should give an example for these properties. +--disable_warnings +drop table if exists t5 ; +--enable_warnings +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +# This first assignment to @arg fixes the type of the variable +# The second assignment sets the value to NULL, but it does not change +# the numeric types. +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select + 8 as const01, @arg01 as param01, + 8.0 as const02, @arg02 as param02, + 80.00000000000e-1 as const03, @arg03 as param03, + 'abc' as const04, @arg04 as param04, + CAST('abc' as binary) as const05, @arg05 as param05, + '1991-08-05' as const06, @arg06 as param06, + CAST('1991-08-05' as date) as const07, @arg07 as param07, + '1991-08-05 01:01:01' as const08, @arg08 as param08, + CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, + unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, + YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, + NULL as const12, @arg12 as param12, + @arg13 as param13, + @arg14 as param14, + @arg15 as param15; + +# Bug#4788 show create table provides incorrect statement +show create table t5 ; +--vertical_results +--enable_metadata +select * from t5 ; +--disable_metadata +--horizontal_results +drop table t5 ; + +# But there seems to be also an implicit conversion of C-API +# data types to a smaller number of base data types. +# +# Example: C-API for prepared statements +# CREATE TABLE abc as SELECT ? as a, ? as b, ... +# +# MYSQL_TYPE of parameter column type +# MYSQL_TYPE_TINY bigint(4) +# MYSQL_TYPE_SHORT bigint(6) +# MYSQL_TYPE_FLOAT double +# ... +# +# So we can hope that the functionality of mysqltest + user variables +# sufficient to simulate much of the behaviour of the C-API +# vis-a-vis the server. + +# The main test object is the table t9, defined as follows: +# +# eval create table t9 +# ( +# c1 tinyint, c2 smallint, c3 mediumint, c4 int, +# c5 integer, c6 bigint, c7 float, c8 double, +# c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +# c13 date, c14 datetime, c15 timestamp(14), c16 time, +# c17 year, c18 bit, c19 bool, c20 char, +# c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +# c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +# c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +# c32 set('monday', 'tuesday', 'wednesday'), +# primary key(c1) +# ) engine = $type ; +# We test each statement in non-prepared mode and in prepared mode +# for comparison purposes. +# +# We test the following conversions: +# BIGINT -> the rest of numeric columns +# CHAR, LONGTEXT, LONGBLOB, NULL, FLOAT, REAL, DOUBLE -> numeric columns +# FLOAT, REAL, CHAR, LONGTEXT, BINARY, BIGINT -> string +# DATETIME, TIME -> text, and back + + +--disable_query_log +select '------ data type conversion tests ------' as test_sequence ; +--enable_query_log +--source include/ps_renew.inc + +# insert a record with many NULLs +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; + +############ select @parm:= .. / select .. into @parm tests ############ +--disable_query_log +select '------ select @parameter:= column ------' as test_sequence ; +--enable_query_log +# PS query to retrieve the content of the @variables +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; + +# non PS statement for comparison purposes +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata +# now the same procedure with the record containing so many NULLs +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata + +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata +# now the same procedure with the record containing so many NULLs +set @my_key= 0 ; +execute stmt1 using @my_key ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata + +# the next statement must fail +--error 1064 +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; + +--disable_query_log +select '------ select column, .. into @parm,.. ------' as test_sequence ; +--enable_query_log +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata +# now the same procedure with the record containing so many NULLs +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata + +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata +# now the same procedure with the record containing so many NULLs +# Bug#5034: prepared "select 1 into @arg15", second execute crashes server +set @my_key= 0 ; +execute stmt1 using @my_key ; +# get as much informations about the parameters as possible +--enable_metadata +execute full_info ; +--disable_metadata + +# the next statement must fail +--error 1064 +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; + + + +######################### test of numeric types ########################## +# # +# c1 tinyint, c2 smallint, c3 mediumint, c4 int, # +# c5 integer, c6 bigint, c7 float, c8 double, # +# c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), # +# # +########################################################################## +--disable_query_log +select '-- insert into numeric columns --' as test_sequence ; +--enable_query_log + +######## INSERT into .. numeric columns values(BIGINT(n),BIGINT) ######## +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(DOUBLE(m,n),DOUBLE) ######## +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, + 30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(CHAR(n),LONGTEXT) ######### +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '40', '40', '40', '40', '40', '40', '40', '40', + '40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(BINARY(n),LONGBLOB) ######## +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('50' as binary), CAST('50' as binary), + CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), + CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), + CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(BIGINT,NULL) ######## +# we first assign number to arg00 to set it's datatype to numeric. +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL ) ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 61, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(DOUBLE,NULL) ######## +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 71, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. numeric columns values(LONGBLOB,NULL) ######## +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 81, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + + +######## SELECT of all inserted records ######## +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; + + +--disable_query_log +select '-- select .. where numeric column = .. --' as test_sequence ; +--enable_query_log +######## SELECT .. WHERE column(numeric)=value(BIGINT(n)/BIGINT) ######## +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 + and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 + and c12= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(numeric)=value(DOUBLE(m,n)/DOUBLE) ######## +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 + and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 + and c12= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(numeric)=value(CHAR(n)/LONGTEXT) ######## +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 + and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 + and c12= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(numeric)=value(BINARY(n)/LONGBLOB) ######## +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary); +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 + and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 + and c12= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + +delete from t9 ; + +#################### Some overflow experiments ################################ +# # +# MySQL Manual (July 2004) # +# - Setting a numeric column to a value that lies outside the column's range. # +# The value is clipped to the closest endpoint of the range. # +# ... # +# - For example, inserting the string '1999.0e-2' into an INT, FLOAT, # +# DECIMAL(10,6), or YEAR column results in the values 1999, 19.9921, # +# 19.992100, and 1999. # +# That means there is an anomaly if a float value is assigned via string to # +# a column of type bigint. The string will be cut from the right side to # +# a "usable" integer value. # +# # +############################################################################### +--disable_query_log +select '-- some numeric overflow experiments --' as test_sequence ; +--enable_query_log +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; + +# Numeric overflow of columns(c1, c2, c3, c4, c5, c12) with type not in +# (BIGINT,FLOAT,REAL,DOUBLE) during insert +# +# Use the maximum BIGINT from the manual +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +# Use the minimum BIGINT from the manual +# +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; + +# Numeric overflow of columns(c1, c2, c3, c4, c5, c12) with type not in +# (FLOAT,REAL,DOUBLE) during insert +# +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +# Attention: The columns(c1,c2,c3,c4,c5,c6) do not get the overflow, +# because the string is treated as written integer and +# '.11111111111111111111e+50' is cut away. +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; +# Attention: The columns(c1,c2,c3,c4,c5,c6) do not get the overflow, +# because the string is treated as written integer and +# '.11111111111111111111e+50' is cut away. +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; +--vertical_results +execute my_select ; +--horizontal_results +execute my_delete ; + +########################## test of string types ########################## +# # +# c20 char, c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, # +# c25 blob, c26 text, c27 mediumblob, c28 mediumtext, c29 longblob, # +# c30 longtext, c31 enum('one', 'two', 'three') # +# # +########################################################################## +--disable_query_log +select '-- insert into string columns --' as test_sequence ; +--enable_query_log + +######## INSERT into .. string columns values(CHAR(n),LONGTEXT) ######## +--disable_query_log +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 20, '20', '20', '20', '20', '20', '20', '20', '20', '20', '20', '20' ) ; +set @arg00= '21' ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 21, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 22, '22', '22', '22', '22', '22', '22', '22', '22', '22', '22', '22' )" ; +execute stmt1 ; +set @arg00= '23'; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 23, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. string columns values(BINARY(n),LONGBLOB) ######## +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 30, CAST('30' as binary), CAST('30' as binary), CAST('30' as binary), + CAST('30' as binary), CAST('30' as binary), CAST('30' as binary), + CAST('30' as binary), CAST('30' as binary), CAST('30' as binary), + CAST('30' as binary), CAST('30' as binary) ) ; +set @arg00= '31' ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 31, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 32, CAST('32' as binary), CAST('32' as binary), CAST('32' as binary), + CAST('32' as binary), CAST('32' as binary), CAST('32' as binary), + CAST('32' as binary), CAST('32' as binary), CAST('32' as binary), + CAST('32' as binary), CAST('32' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('33' as binary); +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 33, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. string columns values(BIGINT(n),BIGINT) ######## +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40 ) ; +set @arg00= 41 ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 41, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42 )" ; +execute stmt1 ; +set @arg00= 43; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 43, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. string columns values(DOUBLE(m,n),DOUBLE) ######## +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 50, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0 ) ; +set @arg00= 51.0 ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 51, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 52, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0, 52.0 )" ; +execute stmt1 ; +set @arg00= 53.0; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 53, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. string columns values(DOUBLE(m,n),DOUBLE) ######## +# typical float writing style +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 54, 5.4e+1, 5.4e+1, 5.4e+1, 5.4e+1, 5.4e+1, 5.4e+1, 5.4e+1, 5.4e+1, + 5.4e+1, 5.4e+1, 5.4e+1 ) ; +set @arg00= 5.5e+1 ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 55, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 56, 5.6e+1, 5.6e+1, 5.6e+1, 5.6e+1, 5.6e+1, 5.6e+1, 5.6e+1, 5.6e+1, + 5.6e+1, 5.6e+1, 5.6e+1 )" ; +execute stmt1 ; +set @arg00= 5.7e+1; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 57, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. string columns values(LONGBLOB,NULL) ######## +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 61, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + +######## INSERT into .. string columns values(BIGINT,NULL) ######## +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 71, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + +######## INSERT into .. string columns values(DOUBLE,NULL) ######## +set @arg00= 8 ; +set @arg00= NULL ; +insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 81, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00 ; + +--enable_query_log + +######## SELECT of all inserted records ######## +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; + + +--disable_query_log +select '-- select .. where string column = .. --' as test_sequence ; +--enable_query_log +######## SELECT .. WHERE column(string)=value(CHAR(n)/LONGTEXT) ######## +set @arg00= '20'; +# c20 (char) must be extended for the comparison +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and + c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and + c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(string)=value(BINARY(n)/LONGBLOB) ######## +set @arg00= CAST('20' as binary); +# c20 (char) must be extended for the comparison +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and + c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and + c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and + c30= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(string)=value(BIGINT(m,n),BIGINT) ######## +set @arg00= 20; +# c20 (char) must be extended for the comparison +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and + c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and + c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(string)=value(DOUBLE(m,n),DOUBLE) ######## +set @arg00= 20.0; +# c20 (char) must be extended for the comparison +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and + c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and + c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, + @arg00, @arg00, @arg00, @arg00, @arg00 ; + +delete from t9 ; + + +######################### test of date/time columns ######################## +# # +# c13 date, c14 datetime, c15 timestamp(14), c16 time, c17 year # +# # +############################################################################ +--disable_query_log +select '-- insert into date/time columns --' as test_sequence ; +--enable_query_log +######## INSERT into .. date/time columns values(VARCHAR(19),LONGTEXT) ######## +--disable_query_log +set @arg00= '1991-01-01 01:01:01' ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 20, '1991-01-01 01:01:01', '1991-01-01 01:01:01', '1991-01-01 01:01:01', + '1991-01-01 01:01:01', '1991-01-01 01:01:01') ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 21, @arg00, @arg00, @arg00, @arg00, @arg00) ; +prepare stmt1 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 22, '1991-01-01 01:01:01', '1991-01-01 01:01:01', '1991-01-01 01:01:01', + '1991-01-01 01:01:01', '1991-01-01 01:01:01')" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 23, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(DATETIME,LONGBLOB) ######## +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 30, CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime)) ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 31, @arg00, @arg00, @arg00, @arg00, @arg00) ; +prepare stmt1 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 32, CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime), + CAST('1991-01-01 01:01:01' as datetime))" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 33, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(BIGINT(n),BIGINT) ######## +set @arg00= 2000000000 ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 40, 2000000000, 2000000000, 2000000000, 2000000000, 2000000000 ) ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 41, @arg00, @arg00, @arg00, @arg00, @arg00) ; +prepare stmt1 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 42, 2000000000, 2000000000, 2000000000, 2000000000, 2000000000 )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 43, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(DOUBLE(m,n),DOUBLE) ######## +set @arg00= 1.0e+10 ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 50, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 ) ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 51, @arg00, @arg00, @arg00, @arg00, @arg00) ; +prepare stmt1 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 52, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10, 1.0e+10 )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 53, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(LONGBLOB,NULL) ######## +# Attention: c15 is timestamp and the manual says: +# The first TIMESTAMP column in table row automatically is updated +# to the current timestamp when the value of any other column in the +# row is changed, unless the TIMESTAMP column explicitly is assigned +# a value other than NULL. +# That's why a fixed NOT NULL value is inserted. +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 60, NULL, NULL, '1991-01-01 01:01:01', + NULL, NULL) ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 61, @arg00, @arg00, '1991-01-01 01:01:01', @arg00, @arg00) ; +prepare stmt1 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 62, NULL, NULL, '1991-01-01 01:01:01', + NULL, NULL)" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 63, ?, ?, '1991-01-01 01:01:01', ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(BIGINT,NULL) ######## +set @arg00= 8 ; +set @arg00= NULL ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 71, @arg00, @arg00, '1991-01-01 01:01:01', @arg00, @arg00) ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 73, ?, ?, '1991-01-01 01:01:01', ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00 ; + + +######## INSERT into .. date/time columns values(DOUBLE,NULL) ######## +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 81, @arg00, @arg00, '1991-01-01 01:01:01', @arg00, @arg00) ; +prepare stmt2 from "insert into t9 + ( c1, c13, c14, c15, c16, c17 ) +values + ( 83, ?, ?, '1991-01-01 01:01:01', ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00 ; + +--enable_query_log + +######## SELECT of all inserted records ######## +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; + + +--disable_query_log +select '-- select .. where date/time column = .. --' as test_sequence ; +--enable_query_log +######## SELECT .. WHERE column(date/time/..)=value(CHAR(n)/LONGTEXT) ######## +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 + and c17= @arg00 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(date/time/..)=value(DATETIME/LONGBLOB) ######## +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 + and c17= @arg00 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; + + +######## SELECT .. WHERE column(year)=value(INT(10)/BIGINT) ######## +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; + + +######## SELECT .. WHERE column(year)=value(DOUBLE(m,n)/DOUBLE) ######## +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; + diff --git a/mysql-test/include/ps_create.inc b/mysql-test/include/ps_create.inc index 77844c99d77..dfc9c494b46 100644 --- a/mysql-test/include/ps_create.inc +++ b/mysql-test/include/ps_create.inc @@ -19,7 +19,7 @@ #---- Please do not alter the following table definitions -------# --disable_warnings -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; --enable_warnings eval create table t1 @@ -28,7 +28,7 @@ eval create table t1 primary key(a) ) engine = $type ; -eval create table t_many_col_types +eval create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index ba7ccefdd98..9cf11709e69 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -14,12 +14,12 @@ # several test cases. # # Please do not modify the structure (DROP/ALTER..) of the tables -# 't1' and 't_many_col_types'. +# 't1' and 't9'. # # But you are encouraged to use these two tables within your statements -# whenever possible. -# t1 - very simple table -# t_many_col_types - table with nearly all available column types +# (DELETE/UPDATE/...) whenever possible. +# t1 - very simple table +# t9 - table with nearly all available column types # # The structure and the content of these tables can be found in # include/ps_create.inc CREATE TABLE ... @@ -124,17 +124,48 @@ set @arg04=2; --disable_warnings drop table if exists t2; --enable_warnings +# t2 will be of table type 'MYISAM' create table t2 as select a,b from t1 ; prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; +--enable_info execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +--disable_info select a,b from t1 where a = @arg00 ; prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; +--enable_info execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +--disable_info +select a,b from t1 order by a ; +drop table t2 ; +# t2 is now of table type '$type' +# The test battery for table type 'MERGE' gets here only a 'MYISAM' table +# +# Test UPDATE with SUBQUERY in prepared mode +# +eval create table t2 +( + a int, b varchar(30), + primary key(a) +) engine = $type ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +--disable_info +select a,b from t1 where a = @arg00 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +--disable_info +select a,b from t1 order by a ; drop table t2 ; ## update with parameters in limit @@ -179,6 +210,46 @@ set @arg01='eight' ; prepare stmt1 from 'insert into t1 values(?, ? )'; execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; +# cases derived from client_test.c: test_null() +set @NULL= null ; +set @arg00= 'abc' ; +# execute must fail, because first column is primary key (-> not null) +--error 1048 +execute stmt1 using @NULL, @NULL ; +--error 1048 +execute stmt1 using @NULL, @NULL ; +--error 1048 +execute stmt1 using @NULL, @arg00 ; +--error 1048 +execute stmt1 using @NULL, @arg00 ; +let $1 = 2; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @arg00 ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; +let $1 = 2; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @NULL ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; +let $1 = 10; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @arg01 ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; + ## insert with two rows in values part set @arg00=81 ; @@ -208,6 +279,22 @@ set @arg01=1 ; --error 1062 execute stmt1 using @arg00, @arg01; +## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' +# cases derived from client_test.c: test_bug3117() +--disable_warnings +drop table if exists t2 ; +--enable_warnings +# The test battery for table type 'MERGE' gets here only a 'MYISAM' table +eval create table t2 (id int auto_increment primary key) +ENGINE= $type ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +insert into t2 values (NULL) ; +# bug#3117 +execute stmt1 ; +drop table t2 ; + ## many parameters set @1000=1000 ; set @x1000_2="x1000_2" ; @@ -237,3 +324,34 @@ delete from t1 where a >= 1000 ; ## replace --error 1295 prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; + + +## multi table statements +--disable_query_log +select '------ multi table tests ------' as test_sequence ; +--enable_query_log +# cases derived from client_test.c: test_multi +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) + values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +let $1= 3 ; +while ($1) +{ + execute stmt_update using @arg00 ; + execute stmt_delete ; + execute stmt_select1 ; + execute stmt_select2 ; + set @arg00= @arg00 + 1 ; + dec $1 ; +} + diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index da3bea80669..5fba7faa59a 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -20,12 +20,12 @@ # several test cases. # # Please do not modify the structure (DROP/ALTER..) of the tables -# 't1' and 't_many_col_types'. +# 't1' and 't9'. # # But you are encouraged to use these two tables within your statements # (DELETE/UPDATE/...) whenever possible. -# t1 - very simple table -# t_many_col_types - table with nearly all available column types +# t1 - very simple table +# t9 - table with nearly all available column types # # The structure and the content of these tables can be found in # include/ps_create.inc CREATE TABLE ... @@ -41,6 +41,11 @@ #-------- Please be very carefull when editing behind this line ----------# +--source include/ps_renew.inc +# +# add a NULL row to t1: this row is used only in this test +insert into t1 values(0,NULL) ; + ## big insert select statements set @duplicate='duplicate ' ; set @1000=1000 ; diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index 9c80c7a040c..3ebe3c7b5a1 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -15,13 +15,13 @@ # # Please do not modify (INSERT/UPDATE/DELETE) the content or the # structure (DROP/ALTER..) of the tables -# 't1' and 't_many_col_types'. +# 't1' and 't9'. # Such tests should be done in include/ps_modify.inc . # # But you are encouraged to use these two tables within your SELECT statements # whenever possible. -# t1 - very simple table -# t_many_col_types - table with nearly all available column types +# t1 - very simple table +# t9 - table with nearly all available column types # # The structure and the content of these tables can be found in # include/ps_create.inc CREATE TABLE ... @@ -38,10 +38,18 @@ #-------- Please be very carefull when editing behind this line ----------# +################ simple select tests ################ --disable_query_log select '------ simple select tests ------' as test_sequence ; --enable_query_log +##### many column types, but no parameter +# heavy modified case derived from client_test.c: test_func_fields() +prepare stmt1 from ' select * from t9 ' ; +--enable_metadata +execute stmt1; +--disable_metadata + ##### parameter used for keyword like SELECT (must fail) set @arg00='SELECT' ; # mysqltest gives no output for the next statement, Why ?? @@ -70,6 +78,17 @@ set @arg00=1 ; select b, a - @arg00 from t1 where a=1 ; prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; +# case derived from client_test.c: test_ps_null_param() +set @arg00=null ; +select @arg00 as my_col ; +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +select @arg00 + 1 as my_col ; +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +select 1 + @arg00 as my_col ; +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; ## parameter is within a function # variations on 'substr' set @arg00='MySQL' ; @@ -86,7 +105,7 @@ execute stmt1 using @arg00 ; # variations on 'concat' set @arg00='MySQL' ; select a , concat(@arg00,b) from t1 ; -# BUG#3796 +# BUG#3796 Prepared statement, select concat(,),wrong result prepare stmt1 from ' select a , concat(?,b) from t1 ' ; execute stmt1 using @arg00; # @@ -122,25 +141,25 @@ execute stmt1 using @arg02, @arg02 ; # case derived from client_test.c: test_ps_conj_select() # for BUG#3420: select returned all rows of the table --disable_warnings -drop table if exists new_tab ; +drop table if exists t5 ; --enable_warnings -create table new_tab (id1 int(11) not null default '0', +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; -drop table new_tab ; +drop table t5 ; # case derived from client_test.c: test_bug1180() # for BUG#1180 optimized away part of WHERE clause --disable_warnings -drop table if exists new_tab ; +drop table if exists t5 ; --enable_warnings -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -148,7 +167,7 @@ set @arg00='1111' ; execute stmt1 using @arg00 ; set @arg00='abc' ; execute stmt1 using @arg00 ; -drop table new_tab ; +drop table t5 ; ##### parameter used for keyword FROM (must fail) @@ -200,6 +219,12 @@ set @arg01=3 ; select a FROM t1 where a in (@arg00,@arg01); prepare stmt1 from ' select a FROM t1 where a in (?,?) '; execute stmt1 using @arg00, @arg01; +# case derived from client_test.c: test_bug1500() +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; # parameter in LIKE prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; @@ -208,6 +233,24 @@ set @arg00='tw%' ; execute stmt1 using @arg00 ; set @arg00='%wo' ; execute stmt1 using @arg00 ; +# case derived from client_test.c: test_ps_null_param(): +# second part, comparisions with NULL placeholders in prepared +# mode +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +select c5 from t9 where c5 < NULL ; +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +select c5 from t9 where c5 = NULL ; +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +select c5 from t9 where c5 <=> NULL ; +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +delete from t9 where c1= 0 ; ##### parameter used for operator in WHERE clause (must fail) set @arg00='>' ; @@ -276,6 +319,7 @@ having sum(a) <> ? '; execute stmt1 using @arg00, @arg01, @arg02, @arg03; +################ join tests ################ --disable_query_log select '------ join tests ------' as test_sequence ; --enable_query_log @@ -301,8 +345,39 @@ prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second order by second.a, first.a'; execute stmt1 using @arg00, @arg01, @arg02; +# test case derived from client_test.c: test_join() +--disable_warnings +drop table if exists t2 ; +--enable_warnings +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +let $1= 9 ; +while ($1) +{ + --disable_query_log + eval select @query$1 as 'the join statement is:' ; + --enable_query_log + eval prepare stmt1 from @query$1 ; + let $2= 3 ; + while ($2) + { + execute stmt1 ; + dec $2 ; + } + dec $1 ; +} +drop table t2 ; +################ subquery tests ################ --disable_query_log select '------ subquery tests ------' as test_sequence ; --enable_query_log @@ -350,8 +425,20 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; # no parameter prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) '; -# also Bug#4000 (only BDB tables) ?? +# also Bug#4000 (only BDB tables) +# Bug#4106 : ndb table, query with correlated subquery, wrong result execute stmt1 ; +# test case derived from client_test.c: test_subqueries_ref +let $1= 3 ; +while ($1) +{ + prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; + execute stmt1 ; + deallocate prepare stmt1 ; + dec $1 ; +} + ###### parameter in the outer part set @arg00='two' ; @@ -360,7 +447,7 @@ select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b) and b=? '; -# also Bug#4000 (only BDB tables) ?? +# also Bug#4000 (only BDB tables) execute stmt1 using @arg00; ###### parameter in the inner part @@ -390,7 +477,7 @@ select a, @arg00, b FROM t1 outer_table where prepare stmt1 from ' select a, ?, b FROM t1 outer_table where b=? and a = (select ? from t1 where outer_table.b = ? and outer_table.a=a ) ' ; -# also Bug#4000 (only BDB tables) ?? +# also Bug#4000 (only BDB tables) execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; ###### subquery after from @@ -404,43 +491,76 @@ prepare stmt1 from ' select a, ? where a=? '; execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +###### subquery in select list +# test case derived from client_test.c: test_create_drop +--disable_warnings +drop table if exists t2 ; +--enable_warnings +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +# test case derived from client_test.c: test_selecttmp() +--disable_warnings +drop table if exists t5, t6, t7 ; +--enable_warnings +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), + (2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +let $1= 3 ; +while ($1) +{ + execute stmt1 ; + dec $1 ; +} +drop table t5, t6, t7 ; + + ###### heavy modified case derived from client_test.c: test_distinct() -## no parameters --disable_warnings drop table if exists t2 ; --enable_warnings -create table t2 as select * from t_many_col_types; -#insert into t2 select * from t_many_col_types; +create table t2 as select * from t9; +## unusual and complex SELECT without parameters set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; --enable_metadata prepare stmt1 from @stmt ; execute stmt1 ; --disable_metadata execute stmt1 ; +## now expand the terrible SELECT to EXPLAIN SELECT set @stmt= concat('explain ',@stmt); --enable_metadata prepare stmt1 from @stmt ; execute stmt1 ; --disable_metadata +# Bug#4271 prepared explain complex select, second executes crashes the server execute stmt1 ; ## many parameters +## replace the constants of the complex SELECT with parameters set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -459,6 +579,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, --disable_metadata execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; +## now expand the terrible SELECT to EXPLAIN SELECT set @stmt= concat('explain ',@stmt); --enable_metadata prepare stmt1 from @stmt ; @@ -470,6 +591,17 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, drop table t2 ; +##### test case derived from client_test.c: test_bug4079() +--error 1242 +select 1 < (select a from t1) ; +prepare stmt1 from ' select 1 < (select a from t1) ' ; +--error 1242 +execute stmt1 ; +# Bug#5066 embedded server, select after failed subquery provides wrong result +# (two additional records, all column values NULL) +select 1 as my_col ; + +################ union tests ################ --disable_query_log select '------ union tests ------' as test_sequence ; --enable_query_log @@ -485,6 +617,16 @@ prepare stmt1 from ' select a FROM t1 where a=1 union all select a FROM t1 where a=1 '; execute stmt1 ; +# test case derived from client_test.c: test_bad_union() +--error 1222 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +--error 1222 +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +--error 1222 +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +--error 1222 +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; + ##### everything in the first table # one parameter as constant in the first table @@ -612,10 +754,13 @@ prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +################ explain select tests ################ --disable_query_log select '------ explain select tests ------' as test_sequence ; --enable_query_log -prepare stmt1 from ' select * from t_many_col_types ' ; +--disable_metadata +# table with many column types +prepare stmt1 from ' explain select * from t9 ' ; --enable_metadata execute stmt1; --disable_metadata diff --git a/mysql-test/include/ps_renew.inc b/mysql-test/include/ps_renew.inc index 1441638f257..f50b5d58485 100644 --- a/mysql-test/include/ps_renew.inc +++ b/mysql-test/include/ps_renew.inc @@ -1,6 +1,6 @@ ################ include/ps_renew.inc ################# # # -# renew the content of t1 and t_many_col_types # +# renew the content of t1 and t9 # # # ####################################################### @@ -13,8 +13,8 @@ insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -23,7 +23,7 @@ set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -32,3 +32,4 @@ set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 2561caa3759..756ccd4d609 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,13 +1,13 @@ use test; test_sequence ------ basic tests ------ -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'MYISAM' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -26,8 +26,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -36,7 +36,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -45,6 +45,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; PREPARE stmt FROM ' select * from t1 where a = ? ' ; SET @var= 2 ; EXECUTE stmt USING @var ; @@ -85,6 +86,10 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp prepare stmt1 from ' select * from t1 where a <= 2 ' ; prepare stmt1 from ' select * from t1 where x <= 2 ' ; ERROR 42S22: Unknown column 'x' in 'where clause' +prepare stmt1 from ' insert into t1(a,x) values(?,?) ' ; +ERROR 42S22: Unknown column 'x' in 'field list' +prepare stmt1 from ' insert into t1(x,a) values(?,?) ' ; +ERROR 42S22: Unknown column 'x' in 'field list' drop table if exists not_exist ; prepare stmt1 from ' select * from not_exist where a <= 2 ' ; ERROR 42S02: Table 'test.not_exist' doesn't exist @@ -100,87 +105,87 @@ prepare stmt1 from ' select * from not_exist where a <= 2 ' ; ERROR 42S02: Table 'test.not_exist' doesn't exist execute stmt1 ; ERROR HY000: Unknown prepared statement handler (stmt1) given to EXECUTE -create table to_be_dropped +create table t5 ( a int primary key, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 1, 'original table', 1); -prepare stmt2 from ' select * from to_be_dropped ' ; +insert into t5( a, b, c) values( 1, 'original table', 1); +prepare stmt2 from ' select * from t5 ' ; execute stmt2 ; a b c 1 original table 1 -drop table to_be_dropped ; +drop table t5 ; execute stmt2 ; -ERROR 42S02: Table 'test.to_be_dropped' doesn't exist -create table to_be_dropped +ERROR 42S02: Table 'test.t5' doesn't exist +create table t5 ( a int primary key, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; a b c 9 recreated table 9 -drop table to_be_dropped ; -create table to_be_dropped +drop table t5 ; +create table t5 ( a int primary key, c int, b char(30) ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; a b c 9 recreated table 9 -drop table to_be_dropped ; -create table to_be_dropped +drop table t5 ; +create table t5 ( a int primary key, b char(30), c int, d timestamp default current_timestamp ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; a b c 9 recreated table 9 -drop table to_be_dropped ; -create table to_be_dropped +drop table t5 ; +create table t5 ( a int primary key, d timestamp default current_timestamp, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; a b c 9 recreated table 9 -drop table to_be_dropped ; -create table to_be_dropped +drop table t5 ; +create table t5 ( a timestamp default '2004-02-29 18:01:59', b char(30), c int ); -insert into to_be_dropped( b, c) values( 'recreated table', 9); +insert into t5( b, c) values( 'recreated table', 9); execute stmt2 ; a b c 2004-02-29 18:01:59 recreated table 9 -drop table to_be_dropped ; -create table to_be_dropped +drop table t5 ; +create table t5 ( f1 int primary key, f2 char(30), f3 int ); -insert into to_be_dropped( f1, f2, f3) values( 9, 'recreated table', 9); +insert into t5( f1, f2, f3) values( 9, 'recreated table', 9); execute stmt2 ; -ERROR 42S22: Unknown column 'to_be_dropped.a' in 'field list' -drop table to_be_dropped ; +ERROR 42S22: Unknown column 't5.a' in 'field list' +drop table t5 ; prepare stmt1 from ' select * from t1 where a <= 2 ' ; execute stmt1 ; a b @@ -205,13 +210,13 @@ prepare stmt1 from ' select * from not_exist where a <= 2 ' ; ERROR 42S02: Table 'test.not_exist' doesn't exist deallocate prepare stmt1; ERROR HY000: Unknown prepared statement handler (stmt1) given to DEALLOCATE PREPARE -create table to_be_dropped +create table t5 ( a int primary key, b char(10) ); -prepare stmt2 from ' select a,b from to_be_dropped where a <= 2 ' ; -drop table to_be_dropped ; +prepare stmt2 from ' select a,b from t5 where a <= 2 ' ; +drop table t5 ; deallocate prepare stmt2; prepare stmt1 from ' select a from t1 where a <= 2 ' ; prepare stmt2 from ' select b from t1 where a <= 2 ' ; @@ -268,10 +273,10 @@ prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; 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 t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL -prepare stmt4 from ' show table status from test like ''t_many_col_types%'' '; +prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; 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 -t_many_col_types MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value @@ -318,14 +323,65 @@ NDB YES/NO Alias for NDBCLUSTER EXAMPLE YES/NO Example storage engine ARCHIVE YES/NO Archive storage engine CSV YES/NO CSV storage engine -drop table if exists tx; -prepare stmt1 from ' drop table if exists tx ' ; +drop table if exists t5; +prepare stmt1 from ' drop table if exists t5 ' ; execute stmt1 ; Warnings: -Note 1051 Unknown table 'tx' -prepare stmt1 from ' drop table tx ' ; +Note 1051 Unknown table 't5' +prepare stmt1 from ' drop table t5 ' ; +execute stmt1 ; +ERROR 42S02: Unknown table 't5' +prepare stmt1 from ' SELECT @@version ' ; execute stmt1 ; -ERROR 42S02: Unknown table 'tx' +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @@VERSION 254 102 34 N 1 31 8 +@@VERSION + +prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ; +prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ; +execute stmt_do ; +content of @var is: +1 +execute stmt_set ; +content of @var is: +1 +execute stmt_do ; +content of @var is: +1 +execute stmt_set ; +content of @var is: +1 +execute stmt_do ; +content of @var is: +1 +execute stmt_set ; +content of @var is: +1 +drop table if exists t5 ; +create table t5 (a int) ; +prepare stmt_do from ' do @var:= (1 in (select a from t5)) ' ; +prepare stmt_set from ' set @var= (1 in (select a from t5)) ' ; +execute stmt_do ; +content of @var is: +0 +execute stmt_set ; +content of @var is: +0 +execute stmt_do ; +content of @var is: +0 +execute stmt_set ; +content of @var is: +0 +execute stmt_do ; +content of @var is: +0 +execute stmt_set ; +content of @var is: +0 +drop table t5 ; +deallocate prepare stmt_do ; +deallocate prepare stmt_set ; prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ; 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 '' select 1 '' at line 1 prepare stmt1 from ' execute stmt2 ' ; @@ -441,6 +497,38 @@ def rows 8 10 1 N 32801 0 8 def Extra 253 255 27 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort +drop table if exists t2; +create table t2 (id smallint, name varchar(20)) ; +prepare stmt1 from ' insert into t2 values(?, ?) ' ; +set @id= 9876 ; +set @arg00= 'MySQL - Open Source Database' ; +set @arg01= "'" ; +set @arg02= '"' ; +set @arg03= "my'sql'" ; +set @arg04= 'my"sql"' ; +insert into t2 values ( @id , @arg00 ); +Warnings: +Warning 1265 Data truncated for column 'name' at row 1 +insert into t2 values ( @id , @arg01 ); +insert into t2 values ( @id , @arg02 ); +insert into t2 values ( @id , @arg03 ); +insert into t2 values ( @id , @arg04 ); +prepare stmt1 from ' select * from t2 where id= ? and name= ? '; +execute stmt1 using @id, @arg00 ; +id name +execute stmt1 using @id, @arg01 ; +id name +9876 ' +execute stmt1 using @id, @arg02 ; +id name +9876 " +execute stmt1 using @id, @arg03 ; +id name +9876 my'sql' +execute stmt1 using @id, @arg04 ; +id name +9876 my"sql" +drop table t2; test_sequence ------ create/drop/alter/rename tests ------ drop table if exists t2, t3; @@ -472,9 +560,21 @@ execute stmt3; ERROR 42S01: Table 'new_t2' already exists rename table new_t2 to t2; drop table t2; +drop table if exists t5, t6, t7, t8 ; +prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; +create table t5 (a int) ; +execute stmt1 ; +ERROR HY000: Can't find file: './test/t7.frm' (errno: 2) +create table t7 (a int) ; +execute stmt1 ; +execute stmt1 ; +ERROR 42S01: Table 't6' already exists +rename table t6 to t5, t8 to t7 ; +execute stmt1 ; +drop table t6, t8 ; test_sequence ------ big statement tests ------ -select 'ABC' as my_const_col from t1 where +(select 'ABC' as my_const_col from t1 where 1 = 1 AND 1 = 1 AND 1 = 1 AND @@ -523,13 +623,13 @@ select 'ABC' as my_const_col from t1 where 1 = 1 AND 1 = 1 AND 1 = 1 AND -1 = 1 ; +1 = 1 ) ; my_const_col ABC ABC ABC ABC -prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE +prepare stmt1 from "select 'ABC' as my_const_col from t1 where 1 = 1 AND 1 = 1 AND 1 = 1 AND @@ -578,7 +678,7 @@ prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE 1 = 1 AND 1 = 1 AND 1 = 1 AND -1 = 1 ' ; +1 = 1 " ; execute stmt1 ; my_const_col ABC @@ -591,7 +691,7 @@ ABC ABC ABC ABC -select 'ABC' as my_const_col FROM t1 WHERE +(select 'ABC' as my_const_col FROM t1 WHERE '1234567890123456789012345678901234567890123456789012345678901234567890' = '1234567890123456789012345678901234567890123456789012345678901234567890' AND '1234567890123456789012345678901234567890123456789012345678901234567890' @@ -609,31 +709,31 @@ select 'ABC' as my_const_col FROM t1 WHERE '1234567890123456789012345678901234567890123456789012345678901234567890' = '1234567890123456789012345678901234567890123456789012345678901234567890' AND '1234567890123456789012345678901234567890123456789012345678901234567890' -= '1234567890123456789012345678901234567890123456789012345678901234567890' ; += '1234567890123456789012345678901234567890123456789012345678901234567890' ) ; my_const_col ABC ABC ABC ABC -prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' '; +prepare stmt1 from "select 'ABC' as my_const_col FROM t1 WHERE +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' AND +'1234567890123456789012345678901234567890123456789012345678901234567890' += '1234567890123456789012345678901234567890123456789012345678901234567890' " ; execute stmt1 ; my_const_col ABC @@ -646,56 +746,6 @@ ABC ABC ABC ABC -set @arg00= 1; -set @arg01= 1; -set @arg02= 1; -set @arg03= 1; -set @arg04= 1; -set @arg05= 1; -set @arg06= 1; -set @arg07= 1; -set @arg10= 1; -set @arg11= 1; -set @arg12= 1; -set @arg13= 1; -set @arg14= 1; -set @arg15= 1; -set @arg16= 1; -set @arg17= 1; -set @arg20= 1; -set @arg21= 1; -set @arg22= 1; -set @arg23= 1; -set @arg24= 1; -set @arg25= 1; -set @arg26= 1; -set @arg27= 1; -set @arg30= 1; -set @arg31= 1; -set @arg32= 1; -set @arg33= 1; -set @arg34= 1; -set @arg35= 1; -set @arg36= 1; -set @arg37= 1; -set @arg40= 1; -set @arg41= 1; -set @arg42= 1; -set @arg43= 1; -set @arg44= 1; -set @arg45= 1; -set @arg46= 1; -set @arg47= 1; -set @arg50= 1; -set @arg51= 1; -set @arg52= 1; -set @arg53= 1; -set @arg54= 1; -set @arg55= 1; -set @arg56= 1; -set @arg57= 1; -set @arg60= 1; -set @arg61= 1; select 'ABC' as my_const_col FROM t1 WHERE @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @@ -743,4 +793,92 @@ ABC ABC ABC ABC +drop table if exists t5 ; +set @col_num= 1000 ; +select @string as "" ; + +create table t5( c999 int,c998 int,c997 int,c996 int,c995 int,c994 int,c993 int,c992 int,c991 int,c990 int,c989 int,c988 int,c987 int,c986 int,c985 int,c984 int,c983 int,c982 int,c981 int,c980 int,c979 int,c978 int,c977 int,c976 int,c975 int,c974 int,c973 int,c972 int,c971 int,c970 int,c969 int,c968 int,c967 int,c966 int,c965 int,c964 int,c963 int,c962 int,c961 int,c960 int,c959 int,c958 int,c957 int,c956 int,c955 int,c954 int,c953 int,c952 int,c951 int,c950 int,c949 int,c948 int,c947 int,c946 int,c945 int,c944 int,c943 int,c942 int,c941 int,c940 int,c939 int,c938 int,c937 int,c936 int,c935 int,c934 int,c933 int,c932 int,c931 int,c930 int,c929 int,c928 int,c927 int,c926 int,c925 int,c924 int,c923 int,c922 int,c921 int,c920 int,c919 int,c918 int,c917 int,c916 int,c915 int,c914 int,c913 int,c912 int,c911 int,c910 int,c909 int,c908 int,c907 int,c906 int,c905 int,c904 int,c903 int,c902 int,c901 int,c900 int,c899 int,c898 int,c897 int,c896 int,c895 int,c894 int,c893 int,c892 int,c891 int,c890 int,c889 int,c888 int,c887 int,c886 int,c885 int,c884 int,c883 int,c882 int,c881 int,c880 int,c879 int,c878 int,c877 int,c876 int,c875 int,c874 int,c873 int,c872 int,c871 int,c870 int,c869 int,c868 int,c867 int,c866 int,c865 int,c864 int,c863 int,c862 int,c861 int,c860 int,c859 int,c858 int,c857 int,c856 int,c855 int,c854 int,c853 int,c852 int,c851 int,c850 int,c849 int,c848 int,c847 int,c846 int,c845 int,c844 int,c843 int,c842 int,c841 int,c840 int,c839 int,c838 int,c837 int,c836 int,c835 int,c834 int,c833 int,c832 int,c831 int,c830 int,c829 int,c828 int,c827 int,c826 int,c825 int,c824 int,c823 int,c822 int,c821 int,c820 int,c819 int,c818 int,c817 int,c816 int,c815 int,c814 int,c813 int,c812 int,c811 int,c810 int,c809 int,c808 int,c807 int,c806 int,c805 int,c804 int,c803 int,c802 int,c801 int,c800 int,c799 int,c798 int,c797 int,c796 int,c795 int,c794 int,c793 int,c792 int,c791 int,c790 int,c789 int,c788 int,c787 int,c786 int,c785 int,c784 int,c783 int,c782 int,c781 int,c780 int,c779 int,c778 int,c777 int,c776 int,c775 int,c774 int,c773 int,c772 int,c771 int,c770 int,c769 int,c768 int,c767 int,c766 int,c765 int,c764 int,c763 int,c762 int,c761 int,c760 int,c759 int,c758 int,c757 int,c756 int,c755 int,c754 int,c753 int,c752 int,c751 int,c750 int,c749 int,c748 int,c747 int,c746 int,c745 int,c744 int,c743 int,c742 int,c741 int,c740 int,c739 int,c738 int,c737 int,c736 int,c735 int,c734 int,c733 int,c732 int,c731 int,c730 int,c729 int,c728 int,c727 int,c726 int,c725 int,c724 int,c723 int,c722 int,c721 int,c720 int,c719 int,c718 int,c717 int,c716 int,c715 int,c714 int,c713 int,c712 int,c711 int,c710 int,c709 int,c708 int,c707 int,c706 int,c705 int,c704 int,c703 int,c702 int,c701 int,c700 int,c699 int,c698 int,c697 int,c696 int,c695 int,c694 int,c693 int,c692 int,c691 int,c690 int,c689 int,c688 int,c687 int,c686 int,c685 int,c684 int,c683 int,c682 int,c681 int,c680 int,c679 int,c678 int,c677 int,c676 int,c675 int,c674 int,c673 int,c672 int,c671 int,c670 int,c669 int,c668 int,c667 int,c666 int,c665 int,c664 int,c663 int,c662 int,c661 int,c660 int,c659 int,c658 int,c657 int,c656 int,c655 int,c654 int,c653 int,c652 int,c651 int,c650 int,c649 int,c648 int,c647 int,c646 int,c645 int,c644 int,c643 int,c642 int,c641 int,c640 int,c639 int,c638 int,c637 int,c636 int,c635 int,c634 int,c633 int,c632 int,c631 int,c630 int,c629 int,c628 int,c627 int,c626 int,c625 int,c624 int,c623 int,c622 int,c621 int,c620 int,c619 int,c618 int,c617 int,c616 int,c615 int,c614 int,c613 int,c612 int,c611 int,c610 int,c609 int,c608 int,c607 int,c606 int,c605 int,c604 int,c603 int,c602 int,c601 int,c600 int,c599 int,c598 int,c597 int,c596 int,c595 int,c594 int,c593 int,c592 int,c591 int,c590 int,c589 int,c588 int,c587 int,c586 int,c585 int,c584 int,c583 int,c582 int,c581 int,c580 int,c579 int,c578 int,c577 int,c576 int,c575 int,c574 int,c573 int,c572 int,c571 int,c570 int,c569 int,c568 int,c567 int,c566 int,c565 int,c564 int,c563 int,c562 int,c561 int,c560 int,c559 int,c558 int,c557 int,c556 int,c555 int,c554 int,c553 int,c552 int,c551 int,c550 int,c549 int,c548 int,c547 int,c546 int,c545 int,c544 int,c543 int,c542 int,c541 int,c540 int,c539 int,c538 int,c537 int,c536 int,c535 int,c534 int,c533 int,c532 int,c531 int,c530 int,c529 int,c528 int,c527 int,c526 int,c525 int,c524 int,c523 int,c522 int,c521 int,c520 int,c519 int,c518 int,c517 int,c516 int,c515 int,c514 int,c513 int,c512 int,c511 int,c510 int,c509 int,c508 int,c507 int,c506 int,c505 int,c504 int,c503 int,c502 int,c501 int,c500 int,c499 int,c498 int,c497 int,c496 int,c495 int,c494 int,c493 int,c492 int,c491 int,c490 int,c489 int,c488 int,c487 int,c486 int,c485 int,c484 int,c483 int,c482 int,c481 int,c480 int,c479 int,c478 int,c477 int,c476 int,c475 int,c474 int,c473 int,c472 int,c471 int,c470 int,c469 int,c468 int,c467 int,c466 int,c465 int,c464 int,c463 int,c462 int,c461 int,c460 int,c459 int,c458 int,c457 int,c456 int,c455 int,c454 int,c453 int,c452 int,c451 int,c450 int,c449 int,c448 int,c447 int,c446 int,c445 int,c444 int,c443 int,c442 int,c441 int,c440 int,c439 int,c438 int,c437 int,c436 int,c435 int,c434 int,c433 int,c432 int,c431 int,c430 int,c429 int,c428 int,c427 int,c426 int,c425 int,c424 int,c423 int,c422 int,c421 int,c420 int,c419 int,c418 int,c417 int,c416 int,c415 int,c414 int,c413 int,c412 int,c411 int,c410 int,c409 int,c408 int,c407 int,c406 int,c405 int,c404 int,c403 int,c402 int,c401 int,c400 int,c399 int,c398 int,c397 int,c396 int,c395 int,c394 int,c393 int,c392 int,c391 int,c390 int,c389 int,c388 int,c387 int,c386 int,c385 int,c384 int,c383 int,c382 int,c381 int,c380 int,c379 int,c378 int,c377 int,c376 int,c375 int,c374 int,c373 int,c372 int,c371 int,c370 int,c369 int,c368 int,c367 int,c366 int,c365 int,c364 int,c363 int,c362 int,c361 int,c360 int,c359 int,c358 int,c357 int,c356 int,c355 int,c354 int,c353 int,c352 int,c351 int,c350 int,c349 int,c348 int,c347 int,c346 int,c345 int,c344 int,c343 int,c342 int,c341 int,c340 int,c339 int,c338 int,c337 int,c336 int,c335 int,c334 int,c333 int,c332 int,c331 int,c330 int,c329 int,c328 int,c327 int,c326 int,c325 int,c324 int,c323 int,c322 int,c321 int,c320 int,c319 int,c318 int,c317 int,c316 int,c315 int,c314 int,c313 int,c312 int,c311 int,c310 int,c309 int,c308 int,c307 int,c306 int,c305 int,c304 int,c303 int,c302 int,c301 int,c300 int,c299 int,c298 int,c297 int,c296 int,c295 int,c294 int,c293 int,c292 int,c291 int,c290 int,c289 int,c288 int,c287 int,c286 int,c285 int,c284 int,c283 int,c282 int,c281 int,c280 int,c279 int,c278 int,c277 int,c276 int,c275 int,c274 int,c273 int,c272 int,c271 int,c270 int,c269 int,c268 int,c267 int,c266 int,c265 int,c264 int,c263 int,c262 int,c261 int,c260 int,c259 int,c258 int,c257 int,c256 int,c255 int,c254 int,c253 int,c252 int,c251 int,c250 int,c249 int,c248 int,c247 int,c246 int,c245 int,c244 int,c243 int,c242 int,c241 int,c240 int,c239 int,c238 int,c237 int,c236 int,c235 int,c234 int,c233 int,c232 int,c231 int,c230 int,c229 int,c228 int,c227 int,c226 int,c225 int,c224 int,c223 int,c222 int,c221 int,c220 int,c219 int,c218 int,c217 int,c216 int,c215 int,c214 int,c213 int,c212 int,c211 int,c210 int,c209 int,c208 int,c207 int,c206 int,c205 int,c204 int,c203 int,c202 int,c201 int,c200 int,c199 int,c198 int,c197 int,c196 int,c195 int,c194 int,c193 int,c192 int,c191 int,c190 int,c189 int,c188 int,c187 int,c186 int,c185 int,c184 int,c183 int,c182 int,c181 int,c180 int,c179 int,c178 int,c177 int,c176 int,c175 int,c174 int,c173 int,c172 int,c171 int,c170 int,c169 int,c168 int,c167 int,c166 int,c165 int,c164 int,c163 int,c162 int,c161 int,c160 int,c159 int,c158 int,c157 int,c156 int,c155 int,c154 int,c153 int,c152 int,c151 int,c150 int,c149 int,c148 int,c147 int,c146 int,c145 int,c144 int,c143 int,c142 int,c141 int,c140 int,c139 int,c138 int,c137 int,c136 int,c135 int,c134 int,c133 int,c132 int,c131 int,c130 int,c129 int,c128 int,c127 int,c126 int,c125 int,c124 int,c123 int,c122 int,c121 int,c120 int,c119 int,c118 int,c117 int,c116 int,c115 int,c114 int,c113 int,c112 int,c111 int,c110 int,c109 int,c108 int,c107 int,c106 int,c105 int,c104 int,c103 int,c102 int,c101 int,c100 int,c99 int,c98 int,c97 int,c96 int,c95 int,c94 int,c93 int,c92 int,c91 int,c90 int,c89 int,c88 int,c87 int,c86 int,c85 int,c84 int,c83 int,c82 int,c81 int,c80 int,c79 int,c78 int,c77 int,c76 int,c75 int,c74 int,c73 int,c72 int,c71 int,c70 int,c69 int,c68 int,c67 int,c66 int,c65 int,c64 int,c63 int,c62 int,c61 int,c60 int,c59 int,c58 int,c57 int,c56 int,c55 int,c54 int,c53 int,c52 int,c51 int,c50 int,c49 int,c48 int,c47 int,c46 int,c45 int,c44 int,c43 int,c42 int,c41 int,c40 int,c39 int,c38 int,c37 int,c36 int,c35 int,c34 int,c33 int,c32 int,c31 int,c30 int,c29 int,c28 int,c27 int,c26 int,c25 int,c24 int,c23 int,c22 int,c21 int,c20 int,c19 int,c18 int,c17 int,c16 int,c15 int,c14 int,c13 int,c12 int,c11 int,c10 int,c9 int,c8 int,c7 int,c6 int,c5 int,c4 int,c3 int,c2 int,c1 int,c0 int) +prepare stmt1 from @string ; +execute stmt1 ; +select @string as "" ; + +insert into t5 values(1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ) +prepare stmt1 from @string ; +execute stmt1 ; +prepare stmt1 from ' select * from t5 ' ; +execute stmt1 ; +drop table t5 ; +test_sequence +------ grant/revoke/drop affects a parallel session test ------ +show grants for second_user@localhost ; +ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' +grant usage on test.* to second_user@localhost +identified by 'looser' ; +grant select on test.t9 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +select current_user(); +current_user() +second_user@localhost +show grants for current_user(); +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +prepare s_t9 from 'select c1 as my_col + from t9 where c1= 1' ; +execute s_t9 ; +my_col +1 +select a as my_col from t1; +ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +grant select on test.t1 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +drop table t9 ; +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +prepare s_t1 from 'select a as my_col from t1' ; +execute s_t1 ; +my_col +1 +2 +3 +4 +execute s_t9 ; +ERROR 42S02: Table 'test.t9' doesn't exist +revoke all privileges on test.t1 from second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +execute s_t1 ; +ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +revoke all privileges, grant option from second_user@localhost ; +show grants for second_user@localhost ; +Grants for second_user@localhost +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +drop user second_user@localhost ; +commit ; +show grants for second_user@localhost ; +ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' drop table t1 ; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 13b54973b8d..ee861b257ea 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1,11 +1,11 @@ use test; -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'MYISAM' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -24,8 +24,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -34,7 +34,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -43,8 +43,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -80,6 +119,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -168,12 +229,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -181,11 +242,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -197,7 +258,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -255,6 +316,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -268,6 +337,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -421,6 +515,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -481,6 +776,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -540,16 +853,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -575,7 +930,7 @@ execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -584,7 +939,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -593,7 +948,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -601,13 +956,13 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -646,7 +1001,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -655,7 +1010,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -665,7 +1020,7 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -673,6 +1028,14 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -691,6 +1054,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -855,44 +1226,38 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 -def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 -def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 -def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 -def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +drop table if exists t2 ; +create table t2 (s varchar(25), fulltext(s)) +ENGINE = 'MYISAM' ; +insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ; +commit ; +prepare stmt1 from ' select s from t2 where match (s) against (?) ' ; +set @arg00='Dogs' ; +execute stmt1 using @arg00 ; +s +Hollow Dogs +prepare stmt1 from ' SELECT s FROM t2 +where match (s) against (concat(?,''digger'')) '; +set @arg00='Grave' ; +execute stmt1 using @arg00 ; +s +Gravedigger +drop table t2 ; test_sequence ------ delete tests ------ delete from t1 ; @@ -901,8 +1266,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -911,7 +1276,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -920,6 +1285,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -946,8 +1312,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -956,7 +1322,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -965,6 +1331,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -1041,6 +1408,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -1048,7 +1417,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1075,8 +1474,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1085,7 +1484,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1094,6 +1493,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -1120,6 +1520,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -1159,6 +1620,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -1192,6 +1666,75 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; @@ -1241,17 +1784,12 @@ union select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1265,17 +1803,1406 @@ select b, a + ? from t1 where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b from t1 ) ' ; execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three drop table t2; -drop table t1, t_many_col_types; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 17e56b8e001..33b793d91e6 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1,11 +1,11 @@ use test; -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'InnoDB' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -24,8 +24,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -34,7 +34,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -43,8 +43,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -80,6 +119,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -168,12 +229,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -181,11 +242,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -197,7 +258,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -255,6 +316,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -268,6 +337,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -421,6 +515,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -481,6 +776,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -540,16 +853,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -575,7 +930,7 @@ execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -584,7 +939,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -593,7 +948,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -601,13 +956,13 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -646,7 +1001,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -655,7 +1010,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -665,7 +1020,7 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -673,6 +1028,14 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -691,6 +1054,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -855,44 +1226,21 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 -def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 -def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 -def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 -def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence ------ delete tests ------ delete from t1 ; @@ -901,8 +1249,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -911,7 +1259,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -920,6 +1268,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -946,8 +1295,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -956,7 +1305,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -965,6 +1314,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -1041,6 +1391,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -1048,7 +1400,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'InnoDB' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1075,8 +1457,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1085,7 +1467,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1094,6 +1476,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -1120,6 +1503,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -1159,6 +1603,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'InnoDB' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -1192,6 +1649,75 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; @@ -1241,17 +1767,12 @@ union select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1265,17 +1786,1406 @@ select b, a + ? from t1 where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b from t1 ) ' ; execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three drop table t2; -drop table t1, t_many_col_types; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index afca7c9f143..b2d01af019f 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1,12 +1,12 @@ use test; -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'HEAP' ; -drop table if exists t_many_col_types; -create table t_many_col_types +drop table if exists t9; +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -25,8 +25,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -35,7 +35,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -44,8 +44,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 253 100 8 Y 0 0 8 +def test t9 t9 c24 c24 253 100 8 Y 0 0 8 +def test t9 t9 c25 c25 253 100 4 Y 0 0 8 +def test t9 t9 c26 c26 253 100 4 Y 0 0 8 +def test t9 t9 c27 c27 253 100 10 Y 0 0 8 +def test t9 t9 c28 c28 253 100 10 Y 0 0 8 +def test t9 t9 c29 c29 253 100 8 Y 0 0 8 +def test t9 t9 c30 c30 253 100 8 Y 0 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -81,6 +120,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -169,12 +230,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -182,11 +243,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -198,7 +259,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -256,6 +317,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -269,6 +338,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -422,6 +516,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -482,6 +777,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -541,16 +854,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -576,7 +931,7 @@ execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -585,7 +940,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -594,7 +949,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -602,13 +957,13 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -647,7 +1002,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -656,7 +1011,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -666,7 +1021,7 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -674,6 +1029,14 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -692,6 +1055,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -856,44 +1227,21 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 253 100 8 Y 0 0 8 -def test t_many_col_types t_many_col_types c24 c24 253 100 8 Y 0 0 8 -def test t_many_col_types t_many_col_types c25 c25 253 100 4 Y 0 0 8 -def test t_many_col_types t_many_col_types c26 c26 253 100 4 Y 0 0 8 -def test t_many_col_types t_many_col_types c27 c27 253 100 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c28 c28 253 100 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c29 c29 253 100 8 Y 0 0 8 -def test t_many_col_types t_many_col_types c30 c30 253 100 8 Y 0 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence ------ delete tests ------ delete from t1 ; @@ -902,8 +1250,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -912,7 +1260,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -921,6 +1269,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -947,8 +1296,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -957,7 +1306,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -966,6 +1315,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -1042,6 +1392,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -1049,7 +1401,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'HEAP' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1076,8 +1458,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1086,7 +1468,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1095,6 +1477,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -1121,6 +1504,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -1160,6 +1604,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'HEAP' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -1193,6 +1650,75 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; @@ -1242,17 +1768,12 @@ union select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1266,17 +1787,1406 @@ select b, a + ? from t1 where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b from t1 ) ' ; execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three drop table t2; -drop table t1, t_many_col_types; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50 50 50 50 50 50 50 50 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52 52 52 52 52 52 52 52 +53 5 53 53 53 53 53 53 53 53 53 53 +54 5 54 54 54 54 54 54 54 54 54 54 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index cb894df53d2..125fa84e671 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1,13 +1,13 @@ use test; drop table if exists t1, t1_1, t1_2, -t_many_col_types, t_many_col_types_1, t_many_col_types_2; -drop table if exists t1, t_many_col_types ; +t9, t9_1, t9_2; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'MYISAM' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -20,14 +20,14 @@ c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) ) engine = 'MYISAM' ; -rename table t1 to t1_1, t_many_col_types to t_many_col_types_1 ; -drop table if exists t1, t_many_col_types ; +rename table t1 to t1_1, t9 to t9_1 ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'MYISAM' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -40,14 +40,14 @@ c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) ) engine = 'MYISAM' ; -rename table t1 to t1_2, t_many_col_types to t_many_col_types_2 ; +rename table t1 to t1_2, t9 to t9_2 ; create table t1 ( a int, b varchar(30), primary key(a) ) ENGINE = MERGE UNION=(t1_1,t1_2) INSERT_METHOD=FIRST; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -59,7 +59,7 @@ c25 blob, c26 text, c27 mediumblob, c28 mediumtext, c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) -) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +) ENGINE = MERGE UNION=(t9_1,t9_2) INSERT_METHOD=FIRST; delete from t1 ; insert into t1 values (1,'one'); @@ -67,8 +67,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -77,7 +77,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -86,8 +86,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -123,6 +162,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -211,12 +272,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -224,11 +285,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -240,7 +301,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -298,6 +359,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -311,6 +380,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -464,6 +558,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -524,6 +819,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -583,16 +896,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -618,7 +973,7 @@ execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -627,7 +982,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -636,7 +991,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -644,13 +999,13 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -689,7 +1044,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -698,7 +1053,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -708,7 +1063,7 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -716,6 +1071,14 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -734,6 +1097,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -898,44 +1269,21 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 -def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 -def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 -def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 -def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence ------ delete tests ------ delete from t1 ; @@ -944,8 +1292,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -954,7 +1302,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -963,6 +1311,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -989,8 +1338,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -999,7 +1348,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1008,6 +1357,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -1084,6 +1434,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -1091,7 +1443,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1118,8 +1500,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1128,7 +1510,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1137,6 +1519,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -1163,6 +1546,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -1202,6 +1646,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -1235,14 +1692,1450 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet -drop table t1, t_many_col_types ; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) ENGINE = MERGE UNION=(t1_1,t1_2) INSERT_METHOD=LAST; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -1254,7 +3147,7 @@ c25 blob, c26 text, c27 mediumblob, c28 mediumtext, c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) -) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +) ENGINE = MERGE UNION=(t9_1,t9_2) INSERT_METHOD=LAST; delete from t1 ; insert into t1 values (1,'one'); @@ -1262,8 +3155,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1272,7 +3165,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1281,8 +3174,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -1318,6 +3250,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -1406,12 +3360,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -1419,11 +3373,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -1435,7 +3389,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -1493,6 +3447,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -1506,6 +3468,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -1659,6 +3646,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -1719,6 +3907,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -1778,16 +3984,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -1813,7 +4061,7 @@ execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -1822,7 +4070,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -1831,7 +4079,7 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -1839,13 +4087,13 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -1884,7 +4132,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -1893,7 +4141,7 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -1903,7 +4151,7 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -1911,6 +4159,14 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -1929,6 +4185,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -2093,44 +4357,21 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 -def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 -def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 -def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 -def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 test_sequence ------ delete tests ------ delete from t1 ; @@ -2139,8 +4380,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2149,7 +4390,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2158,6 +4399,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -2184,8 +4426,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2194,7 +4436,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2203,6 +4445,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -2279,6 +4522,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -2286,7 +4531,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -2313,8 +4588,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2323,7 +4598,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -2332,6 +4607,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -2358,6 +4634,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -2397,6 +4734,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -2430,5 +4780,1441 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found drop table t1, t1_1, t1_2, -t_many_col_types_1, t_many_col_types_2, t_many_col_types; +t9_1, t9_2, t9; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 0ff2025ee2a..88e4d701acf 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1,11 +1,11 @@ use test; -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) engine = 'BDB' ; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -24,8 +24,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -34,7 +34,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -43,8 +43,47 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; test_sequence ------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 @@ -80,6 +119,28 @@ prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; execute stmt1 using @arg00 ; b a - ? one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL set @arg00='MySQL' ; select substr(@arg00,1,2) from t1 where a=1 ; substr(@arg00,1,2) @@ -168,12 +229,12 @@ first NULL execute stmt1 using @arg02, @arg02 ; ? ? NULL NULL -drop table if exists new_tab ; -create table new_tab (id1 int(11) not null default '0', +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; -insert into new_tab values (1,'hh','hh'),(2,'hh','hh'), +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from new_tab where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -181,11 +242,11 @@ id1 value1 1 hh 2 hh 1 ii -drop table new_tab ; -drop table if exists new_tab ; -create table new_tab(session_id char(9) not null) ; -insert into new_tab values ('abc') ; -prepare stmt1 from ' select * from new_tab +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 where ?=''1111'' and session_id = ''abc'' ' ; set @arg00='abc' ; execute stmt1 using @arg00 ; @@ -197,7 +258,7 @@ abc set @arg00='abc' ; execute stmt1 using @arg00 ; session_id -drop table new_tab ; +drop table t5 ; set @arg00='FROM' ; select a @arg00 t1 where a=1 ; 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 '@arg00 t1 where a=1' at line 1 @@ -255,6 +316,14 @@ execute stmt1 using @arg00, @arg01; a 2 3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -268,6 +337,31 @@ set @arg00='%wo' ; execute stmt1 using @arg00 ; b two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; set @arg00='>' ; select a FROM t1 where a @arg00 1 ; 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 '@arg00 1' at line 1 @@ -421,6 +515,207 @@ a ? a 3 ABC 3 2 ABC 4 4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; test_sequence ------ subquery tests ------ prepare stmt1 from ' select a, b FROM t1 outer_table where @@ -481,6 +776,24 @@ a b 2 two 3 three 4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; set @arg00='two' ; select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; @@ -540,16 +853,58 @@ execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; a ? 0 1 drop table if exists t2 ; -create table t2 as select * from t_many_col_types; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; set @stmt= ' SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t_many_col_types.c2 - 0e-3) = t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t_many_col_types.c4) as exists_s, + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; @@ -560,22 +915,22 @@ def in_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8 scalar_s exists_s in_s in_row_s 2.0000 0 1 0 -18.0000 1 0 1 2.0000 0 1 0 18.0000 1 0 1 +18.0000 1 0 1 execute stmt1 ; scalar_s exists_s in_s in_row_s 2.0000 0 1 0 -18.0000 1 0 1 2.0000 0 1 0 18.0000 1 0 1 +18.0000 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -584,8 +939,8 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -593,21 +948,21 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t_many_col_types.c2-?)=t2.c2 - GROUP BY t_many_col_types.c15 LIMIT 1) as scalar_s, + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, exists (select ? from t2 - where t2.c3*?=t_many_col_types.c4) as exists_s, + where t2.c3*?=t9.c4) as exists_s, c5*? in (select c6+? from t2) as in_s, (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t_many_col_types, +FROM t9, (select c25 x, c32 y from t2) tt WHERE x =c25 ' ; set @arg00= 0.0 ; set @arg01= 0e-3 ; @@ -629,16 +984,16 @@ def in_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8 scalar_s exists_s in_s in_row_s 2 0 1 0 -18 1 0 1 2 0 1 0 18 1 0 1 +18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; scalar_s exists_s in_s in_row_s 2 0 1 0 -18 1 0 1 2 0 1 0 18 1 0 1 +18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @@ -646,7 +1001,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 def select_type 253 19 18 N 1 31 8 -def table 253 64 16 N 1 31 8 +def table 253 64 10 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 @@ -655,8 +1010,8 @@ def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -665,14 +1020,22 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY ALL NULL NULL NULL NULL 2 +1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 test_sequence ------ union tests ------ prepare stmt1 from ' select a FROM t1 where a=1 @@ -691,6 +1054,14 @@ execute stmt1 ; a 1 1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct @@ -855,44 +1226,21 @@ the_sum the_town 204 Lisboa test_sequence ------ explain select tests ------ -prepare stmt1 from ' select * from t_many_col_types ' ; +prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t_many_col_types t_many_col_types c1 c1 1 4 1 N 49155 0 63 -def test t_many_col_types t_many_col_types c2 c2 2 6 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c3 c3 9 9 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c4 c4 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c5 c5 3 11 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c6 c6 8 20 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c7 c7 4 12 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c8 c8 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c9 c9 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c10 c10 5 22 1 Y 32768 31 63 -def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63 -def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63 -def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63 -def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63 -def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63 -def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63 -def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c19 c19 1 1 1 Y 32768 0 63 -def test t_many_col_types t_many_col_types c20 c20 254 1 1 Y 0 0 8 -def test t_many_col_types t_many_col_types c21 c21 253 10 10 Y 0 0 8 -def test t_many_col_types t_many_col_types c22 c22 253 30 30 Y 0 0 8 -def test t_many_col_types t_many_col_types c23 c23 252 255 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c24 c24 252 255 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c25 c25 252 65535 4 Y 144 0 63 -def test t_many_col_types t_many_col_types c26 c26 252 65535 4 Y 16 0 8 -def test t_many_col_types t_many_col_types c27 c27 252 16777215 10 Y 144 0 63 -def test t_many_col_types t_many_col_types c28 c28 252 16777215 10 Y 16 0 8 -def test t_many_col_types t_many_col_types c29 c29 252 16777215 8 Y 144 0 63 -def test t_many_col_types t_many_col_types c30 c30 252 16777215 8 Y 16 0 8 -def test t_many_col_types t_many_col_types c31 c31 254 5 3 Y 256 0 8 -def test t_many_col_types t_many_col_types c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 3 test_sequence ------ delete tests ------ delete from t1 ; @@ -901,8 +1249,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -911,7 +1259,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -920,6 +1268,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -946,8 +1295,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -956,7 +1305,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -965,6 +1314,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; execute stmt1; select a,b from t1 where a=2; @@ -1041,6 +1391,8 @@ prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b 23 two @@ -1048,7 +1400,37 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'BDB' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1075,8 +1457,8 @@ insert into t1 values (2,'two'); insert into t1 values (3,'three'); insert into t1 values (4,'four'); commit ; -delete from t_many_col_types ; -insert into t_many_col_types +delete from t9 ; +insert into t9 set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, c10= 1, c11= 1, c12 = 1, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1085,7 +1467,7 @@ c18= 1, c19=true, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t_many_col_types +insert into t9 set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, c10= 9, c11= 9, c12 = 9, c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', @@ -1094,6 +1476,7 @@ c18= 1, c19=false, c20= 'a', c21= '123456789a', c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; prepare stmt1 from 'insert into t1 values(5, ''five'' )'; execute stmt1; select a,b from t1 where a = 5; @@ -1120,6 +1503,67 @@ execute stmt1 using @arg00, @arg01 ; select a,b from t1 where b = @arg01; a b 8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; set @arg00=81 ; set @arg01='8-1' ; set @arg02=82 ; @@ -1159,6 +1603,19 @@ set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'BDB' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; set @1000=1000 ; set @x1000_2="x1000_2" ; set @x1000_3="x1000_3" ; @@ -1192,6 +1649,75 @@ a b delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; @@ -1241,17 +1767,12 @@ union select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1265,17 +1786,1406 @@ select b, a + ? from t1 where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b from t1 ) ' ; execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 8 -info: Records: 8 Duplicates: 0 Warnings: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 select a,b from t2 order by a ; a b 3 duplicate 4 duplicate -7 duplicate -8 duplicate -9 duplicate -81 duplicate -82 duplicate 103 three drop table t2; -drop table t1, t_many_col_types; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result new file mode 100644 index 00000000000..eaadafdf339 --- /dev/null +++ b/mysql-test/r/ps_7ndb.result @@ -0,0 +1,3170 @@ +use test; +drop table if exists t1, t9 ; +create table t1 +( +a int not null, b varchar(30), +primary key(a) +) engine = 'NDB' ; +drop table if exists t9; +create table t9 +( +c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), +c25 char(100), c26 char(100), c27 char(100), c28 char(100), +c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'NDB' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 253 100 8 Y 0 0 8 +def test t9 t9 c24 c24 253 100 8 Y 0 0 8 +def test t9 t9 c25 c25 253 100 4 Y 0 0 8 +def test t9 t9 c26 c26 253 100 4 Y 0 0 8 +def test t9 t9 c27 c27 253 100 10 Y 0 0 8 +def test t9 t9 c28 c28 253 100 10 Y 0 0 8 +def test t9 t9 c29 c29 253 100 8 Y 0 0 8 +def test t9 t9 c30 c30 253 100 8 Y 0 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +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 '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 ; +a concat(@arg00,b) +2 MySQLtwo +4 MySQLfour +3 MySQLthree +1 MySQLone +prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +execute stmt1 using @arg00; +a concat(?,b) +2 MySQLtwo +4 MySQLfour +3 MySQLthree +1 MySQLone +select a , concat(b,@arg00) from t1 ; +a concat(b,@arg00) +2 twoMySQL +4 fourMySQL +3 threeMySQL +1 oneMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +execute stmt1 using @arg00; +a concat(b,?) +2 twoMySQL +4 fourMySQL +3 threeMySQL +1 oneMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b) from t1 +group by 'a' ; +group_concat(@arg00,b) +MySQLtwo,MySQLfour,MySQLthree,MySQLone +prepare stmt1 from ' select group_concat(?,b) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b) +MySQLtwo,MySQLfour,MySQLthree,MySQLone +select group_concat(b,@arg00) from t1 +group by 'a' ; +group_concat(b,@arg00) +twoMySQL,fourMySQL,threeMySQL,oneMySQL +prepare stmt1 from ' select group_concat(b,?) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,?) +twoMySQL,fourMySQL,threeMySQL,oneMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +2 hh +1 ii +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +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 '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +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 '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +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 '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +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 '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +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 '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +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 '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01); +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +two +one +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +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 '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +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 '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 ; +a b +4 four +3 three +1 one +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? ' ; +execute stmt1 using @arg00 ; +a b +4 four +3 three +1 one +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 +limit 1 '; +execute stmt1 ; +a b +2 two +prepare stmt1 from ' select a,b from t1 +limit ? '; +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 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a ; +a1 a2 +2 2 +4 4 +3 3 +1 1 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a '; +execute stmt1 ; +a1 a2 +2 2 +4 4 +3 3 +1 1 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; +set @query2= 'SELECT * FROM t2 natural join t1 ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 natural right join t1 +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 left join t1 using(a) +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 natural left join t1 +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 join t1 using(a) +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +the join statement is: +SELECT * FROM t2 natural join t1 +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +2 two +4 four +3 three +1 one +execute stmt1 ; +a b +2 two +4 four +3 three +1 one +execute stmt1 ; +a b +2 two +4 four +3 three +1 one +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +execute stmt1 ; +a b a b +2 two 2 two +4 four 4 four +3 three 3 three +1 one 1 one +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) '; +execute stmt1 ; +a b +2 two +4 four +3 three +1 one +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 21 7 Y 32768 4 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +execute stmt1 ; +scalar_s exists_s in_s in_row_s +18.0000 1 0 1 +2.0000 0 1 0 +18.0000 1 0 1 +2.0000 0 1 0 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 8 +def table 253 64 10 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 +1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 +1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def scalar_s 5 23 2 Y 32768 31 8 +def exists_s 8 1 1 N 32769 0 8 +def in_s 8 21 1 Y 32768 0 8 +def in_row_s 8 21 1 Y 32768 0 8 +scalar_s exists_s in_s in_row_s +18 1 0 1 +2 0 1 0 +18 1 0 1 +2 0 1 0 +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +scalar_s exists_s in_s in_row_s +18 1 0 1 +2 0 1 0 +18 1 0 1 +2 0 1 0 +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 18 N 1 31 8 +def table 253 64 10 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 44 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 +1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t9 ALL NULL NULL NULL NULL 2 +1 PRIMARY ALL NULL NULL NULL NULL 2 Using where +6 DERIVED t2 ALL NULL NULL NULL NULL 2 +5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 8 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 8 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +select a,b from t1 where a=@arg01; +a b +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +select a,b from t1 where a = @arg00 ; +a b +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 0 +info: Rows matched: 0 Changed: 0 Warnings: 0 +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int not null, b varchar(30), +primary key(a) +) engine = 'NDB' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +select a,b from t1 where a = @arg00 ; +a b +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 0 +info: Rows matched: 0 Changed: 0 Warnings: 0 +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +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 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +6 six +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'NDB' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_1 +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_1 +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_1 +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 order by a ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +drop table t2; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` char(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longblob, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +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 ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 128 31 63 +def @arg21 254 8192 0 Y 128 31 63 +def @arg22 254 8192 0 Y 128 31 63 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 128 31 63 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 128 31 63 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 128 31 63 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 128 31 63 +def @arg31 254 8192 0 Y 128 31 63 +def @arg32 254 8192 0 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +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 '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50 50 50 50 50 50 50 50 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52 52 52 52 52 52 52 52 +53 5 53 53 53 53 53 53 53 53 53 53 +54 5 54 54 54 54 54 54 54 54 54 54 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3 ; +found +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1.991e+3" ; +execute stmt1 ; +found +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +drop table t1, t9; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 084253a106a..dfdde884359 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -14,13 +14,13 @@ select '------ basic tests ------' as test_sequence ; --enable_query_log let $type= 'MYISAM' ; -# create the tables (t1 and t_many_col_types) used in many tests +# create the tables (t1 and t9) used in many tests --source include/ps_create.inc # insert data into these tables --source include/ps_renew.inc -##### The basic functions #### +################ The basic functions ################ # 1. PREPARE stmt_name FROM ; # ::= @@ -54,7 +54,7 @@ select * from t1 where a = @var ; # The server will reply with "Query Ok" or an error message. DEALLOCATE PREPARE stmt ; -## prepare +################ PREPARE ################ # prepare without parameter prepare stmt1 from ' select 1 as my_col ' ; # prepare with parameter @@ -91,9 +91,15 @@ set @arg00=NULL; prepare stmt1 from @arg01; prepare stmt1 from ' select * from t1 where a <= 2 ' ; -# prepare must fail (column does not exist) +# prepare must fail (column x does not exist) --error 1054 prepare stmt1 from ' select * from t1 where x <= 2 ' ; +# cases derived from client_test.c: test_null() +# prepare must fail (column x does not exist) +--error 1054 +prepare stmt1 from ' insert into t1(a,x) values(?,?) ' ; +--error 1054 +prepare stmt1 from ' insert into t1(x,a) values(?,?) ' ; --disable_warnings drop table if exists not_exist ; --enable_warnings @@ -109,7 +115,7 @@ prepare stmt1 from ' insert into t1 values(? ' ; prepare stmt1 from ' select a, b from t1 where a=? and where ' ; -## execute +################ EXECUTE ################ # execute must fail (statement never_prepared never prepared) --error 1243 execute never_prepared ; @@ -122,89 +128,89 @@ prepare stmt1 from ' select * from not_exist where a <= 2 ' ; execute stmt1 ; # drop the table between prepare and execute -create table to_be_dropped +create table t5 ( a int primary key, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 1, 'original table', 1); -prepare stmt2 from ' select * from to_be_dropped ' ; +insert into t5( a, b, c) values( 1, 'original table', 1); +prepare stmt2 from ' select * from t5 ' ; execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # execute must fail (table was dropped after prepare) --error 1146 execute stmt2 ; # cases derived from client_test.c: test_select_prepare() # 1. drop + create table (same column names/types/order) # between prepare and execute -create table to_be_dropped +create table t5 ( a int primary key, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # 2. drop + create table (same column names/types but different order) # between prepare and execute -create table to_be_dropped +create table t5 ( a int primary key, c int, b char(30) ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # 3. drop + create table (same column names/types/order+extra column) # between prepare and execute -create table to_be_dropped +create table t5 ( a int primary key, b char(30), c int, d timestamp default current_timestamp ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # 4. drop + create table (same column names/types, different order + # additional column) between prepare and execute -create table to_be_dropped +create table t5 ( a int primary key, d timestamp default current_timestamp, b char(30), c int ); -insert into to_be_dropped( a, b, c) values( 9, 'recreated table', 9); +insert into t5( a, b, c) values( 9, 'recreated table', 9); execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # 5. drop + create table (same column names/order, different types) # between prepare and execute -create table to_be_dropped +create table t5 ( a timestamp default '2004-02-29 18:01:59', b char(30), c int ); -insert into to_be_dropped( b, c) values( 'recreated table', 9); +insert into t5( b, c) values( 'recreated table', 9); execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # 6. drop + create table (same column types/order, different names) # between prepare and execute -create table to_be_dropped +create table t5 ( f1 int primary key, f2 char(30), f3 int ); -insert into to_be_dropped( f1, f2, f3) values( 9, 'recreated table', 9); +insert into t5( f1, f2, f3) values( 9, 'recreated table', 9); --error 1054 execute stmt2 ; -drop table to_be_dropped ; +drop table t5 ; # execute without parameter prepare stmt1 from ' select * from t1 where a <= 2 ' ; @@ -223,8 +229,8 @@ execute stmt1 using @arg00, @arg01; # execute must fail (parameter is not set) execute stmt1 using @not_set; -## deallocate -# deallocate must fail (never_prepared was never prepared) +################ DEALLOCATE ################ +# deallocate must fail (the statement 'never_prepared' was never prepared) --error 1243 deallocate prepare never_prepared ; # deallocate must fail (prepare stmt1 just failed, @@ -234,13 +240,13 @@ prepare stmt1 from ' select * from t1 where a <= 2 ' ; prepare stmt1 from ' select * from not_exist where a <= 2 ' ; --error 1243 deallocate prepare stmt1; -create table to_be_dropped +create table t5 ( a int primary key, b char(10) ); -prepare stmt2 from ' select a,b from to_be_dropped where a <= 2 ' ; -drop table to_be_dropped ; +prepare stmt2 from ' select a,b from t5 where a <= 2 ' ; +drop table t5 ; # deallocate prepared statement where the table was dropped after prepare deallocate prepare stmt2; @@ -271,7 +277,7 @@ create table t2 a int primary key, b char(10) ); -###### SHOW COMMANDS +################ SHOW COMMANDS ################ prepare stmt4 from ' show databases '; execute stmt4; prepare stmt4 from ' show tables from test like ''t2%'' '; @@ -287,7 +293,7 @@ prepare stmt4 from ' show table status from test like ''t2%'' '; # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table -prepare stmt4 from ' show table status from test like ''t_many_col_types%'' '; +prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # # Bug#4288 @@ -324,18 +330,68 @@ prepare stmt4 from ' show storage engines '; --replace_column 2 YES/NO execute stmt4; -###### MISC STUFF +################ MISC STUFF ################ ## get a warning and an error # cases derived from client_test.c: test_warnings(), test_errors() --disable_warnings -drop table if exists tx; +drop table if exists t5; --enable_warnings -prepare stmt1 from ' drop table if exists tx ' ; +prepare stmt1 from ' drop table if exists t5 ' ; execute stmt1 ; -prepare stmt1 from ' drop table tx ' ; +prepare stmt1 from ' drop table t5 ' ; --error 1051 execute stmt1 ; +## SELECT @@version +# cases derived from client_test.c: test_select_version() +--enable_metadata +prepare stmt1 from ' SELECT @@version ' ; +# egalize the version +--replace_column 1 +execute stmt1 ; +--disable_metadata + +## do @var:= and set @var= +# cases derived from client_test.c: test_do_set() +prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ; +prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ; +let $1= 3 ; +while ($1) +{ + execute stmt_do ; + --disable_query_log + select @var as 'content of @var is:' ; + --enable_query_log + execute stmt_set ; + --disable_query_log + select @var as 'content of @var is:' ; + --enable_query_log + dec $1 ; +} +# the same test with a table containing one column and 'select *' +--disable_warnings +drop table if exists t5 ; +--enable_warnings +create table t5 (a int) ; +prepare stmt_do from ' do @var:= (1 in (select a from t5)) ' ; +prepare stmt_set from ' set @var= (1 in (select a from t5)) ' ; +let $1= 3 ; +while ($1) +{ + execute stmt_do ; + --disable_query_log + select @var as 'content of @var is:' ; + --enable_query_log + execute stmt_set ; + --disable_query_log + select @var as 'content of @var is:' ; + --enable_query_log + dec $1 ; +} +drop table t5 ; +deallocate prepare stmt_do ; +deallocate prepare stmt_set ; + ## nonsense like prepare of prepare,execute or deallocate --error 1064 prepare stmt1 from ' prepare stmt2 from '' select 1 '' ' ; @@ -447,6 +503,34 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; --disable_metadata +## parameters with probably problematic characters (quote, double quote) +# cases derived from client_test.c: test_logs() +# try if +--disable_warnings +drop table if exists t2; +--enable_warnings +create table t2 (id smallint, name varchar(20)) ; +prepare stmt1 from ' insert into t2 values(?, ?) ' ; +set @id= 9876 ; +set @arg00= 'MySQL - Open Source Database' ; +set @arg01= "'" ; +set @arg02= '"' ; +set @arg03= "my'sql'" ; +set @arg04= 'my"sql"' ; +insert into t2 values ( @id , @arg00 ); +insert into t2 values ( @id , @arg01 ); +insert into t2 values ( @id , @arg02 ); +insert into t2 values ( @id , @arg03 ); +insert into t2 values ( @id , @arg04 ); +prepare stmt1 from ' select * from t2 where id= ? and name= ? '; +execute stmt1 using @id, @arg00 ; +execute stmt1 using @id, @arg01 ; +execute stmt1 using @id, @arg02 ; +execute stmt1 using @id, @arg03 ; +execute stmt1 using @id, @arg04 ; +drop table t2; + +################ CREATE/DROP/ALTER/RENAME TESTS ################ --disable_query_log select '------ create/drop/alter/rename tests ------' as test_sequence ; --enable_query_log @@ -455,11 +539,13 @@ select '------ create/drop/alter/rename tests ------' as test_sequence ; drop table if exists t2, t3; --enable_warnings +## DROP TABLE prepare stmt_drop from ' drop table if exists t2 ' ; --disable_warnings execute stmt_drop; --enable_warnings +## CREATE TABLE prepare stmt_create from ' create table t2 ( a int primary key, b char(10)) '; execute stmt_create; @@ -467,6 +553,7 @@ prepare stmt3 from ' create table t3 like t2 '; execute stmt3; drop table t3; +## CREATE TABLE .. SELECT set @arg00=1; prepare stmt3 from ' create table t3 (m int) select ? as m ' ; # Bug#4280 server hangs, prepared "create table .. as select ? .." @@ -480,6 +567,8 @@ prepare stmt3 from ' create index t2_idx on t2(b) '; prepare stmt3 from ' drop index t2_idx on t2 ' ; --error 1295 prepare stmt3 from ' alter table t2 drop primary key '; + +## RENAME TABLE --disable_warnings drop table if exists new_t2; --enable_warnings @@ -489,15 +578,41 @@ execute stmt3; execute stmt3; rename table new_t2 to t2; drop table t2; +## RENAME more than on TABLE within one statement +# cases derived from client_test.c: test_rename() +--disable_warnings +drop table if exists t5, t6, t7, t8 ; +--enable_warnings +prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; +create table t5 (a int) ; +# rename must fail, tc does not exist +--error 1017 +execute stmt1 ; +create table t7 (a int) ; +# rename, t5 -> t6 and t7 -> t8 +execute stmt1 ; +# rename must fail, t5 and t7 does not exist t6 and t8 already exist +--error 1050 +execute stmt1 ; +rename table t6 to t5, t8 to t7 ; +# rename, t5 -> t6 and t7 -> t8 +execute stmt1 ; +drop table t6, t8 ; + +################ BIG STATEMENT TESTS ################ --disable_query_log select '------ big statement tests ------' as test_sequence ; --enable_query_log +# The following tests use huge numbers of lines, characters or parameters +# per prepared statement. +# I assume the server and also the client (mysqltest) are stressed. +# # Attention: The limits used are NOT derived from the manual # or other sources. ## many lines ( 50 ) -select 'ABC' as my_const_col from t1 where +let $my_stmt= select 'ABC' as my_const_col from t1 where 1 = 1 AND 1 = 1 AND 1 = 1 AND @@ -547,62 +662,14 @@ select 'ABC' as my_const_col from t1 where 1 = 1 AND 1 = 1 AND 1 = 1 ; -prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 AND -1 = 1 ' ; +eval ($my_stmt) ; +eval prepare stmt1 from "$my_stmt" ; execute stmt1 ; execute stmt1 ; ## many characters ( about 1400 ) -select 'ABC' as my_const_col FROM t1 WHERE +let $my_stmt= select 'ABC' as my_const_col FROM t1 WHERE '1234567890123456789012345678901234567890123456789012345678901234567890' = '1234567890123456789012345678901234567890123456789012345678901234567890' AND '1234567890123456789012345678901234567890123456789012345678901234567890' @@ -621,30 +688,14 @@ select 'ABC' as my_const_col FROM t1 WHERE = '1234567890123456789012345678901234567890123456789012345678901234567890' AND '1234567890123456789012345678901234567890123456789012345678901234567890' = '1234567890123456789012345678901234567890123456789012345678901234567890' ; -prepare stmt1 from ' select ''ABC'' as my_const_col FROM t1 WHERE -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' AND -''1234567890123456789012345678901234567890123456789012345678901234567890'' -= ''1234567890123456789012345678901234567890123456789012345678901234567890'' '; +eval ($my_stmt) ; +eval prepare stmt1 from "$my_stmt" ; execute stmt1 ; execute stmt1 ; ## many parameters ( 50 ) +--disable_query_log set @arg00= 1; set @arg01= 1; set @arg02= 1; @@ -695,6 +746,7 @@ set @arg56= 1; set @arg57= 1; set @arg60= 1; set @arg61= 1; +--enable_query_log select 'ABC' as my_const_col FROM t1 WHERE @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @arg00=@arg00 and @@ -729,8 +781,156 @@ execute stmt1 using @arg50, @arg51, @arg52, @arg53, @arg54, @arg55, @arg56, @arg57, @arg60, @arg61 ; +# cases derived from client_test.c: test_mem_overun() +--disable_warnings +drop table if exists t5 ; +--enable_warnings + +set @col_num= 1000 ; + +--disable_query_log +set @string= 'create table t5( ' ; +let $1=`select @col_num - 1` ; +while ($1) +{ + eval set @string= concat(@string, 'c$1 int,') ; + dec $1 ; +} +set @string= concat(@string, 'c0 int)' ); +--enable_query_log +select @string as "" ; +prepare stmt1 from @string ; +execute stmt1 ; + +--disable_query_log +set @string= 'insert into t5 values(' ; +let $1=`select @col_num - 1` ; +while ($1) +{ + eval set @string= concat(@string, '1 ,') ; + dec $1 ; +} +eval set @string= concat(@string, '1 )') ; +--enable_query_log +select @string as "" ; +prepare stmt1 from @string ; +execute stmt1 ; + +prepare stmt1 from ' select * from t5 ' ; +--enable_metadata +# prevent too long lines +--vertical_results +--disable_result_log +execute stmt1 ; +--enable_result_log +--disable_metadata +--horizontal_results + +drop table t5 ; + + +################ GRANT/REVOKE/DROP affecting a parallel session ################ +--disable_query_log +select '------ grant/revoke/drop affects a parallel session test ------' + as test_sequence ; +--enable_query_log + +#---------------------------------------------------------------------# +# Here we test that: +# 1. A new GRANT will be visible within another sessions. # +# # +# Let's assume there is a parallel session with an already prepared # +# statement for a table. # +# A DROP TABLE will affect the EXECUTE properties. # +# A REVOKE will affect the EXECUTE properties. # +#---------------------------------------------------------------------# + +# Who am I ? +# this is different across different systems: +# select current_user(), user() ; + +#### create a new user account #### +## There should be no grants for that non existing user +--error 1141 +show grants for second_user@localhost ; +## create a new user account by using GRANT statements on t9 +grant usage on test.* to second_user@localhost +identified by 'looser' ; +grant select on test.t9 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; + + +#### establish a second session to the new user account +connect (con3,localhost,second_user,looser,test); +## switch to the second session +connection con3; +# Who am I ? +select current_user(); +## check the access rights +show grants for current_user(); +prepare s_t9 from 'select c1 as my_col + from t9 where c1= 1' ; +execute s_t9 ; +# check that we cannot do a SELECT on the table t1; +--error 1142 +select a as my_col from t1; + + +#### give access rights to t1 and drop table t9 +## switch back to the first session +connection default; +grant select on test.t1 to second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; +drop table t9 ; +show grants for second_user@localhost ; + + +#### check the access as new user +## switch to the second session +connection con3; +######## Question 1: The table t1 should be now accessible. ######## +show grants for second_user@localhost ; +prepare s_t1 from 'select a as my_col from t1' ; +execute s_t1 ; +######## Question 2: The table t9 does not exist. ######## +--error 1146 +execute s_t9 ; + + +#### revoke the access rights to t1 +## switch back to the first session +connection default; +revoke all privileges on test.t1 from second_user@localhost +identified by 'looser' ; +show grants for second_user@localhost ; + +#### check the access as new user +## switch to the second session +connection con3; +show grants for second_user@localhost ; +######## Question 2: The table t1 should be now not accessible. ######## +--error 1142 +execute s_t1 ; + +## cleanup +## switch back to the first session +connection default; +## disconnect the second session +disconnect con3 ; +## remove all rights of second_user@localhost +revoke all privileges, grant option from second_user@localhost ; +show grants for second_user@localhost ; +drop user second_user@localhost ; +commit ; +--error 1141 +show grants for second_user@localhost ; + + drop table t1 ; + ##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES ##### # # 0. You don't have the time to @@ -749,7 +949,7 @@ drop table t1 ; # NO --> alter t/ps_1general.test (Example: Command with syntax error) # If you need a table, please try to use # t1 - very simple table -# t_many_col_types - table with nearly all available column types +# t9 - table with nearly all available column types # whenever possible. # # The structure and the content of these tables can be found in @@ -804,11 +1004,11 @@ drop table t1 ; # include/ps_query.inc test cases with SELECT/... # These test cases should not modify the content or # the structure (DROP/ALTER..) of the tables -# 't1' and 't_many_col_types'. +# 't1' and 't9'. # include/ps_modify.inc test cases with INSERT/UPDATE/... # These test cases should not modify the structure # (DROP/ALTER..) of the tables -# 't1' and 't_many_col_types'. +# 't1' and 't9'. # These two test sequences will be applied to all table types . # # include/ps_modify1.inc test cases with INSERT/UPDATE/... @@ -816,7 +1016,7 @@ drop table t1 ; # except MERGE tables. # # include/ps_create.inc DROP and CREATE of the tables -# 't1' and 't_many_col_types' . +# 't1' and 't9' . # include/ps_renew.inc DELETE all rows and INSERT some rows, that means # recreate the original content of these tables. # Please do not alter the commands concerning these two tables. diff --git a/mysql-test/t/ps_2myisam.test b/mysql-test/t/ps_2myisam.test index c7e4746762b..534703efc14 100644 --- a/mysql-test/t/ps_2myisam.test +++ b/mysql-test/t/ps_2myisam.test @@ -15,7 +15,28 @@ let $type= 'MYISAM' ; -- source include/ps_renew.inc -- source include/ps_query.inc + +# parameter in SELECT ... MATCH/AGAINST +# case derived from client_test.c: test_bug1500() +--disable_warnings +drop table if exists t2 ; +--enable_warnings +eval create table t2 (s varchar(25), fulltext(s)) +ENGINE = $type ; +insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ; +commit ; + +prepare stmt1 from ' select s from t2 where match (s) against (?) ' ; +set @arg00='Dogs' ; +execute stmt1 using @arg00 ; +prepare stmt1 from ' SELECT s FROM t2 +where match (s) against (concat(?,''digger'')) '; +set @arg00='Grave' ; +execute stmt1 using @arg00 ; +drop table t2 ; + -- source include/ps_modify.inc -- source include/ps_modify1.inc +-- source include/ps_conv.inc -drop table t1, t_many_col_types; +drop table t1, t9; diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test index 055e1e127e5..f83b61914a2 100644 --- a/mysql-test/t/ps_3innodb.test +++ b/mysql-test/t/ps_3innodb.test @@ -19,5 +19,6 @@ let $type= 'InnoDB' ; -- source include/ps_query.inc -- source include/ps_modify.inc -- source include/ps_modify1.inc +-- source include/ps_conv.inc -drop table t1, t_many_col_types; +drop table t1, t9; diff --git a/mysql-test/t/ps_4heap.test b/mysql-test/t/ps_4heap.test index d1c81d95cd7..a7b2e332af4 100644 --- a/mysql-test/t/ps_4heap.test +++ b/mysql-test/t/ps_4heap.test @@ -12,7 +12,7 @@ use test; let $type= 'HEAP' ; --disable_warnings -drop table if exists t1, t_many_col_types ; +drop table if exists t1, t9 ; --enable_warnings eval create table t1 ( @@ -21,12 +21,12 @@ eval create table t1 ) engine = $type ; --disable_warnings -drop table if exists t_many_col_types; +drop table if exists t9; --enable_warnings # The used table type doesn't support BLOB/TEXT columns. # (The server would send error 1163 .) # So we use char(100) instead. -eval create table t_many_col_types +eval create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -44,5 +44,6 @@ eval create table t_many_col_types -- source include/ps_query.inc -- source include/ps_modify.inc -- source include/ps_modify1.inc +-- source include/ps_conv.inc -drop table t1, t_many_col_types; +drop table t1, t9; diff --git a/mysql-test/t/ps_5merge.test b/mysql-test/t/ps_5merge.test index ff48a50f331..9a79842709c 100644 --- a/mysql-test/t/ps_5merge.test +++ b/mysql-test/t/ps_5merge.test @@ -12,13 +12,13 @@ use test; --disable_warnings drop table if exists t1, t1_1, t1_2, - t_many_col_types, t_many_col_types_1, t_many_col_types_2; + t9, t9_1, t9_2; --enable_warnings let $type= 'MYISAM' ; -- source include/ps_create.inc -rename table t1 to t1_1, t_many_col_types to t_many_col_types_1 ; +rename table t1 to t1_1, t9 to t9_1 ; -- source include/ps_create.inc -rename table t1 to t1_2, t_many_col_types to t_many_col_types_2 ; +rename table t1 to t1_2, t9 to t9_2 ; create table t1 ( @@ -26,7 +26,7 @@ create table t1 primary key(a) ) ENGINE = MERGE UNION=(t1_1,t1_2) INSERT_METHOD=FIRST; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -38,7 +38,7 @@ create table t_many_col_types c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) -) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +) ENGINE = MERGE UNION=(t9_1,t9_2) INSERT_METHOD=FIRST; -- source include/ps_renew.inc @@ -47,16 +47,17 @@ INSERT_METHOD=FIRST; # no test of ps_modify1, because insert .. select # is not allowed on MERGE tables # -- source include/ps_modify1.inc +-- source include/ps_conv.inc # Lets's try the same tests with INSERT_METHOD=LAST -drop table t1, t_many_col_types ; +drop table t1, t9 ; create table t1 ( a int, b varchar(30), primary key(a) ) ENGINE = MERGE UNION=(t1_1,t1_2) INSERT_METHOD=LAST; -create table t_many_col_types +create table t9 ( c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, @@ -68,7 +69,7 @@ create table t_many_col_types c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) -) ENGINE = MERGE UNION=(t_many_col_types_1,t_many_col_types_2) +) ENGINE = MERGE UNION=(t9_1,t9_2) INSERT_METHOD=LAST; -- source include/ps_renew.inc @@ -77,6 +78,7 @@ INSERT_METHOD=LAST; # no test of ps_modify1, because insert .. select # is not allowed on MERGE tables # -- source include/ps_modify1.inc +-- source include/ps_conv.inc drop table t1, t1_1, t1_2, - t_many_col_types_1, t_many_col_types_2, t_many_col_types; + t9_1, t9_2, t9; diff --git a/mysql-test/t/ps_6bdb.test b/mysql-test/t/ps_6bdb.test index 7dbd08f5baa..5db3349279e 100644 --- a/mysql-test/t/ps_6bdb.test +++ b/mysql-test/t/ps_6bdb.test @@ -18,5 +18,6 @@ let $type= 'BDB' ; -- source include/ps_query.inc -- source include/ps_modify.inc -- source include/ps_modify1.inc +-- source include/ps_conv.inc -drop table t1, t_many_col_types; +drop table t1, t9; diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test new file mode 100644 index 00000000000..848eac0080a --- /dev/null +++ b/mysql-test/t/ps_7ndb.test @@ -0,0 +1,377 @@ +############################################### +# # +# Prepared Statements test on NDB tables # +# # +############################################### + +# +# NOTE: PLEASE SEE ps_1general.test (bottom) +# BEFORE ADDING NEW TEST CASES HERE !!! + +use test; + +-- source include/have_ndb.inc +let $type= 'NDB' ; +--disable_warnings +drop table if exists t1, t9 ; +--enable_warnings +eval create table t1 +( + a int not null, b varchar(30), + primary key(a) +) engine = $type ; + +--disable_warnings +drop table if exists t9; +--enable_warnings +# The used table type doesn't support BLOB/TEXT columns. +# (The server would send error 1163 .) +# So we use char(100) instead. +eval create table t9 +( + c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, + c5 integer, c6 bigint, c7 float, c8 double, + c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), + c13 date, c14 datetime, c15 timestamp(14), c16 time, + c17 year, c18 bit, c19 bool, c20 char, + c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), + c25 char(100), c26 char(100), c27 char(100), c28 char(100), + c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), + c32 set('monday', 'tuesday', 'wednesday'), + primary key(c1) +) engine = $type ; +-- source include/ps_renew.inc + +-- source include/ps_query.inc +# The following line is deactivated, because the ndb storage engine is not able +# to do primary key column updates . +#-- source include/ps_modify.inc +# let's include all statements which will work +--disable_query_log +select '------ delete tests ------' as test_sequence ; +--enable_query_log +--source include/ps_renew.inc + +## delete without parameter +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +# delete with row not found +execute stmt1; + +## delete with one parameter in the where clause +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; + +## truncate a table +--error 1295 +prepare stmt1 from 'truncate table t1' ; + + +--disable_query_log +select '------ update tests ------' as test_sequence ; +--enable_query_log +--source include/ps_renew.inc + +## update without parameter +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +# dummy update +execute stmt1; +select a,b from t1 where a=2; + +## update with one parameter in the set clause +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; + +## update with one parameter in the where cause +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +update t1 set b='two' where a=@arg00; +# row not found in update +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; + +## update on primary key column (two parameters) +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +# dummy update +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +# deactivated primary key column update +# execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +set @arg00=NULL; +set @arg01=2; +# deactivated primary key column update +# execute stmt1 using @arg00, @arg01; +select a,b from t1 order by a; +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; + +## update with subquery and several parameters +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +--disable_warnings +drop table if exists t2; +--enable_warnings +# t2 will be of table type 'MYISAM' +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +# deactivated primary key column update +# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +--disable_info +select a,b from t1 where a = @arg00 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +--disable_info +select a,b from t1 order by a; +drop table t2 ; +# t2 is now of table type '$type' +# The test battery for table type 'MERGE' gets here only a 'MYISAM' table +eval create table t2 +( + a int not null, b varchar(30), + primary key(a) +) engine = $type ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +# deactivated primary key column update +# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +--disable_info +select a,b from t1 where a = @arg00 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +--enable_info +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +--disable_info +select a,b from t1 order by a; +drop table t2 ; + +## update with parameters in limit +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +# currently (May 2004, Version 4.1) it is impossible +-- error 1064 +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; + +--disable_query_log +select '------ insert tests ------' as test_sequence ; +--enable_query_log +--source include/ps_renew.inc + +## insert without parameter +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; + +## insert with one parameter in values part +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +# the second insert fails, because the first column is primary key +--error 1062 +execute stmt1 using @arg00; +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; + +## insert with two parameter in values part +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +# cases derived from client_test.c: test_null() +set @NULL= null ; +set @arg00= 'abc' ; +# execute must fail, because first column is primary key (-> not null) +--error 1048 +execute stmt1 using @NULL, @NULL ; +--error 1048 +execute stmt1 using @NULL, @NULL ; +--error 1048 +execute stmt1 using @NULL, @arg00 ; +--error 1048 +execute stmt1 using @NULL, @arg00 ; +let $1 = 2; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @arg00 ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; +let $1 = 2; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @NULL ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; +let $1 = 10; +while ($1) +{ + eval set @arg01= 10000 + $1 ; + execute stmt1 using @arg01, @arg01 ; + dec $1; +} +select * from t1 where a > 10000 order by a ; +delete from t1 where a > 10000 ; + + +## insert with two rows in values part +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; + +## insert with two parameter in the set part +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; + +## insert with parameters in the ON DUPLICATE KEY part +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +# There is no primary key collision, so there will be no key column update +# If a key column update would be necessary occurs BUG#4312 +# deactivated, activate when BUG#4312: is solved +# execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +set @arg00=81 ; +set @arg01=1 ; +# deactivated, activate when BUG#4312: is solved +# execute stmt1 using @arg00, @arg01; + +## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' +# cases derived from client_test.c: test_bug3117() +--disable_warnings +drop table if exists t2 ; +--enable_warnings +# The test battery for table type 'MERGE' gets here only a 'MYISAM' table +eval create table t2 (id int auto_increment primary key) +ENGINE= $type ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +insert into t2 values (NULL) ; +execute stmt1 ; +drop table t2 ; + +## many parameters +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; + +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +# deactivated, activate when BUG#4312: is solved +# insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +# on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +# deactivated, activate when BUG#4312: is solved +# execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +# deactivated, activate when BUG#4312: is solved +# execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +delete from t1 where a >= 1000 ; + +## replace +--error 1295 +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; + +## multi table statements +--disable_query_log +select '------ multi table tests ------' as test_sequence ; +--enable_query_log +# cases derived from client_test.c: test_multi +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) + values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +let $1= 3 ; +while ($1) +{ + execute stmt_update using @arg00 ; + execute stmt_delete ; + execute stmt_select1 ; + execute stmt_select2 ; + set @arg00= @arg00 + 1 ; + dec $1 ; +} + +-- source include/ps_modify1.inc +-- source include/ps_conv.inc + +drop table t1, t9; -- cgit v1.2.1 From 6a557d964535ade04ed1bbfddf0423152ac42c49 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 25 Sep 2004 16:06:30 +0000 Subject: added printout for where configuration is fetched debug printouts mysql-test/ndb/ndbcluster.sh: . ndb/include/mgmcommon/ConfigRetriever.hpp: added printout for where configuration is fetched ndb/src/common/mgmcommon/ConfigRetriever.cpp: added printout for where configuration is fetched ndb/src/kernel/main.cpp: added printout for where configuration is fetched ndb/src/kernel/vm/Configuration.cpp: added printout for where configuration is fetched ndb/src/kernel/vm/Configuration.hpp: added printout for where configuration is fetched ndb/src/ndbapi/Ndb.cpp: debug printouts --- mysql-test/ndb/ndbcluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index a1b6400d753..7485e42923e 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -45,7 +45,7 @@ status_ndb= ndb_diskless=0 ndb_no_ord=512 -ndb_con_op=10000 +ndb_con_op=105000 ndb_dmem=80M ndb_imem=24M -- cgit v1.2.1 From 722b80898016511d99da69af63a3bf0733d72c39 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Sep 2004 15:57:07 +0400 Subject: Disabled part of ps_1general.test behaving differently on different builds. (Until mysqltest will support replace_result and replace_column on metadata). mysql-test/r/ps_1general.result: Disabled part of test behaving differently on different builds. (Until mysqltest will support replace_result and replace_column on metadata). mysql-test/t/ps_1general.test: Disabled part of test behaving differently on different builds. (Until mysqltest will support replace_result and replace_column on metadata). --- mysql-test/r/ps_1general.result | 2 -- mysql-test/t/ps_1general.test | 11 +++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 756ccd4d609..6dcdb0feab1 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -333,8 +333,6 @@ execute stmt1 ; ERROR 42S02: Unknown table 't5' prepare stmt1 from ' SELECT @@version ' ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @@VERSION 254 102 34 N 1 31 8 @@VERSION prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index dfdde884359..f27aca7a452 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -344,12 +344,19 @@ execute stmt1 ; ## SELECT @@version # cases derived from client_test.c: test_select_version() ---enable_metadata +# +# TODO: Metadata check is temporary disabled here, because metadata of +# this statement also depends on @@version contents and you can't apply +# replace_column and replace_result to it. It will be enabled again when +# support of replace_column and replace_result on metadata will be +# implemented. +# +#--enable_metadata prepare stmt1 from ' SELECT @@version ' ; # egalize the version --replace_column 1 execute stmt1 ; ---disable_metadata +#--disable_metadata ## do @var:= and set @var= # cases derived from client_test.c: test_do_set() -- cgit v1.2.1 From 0e315ff762dd9f5f44837ffd18e0770174465744 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Sep 2004 16:11:24 +0200 Subject: WL#1424 Updated after review * Changed the implementation of ndbcluster_find_files to be more efficient, using only one mutex lock * Moved ha_find_files to end of mysql_find_files so that it can be passed the list that we are interested to find. mysql-test/t/ndb_autodiscover.test: Added a new test case, disabled for now, waiting for mysql-test-run to set a NDB_CONNECTSTRING sql/ha_ndbcluster.cc: Rewrite of ndbcluster_find_files to remove and delete files using only one mutex lock. This version only discover files that fulfill wildcard. sql/ha_ndbcluster.h: Add list of files as parameter sql/handler.cc: Add list of files as parameter sql/handler.h: Add list of files as parameter sql/sql_show.cc: Moving the ha_find_files to end of function, so that the file lista can be passsed to it. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/t/ndb_autodiscover.test | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 47a1155065b..50c94d7a6e4 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -215,9 +215,43 @@ drop table t6, t7; #show status like 'handler_discover%'; #drop table t4; # +# +# system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +# +# +# #show tables; +####################################################### +# Test that a table that has been dropped from NDB +# but still exists on disk is deleted from disk +# when SHOW TABLES is called +# +# +#flush status; +# +#create table t4( +# id int not null primary key, +# id2 int, +# name char(27) +#) engine=ndb; +#insert into t4 values (1, 76, "Automatic2"); +#select * from t4; +#flush tables; +# +# Remove the table from NDB +#system exec ../ndb/tools/ndb_drop_table -c localhost:9350 -d test t4 > /dev/null ; + +#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; + +#SHOW TABLES; + +# Is there another way to find out that the file is gone? +#--error 1146 +#select * from t4; + + ######################################################### # Test that a table that has been changed in NDB -- cgit v1.2.1 From 79d4ac7cfd9aab50b92dcc75ed865df5b671366a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Sep 2004 17:11:28 +0200 Subject: Setting MODE_NO_AUTO_VALUE_ON_ZERO at copying in copy_data_between_tables --- mysql-test/r/ndb_alter_table.result | 15 +++++++++++++++ mysql-test/t/ndb_alter_table.test | 8 ++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index a36536b878d..897fa77185d 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -72,6 +72,21 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8 1 100 3 4 5 PENDING 0000-00-00 00:00:00 1 101 3 4 5 PENDING 0000-00-00 00:00:00 2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 +delete from t1; +insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); +SET SQL_MODE=''; +insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); +select * from t1 order by col1; +col6 col1 col3 fourth col4 col4_5 col5 col7 col8 +0 0 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 +1 103 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00 +alter table t1 drop column col4_5; +insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00'); +select * from t1 order by col1; +col6 col1 col3 fourth col4 col5 col7 col8 +0 0 4 3 5 PENDING EXTRA 2004-01-01 00:00:00 +1 103 4 3 5 PENDING EXTRA 2004-01-01 00:00:00 +2 104 4 3 5 PENDING EXTRA 2004-01-01 00:00:00 drop table t1; CREATE TABLE t1 ( a INT NOT NULL, diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 96270d94dcb..9128d0c3811 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -47,6 +47,14 @@ select * from t1 order by col1; insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); show table status; select * from t1 order by col1; +delete from t1; +insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); +SET SQL_MODE=''; +insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); +select * from t1 order by col1; +alter table t1 drop column col4_5; +insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00'); +select * from t1 order by col1; drop table t1; -- cgit v1.2.1 From 0b7c703878ade2b2675c056267b71440d9dd960c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Sep 2004 21:52:20 +0500 Subject: bug #5723 length(varchar utf8 field) returns verying results --- mysql-test/r/bdb.result | 9 +++++++++ mysql-test/r/ctype_utf8.result | 16 ++++++++++++++++ mysql-test/t/bdb.test | 12 ++++++++++++ mysql-test/t/ctype_utf8.test | 14 ++++++++++++++ 4 files changed, 51 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 25118702d09..846adaf53ef 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1251,3 +1251,12 @@ truncate t1; select * from t1; a b drop table t1; +SET NAMES utf8; +create table t1 (a varchar(255) character set utf8) engine=bdb; +set @a:= convert(repeat(_latin1 0xFF, 255) using utf8); +insert into t1 values (@a); +select a, length(a), char_length(a) from t1; +a length(a) char_length(a) +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 510 255 +drop table t1; +SET NAMES latin1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index c7d015da9dc..dcd19584c31 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -644,3 +644,19 @@ INSERT INTO t1 VALUES ('test'); SELECT a FROM t1 WHERE a LIKE '%te'; a DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1 ( +subject varchar(255) character set utf8 collate utf8_unicode_ci, +p varchar(15) character set utf8 +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); +INSERT INTO t1 VALUES ('aaa','bbb'); +SELECT length(subject) FROM t1; +length(subject) +432 +3 +SELECT length(subject) FROM t1 ORDER BY 1; +length(subject) +3 +432 +DROP TABLE t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 7ee7d18439d..86214ecd5a8 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -897,3 +897,15 @@ commit; truncate t1; select * from t1; drop table t1; + +# +# Check that BDB works fine with a string which is +# longer than 255 bytes for multibyte characters. +# +SET NAMES utf8; +create table t1 (a varchar(255) character set utf8) engine=bdb; +set @a:= convert(repeat(_latin1 0xFF, 255) using utf8); +insert into t1 values (@a); +select a, length(a), char_length(a) from t1; +drop table t1; +SET NAMES latin1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index f5bd9ede673..4c6ff2abde7 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -499,3 +499,17 @@ CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8; INSERT INTO t1 VALUES ('test'); SELECT a FROM t1 WHERE a LIKE '%te'; DROP TABLE t1; + +# +# Bug #5723: length() returns varying results +# +SET NAMES utf8; +CREATE TABLE t1 ( + subject varchar(255) character set utf8 collate utf8_unicode_ci, + p varchar(15) character set utf8 +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); +INSERT INTO t1 VALUES ('aaa','bbb'); +SELECT length(subject) FROM t1; +SELECT length(subject) FROM t1 ORDER BY 1; +DROP TABLE t1; -- cgit v1.2.1 From 0b1a83eada35128b1ab8e64d63b348ab4b105427 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Sep 2004 00:50:00 +0400 Subject: Fix for bug #4131 "TIMESTAMP columns missing minutes and seconds when using GROUP BY" Now we are setting Field_timestamp::field_length to 19 in open_table() if we are in new mode (and we are restoring it back when we are coming back to normal mode). This also should solve potential problems with some of LOAD DATA INFILE and SELECT * INTO in this mode. mysql-test/r/type_timestamp.result: Added test for bug #4131 'TIMESTAMP columns missing minutes and seconds when using GROUP BY' and other --new mode related behavior. mysql-test/t/type_timestamp.test: Added test for bug #4131 'TIMESTAMP columns missing minutes and seconds when using GROUP BY' and other --new mode related behavior. sql/field.cc: Added Field_timestamp::orig_field_length member for saving original field_length value, because this member can be modified if new_mode is in effect. Lot of Field_timestamp code simplified and Field_timestamp::make_field() is no longer needed because we are setting field_length to 19 if we are in --new mode now. sql/field.h: Added Field_timestamp::orig_field_length member for saving original field_length value, because this member can be modified if new_mode is in effect. Field_timestamp::make_field() is no longer needed because we are setting field_length to 19 if we are in --new mode now. sql/sql_base.cc: If --new mode is in effect all TIMESTAMP fields should pretend that they have length of 19. We are achieving this by setting Field_timestamp::field_length to 19 (or original value) in open_table(). We are using TABLE::timestamp_mode variable for avoiding of unnecessary looping over all fields of the table and setting field_length if table was used with same new_mode value before. Note: We do not introduce general framework for setting up Field objects for usage with current THD here because this fix is only needed in 4.0 and Monty said that we will also remove looping over all fields when updating table_name member at some point. This more general framework will also complicate nice optimization with avoiding of unneeded looping. sql/sql_parse.cc: Now when we are creating TIMESTAMP(19) fields by default in --new mode, otherwise we will have unaligned behavior between ALTER and CREATE. sql/table.h: Added TABLE::timestamp_mode field for saving information whenever we set field_length members of table's TIMESTAMP fields to 19 (to honor new_mode) or they have original values. --- mysql-test/r/type_timestamp.result | 60 ++++++++++++++++++++++++++++++++------ mysql-test/t/type_timestamp.test | 32 ++++++++++++++++++++ 2 files changed, 83 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 752a5045eb0..6253fa96ba8 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -122,40 +122,41 @@ t2 t4 t6 t8 t10 t12 t14 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 drop table t1; +set new=0; create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 timestamp default '2003-01-01 00:00:00'); set TIMESTAMP=1000000000; insert into t1 values(); select * from t1; t1 t2 -2001-09-09 04:46:40 2003-01-01 00:00:00 +20010909044640 20030101000000 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `t1` timestamp(14) NOT NULL, - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' + `t2` timestamp(14) NOT NULL default '20030101000000' ) TYPE=MyISAM show columns from t1; Field Type Null Key Default Extra t1 timestamp(14) YES NULL -t2 timestamp(14) YES 2003-01-01 00:00:00 +t2 timestamp(14) YES 20030101000000 show columns from t1 like 't2'; Field Type Null Key Default Extra -t2 timestamp(14) YES 2003-01-01 00:00:00 +t2 timestamp(14) YES 20030101000000 create table t2 (select * from t1); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `t1` timestamp(14) NOT NULL, - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' + `t2` timestamp(14) NOT NULL default '20030101000000' ) TYPE=MyISAM alter table t1 add column t0 timestamp first; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `t0` timestamp(14) NOT NULL, - `t1` timestamp(14) NOT NULL default '2003-01-01 00:00:00', - `t2` timestamp(14) NOT NULL default '2003-01-01 00:00:00' + `t1` timestamp(14) NOT NULL default '20030101000000', + `t2` timestamp(14) NOT NULL default '20030101000000' ) TYPE=MyISAM drop table t1,t2; create table t1 (ts1 timestamp, ts2 timestamp); @@ -164,8 +165,8 @@ insert into t1 values (); insert into t1 values (DEFAULT, DEFAULT); select * from t1; ts1 ts2 -2001-09-09 04:46:40 0000-00-00 00:00:00 -2001-09-09 04:46:40 0000-00-00 00:00:00 +20010909044640 00000000000000 +20010909044640 00000000000000 drop table t1; create table t1 (ts timestamp(19)); show create table t1; @@ -179,3 +180,44 @@ select * from t1; ts 2001-09-09 04:46:40 drop table t1; +set new=1; +create table t1 (a char(2), t timestamp); +insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'), +('b', '2004-02-01 00:00:00'); +select max(t) from t1 group by a; +max(t) +2004-01-01 01:00:00 +2004-02-01 00:00:00 +drop table t1; +create table t1 (ts1 timestamp); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ts1` timestamp(19) NOT NULL +) TYPE=MyISAM +alter table t1 add ts2 timestamp; +set new=0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ts1` timestamp(19) NOT NULL, + `ts2` timestamp(19) NOT NULL default '0000-00-00 00:00:00' +) TYPE=MyISAM +drop table t1; +create table t1 (ts1 timestamp); +insert into t1 values ('2004-01-01 00:00:00'), ('2004-01-01 01:00:00'); +select * from t1; +ts1 +20040101000000 +20040101010000 +set new=1; +select * from t1; +ts1 +2004-01-01 00:00:00 +2004-01-01 01:00:00 +set new=0; +select * from t1; +ts1 +20040101000000 +20040101010000 +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 92bd20e846e..464ee63c137 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -71,6 +71,7 @@ select * from t1; set new=1; select * from t1; drop table t1; +set new=0; # # Bug #1885, bug #2539. @@ -116,3 +117,34 @@ set TIMESTAMP=1000000000; insert into t1 values (); select * from t1; drop table t1; + +# +# Test for bug #4131, TIMESTAMP columns missing minutes and seconds when +# using GROUP BY in @@new=1 mode. +# +set new=1; +create table t1 (a char(2), t timestamp); +insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'), + ('b', '2004-02-01 00:00:00'); +select max(t) from t1 group by a; +drop table t1; + +# +# More --new mode tests +# Both columns created before and during alter should have same length. +# +create table t1 (ts1 timestamp); +show create table t1; +alter table t1 add ts2 timestamp; +set new=0; +show create table t1; +drop table t1; +# Selecting from table in --new mode should not affect further selects. +create table t1 (ts1 timestamp); +insert into t1 values ('2004-01-01 00:00:00'), ('2004-01-01 01:00:00'); +select * from t1; +set new=1; +select * from t1; +set new=0; +select * from t1; +drop table t1; -- cgit v1.2.1 From a26cea5e6c30226b849dbd94abf147ebcf49c19b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Sep 2004 17:01:26 +0200 Subject: mysql-test-run.sh: Added timing output for each test case. Added --embedded-server option. mysqltest.c: Added 'start_timer', 'end_timer' commands Makefile.am: Include mysys/my_getsystime.c to get time function in mysqltest Many files: new file client/Makefile.am: Include mysys/my_getsystime.c to get time function in mysqltest client/mysqltest.c: Added 'start_timer', 'end_timer' commands mysql-test/mysql-test-run.sh: Added timing output for each test case. Added --embedded-server option. --- mysql-test/mysql-test-run.sh | 226 ++- mysql-test/r/alter_table.result.es | 483 +++++++ mysql-test/r/drop_temp_table.result.es | 12 + mysql-test/r/insert_select.result.es | 628 +++++++++ mysql-test/r/packet.result.es | 26 + mysql-test/r/query_cache.result.es | 910 ++++++++++++ mysql-test/r/select.result.es | 2366 ++++++++++++++++++++++++++++++++ mysql-test/r/type_blob.result.es | 692 ++++++++++ mysql-test/r/type_float.result.es | 143 ++ mysql-test/r/type_ranges.result.es | 320 +++++ 10 files changed, 5741 insertions(+), 65 deletions(-) create mode 100644 mysql-test/r/alter_table.result.es create mode 100644 mysql-test/r/drop_temp_table.result.es create mode 100644 mysql-test/r/insert_select.result.es create mode 100644 mysql-test/r/packet.result.es create mode 100644 mysql-test/r/query_cache.result.es create mode 100644 mysql-test/r/select.result.es create mode 100644 mysql-test/r/type_blob.result.es create mode 100644 mysql-test/r/type_float.result.es create mode 100644 mysql-test/r/type_ranges.result.es (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 41dc3c419f0..333dd453b96 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -232,9 +232,13 @@ DBUSER="" START_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10 MYSQL_TEST_SSL_OPTS="" +USE_EMBEDDED_SERVER="" +RESULT_EXT="" while test $# -gt 0; do case "$1" in + --embedded-server) USE_EMBEDDED_SERVER=1 ; USE_MANAGER=0 ; NO_SLAVE=1 ; \ + USE_RUNNING_SERVER="" RESULT_EXT=".es" ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --force) FORCE=1 ;; --verbose-manager) MANAGER_QUIET_OPT="" ;; @@ -458,18 +462,27 @@ fi if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi E=`$EXPR $COLUMNS - 8` -DASH72=`$ECHO '------------------------------------------'|$CUT -c 1-$E` +DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c 1-$E` # on source dist, we pick up freshly build executables # on binary, use what is installed if [ x$SOURCE_DIST = x1 ] ; then - MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" - if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then - MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest" - elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then - MYSQL_TEST="$BASEDIR/client/.libs/mysqltest" + if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then + if [ -f "$BASEDIR/libmysqld/examples/mysqltest" ] ; then + MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest" + else + echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2 + exit 1 + fi else - MYSQL_TEST="$BASEDIR/client/mysqltest" + MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" + if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then + MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest" + elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then + MYSQL_TEST="$BASEDIR/client/.libs/mysqltest" + else + MYSQL_TEST="$BASEDIR/client/mysqltest" + fi fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" @@ -565,7 +578,8 @@ export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ - --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS" + --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT --timer-file=$MY_LOG_DIR/timer \ + $MYSQL_TEST_SSL_OPTS" MYSQL_TEST_BIN=$MYSQL_TEST MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS" GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client @@ -599,6 +613,13 @@ show_failed_diff () result_file=r/$1.result eval_file=r/$1.eval + # If we have an special externsion for result files we use it if we are recording + # or a result file with that extension exists. + if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] + then + result_file="$result_file$RESULT_EXT" + fi + if [ -f $eval_file ] then result_file=$eval_file @@ -880,6 +901,8 @@ EOF abort_if_failed "Could not execute manager command" } +# The embedded server needs the cleanup so we do some of the start work +# but stop before actually running mysqld or anything. start_master() { @@ -949,6 +972,18 @@ start_master() CUR_MYERR=$MASTER_MYERR CUR_MYSOCK=$MASTER_MYSOCK + # For embedded server we collect the server flags and return + if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then + # Add a -A to each argument to pass it to embedded server + EMBEDDED_SERVER_OPTS="" + for opt in $master_args + do + EMBEDDED_SERVER_OPTS="$EMBEDDED_SERVER_OPTS -A $opt" + done + EXTRA_MYSQL_TEST_OPT="$EMBEDDED_SERVER_OPTS" + return + fi + if [ x$DO_DDD = x1 ] then $ECHO "set args $master_args" > $GDB_MASTER_INIT @@ -1159,22 +1194,26 @@ stop_master () { if [ x$MASTER_RUNNING = x1 ] then - pid=`$CAT $MASTER_MYPID` - manager_term $pid master - if [ $? != 0 ] && [ -f $MASTER_MYPID ] - then # try harder! - $ECHO "master not cooperating with mysqladmin, will try manual kill" - kill $pid - sleep_until_file_deleted $pid $MASTER_MYPID - if [ -f $MASTER_MYPID ] ; then - $ECHO "master refused to die. Sending SIGKILL" - kill -9 `$CAT $MASTER_MYPID` - $RM -f $MASTER_MYPID + # For embedded server we don't stop anyting but mark that + # MASTER_RUNNING=0 to get cleanup when calling start_master(). + if [ x$USE_EMBEDDED_SERVER != x1 ] ; then + pid=`$CAT $MASTER_MYPID` + manager_term $pid master + if [ $? != 0 ] && [ -f $MASTER_MYPID ] + then # try harder! + $ECHO "master not cooperating with mysqladmin, will try manual kill" + kill $pid + sleep_until_file_deleted $pid $MASTER_MYPID + if [ -f $MASTER_MYPID ] ; then + $ECHO "master refused to die. Sending SIGKILL" + kill -9 `$CAT $MASTER_MYPID` + $RM -f $MASTER_MYPID + else + $ECHO "master responded to SIGTERM " + fi else - $ECHO "master responded to SIGTERM " + sleep $SLEEP_TIME_AFTER_RESTART fi - else - sleep $SLEEP_TIME_AFTER_RESTART fi MASTER_RUNNING=0 fi @@ -1217,9 +1256,13 @@ run_testcase () master_init_script=$TESTDIR/$tname-master.sh slave_init_script=$TESTDIR/$tname-slave.sh slave_master_info_file=$TESTDIR/$tname.slave-mi - result_file=$tname + tsrcdir=$TESTDIR/$tname-src + result_file="r/$tname.result" echo $tname > $CURRENT_TEST SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0` + if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] ; then + result_file="$result_file$RESULT_EXT" + fi if [ "$USE_MANAGER" = 1 ] ; then many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)` fi @@ -1249,11 +1292,46 @@ run_testcase () return fi - # Stop all slave threads, so that we don't have useless reconnection attempts - # and error messages in case the slave and master servers restart. - stop_slave_threads - stop_slave_threads 1 - stop_slave_threads 2 + if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then + # Stop all slave threads, so that we don't have useless reconnection + # attempts and error messages in case the slave and master servers restart. + stop_slave_threads + stop_slave_threads 1 + stop_slave_threads 2 + fi + + # FIXME temporary solution, we will get a new C version of this + # script soon anyway so it is not worth it spending the time + if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then + for t in \ + + "bdb-deadlock" \ + "connect" \ + "flush_block_commit" \ + "grant2" \ + "grant_cache" \ + "grant" \ + "init_connect" \ + "innodb-deadlock" \ + "innodb-lock" \ + "mix_innodb_myisam_binlog" \ + "mysqlbinlog2" \ + "mysqlbinlog" \ + "mysqldump" \ + "mysql_protocols" \ + "ps_1general" \ + "rename" \ + "show_check" \ + "system_mysql_db_fix" \ + "user_var" \ + "variables" + do + if [ "$tname" = "$t" ] ; then + skip_test $tname + return + fi + done + fi if [ -z "$USE_RUNNING_SERVER" ] ; then @@ -1269,6 +1347,10 @@ run_testcase () ;; --result-file=*) result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"` + result_file="r/$result_file.result" + if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] ; then + result_file="$result_file$RESULT_EXT" + fi # Note that this must be set to space, not "" for test-reset to work EXTRA_MASTER_OPT=" " ;; @@ -1278,7 +1360,11 @@ run_testcase () start_master TZ=$MY_TZ; export TZ else - if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ] + # If we had extra master opts to the previous run + # or there is no master running (FIXME strange.....) + # or there is a master init script + if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || \ + [ -f $master_init_script ] then EXTRA_MASTER_OPT="" stop_master @@ -1289,47 +1375,50 @@ run_testcase () fi fi - do_slave_restart=0 - if [ -f $slave_opt_file ] ; - then - EXTRA_SLAVE_OPT=`$CAT $slave_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"` - do_slave_restart=1 - else - if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ; - then - EXTRA_SLAVE_OPT="" - do_slave_restart=1 - fi - fi - - if [ -f $slave_master_info_file ] ; then - SLAVE_MASTER_INFO=`$CAT $slave_master_info_file` - do_slave_restart=1 - else - if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ; + # We never start a slave if embedded server is used + if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then + do_slave_restart=0 + if [ -f $slave_opt_file ] ; then - SLAVE_MASTER_INFO="" + EXTRA_SLAVE_OPT=`$CAT $slave_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"` do_slave_restart=1 + else + if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ; + then + EXTRA_SLAVE_OPT="" + do_slave_restart=1 + fi fi - fi - if [ x$do_slave_restart = x1 ] ; then - stop_slave - echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR - start_slave - else - echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR - fi - if [ x$many_slaves = x1 ]; then - start_slave 1 - start_slave 2 + if [ -f $slave_master_info_file ] ; then + SLAVE_MASTER_INFO=`$CAT $slave_master_info_file` + do_slave_restart=1 + else + if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ; + then + SLAVE_MASTER_INFO="" + do_slave_restart=1 + fi + fi + + if [ x$do_slave_restart = x1 ] ; then + stop_slave + echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR + start_slave + else + echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR + fi + if [ x$many_slaves = x1 ]; then + start_slave 1 + start_slave 2 + fi fi fi cd $MYSQL_TEST_DIR if [ -f $tf ] ; then $RM -f r/$tname.*reject - mysql_test_args="-R r/$result_file.result $EXTRA_MYSQL_TEST_OPT" + mysql_test_args="-R $result_file $EXTRA_MYSQL_TEST_OPT" if [ -z "$DO_CLIENT_GDB" ] ; then `$MYSQL_TEST $mysql_test_args < $tf 2> $TIMEFILE`; else @@ -1349,7 +1438,12 @@ run_testcase () if [ $res = 0 ]; then total_inc pass_inc - $ECHO "$RES$RES_SPACE [ pass ]" + TIMER="" + if [ -f "$MY_LOG_DIR/timer" ]; then + TIMER=`cat $MY_LOG_DIR/timer` + TIMER=`$PRINTF "%13s" $TIMER` + fi + $ECHO "$RES$RES_SPACE [ pass ] $TIMER" else # why the following ``if'' ? That is why res==1 is special ? if [ $res = 2 ]; then @@ -1364,12 +1458,13 @@ run_testcase () $ECHO "$RES$RES_SPACE [ fail ]" $ECHO error_is - show_failed_diff $result_file + show_failed_diff $tname $ECHO if [ x$FORCE != x1 ] ; then $ECHO "Aborting: $tname failed. To continue, re-run with '--force'." $ECHO - if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] + if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ + [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] then mysql_stop stop_manager @@ -1377,7 +1472,8 @@ run_testcase () exit 1 fi - if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] + if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ + [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] then mysql_restart fi @@ -1511,7 +1607,7 @@ then fi $ECHO -$ECHO " TEST RESULT" +$ECHO "TEST RESULT TIME (ms)" $ECHO $DASH72 if [ -z "$1" ] ; diff --git a/mysql-test/r/alter_table.result.es b/mysql-test/r/alter_table.result.es new file mode 100644 index 00000000000..4f93b40a573 --- /dev/null +++ b/mysql-test/r/alter_table.result.es @@ -0,0 +1,483 @@ +drop table if exists t1,t2; +drop database if exists mysqltest; +create table t1 ( +col1 int not null auto_increment primary key, +col2 varchar(30) not null, +col3 varchar (20) not null, +col4 varchar(4) not null, +col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, +col6 int not null, to_be_deleted int); +insert into t1 values (2,4,3,5,"PENDING",1,7); +alter table t1 +add column col4_5 varchar(20) not null after col4, +add column col7 varchar(30) not null after col5, +add column col8 datetime not null, drop column to_be_deleted, +change column col2 fourth varchar(30) not null after col3, +modify column col6 int not null first; +select * from t1; +col6 col1 col3 fourth col4 col4_5 col5 col7 col8 +1 2 3 4 5 PENDING 0000-00-00 00:00:00 +drop table t1; +create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL); +insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12); +alter table t1 add column new_col int, order by payoutid,bandid; +select * from t1; +bandID payoutID new_col +6 1 NULL +3 4 NULL +1 6 NULL +2 6 NULL +4 9 NULL +5 10 NULL +7 12 NULL +8 12 NULL +alter table t1 order by bandid,payoutid; +select * from t1; +bandID payoutID new_col +1 6 NULL +2 6 NULL +3 4 NULL +4 9 NULL +5 10 NULL +6 1 NULL +7 12 NULL +8 12 NULL +drop table t1; +CREATE TABLE t1 ( +GROUP_ID int(10) unsigned DEFAULT '0' NOT NULL, +LANG_ID smallint(5) unsigned DEFAULT '0' NOT NULL, +NAME varchar(80) DEFAULT '' NOT NULL, +PRIMARY KEY (GROUP_ID,LANG_ID), +KEY NAME (NAME)); +ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null; +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +GROUP_ID int(10) unsigned NULL PRI 0 +LANG_ID smallint(5) unsigned NULL PRI 0 +NAME char(80) latin1_swedish_ci MUL +DROP TABLE t1; +create table t1 (n int); +insert into t1 values(9),(3),(12),(10); +alter table t1 order by n; +select * from t1; +n +3 +9 +10 +12 +drop table t1; +CREATE TABLE t1 ( +id int(11) unsigned NOT NULL default '0', +category_id tinyint(4) unsigned NOT NULL default '0', +type_id tinyint(4) unsigned NOT NULL default '0', +body text NOT NULL, +user_id int(11) unsigned NOT NULL default '0', +status enum('new','old') NOT NULL default 'new', +PRIMARY KEY (id) +) ENGINE=MyISAM; +ALTER TABLE t1 ORDER BY t1.id, t1.status, t1.type_id, t1.user_id, t1.body; +DROP TABLE t1; +CREATE TABLE t1 (AnamneseId int(10) unsigned NOT NULL auto_increment,B BLOB,PRIMARY KEY (AnamneseId)) engine=myisam; +insert into t1 values (null,"hello"); +LOCK TABLES t1 WRITE; +ALTER TABLE t1 ADD Column new_col int not null; +UNLOCK TABLES; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; +create table t1 (i int unsigned not null auto_increment primary key); +insert into t1 values (null),(null),(null),(null); +alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i); +select * from t1; +i +1 +2 +3 +4 +drop table t1; +create table t1 (name char(15)); +insert into t1 (name) values ("current"); +create database mysqltest; +create table mysqltest.t1 (name char(15)); +insert into mysqltest.t1 (name) values ("mysqltest"); +select * from t1; +name +current +select * from mysqltest.t1; +name +mysqltest +alter table t1 rename mysqltest.t1; +ERROR 42S01: Table 't1' already exists +select * from t1; +name +current +select * from mysqltest.t1; +name +mysqltest +drop table t1; +drop database mysqltest; +create database mysqltest; +create table mysqltest.t1 (a int,b int,c int); +grant all on mysqltest.t1 to mysqltest_1@localhost; +alter table t1 rename t2; +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +delete from mysql.user where user=_binary'mysqltest_1'; +drop database mysqltest; +create table t1 (n1 int not null, n2 int, n3 int, n4 float, +unique(n1), +key (n1, n2, n3, n4), +key (n2, n3, n4, n1), +key (n3, n4, n1, n2), +key (n4, n1, n2, n3) ); +alter table t1 disable keys; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 n1 1 n1 A 0 NULL NULL BTREE +t1 1 n1_2 1 n1 A NULL NULL NULL BTREE disabled +t1 1 n1_2 2 n2 A NULL NULL NULL YES BTREE disabled +t1 1 n1_2 3 n3 A NULL NULL NULL YES BTREE disabled +t1 1 n1_2 4 n4 A NULL NULL NULL YES BTREE disabled +t1 1 n2 1 n2 A NULL NULL NULL YES BTREE disabled +t1 1 n2 2 n3 A NULL NULL NULL YES BTREE disabled +t1 1 n2 3 n4 A NULL NULL NULL YES BTREE disabled +t1 1 n2 4 n1 A NULL NULL NULL BTREE disabled +t1 1 n3 1 n3 A NULL NULL NULL YES BTREE disabled +t1 1 n3 2 n4 A NULL NULL NULL YES BTREE disabled +t1 1 n3 3 n1 A NULL NULL NULL BTREE disabled +t1 1 n3 4 n2 A NULL NULL NULL YES BTREE disabled +t1 1 n4 1 n4 A NULL NULL NULL YES BTREE disabled +t1 1 n4 2 n1 A NULL NULL NULL BTREE disabled +t1 1 n4 3 n2 A NULL NULL NULL YES BTREE disabled +t1 1 n4 4 n3 A NULL NULL NULL YES BTREE disabled +insert into t1 values(10,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(9,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(8,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(7,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(6,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(5,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(4,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(3,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(2,RAND()*1000,RAND()*1000,RAND()); +insert into t1 values(1,RAND()*1000,RAND()*1000,RAND()); +alter table t1 enable keys; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 n1 1 n1 A 10 NULL NULL BTREE +t1 1 n1_2 1 n1 A 10 NULL NULL BTREE +t1 1 n1_2 2 n2 A 10 NULL NULL YES BTREE +t1 1 n1_2 3 n3 A 10 NULL NULL YES BTREE +t1 1 n1_2 4 n4 A 10 NULL NULL YES BTREE +t1 1 n2 1 n2 A 10 NULL NULL YES BTREE +t1 1 n2 2 n3 A 10 NULL NULL YES BTREE +t1 1 n2 3 n4 A 10 NULL NULL YES BTREE +t1 1 n2 4 n1 A 10 NULL NULL BTREE +t1 1 n3 1 n3 A 10 NULL NULL YES BTREE +t1 1 n3 2 n4 A 10 NULL NULL YES BTREE +t1 1 n3 3 n1 A 10 NULL NULL BTREE +t1 1 n3 4 n2 A 10 NULL NULL YES BTREE +t1 1 n4 1 n4 A 10 NULL NULL YES BTREE +t1 1 n4 2 n1 A 10 NULL NULL BTREE +t1 1 n4 3 n2 A 10 NULL NULL YES BTREE +t1 1 n4 4 n3 A 10 NULL NULL YES BTREE +drop table t1; +create table t1 (i int unsigned not null auto_increment primary key); +alter table t1 rename t2; +alter table t2 rename t1, add c char(10) comment "no comment"; +show columns from t1; +Field Type Null Key Default Extra +i int(10) unsigned PRI NULL auto_increment +c char(10) YES NULL +drop table t1; +create table t1 (a int, b int); +insert into t1 values(1,100), (2,100), (3, 100); +insert into t1 values(1,99), (2,99), (3, 99); +insert into t1 values(1,98), (2,98), (3, 98); +insert into t1 values(1,97), (2,97), (3, 97); +insert into t1 values(1,96), (2,96), (3, 96); +insert into t1 values(1,95), (2,95), (3, 95); +insert into t1 values(1,94), (2,94), (3, 94); +insert into t1 values(1,93), (2,93), (3, 93); +insert into t1 values(1,92), (2,92), (3, 92); +insert into t1 values(1,91), (2,91), (3, 91); +insert into t1 values(1,90), (2,90), (3, 90); +insert into t1 values(1,89), (2,89), (3, 89); +insert into t1 values(1,88), (2,88), (3, 88); +insert into t1 values(1,87), (2,87), (3, 87); +insert into t1 values(1,86), (2,86), (3, 86); +insert into t1 values(1,85), (2,85), (3, 85); +insert into t1 values(1,84), (2,84), (3, 84); +insert into t1 values(1,83), (2,83), (3, 83); +insert into t1 values(1,82), (2,82), (3, 82); +insert into t1 values(1,81), (2,81), (3, 81); +insert into t1 values(1,80), (2,80), (3, 80); +insert into t1 values(1,79), (2,79), (3, 79); +insert into t1 values(1,78), (2,78), (3, 78); +insert into t1 values(1,77), (2,77), (3, 77); +insert into t1 values(1,76), (2,76), (3, 76); +insert into t1 values(1,75), (2,75), (3, 75); +insert into t1 values(1,74), (2,74), (3, 74); +insert into t1 values(1,73), (2,73), (3, 73); +insert into t1 values(1,72), (2,72), (3, 72); +insert into t1 values(1,71), (2,71), (3, 71); +insert into t1 values(1,70), (2,70), (3, 70); +insert into t1 values(1,69), (2,69), (3, 69); +insert into t1 values(1,68), (2,68), (3, 68); +insert into t1 values(1,67), (2,67), (3, 67); +insert into t1 values(1,66), (2,66), (3, 66); +insert into t1 values(1,65), (2,65), (3, 65); +insert into t1 values(1,64), (2,64), (3, 64); +insert into t1 values(1,63), (2,63), (3, 63); +insert into t1 values(1,62), (2,62), (3, 62); +insert into t1 values(1,61), (2,61), (3, 61); +insert into t1 values(1,60), (2,60), (3, 60); +insert into t1 values(1,59), (2,59), (3, 59); +insert into t1 values(1,58), (2,58), (3, 58); +insert into t1 values(1,57), (2,57), (3, 57); +insert into t1 values(1,56), (2,56), (3, 56); +insert into t1 values(1,55), (2,55), (3, 55); +insert into t1 values(1,54), (2,54), (3, 54); +insert into t1 values(1,53), (2,53), (3, 53); +insert into t1 values(1,52), (2,52), (3, 52); +insert into t1 values(1,51), (2,51), (3, 51); +insert into t1 values(1,50), (2,50), (3, 50); +insert into t1 values(1,49), (2,49), (3, 49); +insert into t1 values(1,48), (2,48), (3, 48); +insert into t1 values(1,47), (2,47), (3, 47); +insert into t1 values(1,46), (2,46), (3, 46); +insert into t1 values(1,45), (2,45), (3, 45); +insert into t1 values(1,44), (2,44), (3, 44); +insert into t1 values(1,43), (2,43), (3, 43); +insert into t1 values(1,42), (2,42), (3, 42); +insert into t1 values(1,41), (2,41), (3, 41); +insert into t1 values(1,40), (2,40), (3, 40); +insert into t1 values(1,39), (2,39), (3, 39); +insert into t1 values(1,38), (2,38), (3, 38); +insert into t1 values(1,37), (2,37), (3, 37); +insert into t1 values(1,36), (2,36), (3, 36); +insert into t1 values(1,35), (2,35), (3, 35); +insert into t1 values(1,34), (2,34), (3, 34); +insert into t1 values(1,33), (2,33), (3, 33); +insert into t1 values(1,32), (2,32), (3, 32); +insert into t1 values(1,31), (2,31), (3, 31); +insert into t1 values(1,30), (2,30), (3, 30); +insert into t1 values(1,29), (2,29), (3, 29); +insert into t1 values(1,28), (2,28), (3, 28); +insert into t1 values(1,27), (2,27), (3, 27); +insert into t1 values(1,26), (2,26), (3, 26); +insert into t1 values(1,25), (2,25), (3, 25); +insert into t1 values(1,24), (2,24), (3, 24); +insert into t1 values(1,23), (2,23), (3, 23); +insert into t1 values(1,22), (2,22), (3, 22); +insert into t1 values(1,21), (2,21), (3, 21); +insert into t1 values(1,20), (2,20), (3, 20); +insert into t1 values(1,19), (2,19), (3, 19); +insert into t1 values(1,18), (2,18), (3, 18); +insert into t1 values(1,17), (2,17), (3, 17); +insert into t1 values(1,16), (2,16), (3, 16); +insert into t1 values(1,15), (2,15), (3, 15); +insert into t1 values(1,14), (2,14), (3, 14); +insert into t1 values(1,13), (2,13), (3, 13); +insert into t1 values(1,12), (2,12), (3, 12); +insert into t1 values(1,11), (2,11), (3, 11); +insert into t1 values(1,10), (2,10), (3, 10); +insert into t1 values(1,9), (2,9), (3, 9); +insert into t1 values(1,8), (2,8), (3, 8); +insert into t1 values(1,7), (2,7), (3, 7); +insert into t1 values(1,6), (2,6), (3, 6); +insert into t1 values(1,5), (2,5), (3, 5); +insert into t1 values(1,4), (2,4), (3, 4); +insert into t1 values(1,3), (2,3), (3, 3); +insert into t1 values(1,2), (2,2), (3, 2); +insert into t1 values(1,1), (2,1), (3, 1); +alter table t1 add unique (a,b), add key (b); +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 a 1 a A NULL NULL NULL YES BTREE +t1 0 a 2 b A NULL NULL NULL YES BTREE +t1 1 b 1 b A 100 NULL NULL YES BTREE +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 a 1 a A 3 NULL NULL YES BTREE +t1 0 a 2 b A 300 NULL NULL YES BTREE +t1 1 b 1 b A 100 NULL NULL YES BTREE +drop table t1; +CREATE TABLE t1 (i int(10), index(i) ); +ALTER TABLE t1 DISABLE KEYS; +INSERT DELAYED INTO t1 VALUES(1),(2),(3); +ALTER TABLE t1 ENABLE KEYS; +drop table t1; +set names koi8r; +create table t1 (a char(10) character set koi8r); +insert into t1 values (''); +select a,hex(a) from t1; +a hex(a) + D4C5D3D4 +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); +select a,hex(a) from t1; +a hex(a) + F2E5F1F2 +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 char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) + D4C5D3D4 +alter table t1 change a a varchar(10) character set cp1251; +select a,hex(a) from t1; +a hex(a) + F2E5F1F2 +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) + D4C5D3D4 +alter table t1 change a a text character set cp1251; +select a,hex(a) from t1; +a hex(a) + F2E5F1F2 +alter table t1 change a a char(10) character set koi8r; +select a,hex(a) from t1; +a hex(a) + D4C5D3D4 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set koi8r default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 CONVERT TO CHARACTER SET latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 DEFAULT CHARACTER SET cp1251; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set latin1 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1251 +drop table t1; +create table t1 (myblob longblob,mytext longtext) +default charset latin1 collate latin1_general_cs; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `myblob` longblob, + `mytext` longtext collate latin1_general_cs +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs +alter table t1 character set latin2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `myblob` longblob, + `mytext` longtext character set latin1 collate latin1_general_cs +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +drop table t1; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES ('localhost','root'),('localhost',''),('games','monty'); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 3 NULL NULL BTREE +ALTER TABLE t1 ENABLE KEYS; +UNLOCK TABLES; +CHECK TABLES t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User), +KEY (Host) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 0 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES ('localhost','root'),('localhost',''); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 2 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +ALTER TABLE t1 ENABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 2 NULL NULL BTREE +t1 1 Host 1 Host A 1 NULL NULL BTREE +UNLOCK TABLES; +CHECK TABLES t1; +Table Op Msg_type Msg_text +test.t1 check status OK +LOCK TABLES t1 WRITE; +ALTER TABLE t1 RENAME t2; +UNLOCK TABLES; +select * from t2; +Host User +localhost +localhost root +DROP TABLE t2; +CREATE TABLE t1 ( +Host varchar(16) binary NOT NULL default '', +User varchar(16) binary NOT NULL default '', +PRIMARY KEY (Host,User), +KEY (Host) +) ENGINE=MyISAM; +LOCK TABLES t1 WRITE; +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE +t1 0 PRIMARY 2 User A 0 NULL NULL BTREE +t1 1 Host 1 Host A NULL NULL NULL BTREE disabled +DROP TABLE t1; +CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE); +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` int(11) default NULL, + UNIQUE KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 DROP PRIMARY KEY; +ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists +DROP TABLE t1; +create table t1 (a int, b int, key(a)); +insert into t1 values (1,1), (2,2); +alter table t1 drop key no_such_key; +ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists +alter table t1 drop key a; +drop table t1; +create table t1 (a int); +alter table t1 rename to `t1\\`; +ERROR 42000: Incorrect table name 't1\\' +rename table t1 to `t1\\`; +ERROR 42000: Incorrect table name 't1\\' +drop table t1; diff --git a/mysql-test/r/drop_temp_table.result.es b/mysql-test/r/drop_temp_table.result.es new file mode 100644 index 00000000000..4497022520e --- /dev/null +++ b/mysql-test/r/drop_temp_table.result.es @@ -0,0 +1,12 @@ +reset master; +create database `drop-temp+table-test`; +use `drop-temp+table-test`; +create temporary table `table:name` (a int); +select get_lock("a",10); +get_lock("a",10) +1 +select get_lock("a",10); +get_lock("a",10) +1 +show binlog events; +drop database `drop-temp+table-test`; diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es new file mode 100644 index 00000000000..3955c0534f2 --- /dev/null +++ b/mysql-test/r/insert_select.result.es @@ -0,0 +1,628 @@ +drop table if exists t1,t2; +create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL); +insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12); +create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY); +insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; +insert into t2 (payoutID) SELECT payoutID+10 FROM t1; +ERROR 23000: Duplicate entry '16' for key 1 +insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; +select * from t2; +payoutID +1 +4 +6 +9 +10 +11 +12 +14 +16 +19 +20 +22 +drop table t1,t2; +CREATE TABLE `t1` ( +`numeropost` bigint(20) unsigned NOT NULL default '0', +`icone` tinyint(4) unsigned NOT NULL default '0', +`numreponse` bigint(20) unsigned NOT NULL auto_increment, +`contenu` text NOT NULL, +`pseudo` varchar(50) NOT NULL default '', +`date` datetime NOT NULL default '0000-00-00 00:00:00', +`ip` bigint(11) NOT NULL default '0', +`signature` tinyint(1) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`,`numreponse`) +,KEY `ip` (`ip`), +KEY `date` (`date`), +KEY `pseudo` (`pseudo`), +KEY `numreponse` (`numreponse`) +) ENGINE=MyISAM; +CREATE TABLE `t2` ( +`numeropost` bigint(20) unsigned NOT NULL default '0', +`icone` tinyint(4) unsigned NOT NULL default '0', +`numreponse` bigint(20) unsigned NOT NULL auto_increment, +`contenu` text NOT NULL, +`pseudo` varchar(50) NOT NULL default '', +`date` datetime NOT NULL default '0000-00-00 00:00:00', +`ip` bigint(11) NOT NULL default '0', +`signature` tinyint(1) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`,`numreponse`), +KEY `ip` (`ip`), +KEY `date` (`date`), +KEY `pseudo` (`pseudo`), +KEY `numreponse` (`numreponse`) +) ENGINE=MyISAM; +INSERT INTO t2 +(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES +(9,1,56,'test','joce','2001-07-25 13:50:53' +,3649052399,0); +INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip) +SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2 +WHERE numeropost=9 ORDER BY numreponse ASC; +show variables like '%bulk%'; +Variable_name Value +bulk_insert_buffer_size 8388608 +INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip) +SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2 +WHERE numeropost=9 ORDER BY numreponse ASC; +DROP TABLE t1,t2; +create table t1(a int, unique(a)); +insert into t1 values(2); +create table t2(a int); +insert into t2 values(1),(2); +reset master; +insert into t1 select * from t2; +ERROR 23000: Duplicate entry '2' for key 1 +show binlog events; +select * from t1; +a +1 +2 +drop table t1, t2; +create table t1 (a int not null); +create table t2 (a int not null); +insert into t1 values (1); +insert into t1 values (a+2); +insert into t1 values (a+3); +insert into t1 values (4),(a+5); +insert into t1 select * from t1; +select * from t1; +a +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +insert into t1 select * from t1 as t2; +select * from t1; +a +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +insert into t2 select * from t1 as t2; +select * from t1; +a +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +insert into t1 select t2.a from t1,t2; +select * from t1; +a +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +2 +3 +4 +5 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +2 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +5 +insert into t1 select * from t1,t1; +ERROR 42000: Not unique table/alias: 't1' +drop table t1,t2; +create table t1 (a int not null primary key, b char(10)); +create table t2 (a int not null, b char(10)); +insert into t1 values (1,"t1:1"),(3,"t1:3"); +insert into t2 values (2,"t2:2"), (3,"t2:3"); +insert into t1 select * from t2; +ERROR 23000: Duplicate entry '3' for key 1 +select * from t1; +a b +1 t1:1 +3 t1:3 +2 t2:2 +replace into t1 select * from t2; +select * from t1; +a b +1 t1:1 +3 t2:3 +2 t2:2 +drop table t1,t2; +CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL); +CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr)); +INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121); +INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1; +drop table t1,t2; +CREATE TABLE t1( +Month date NOT NULL, +Type tinyint(3) unsigned NOT NULL auto_increment, +Field int(10) unsigned NOT NULL, +Count int(10) unsigned NOT NULL, +UNIQUE KEY Month (Month,Type,Field) +); +insert into t1 Values +(20030901, 1, 1, 100), +(20030901, 1, 2, 100), +(20030901, 2, 1, 100), +(20030901, 2, 2, 100), +(20030901, 3, 1, 100); +select * from t1; +Month Type Field Count +2003-09-01 1 1 100 +2003-09-01 1 2 100 +2003-09-01 2 1 100 +2003-09-01 2 2 100 +2003-09-01 3 1 100 +Select null, Field, Count From t1 Where Month=20030901 and Type=2; +NULL Field Count +NULL 1 100 +NULL 2 100 +create table t2(No int not null, Field int not null, Count int not null); +insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2 +select * from t2; +No Field Count +0 1 100 +0 2 100 +drop table t1, t2; diff --git a/mysql-test/r/packet.result.es b/mysql-test/r/packet.result.es new file mode 100644 index 00000000000..0ff587b3957 --- /dev/null +++ b/mysql-test/r/packet.result.es @@ -0,0 +1,26 @@ +set global max_allowed_packet=100; +set max_allowed_packet=100; +set global net_buffer_length=100; +set net_buffer_length=100; +SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; +len +1024 +select repeat('a',2000); +repeat('a',2000) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated +select @@net_buffer_length, @@max_allowed_packet; +@@net_buffer_length @@max_allowed_packet +1024 1024 +SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; +set global max_allowed_packet=default; +set max_allowed_packet=default; +set global net_buffer_length=default; +set net_buffer_length=default; +SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; +len +100 +select length(repeat('a',2000)); +length(repeat('a',2000)) +2000 diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es new file mode 100644 index 00000000000..218e4e1ae2a --- /dev/null +++ b/mysql-test/r/query_cache.result.es @@ -0,0 +1,910 @@ +set GLOBAL query_cache_size=1355776; +flush query cache; +flush query cache; +reset query cache; +flush status; +drop table if exists t1,t2,t3,t4,t11,t21; +drop database if exists mysqltest; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t1; +a +1 +2 +3 +select sql_no_cache * from t1; +a +1 +2 +3 +select length(now()) from t1; +length(now()) +19 +19 +19 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +drop table t1; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (4),(5),(6); +create table t3 (a int not null) engine=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST; +select * from t3; +a +1 +2 +3 +4 +5 +6 +select * from t3; +a +1 +2 +3 +4 +5 +6 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +insert into t2 values (7); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1; +a +1 +2 +3 +select * from t1; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +insert into t3 values (8); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t3; +a +1 +2 +3 +8 +4 +5 +6 +7 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +update t2 set a=9 where a=7; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1; +a +1 +2 +3 +8 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +update t3 set a=10 where a=1; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t3; +a +10 +2 +3 +8 +4 +5 +6 +9 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +delete from t2 where a=9; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1; +a +10 +2 +3 +8 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +delete from t3 where a=10; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1, t2, t3; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +insert into t1 values (4); +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 2 +flush query cache; +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +drop table t1, t2; +create table t1 (a text not null); +create table t11 (a text not null); +create table t2 (a text not null); +create table t21 (a text not null); +create table t3 (a text not null); +insert into t1 values("1111111111111111111111111111111111111111111111111111"); +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t11 select * from t1; +insert into t21 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t3 select * from t1; +insert into t3 select * from t2; +insert into t3 select * from t1; +select * from t11; +select * from t21; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 7 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +insert into t11 values(""); +select * from t3; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 8 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 2 +flush query cache; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 7 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +drop table t1, t2, t3, t11, t21; +set query_cache_type=demand; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select sql_cache * from t1 union select * from t1; +a +1 +2 +3 +set query_cache_type=2; +select sql_cache * from t1 union select * from t1; +a +1 +2 +3 +select * from t1 union select sql_cache * from t1; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 4 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +set query_cache_type=on; +reset query cache; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select sql_no_cache * from t1; +a +1 +2 +3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1; +create table t1 (a text not null); +select CONNECTION_ID() from t1; +CONNECTION_ID() +select FOUND_ROWS(); +FOUND_ROWS() +0 +select NOW() from t1; +NOW() +select CURDATE() from t1; +CURDATE() +select CURTIME() from t1; +CURTIME() +select DATABASE() from t1; +DATABASE() +select ENCRYPT("test") from t1; +ENCRYPT("test") +select LAST_INSERT_ID() from t1; +LAST_INSERT_ID() +select RAND() from t1; +RAND() +select UNIX_TIMESTAMP() from t1; +UNIX_TIMESTAMP() +select USER() from t1; +USER() +select benchmark(1,1) from t1; +benchmark(1,1) +explain extended select benchmark(1,1) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select sql_no_cache benchmark(1,1) AS `benchmark(1,1)` from test.t1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +create table t2 (a text not null); +insert into t1 values("1111111111111111111111111111111111111111111111111111"); +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 4 +show status like "Qcache_lowmem_prunes"; +Variable_name Value +Qcache_lowmem_prunes 0 +select a as a1, a as a2 from t1; +select a as a2, a as a3 from t1; +select a as a3, a as a4 from t1; +select a as a1, a as a2 from t1; +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 4 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_lowmem_prunes"; +Variable_name Value +Qcache_lowmem_prunes 2 +reset query cache; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +select * from t1; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1,t2; +create database mysqltest; +create table mysqltest.t1 (i int not null auto_increment, a int, primary key (i)); +insert into mysqltest.t1 (a) values (1); +select * from mysqltest.t1 where i is null; +i a +1 1 +create table t1(a int); +select * from t1; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +select * from mysqltest.t1; +i a +1 1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 3 +drop database mysqltest; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +drop table t1; +create table t1 (a char(1) not null collate koi8r_general_ci); +insert into t1 values(_koi8r""); +set CHARACTER SET koi8r; +select * from t1; +a + +set CHARACTER SET cp1251_koi8; +select * from t1; +a + +set CHARACTER SET DEFAULT; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 4 +drop table t1; +create database if not exists mysqltest; +create table mysqltest.t1 (i int not null); +create table t1 (i int not null); +insert into mysqltest.t1 (i) values (1); +insert into t1 (i) values (2); +select * from t1; +i +2 +use mysqltest; +select * from t1; +i +1 +select * from t1; +i +1 +use test; +select * from t1; +i +2 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +drop database mysqltest; +drop table t1; +create table t1 (i int not null); +insert into t1 (i) values (1),(2),(3),(4); +select SQL_CALC_FOUND_ROWS * from t1 limit 2; +i +1 +2 +select FOUND_ROWS(); +FOUND_ROWS() +4 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +select * from t1 where i=1; +i +1 +select FOUND_ROWS(); +FOUND_ROWS() +1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +select SQL_CALC_FOUND_ROWS * from t1 limit 2; +i +1 +2 +select FOUND_ROWS(); +FOUND_ROWS() +4 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 7 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +select * from t1 where i=1; +i +1 +select FOUND_ROWS(); +FOUND_ROWS() +1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 8 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t1; +flush query cache; +reset query cache; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t1; +a +1 +2 +3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +insert delayed into t1 values (4); +select a from t1; +a +1 +2 +3 +4 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +drop table t1; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 4096 +set GLOBAL query_cache_min_res_unit=1001; +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 1008 +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t1; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 11 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t1; +select a from t2; +a +1 +2 +3 +select a from t2; +a +1 +2 +3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 12 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +drop table t2; +set GLOBAL query_cache_min_res_unit=default; +show global variables like "query_cache_min_res_unit"; +Variable_name Value +query_cache_min_res_unit 4096 +create table t1 (a int not null); +insert into t1 values (1); +select "aaa" from t1; +aaa +aaa +select "AAA" from t1; +AAA +AAA +drop table t1; +create table t1 (a int); +set GLOBAL query_cache_size=1000; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +select * from t1; +a +set GLOBAL query_cache_size=1024; +Warnings: +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +select * from t1; +a +set GLOBAL query_cache_size=10240; +Warnings: +Warning 1282 Query cache failed to set size 10240; new query cache size is 0 +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +select * from t1; +a +set GLOBAL query_cache_size=20480; +Warnings: +Warning 1282 Query cache failed to set size 20480; new query cache size is 0 +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +select * from t1; +a +set GLOBAL query_cache_size=40960; +Warnings: +Warning 1282 Query cache failed to set size 40960; new query cache size is 0 +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 0 +select * from t1; +a +set GLOBAL query_cache_size=51200; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 51200 +select * from t1; +a +set GLOBAL query_cache_size=61440; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 61440 +select * from t1; +a +set GLOBAL query_cache_size=81920; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 81920 +select * from t1; +a +set GLOBAL query_cache_size=102400; +show global variables like "query_cache_size"; +Variable_name Value +query_cache_size 102400 +select * from t1; +a +drop table t1; +set GLOBAL query_cache_size=1048576; +create table t1 (i int not null); +create table t2 (i int not null); +select * from t1; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +create temporary table t3 (i int not null); +select * from t2; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +select * from t3; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +update t1 set i=(select distinct 1 from (select * from t2) a); +drop table t1, t2, t3; +use mysql; +select * from db; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +use test; +select * from mysql.db; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +create table t1(id int auto_increment primary key); +insert into t1 values (NULL), (NULL), (NULL); +select * from t1 where id=2; +id +2 +alter table t1 rename to t2; +select * from t1 where id=2; +ERROR 42S02: Table 'test.t1' doesn't exist +drop table t2; +select * from t1 where id=2; +ERROR 42S02: Table 'test.t1' doesn't exist +create table t1 (word char(20) not null); +select * from t1; +word +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +load data infile 'TEST_DIR/std_data/words.dat' into table t1; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select count(*) from t1; +count(*) +70 +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1 into outfile "query_cache.out.file"; +select * from t1 into outfile "query_cache.out.file"; +ERROR HY000: File 'query_cache.out.file' already exists +select * from t1 limit 1 into dumpfile "query_cache.dump.file"; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1; +a +1 +2 +SET OPTION SQL_SELECT_LIMIT=1; +select * from t1; +a +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +SET OPTION SQL_SELECT_LIMIT=DEFAULT; +drop table t1; +flush query cache; +reset query cache; +flush status; +set GLOBAL query_cache_size=1048576; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a text not null); +create table t3 (a text not null); +insert into t3 values("1111111111111111111111111111111111111111111111111111"); +insert into t2 select * from t3; +insert into t3 select * from t2; +insert into t2 select * from t3; +insert into t3 select * from t2; +insert into t2 select * from t3; +insert into t3 select * from t2; +insert into t2 select * from t3; +insert into t3 select * from t2; +insert into t2 select * from t3; +insert into t3 select * from t2; +drop table t2; +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +create table t4 (a int not null); +insert into t4 values (1),(2),(3); +select * from t4; +select * from t2; +select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2; +select * from t2; +select * from t4; +select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2; +select * from t2; +select * from t4; +select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2; +delete from t2 where a=1; +flush query cache; +select * from t3; +delete from t4 where a=1; +flush query cache; +drop table t1,t2,t3,t4; +set query_cache_wlock_invalidate=1; +create table t1 (a int not null); +create table t2 (a int not null); +select * from t1; +a +select * from t2; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +lock table t1 write, t2 read; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +unlock table; +drop table t1,t2; +set query_cache_wlock_invalidate=default; +SET NAMES koi8r; +CREATE TABLE t1 (a char(1) character set koi8r); +INSERT INTO t1 VALUES (_koi8r''),(_koi8r''); +SELECT a,'',''='' FROM t1; +a б 'Б'='б' + 1 + 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +set collation_connection=koi8r_bin; +SELECT a,'',''='' FROM t1; +a б 'Б'='б' + 0 + 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +set character_set_client=cp1251; +SELECT a,'',''='' FROM t1; +a В 'в'='В' + 0 + 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 3 +set character_set_results=cp1251; +SELECT a,'',''='' FROM t1; +a В 'в'='В' + 0 + 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 6 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 4 +DROP TABLE t1; +CREATE TABLE t1 (a int(1)); +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +SELECT * FROM test.t1; +a +USE test; +DROP TABLE t1; +set character_set_results=null; +select @@character_set_results; +@@character_set_results +NULL +set character_set_results=default; +set GLOBAL query_cache_size=1355776; +create table t1 (id int auto_increment primary key, c char(25)); +insert into t1 set c = repeat('x',24); +insert into t1 set c = concat(repeat('x',24),'x'); +insert into t1 set c = concat(repeat('x',24),'w'); +insert into t1 set c = concat(repeat('x',24),'y'); +set max_sort_length=200; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxy +reset query cache; +set max_sort_length=20; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxy +set max_sort_length=200; +select c from t1 order by c, id; +c +xxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxw +xxxxxxxxxxxxxxxxxxxxxxxxx +xxxxxxxxxxxxxxxxxxxxxxxxy +set max_sort_length=default; +select '1' || '3' from t1; +'1' || '3' +1 +1 +1 +1 +set SQL_MODE=oracle; +select '1' || '3' from t1; +'1' || '3' +13 +13 +13 +13 +set SQL_MODE=default; +drop table t1; +create table t1 (a varchar(20), b int); +insert into t1 values ('12345678901234567890', 1); +set group_concat_max_len=10; +select group_concat(a) FROM t1 group by b; +group_concat(a) +1234567890 +set group_concat_max_len=1024; +select group_concat(a) FROM t1 group by b; +group_concat(a) +12345678901234567890 +set group_concat_max_len=default; +drop table t1; +SET GLOBAL query_cache_size=0; diff --git a/mysql-test/r/select.result.es b/mysql-test/r/select.result.es new file mode 100644 index 00000000000..2ff58372d6d --- /dev/null +++ b/mysql-test/r/select.result.es @@ -0,0 +1,2366 @@ +drop table if exists t1,t2,t3,t4; +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 +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 Using where +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 +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 t2 ALL NULL NULL NULL NULL 1199 Using temporary +1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using where; Using index +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.00 +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.00 +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 PRI NULL auto_increment +fld1 int(6) unsigned zerofill NULL UNI 000000 +companynr tinyint(2) unsigned zerofill NULL 00 +fld3 char(30) latin1_swedish_ci MUL +fld4 char(35) latin1_swedish_ci +fld5 char(35) latin1_swedish_ci +fld6 char(4) latin1_swedish_ci +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL UNI 000000 +fld3 char(30) latin1_swedish_ci MUL +fld4 char(35) latin1_swedish_ci +fld5 char(35) latin1_swedish_ci +fld6 char(4) latin1_swedish_ci +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; +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(14) 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 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +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.26 +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 a +1 1 1 +2 2 1 +3 3 1 +1 1 2 +2 2 2 +3 3 2 +1 1 3 +2 2 3 +3 3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a a +1 1 1 +2 1 1 +3 1 1 +1 2 2 +2 2 2 +3 2 2 +1 3 3 +2 3 3 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a a +1 1 1 +2 2 1 +3 3 1 +1 1 2 +2 2 2 +3 3 2 +1 1 3 +2 2 3 +3 3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a a +1 1 1 +2 1 1 +3 1 1 +1 2 2 +2 2 2 +3 2 2 +1 3 3 +2 3 3 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a a +1 1 2 +1 1 3 +2 2 2 +2 2 3 +3 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 a +1 1 NULL +2 1 1 +3 1 1 +1 2 NULL +2 2 2 +3 2 2 +1 3 NULL +2 3 3 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a a a +1 1 1 +2 2 2 +3 3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a a a +1 1 1 +2 1 NULL +3 1 NULL +1 2 NULL +2 2 2 +3 2 NULL +1 3 NULL +2 3 NULL +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a a +1 1 2 +1 1 3 +2 2 2 +2 2 3 +3 3 2 +3 3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a a +1 1 NULL +2 1 1 +3 1 1 +1 2 NULL +2 2 2 +3 2 2 +1 3 NULL +2 3 3 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a a a +1 1 1 +2 2 2 +3 3 3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a a a +1 1 1 +2 1 NULL +3 1 NULL +1 2 NULL +2 2 2 +3 2 NULL +1 3 NULL +2 3 NULL +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a a a +1 1 1 +2 2 2 +3 3 3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a a a +1 1 1 +2 2 2 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a a +1 NULL 1 +2 NULL 1 +3 NULL 1 +1 1 2 +2 2 2 +3 3 2 +1 1 3 +2 2 3 +3 3 3 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a a +2 1 1 +3 1 1 +2 2 2 +3 2 2 +2 3 3 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a a a +1 1 1 +2 NULL 1 +3 NULL 1 +1 NULL 2 +2 2 2 +3 NULL 2 +1 NULL 3 +2 NULL 3 +3 3 3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a a a +1 1 1 +2 2 2 +3 3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a a a +1 1 1 +2 NULL 1 +3 NULL 1 +1 NULL 2 +2 2 2 +3 NULL 2 +1 NULL 3 +2 NULL 3 +3 3 3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a a a +1 1 1 +2 2 2 +3 3 3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +2 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a a a +1 1 1 +2 2 2 +3 3 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 ( +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 +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; diff --git a/mysql-test/r/type_blob.result.es b/mysql-test/r/type_blob.result.es new file mode 100644 index 00000000000..84d02b4a4b4 --- /dev/null +++ b/mysql-test/r/type_blob.result.es @@ -0,0 +1,692 @@ +drop table if exists t1,t2,t3,t4,t5,t6,t7; +CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000)); +show columns from t1; +Field Type Null Key Default Extra +a blob YES NULL +b text YES NULL +c blob YES NULL +d mediumtext YES NULL +e longtext YES NULL +CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); +Warnings: +Warning 1246 Converting column 'a' from CHAR to TEXT +Warning 1246 Converting column 'b' from CHAR to BLOB +Warning 1246 Converting column 'c' from CHAR to TEXT +show columns from t2; +Field Type Null Key Default Extra +a text YES NULL +b mediumblob YES NULL +c longtext YES NULL +create table t3 (a long, b long byte); +show create TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` mediumtext, + `b` mediumblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2,t3 +#; +CREATE TABLE t1 (a char(257) default "hello"); +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead +CREATE TABLE t2 (a blob default "hello"); +ERROR 42000: BLOB/TEXT column 'a' can't have a default value +drop table if exists t1,t2; +create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); +insert into t1 values (null,"a","A"); +insert into t1 values (null,"bbb","BBB"); +insert into t1 values (null,"ccc","CCC"); +select last_insert_id(); +last_insert_id() +3 +select * from t1,t1 as t2; +nr b str nr b str +1 a A 1 a A +2 bbb BBB 1 a A +3 ccc CCC 1 a A +1 a A 2 bbb BBB +2 bbb BBB 2 bbb BBB +3 ccc CCC 2 bbb BBB +1 a A 3 ccc CCC +2 bbb BBB 3 ccc CCC +3 ccc CCC 3 ccc CCC +drop table t1; +create table t1 (a text); +insert into t1 values ('where'); +update t1 set a='Where'; +select * from t1; +a +Where +drop table t1; +create table t1 (t text,c char(10),b blob, d binary(10)); +insert into t1 values (NULL,NULL,NULL,NULL); +insert into t1 values ("","","",""); +insert into t1 values ("hello","hello","hello","hello"); +insert into t1 values ("HELLO","HELLO","HELLO","HELLO"); +insert into t1 values ("HELLO MY","HELLO MY","HELLO MY","HELLO MY"); +insert into t1 values ("a","a","a","a"); +insert into t1 values (1,1,1,1); +insert into t1 values (NULL,NULL,NULL,NULL); +update t1 set c="",b=null where c="1"; +lock tables t1 READ; +show full fields from t1; +Field Type Collation Null Key Default Extra Privileges Comment +t text latin1_swedish_ci YES NULL +c varchar(10) latin1_swedish_ci YES NULL +b blob 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 varchar(10) latin1_swedish_ci YES NULL +b blob NULL YES NULL +d varbinary(10) NULL YES NULL +unlock tables; +select t from t1 where t like "hello"; +t +hello +HELLO +select c from t1 where c like "hello"; +c +hello +HELLO +select b from t1 where b like "hello"; +b +hello +select d from t1 where d like "hello"; +d +hello +select c from t1 having c like "hello"; +c +hello +HELLO +select d from t1 having d like "hello"; +d +hello +select t from t1 where t like "%HELLO%"; +t +hello +HELLO +HELLO MY +select c from t1 where c like "%HELLO%"; +c +hello +HELLO +HELLO MY +select b from t1 where b like "%HELLO%"; +b +HELLO +HELLO MY +select d from t1 where d like "%HELLO%"; +d +HELLO +HELLO MY +select c from t1 having c like "%HELLO%"; +c +hello +HELLO +HELLO MY +select d from t1 having d like "%HELLO%"; +d +HELLO +HELLO MY +select d from t1 having d like "%HE%LLO%"; +d +HELLO +HELLO MY +select t from t1 order by t; +t +NULL +NULL + +1 +a +hello +HELLO +HELLO MY +select c from t1 order by c; +c +NULL +NULL + + +a +hello +HELLO +HELLO MY +select b from t1 order by b; +b +NULL +NULL +NULL + +HELLO +HELLO MY +a +hello +select d from t1 order by d; +d +NULL +NULL + +1 +HELLO +HELLO MY +a +hello +select distinct t from t1; +t +NULL + +hello +HELLO MY +a +1 +select distinct b from t1; +b +NULL + +hello +HELLO +HELLO MY +a +select distinct t from t1 order by t; +t +NULL + +1 +a +hello +HELLO MY +select distinct b from t1 order by b; +b +NULL + +HELLO +HELLO MY +a +hello +select t from t1 group by t; +t +NULL + +1 +a +hello +HELLO MY +select b from t1 group by b; +b +NULL + +HELLO +HELLO MY +a +hello +set option sql_big_tables=1; +select distinct t from t1; +t +NULL + +hello +HELLO MY +a +1 +select distinct b from t1; +b +NULL + +hello +HELLO +HELLO MY +a +select distinct t from t1 order by t; +t +NULL + +1 +a +hello +HELLO MY +select distinct b from t1 order by b; +b +NULL + +HELLO +HELLO MY +a +hello +select distinct c from t1; +c +NULL + +hello +HELLO MY +a +select distinct d from t1; +d +NULL + +hello +HELLO +HELLO MY +a +1 +select distinct c from t1 order by c; +c +NULL + +a +hello +HELLO MY +select distinct d from t1 order by d; +d +NULL + +1 +HELLO +HELLO MY +a +hello +select c from t1 group by c; +c +NULL + +a +hello +HELLO MY +select d from t1 group by d; +d +NULL + +1 +HELLO +HELLO MY +a +hello +set option sql_big_tables=0; +select distinct * from t1; +t c b d +NULL NULL NULL NULL + +hello hello hello hello +HELLO HELLO HELLO HELLO +HELLO MY HELLO MY HELLO MY HELLO MY +a a a a +1 NULL 1 +select t,count(*) from t1 group by t; +t count(*) +NULL 2 + 1 +1 1 +a 1 +hello 2 +HELLO MY 1 +select b,count(*) from t1 group by b; +b count(*) +NULL 3 + 1 +HELLO 1 +HELLO MY 1 +a 1 +hello 1 +select c,count(*) from t1 group by c; +c count(*) +NULL 2 + 2 +a 1 +hello 2 +HELLO MY 1 +select d,count(*) from t1 group by d; +d count(*) +NULL 2 + 1 +1 1 +HELLO 1 +HELLO MY 1 +a 1 +hello 1 +drop table t1; +create table t1 (a text, unique (a(2100))); +ERROR 42000: Specified key was too long; max key length is 1000 bytes +create table t1 (a text, key (a(2100))); +Warnings: +Warning 1071 Specified key was too long; max key length is 1000 bytes +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text, + KEY `a` (`a`(1000)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 ( +t1_id bigint(21) NOT NULL auto_increment, +_field_72 varchar(128) DEFAULT '' NOT NULL, +_field_95 varchar(32), +_field_115 tinyint(4) DEFAULT '0' NOT NULL, +_field_122 tinyint(4) DEFAULT '0' NOT NULL, +_field_126 tinyint(4), +_field_134 tinyint(4), +PRIMARY KEY (t1_id), +UNIQUE _field_72 (_field_72), +KEY _field_115 (_field_115), +KEY _field_122 (_field_122) +); +INSERT INTO t1 VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',0,1,NULL,NULL); +INSERT INTO t1 VALUES (2,'hroberts','7415275a8c95952901e42b13a6b78566',0,1,NULL,NULL); +INSERT INTO t1 VALUES (3,'guest','d41d8cd98f00b204e9800998ecf8427e',1,0,NULL,NULL); +CREATE TABLE t2 ( +seq_0_id bigint(21) DEFAULT '0' NOT NULL, +seq_1_id bigint(21) DEFAULT '0' NOT NULL, +PRIMARY KEY (seq_0_id,seq_1_id) +); +INSERT INTO t2 VALUES (1,1); +INSERT INTO t2 VALUES (2,1); +INSERT INTO t2 VALUES (2,2); +CREATE TABLE t3 ( +t3_id bigint(21) NOT NULL auto_increment, +_field_131 varchar(128), +_field_133 tinyint(4) DEFAULT '0' NOT NULL, +_field_135 datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, +_field_137 tinyint(4), +_field_139 datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, +_field_140 blob, +_field_142 tinyint(4) DEFAULT '0' NOT NULL, +_field_145 tinyint(4) DEFAULT '0' NOT NULL, +_field_148 tinyint(4) DEFAULT '0' NOT NULL, +PRIMARY KEY (t3_id), +KEY _field_133 (_field_133), +KEY _field_135 (_field_135), +KEY _field_139 (_field_139), +KEY _field_142 (_field_142), +KEY _field_145 (_field_145), +KEY _field_148 (_field_148) +); +INSERT INTO t3 VALUES (1,'test job 1',0,'0000-00-00 00:00:00',0,'1999-02-25 22:43:32','test\r\njob\r\n1',0,0,0); +INSERT INTO t3 VALUES (2,'test job 2',0,'0000-00-00 00:00:00',0,'1999-02-26 21:08:04','',0,0,0); +CREATE TABLE t4 ( +seq_0_id bigint(21) DEFAULT '0' NOT NULL, +seq_1_id bigint(21) DEFAULT '0' NOT NULL, +PRIMARY KEY (seq_0_id,seq_1_id) +); +INSERT INTO t4 VALUES (1,1); +INSERT INTO t4 VALUES (2,1); +CREATE TABLE t5 ( +t5_id bigint(21) NOT NULL auto_increment, +_field_149 tinyint(4), +_field_156 varchar(128) DEFAULT '' NOT NULL, +_field_157 varchar(128) DEFAULT '' NOT NULL, +_field_158 varchar(128) DEFAULT '' NOT NULL, +_field_159 varchar(128) DEFAULT '' NOT NULL, +_field_160 varchar(128) DEFAULT '' NOT NULL, +_field_161 varchar(128) DEFAULT '' NOT NULL, +PRIMARY KEY (t5_id), +KEY _field_156 (_field_156), +KEY _field_157 (_field_157), +KEY _field_158 (_field_158), +KEY _field_159 (_field_159), +KEY _field_160 (_field_160), +KEY _field_161 (_field_161) +); +INSERT INTO t5 VALUES (1,0,'tomato','','','','',''); +INSERT INTO t5 VALUES (2,0,'cilantro','','','','',''); +CREATE TABLE t6 ( +seq_0_id bigint(21) DEFAULT '0' NOT NULL, +seq_1_id bigint(21) DEFAULT '0' NOT NULL, +PRIMARY KEY (seq_0_id,seq_1_id) +); +INSERT INTO t6 VALUES (1,1); +INSERT INTO t6 VALUES (1,2); +INSERT INTO t6 VALUES (2,2); +CREATE TABLE t7 ( +t7_id bigint(21) NOT NULL auto_increment, +_field_143 tinyint(4), +_field_165 varchar(32), +_field_166 smallint(6) DEFAULT '0' NOT NULL, +PRIMARY KEY (t7_id), +KEY _field_166 (_field_166) +); +INSERT INTO t7 VALUES (1,0,'High',1); +INSERT INTO t7 VALUES (2,0,'Medium',2); +INSERT INTO t7 VALUES (3,0,'Low',3); +select replace(t3._field_140, "\r","^M"),t3_id,min(t3._field_131), min(t3._field_135), min(t3._field_139), min(t3._field_137), min(link_alias_142._field_165), min(link_alias_133._field_72), min(t3._field_145), min(link_alias_148._field_156), replace(min(t3._field_140), "\r","^M"),t3.t3_id from t3 left join t4 on t4.seq_0_id = t3.t3_id left join t7 link_alias_142 on t4.seq_1_id = link_alias_142.t7_id left join t6 on t6.seq_0_id = t3.t3_id left join t1 link_alias_133 on t6.seq_1_id = link_alias_133.t1_id left join t2 on t2.seq_0_id = t3.t3_id left join t5 link_alias_148 on t2.seq_1_id = link_alias_148.t5_id where t3.t3_id in (1) group by t3.t3_id order by link_alias_142._field_166, _field_139, link_alias_133._field_72, _field_135, link_alias_148._field_156; +replace(t3._field_140, "\r","^M") t3_id min(t3._field_131) min(t3._field_135) min(t3._field_139) min(t3._field_137) min(link_alias_142._field_165) min(link_alias_133._field_72) min(t3._field_145) min(link_alias_148._field_156) replace(min(t3._field_140), "\r","^M") t3_id +test^M +job^M +1 1 test job 1 0000-00-00 00:00:00 1999-02-25 22:43:32 0 High admin 0 tomato test^M +job^M +1 1 +drop table t1,t2,t3,t4,t5,t6,t7; +create table t1 (a blob); +insert into t1 values ("empty"),(""); +select a,reverse(a) from t1; +a reverse(a) +empty ytpme + +drop table t1; +create table t1 (a blob, key (a(10))); +insert into t1 values ("bye"),("hello"),("hello"),("hello word"); +select * from t1 where a like "hello%"; +a +hello +hello +hello word +drop table t1; +CREATE TABLE t1 ( +f1 int(11) DEFAULT '0' NOT NULL, +f2 varchar(16) DEFAULT '' NOT NULL, +f5 text, +KEY index_name (f1,f2,f5(16)) +); +INSERT INTO t1 VALUES (0,'traktor','1111111111111'); +INSERT INTO t1 VALUES (1,'traktor','1111111111111111111111111'); +select count(*) from t1 where f2='traktor'; +count(*) +2 +drop table t1; +create table t1 (foobar tinyblob not null, boggle smallint not null, key (foobar(32), boggle)); +insert into t1 values ('fish', 10),('bear', 20); +select foobar, boggle from t1 where foobar = 'fish'; +foobar boggle +fish 10 +select foobar, boggle from t1 where foobar = 'fish' and boggle = 10; +foobar boggle +fish 10 +drop table t1; +create table t1 (id integer auto_increment unique,imagem LONGBLOB not null); +insert into t1 (id) values (1); +select +charset(load_file('../../std_data/words.dat')), +collation(load_file('../../std_data/words.dat')), +coercibility(load_file('../../std_data/words.dat')); +charset(load_file('../../std_data/words.dat')) collation(load_file('../../std_data/words.dat')) coercibility(load_file('../../std_data/words.dat')) +NULL NULL 3 +explain extended select +charset(load_file('../../std_data/words.dat')), +collation(load_file('../../std_data/words.dat')), +coercibility(load_file('../../std_data/words.dat')); +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 sql_no_cache charset(load_file(_latin1'../../std_data/words.dat')) AS `charset(load_file('../../std_data/words.dat'))`,collation(load_file(_latin1'../../std_data/words.dat')) AS `collation(load_file('../../std_data/words.dat'))`,coercibility(load_file(_latin1'../../std_data/words.dat')) AS `coercibility(load_file('../../std_data/words.dat'))` +update t1 set imagem=load_file('../../std_data/words.dat') where id=1; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'imagem' at row 1 +select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; +if(imagem is null, "ERROR", "OK") length(imagem) +OK 0 +drop table t1; +create table t1 select load_file('../../std_data/words.dat'); +show full fields from t1; +Field Type Collation Null Key Default Extra Privileges Comment +load_file('../../std_data/words.dat') longblob NULL YES NULL +drop table t1; +create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '); +select * from t1 where txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy ' or txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where id='1' or id='2'; +id txt +1 Chevy +2 Chevy +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +id txt +1 Chevy +2 Chevy +3 Ford +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy ','Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt < 'Chevy '; +id txt +select * from t1 where txt <= 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt > 'Chevy'; +id txt +3 Ford +select * from t1 where txt >= 'Chevy'; +id txt +1 Chevy +2 Chevy +3 Ford +drop table t1; +create table t1 (id integer primary key auto_increment, txt text, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL); +select * from t1 where txt='Chevy' or txt is NULL; +id txt +3 NULL +1 Chevy +2 Chevy +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range txt_index txt_index 23 NULL 2 Using where +select * from t1 where txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy ' or txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where id='1' or id='2'; +id txt +1 Chevy +2 Chevy +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +id txt +1 Chevy +2 Chevy +4 Ford +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy ','Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt < 'Chevy '; +id txt +select * from t1 where txt < 'Chevy ' or txt is NULL; +id txt +3 NULL +select * from t1 where txt <= 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt > 'Chevy'; +id txt +4 Ford +select * from t1 where txt >= 'Chevy'; +id txt +1 Chevy +2 Chevy +4 Ford +alter table t1 modify column txt blob; +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where +select * from t1 where txt='Chevy' or txt is NULL; +id txt +1 Chevy +3 NULL +explain select * from t1 where txt='Chevy' or txt is NULL order by txt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where; Using filesort +select * from t1 where txt='Chevy' or txt is NULL order by txt; +id txt +3 NULL +1 Chevy +drop table t1; +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); +INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +select max(i) from t1 where c = ''; +max(i) +4 +drop table t1; diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es new file mode 100644 index 00000000000..411817bbfef --- /dev/null +++ b/mysql-test/r/type_float.result.es @@ -0,0 +1,143 @@ +drop table if exists t1; +SELECT 10,10.0,10.,.1e+2,100.0e-1; +10 10.0 10. .1e+2 100.0e-1 +10 10.0 10 10 10 +SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; +6e-05 -6e-05 --6e-05 -6e-05+1.000000 +6e-05 -6e-05 6e-05 0.99994 +SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; +1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 +10 10 10 10 10 10 0.1 0.1 0.1 +create table t1 (f1 float(24),f2 float(52)); +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +f1 float NULL YES NULL +f2 double NULL YES NULL +insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); +Warnings: +Warning 1264 Data truncated; out of range for column 'f1' at row 7 +Warning 1264 Data truncated; out of range for column 'f1' at row 8 +insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); +select * from t1; +f1 f2 +10 10 +100000 100000 +1.23457e+09 1234567890 +1e+10 10000000000 +1e+15 1e+15 +1e+20 1e+20 +3.40282e+38 1e+50 +3.40282e+38 1e+150 +-10 -10 +1e-05 1e-05 +1e-10 1e-10 +1e-15 1e-15 +1e-20 1e-20 +0 1e-50 +0 1e-150 +drop table t1; +create table t1 (datum double); +insert into t1 values (0.5),(1.0),(1.5),(2.0),(2.5); +select * from t1; +datum +0.5 +1 +1.5 +2 +2.5 +select * from t1 where datum < 1.5; +datum +0.5 +1 +select * from t1 where datum > 1.5; +datum +2 +2.5 +select * from t1 where datum = 1.5; +datum +1.5 +drop table t1; +create table t1 (a decimal(7,3) not null, key (a)); +insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1"); +select a from t1 order by a; +a +-0.010 +-0.002 +-0.000 +0.000 +1.000 +select min(a) from t1; +min(a) +-0.010 +drop table t1; +create table t1 (c1 double, c2 varchar(20)); +insert t1 values (121,"16"); +select c1 + c1 * (c2 / 100) as col from t1; +col +140.36 +create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1; +select * from t2; +col1 col2 col3 col4 +140.36 121.00000 121 3.47850542618522e-07 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `col1` double default NULL, + `col2` double(22,5) default NULL, + `col3` double default NULL, + `col4` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1,t2; +create table t1 (a float); +insert into t1 values (1); +select max(a),min(a),avg(a) from t1; +max(a) min(a) avg(a) +1 1 1 +drop table t1; +create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6)); +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +f float NULL YES NULL +f2 float NULL YES NULL +f3 float(6,2) NULL YES NULL +d double NULL YES NULL +d2 double NULL YES NULL +d3 double(10,3) NULL YES NULL +de decimal(10,0) NULL YES NULL +de2 decimal(6,0) NULL YES NULL +de3 decimal(5,2) NULL YES NULL +n decimal(10,0) NULL YES NULL +n2 decimal(8,0) NULL YES NULL +n3 decimal(7,6) NULL YES NULL +drop table t1; +create table t1 (a decimal(7,3) not null, key (a)); +insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1"); +select a from t1 order by a; +a +-0.010 +-0.002 +-0.000 +0.000 +1.000 +select min(a) from t1; +min(a) +-0.010 +drop table t1; +create table t1 (a float(200,100), b double(200,100)); +insert t1 values (1.0, 2.0); +select * from t1; +a b +1.000000000000000000000000000000 2.000000000000000000000000000000 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` float(200,30) default NULL, + `b` double(200,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (c20 char); +insert into t1 values (5000.0); +drop table t1; +create table t1 (f float(54)); +ERROR 42000: Incorrect column specifier for column 'f' +drop table if exists t1; diff --git a/mysql-test/r/type_ranges.result.es b/mysql-test/r/type_ranges.result.es new file mode 100644 index 00000000000..548b00750ea --- /dev/null +++ b/mysql-test/r/type_ranges.result.es @@ -0,0 +1,320 @@ +drop table if exists t1,t2,t3; +SET SQL_WARNINGS=1; +CREATE TABLE t1 ( +auto int(5) unsigned NOT NULL auto_increment, +string char(10) default "hello", +tiny tinyint(4) DEFAULT '0' NOT NULL , +short smallint(6) DEFAULT '1' NOT NULL , +medium mediumint(8) DEFAULT '0' NOT NULL, +long_int int(11) DEFAULT '0' NOT NULL, +longlong bigint(13) DEFAULT '0' NOT NULL, +real_float float(13,1) DEFAULT 0.0 NOT NULL, +real_double double(16,4), +utiny tinyint(3) unsigned DEFAULT '0' NOT NULL, +ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL, +umedium mediumint(8) unsigned DEFAULT '0' NOT NULL, +ulong int(11) unsigned DEFAULT '0' NOT NULL, +ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL, +time_stamp timestamp, +date_field date, +time_field time, +date_time datetime, +blob_col blob, +tinyblob_col tinyblob, +mediumblob_col mediumblob not null, +longblob_col longblob not null, +options enum('one','two','tree') not null, +flags set('one','two','tree') not null, +PRIMARY KEY (auto), +KEY (utiny), +KEY (tiny), +KEY (short), +KEY any_name (medium), +KEY (longlong), +KEY (real_float), +KEY (ushort), +KEY (umedium), +KEY (ulong), +KEY (ulonglong,ulong), +KEY (options,flags) +); +show full fields from t1; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL PRI NULL auto_increment +string varchar(10) latin1_swedish_ci YES hello +tiny tinyint(4) NULL MUL 0 +short smallint(6) NULL MUL 1 +medium mediumint(8) NULL MUL 0 +long_int int(11) NULL 0 +longlong bigint(13) NULL MUL 0 +real_float float(13,1) NULL MUL 0.0 +real_double double(16,4) NULL YES NULL +utiny tinyint(3) unsigned NULL MUL 0 +ushort smallint(5) unsigned zerofill NULL MUL 00000 +umedium mediumint(8) unsigned NULL MUL 0 +ulong int(11) unsigned NULL MUL 0 +ulonglong bigint(13) unsigned NULL MUL 0 +time_stamp timestamp NULL YES CURRENT_TIMESTAMP +date_field date NULL YES NULL +time_field time NULL YES NULL +date_time datetime NULL YES NULL +blob_col blob NULL YES NULL +tinyblob_col tinyblob NULL YES NULL +mediumblob_col mediumblob NULL +longblob_col longblob NULL +options enum('one','two','tree') latin1_swedish_ci MUL one +flags set('one','two','tree') latin1_swedish_ci +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE +t1 1 utiny 1 utiny A NULL NULL NULL BTREE +t1 1 tiny 1 tiny A NULL NULL NULL BTREE +t1 1 short 1 short A NULL NULL NULL BTREE +t1 1 any_name 1 medium A NULL NULL NULL BTREE +t1 1 longlong 1 longlong A NULL NULL NULL BTREE +t1 1 real_float 1 real_float A NULL NULL NULL BTREE +t1 1 ushort 1 ushort A NULL NULL NULL BTREE +t1 1 umedium 1 umedium A NULL NULL NULL BTREE +t1 1 ulong 1 ulong A NULL NULL NULL BTREE +t1 1 ulonglong 1 ulonglong A NULL NULL NULL BTREE +t1 1 ulonglong 2 ulong A NULL NULL NULL BTREE +t1 1 options 1 options A NULL NULL NULL BTREE +t1 1 options 2 flags A NULL NULL NULL BTREE +CREATE UNIQUE INDEX test on t1 ( auto ) ; +CREATE INDEX test2 on t1 ( ulonglong,ulong) ; +CREATE INDEX test3 on t1 ( medium ) ; +DROP INDEX test ON t1; +insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); +insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); +insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); +insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); +Warnings: +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 +Warning 1265 Data truncated for column 'flags' at row 1 +insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree"); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 +insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0); +Warnings: +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1265 Data truncated for column 'options' at row 1 +insert into t1 (tiny) values (1); +select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; +auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col +10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 +11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 +12 0.33 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 18446744073709551615 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 +14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 18446744069414584321 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 +15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 +16 hello 1 1 0 0 0 0.0 NULL 0 00000 0 0 0 0 NULL NULL NULL NULL NULL +ALTER TABLE t1 +add new_field char(10) default "new" not null, +change blob_col new_blob_col varchar(20), +change date_field date_field char(10), +alter column string set default "new default", +alter short drop default, +DROP INDEX utiny, +DROP INDEX ushort, +DROP PRIMARY KEY, +DROP FOREIGN KEY any_name, +ADD INDEX (auto); +LOCK TABLES t1 WRITE; +ALTER TABLE t1 +RENAME as t2, +DROP longblob_col; +UNLOCK TABLES; +ALTER TABLE t2 rename as t3; +LOCK TABLES t3 WRITE ; +ALTER TABLE t3 rename as t1; +UNLOCK TABLES; +select auto,new_field,new_blob_col,date_field from t1 ; +auto new_field new_blob_col date_field +10 new 1 0000-00-00 +11 new NULL NULL +12 new 1997-03-03 +13 new -1 1997-08-07 +14 new -4294967295 0000-00-00 +15 new 4294967295 0000-00-00 +16 new NULL NULL +CREATE TABLE t2 ( +auto int(5) unsigned NOT NULL auto_increment, +string char(20), +mediumblob_col mediumblob not null, +new_field char(2), +PRIMARY KEY (auto) +); +INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10; +Warnings: +Warning 1265 Data truncated for column 'new_field' at row 2 +Warning 1265 Data truncated for column 'new_field' at row 3 +Warning 1265 Data truncated for column 'new_field' at row 4 +Warning 1265 Data truncated for column 'new_field' at row 5 +Warning 1265 Data truncated for column 'new_field' at row 6 +Warning 1265 Data truncated for column 'new_field' at row 7 +select * from t2; +auto string mediumblob_col new_field +1 2 2 ne +2 0.33 ne +3 -1 -1 ne +4 -429496729 -4294967295 ne +5 4294967295 4294967295 ne +6 hello ne +select distinct flags from t1; +flags + +one,two,tree +one +one,two +select flags from t1 where find_in_set("two",flags)>0; +flags +one,two,tree +one,two,tree +one,two +one,two +select flags from t1 where find_in_set("unknown",flags)>0; +flags +select options,flags from t1 where options="ONE" and flags="ONE"; +options flags +one one +select options,flags from t1 where options="one" and flags="one"; +options flags +one one +drop table t2; +create table t2 select * from t1; +Warnings: +Warning 1265 Data truncated for column 'options' at row 4 +Warning 1265 Data truncated for column 'options' at row 5 +Warning 1265 Data truncated for column 'options' at row 6 +update t2 set string="changed" where auto=16; +show full columns from t1; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL MUL NULL auto_increment +string varchar(10) latin1_swedish_ci YES new defaul +tiny tinyint(4) NULL MUL 0 +short smallint(6) NULL MUL 0 +medium mediumint(8) NULL MUL 0 +long_int int(11) NULL 0 +longlong bigint(13) NULL MUL 0 +real_float float(13,1) NULL MUL 0.0 +real_double double(16,4) NULL YES NULL +utiny tinyint(3) unsigned NULL 0 +ushort smallint(5) unsigned zerofill NULL 00000 +umedium mediumint(8) unsigned NULL MUL 0 +ulong int(11) unsigned NULL MUL 0 +ulonglong bigint(13) unsigned NULL MUL 0 +time_stamp timestamp NULL YES CURRENT_TIMESTAMP +date_field varchar(10) latin1_swedish_ci YES NULL +time_field time NULL YES NULL +date_time datetime NULL YES NULL +new_blob_col varchar(20) latin1_swedish_ci YES NULL +tinyblob_col tinyblob NULL YES NULL +mediumblob_col mediumblob NULL +options enum('one','two','tree') latin1_swedish_ci MUL one +flags set('one','two','tree') latin1_swedish_ci +new_field varchar(10) latin1_swedish_ci new +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int(5) unsigned NULL 0 +string varchar(10) latin1_swedish_ci YES new defaul +tiny tinyint(4) NULL 0 +short smallint(6) NULL 0 +medium mediumint(8) NULL 0 +long_int int(11) NULL 0 +longlong bigint(13) NULL 0 +real_float float(13,1) NULL 0.0 +real_double double(16,4) NULL YES NULL +utiny tinyint(3) unsigned NULL 0 +ushort smallint(5) unsigned zerofill NULL 00000 +umedium mediumint(8) unsigned NULL 0 +ulong int(11) unsigned NULL 0 +ulonglong bigint(13) unsigned NULL 0 +time_stamp timestamp NULL YES 0000-00-00 00:00:00 +date_field varchar(10) latin1_swedish_ci YES NULL +time_field time NULL YES NULL +date_time datetime NULL YES NULL +new_blob_col varchar(20) latin1_swedish_ci YES NULL +tinyblob_col tinyblob NULL YES NULL +mediumblob_col mediumblob NULL +options enum('one','two','tree') latin1_swedish_ci one +flags set('one','two','tree') latin1_swedish_ci +new_field varchar(10) latin1_swedish_ci new +select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null))); +auto auto +16 16 +select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and not (t1.string<=>t2.string and t1.tiny<=>t2.tiny and t1.short<=>t2.short and t1.medium<=>t2.medium and t1.long_int<=>t2.long_int and t1.longlong<=>t2.longlong and t1.real_float<=>t2.real_float and t1.real_double<=>t2.real_double and t1.utiny<=>t2.utiny and t1.ushort<=>t2.ushort and t1.umedium<=>t2.umedium and t1.ulong<=>t2.ulong and t1.ulonglong<=>t2.ulonglong and t1.time_stamp<=>t2.time_stamp and t1.date_field<=>t2.date_field and t1.time_field<=>t2.time_field and t1.date_time<=>t2.date_time and t1.new_blob_col<=>t2.new_blob_col and t1.tinyblob_col<=>t2.tinyblob_col and t1.mediumblob_col<=>t2.mediumblob_col and t1.options<=>t2.options and t1.flags<=>t2.flags and t1.new_field<=>t2.new_field); +auto auto +16 16 +drop table t2; +create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, "a" as t2, repeat("a",256) as t3, binary repeat("b",256) as t4 from t1; +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto bigint(17) unsigned NULL PRI 0 +t1 bigint(1) NULL 0 +t2 char(1) latin1_swedish_ci +t3 longtext latin1_swedish_ci +t4 longblob NULL +select * from t2; +auto t1 t2 t3 t4 +11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +12 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +13 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +14 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +15 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +16 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +17 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +drop table t1,t2; +create table t1 (c int); +insert into t1 values(1),(2); +create table t2 select * from t1; +create table t3 select * from t1, t2; +ERROR 42S21: Duplicate column name 'c' +create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2; +show full columns from t3; +Field Type Collation Null Key Default Extra Privileges Comment +c1 int(11) NULL YES NULL +c2 int(11) NULL YES NULL +const bigint(1) NULL 0 +drop table t1,t2,t3; +create table t1 ( myfield INT NOT NULL, UNIQUE INDEX (myfield), unique (myfield), index(myfield)); +drop table t1; +create table t1 ( id integer unsigned not null primary key ); +create table t2 ( id integer unsigned not null primary key ); +insert into t1 values (1), (2); +insert into t2 values (1); +select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id ); +id_A id_B +1 1 +2 NULL +create table t3 (id_A integer unsigned not null, id_B integer unsigned null ); +insert into t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id ); +select * from t3; +id_A id_B +1 1 +2 NULL +drop table t3; +create table t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id ); +select * from t3; +id_A id_B +1 1 +2 NULL +drop table t1,t2,t3; -- cgit v1.2.1 From 0098002833e52a2a2041750df8495fc722339b08 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 09:14:18 +0200 Subject: mysql-test-run.sh: Embarrassing typo mysql-test/mysql-test-run.sh: Embarrassing typo --- mysql-test/mysql-test-run.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 333dd453b96..64e903a115b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1304,7 +1304,6 @@ run_testcase () # script soon anyway so it is not worth it spending the time if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then for t in \ - "bdb-deadlock" \ "connect" \ "flush_block_commit" \ -- cgit v1.2.1 From 6e028ad0002bee4fe1ded52fe0538124bb8604b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 09:53:14 +0200 Subject: Adjusted so auto_increment value after bulk insert will be exactly +1 after last (if no parallel inserts) --- mysql-test/r/ndb_alter_table.result | 52 ++++++++++++++++++++++++++++++++++--- mysql-test/t/ndb_alter_table.test | 32 ++++++++++++++++++++--- 2 files changed, 77 insertions(+), 7 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 897fa77185d..2ee1bf4497b 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -94,16 +94,60 @@ b INT NOT NULL ) ENGINE=ndbcluster; INSERT INTO t1 VALUES (9410,9412); ALTER TABLE t1 ADD COLUMN c int not null; -select * from t1; +select * from t1 order by a; a b c 9410 9412 0 -select * from t1; +select * from t1 order by a; a b c 9410 9412 0 alter table t1 drop c; -select * from t1; +select * from t1 order by a; a b 9410 9412 drop table t1; -select * from t1; +select * from t1 order by a; ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 ( +a INT NOT NULL PRIMARY KEY, +b INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0,1),(17,18); +select * from t1 order by a; +a b +0 1 +17 18 +alter table t1 modify column a int not null auto_increment; +select * from t1 order by a; +a b +0 1 +17 18 +INSERT INTO t1 VALUES (0,19),(20,21); +select * from t1 order by a; +a b +0 1 +17 18 +18 19 +20 21 +drop table t1; +CREATE TABLE t1 ( +a INT NOT NULL PRIMARY KEY, +b INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0,1),(17,18); +select * from t1; +a b +17 18 +0 1 +alter table t1 add c int not null unique auto_increment; +select * from t1 order by a; +a b c +0 1 2 +17 18 1 +INSERT INTO t1 VALUES (18,19,3),(20,21,0); +select * from t1 order by a; +a b c +0 1 2 +17 18 1 +18 19 3 +20 21 4 +drop table t1; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 9128d0c3811..aa3da77a1da 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -74,19 +74,45 @@ connect (con2,localhost,,,test); connection con1; ALTER TABLE t1 ADD COLUMN c int not null; -select * from t1; +select * from t1 order by a; connection con2; -select * from t1; +select * from t1 order by a; alter table t1 drop c; connection con1; -select * from t1; +select * from t1 order by a; drop table t1; connection con2; --error 1146 +select * from t1 order by a; + +CREATE TABLE t1 ( + a INT NOT NULL PRIMARY KEY, + b INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (0,1),(17,18); +select * from t1 order by a; +alter table t1 modify column a int not null auto_increment; +select * from t1 order by a; +INSERT INTO t1 VALUES (0,19),(20,21); +select * from t1 order by a; +drop table t1; + +CREATE TABLE t1 ( + a INT NOT NULL PRIMARY KEY, + b INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (0,1),(17,18); select * from t1; +alter table t1 add c int not null unique auto_increment; +select * from t1 order by a; +INSERT INTO t1 VALUES (18,19,3),(20,21,0); +select * from t1 order by a; +drop table t1; #--disable_warnings #DROP TABLE IF EXISTS t2; -- cgit v1.2.1 From c7a18f634dd72f56115156a3591e1177d90533b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 16:27:50 +0200 Subject: client_test.test: Run client_test as a testcase new file mysql-test-run.sh: More clearly report failure if --force, also exit 1 client_test.c: Use MAXPATHLEN in test_frm_bug() Renable test cases disabled for running from mysql-test-run mysqltest.c: Don't check errno from popen, may not be set client/mysqltest.c: Don't check errno from popen, may not be set tests/client_test.c: Use MAXPATHLEN in test_frm_bug() Renable test cases disabled for running from mysql-test-run mysql-test/mysql-test-run.sh: More clearly report failure if --force, also exit 1 mysql-test/t/client_test.test: Run client_test as a testcase --- mysql-test/mysql-test-run.sh | 11 +++++++++-- mysql-test/t/client_test.test | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 mysql-test/t/client_test.test (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 41dc3c419f0..c9fb682c90a 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -208,6 +208,7 @@ MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log MYSQL_MANAGER_USER=root NO_SLAVE=0 USER_TEST= +FAILED_CASES= EXTRA_MASTER_OPT="" EXTRA_MYSQL_TEST_OPT="" @@ -1376,7 +1377,7 @@ run_testcase () fi exit 1 fi - + FAILED_CASES="$FAILED_CASES $tname" if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then mysql_restart @@ -1562,4 +1563,10 @@ $ECHO [ "$DO_GCOV" ] && gcov_collect # collect coverage information [ "$DO_GPROF" ] && gprof_collect # collect coverage information -exit 0 +if [ $TOT_FAIL -ne 0 ]; then + $ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES" + $ECHO + exit 1 +else + exit 0 +fi diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test new file mode 100644 index 00000000000..eb053b6c902 --- /dev/null +++ b/mysql-test/t/client_test.test @@ -0,0 +1,2 @@ +-- disable_result_log +--exec ../tests/client_test --testcase --user=root --socket=var/tmp/master.sock --port=$MYSQL_TCP_PORT -- cgit v1.2.1 From db2ab4961236b0565b11c383560228cc8ff9dc6e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 18:25:57 +0200 Subject: mysql-test-run.sh: Make timer an option mysql-test/mysql-test-run.sh: Make timer an option --- mysql-test/mysql-test-run.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index f79a79256f8..5cb491b43c4 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -233,6 +233,7 @@ DBUSER="" START_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10 MYSQL_TEST_SSL_OPTS="" +USE_TIMER="" USE_EMBEDDED_SERVER="" RESULT_EXT="" @@ -242,6 +243,7 @@ while test $# -gt 0; do USE_RUNNING_SERVER="" RESULT_EXT=".es" ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --force) FORCE=1 ;; + --timer) USE_TIMER=1 ;; --verbose-manager) MANAGER_QUIET_OPT="" ;; --old-master) MASTER_40_ARGS="";; --master-binary=*) @@ -584,8 +586,10 @@ export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ - --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT --timer-file=$MY_LOG_DIR/timer \ - $MYSQL_TEST_SSL_OPTS" + --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS" +if [ x$USE_TIMER = x1 ] ; then + MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS --timer-file=$MY_LOG_DIR/timer" +fi MYSQL_TEST_BIN=$MYSQL_TEST MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS" GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client @@ -1444,7 +1448,7 @@ run_testcase () total_inc pass_inc TIMER="" - if [ -f "$MY_LOG_DIR/timer" ]; then + if [ x$USE_TIMER = x1 -a -f "$MY_LOG_DIR/timer" ]; then TIMER=`cat $MY_LOG_DIR/timer` TIMER=`$PRINTF "%13s" $TIMER` fi @@ -1623,7 +1627,11 @@ then fi $ECHO +if [ x$USE_TIMER = x1 ] ; then $ECHO "TEST RESULT TIME (ms)" +else +$ECHO "TEST RESULT" +fi $ECHO $DASH72 if [ -z "$1" ] ; -- cgit v1.2.1 From b1148b8aea01dde2bde76a0f4b0e92df53da8210 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 17:04:30 +0000 Subject: added 2 masters for ndb tests --- mysql-test/include/have_ndb.inc | 2 + mysql-test/install_test_db.sh | 9 +++- mysql-test/mysql-test-run.sh | 105 +++++++++++++++++++++++++--------------- 3 files changed, 76 insertions(+), 40 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 095c2dcaaa4..366b2e38b5a 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -2,3 +2,5 @@ disable_query_log; show variables like "have_ndbcluster"; enable_query_log; +connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT"1",); diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index 8db338f0f58..4554b92857e 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -36,8 +36,13 @@ then data=var/slave-data ldata=$fix_bin/var/slave-data else - data=var/master-data - ldata=$fix_bin/var/master-data + if [ x$1 = x"-1" ] + then + data=var/master-data1 + else + data=var/master-data + fi + ldata=$fix_bin/$data fi mdata=$data/mysql diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 1765bf4504b..707a6c76f8d 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -198,9 +198,10 @@ DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH" export LD_LIBRARY_PATH DYLD_LIBRARY_PATH MASTER_RUNNING=0 +MASTER1_RUNNING=0 MASTER_MYPORT=9306 SLAVE_RUNNING=0 -SLAVE_MYPORT=9307 +SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves NDBCLUSTER_PORT=9350 MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd @@ -723,13 +724,22 @@ report_stats () { mysql_install_db () { $ECHO "Removing Stale Files" - $RM -rf $MASTER_MYDDIR $SLAVE_MYDDIR $MY_LOG_DIR/* + $RM -rf $MASTER_MYDDIR $MASTER_MYDDIR"1" $SLAVE_MYDDIR $MY_LOG_DIR/* $ECHO "Installing Master Databases" $INSTALL_DB if [ $? != 0 ]; then error "Could not install master test DBs" exit 1 fi + if [ ! -z "$USE_NDBCLUSTER" ] + then + $ECHO "Installing Master Databases 1" + $INSTALL_DB -1 + if [ $? != 0 ]; then + error "Could not install master test DBs 1" + exit 1 + fi + fi $ECHO "Installing Slave Databases" $INSTALL_DB -slave if [ $? != 0 ]; then @@ -868,10 +878,10 @@ manager_term() ident=$2 if [ $USE_MANAGER = 0 ] ; then # Shutdown time must be high as slave may be in reconnect - $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1 + $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1 res=$? # Some systems require an extra connect - $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1 + $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1 if test $res = 0 then wait_for_pid $pid @@ -888,17 +898,18 @@ EOF start_master() { - if [ x$MASTER_RUNNING = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then + eval "this_master_running=\$MASTER$1_RUNNING" + if [ x$this_master_running = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then return fi # Remove stale binary logs except for 2 tests which need them if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ] then - $RM -f $MYSQL_TEST_DIR/var/log/master-bin.* + $RM -f $MYSQL_TEST_DIR/var/log/master-bin$1.* fi # Remove old master.info and relay-log.info files - $RM -f $MYSQL_TEST_DIR/var/master-data/master.info $MYSQL_TEST_DIR/var/master-data/relay-log.info + $RM -f $MYSQL_TEST_DIR/var/master-data$1/master.info $MYSQL_TEST_DIR/var/master-data$1/relay-log.info #run master initialization shell script if one exists @@ -907,20 +918,27 @@ start_master() /bin/sh $master_init_script fi cd $BASEDIR # for gcov + if [ -n "$1" ] ; then + id=`$EXPR $1 + 101`; + this_master_myport=`$EXPR $MASTER_MYPORT + $1` + else + id=1; + this_master_myport=$MASTER_MYPORT + fi if [ -z "$DO_BENCH" ] then - master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \ - --server-id=1 \ + master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \ + --server-id=$id \ --basedir=$MY_BASEDIR \ - --port=$MASTER_MYPORT \ + --port=$this_master_myport \ --local-infile \ --exit-info=256 \ --core \ $USE_NDBCLUSTER \ - --datadir=$MASTER_MYDDIR \ - --pid-file=$MASTER_MYPID \ - --socket=$MASTER_MYSOCK \ - --log=$MASTER_MYLOG \ + --datadir=$MASTER_MYDDIR$1 \ + --pid-file=$MASTER_MYPID$1 \ + --socket=$MASTER_MYSOCK$1 \ + --log=$MASTER_MYLOG$1 \ --character-sets-dir=$CHARSETSDIR \ --default-character-set=$CHARACTER_SET \ --tmpdir=$MYSQL_TMP_DIR \ @@ -931,14 +949,14 @@ start_master() $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" else - master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \ - --server-id=1 --rpl-recovery-rank=1 \ + master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \ + --server-id=$id --rpl-recovery-rank=1 \ --basedir=$MY_BASEDIR --init-rpl-role=master \ - --port=$MASTER_MYPORT \ + --port=$this_master_myport \ --local-infile \ - --datadir=$MASTER_MYDDIR \ - --pid-file=$MASTER_MYPID \ - --socket=$MASTER_MYSOCK \ + --datadir=$MASTER_MYDDIR$1 \ + --pid-file=$MASTER_MYPID$1 \ + --socket=$MASTER_MYSOCK$1 \ --character-sets-dir=$CHARSETSDIR \ --default-character-set=$CHARACTER_SET \ --core \ @@ -982,11 +1000,11 @@ EOF -title "Master" -e gdb -x $GDB_MASTER_INIT $MASTER_MYSQLD fi else - manager_launch master $MASTER_MYSQLD $master_args + manager_launch master$1 $MASTER_MYSQLD $master_args fi - sleep_until_file_created $MASTER_MYPID $wait_for_master + sleep_until_file_created $MASTER_MYPID$1 $wait_for_master wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER - MASTER_RUNNING=1 + eval "MASTER$1_RUNNING=1" } start_slave() @@ -1162,26 +1180,27 @@ stop_slave_threads () stop_master () { - if [ x$MASTER_RUNNING = x1 ] + eval "this_master_running=\$MASTER$1_RUNNING" + if [ x$this_master_running = x1 ] then - pid=`$CAT $MASTER_MYPID` - manager_term $pid master - if [ $? != 0 ] && [ -f $MASTER_MYPID ] + pid=`$CAT $MASTER_MYPID$1` + manager_term $pid master $1 + if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ] then # try harder! $ECHO "master not cooperating with mysqladmin, will try manual kill" kill $pid - sleep_until_file_deleted $pid $MASTER_MYPID - if [ -f $MASTER_MYPID ] ; then + sleep_until_file_deleted $pid $MASTER_MYPID$1 + if [ -f $MASTER_MYPID$1 ] ; then $ECHO "master refused to die. Sending SIGKILL" - kill -9 `$CAT $MASTER_MYPID` - $RM -f $MASTER_MYPID + kill -9 `$CAT $MASTER_MYPID$1` + $RM -f $MASTER_MYPID$1 else $ECHO "master responded to SIGTERM " fi else sleep $SLEEP_TIME_AFTER_RESTART fi - MASTER_RUNNING=0 + eval "MASTER$1_RUNNING=0" fi } @@ -1191,6 +1210,7 @@ mysql_stop () $ECHO "Shutting-down MySQL daemon" $ECHO "" stop_master + stop_master 1 $ECHO "Master shutdown finished" stop_slave stop_slave 1 @@ -1279,16 +1299,24 @@ run_testcase () ;; esac stop_master + stop_master 1 echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master + if [ ! -z "$USE_NDBCLUSTER" ] ; then + start_master 1 + fi TZ=$MY_TZ; export TZ else if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ] then EXTRA_MASTER_OPT="" stop_master + stop_master 1 echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master + if [ ! -z "$USE_NDBCLUSTER" ] ; then + start_master 1 + fi else echo "CURRENT_TEST: $tname" >> $MASTER_MYERR fi @@ -1432,11 +1460,11 @@ then if [ ! -z "$USE_NDBCLUSTER" ] then - if [ -z "$USE_RUNNING_NDBCLUSTER" ] - then - # Kill any running ndbcluster stuff - ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop - fi + if [ -z "$USE_RUNNING_NDBCLUSTER" ] + then + # Kill any running ndbcluster stuff + ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop + fi fi # Remove files that can cause problems @@ -1445,6 +1473,7 @@ then # Remove old berkeley db log files that can confuse the server $RM -f $MASTER_MYDDIR/log.* + $RM -f $MASTER_MYDDIR"1"/log.* wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE @@ -1456,7 +1485,7 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" - if [ "$DO_BENCH" = 1 ] + if [ "$DO_BENCH" = 1 -a ! "$DO_SMALL_BENCH" = 1 ] then NDBCLUSTER_OPTS="" else -- cgit v1.2.1 From 7da6b60883f8a9e4349591066bf284344e54f981 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 21:44:42 +0400 Subject: Some of the recently pushed prepared statements tests were disabled due to failures caused by floating point conversion issues on optimized builds). mysql-test/include/ps_conv.inc: Disable some of the tests for the test suite to pass on an optimized build (floating point issues...). mysql-test/include/ps_query.inc: Disable some of the tests for the test suite to pass on an optimized build (floating point issues...). mysql-test/r/ps_2myisam.result: Fix test results. mysql-test/r/ps_3innodb.result: Fix test results. mysql-test/r/ps_4heap.result: Fix test results. mysql-test/r/ps_5merge.result: Fix test results. mysql-test/r/ps_6bdb.result: Fix test results. mysql-test/r/ps_7ndb.result: Fix test results. --- mysql-test/include/ps_conv.inc | 8 +- mysql-test/include/ps_query.inc | 5 + mysql-test/r/ps_2myisam.result | 98 ++------------------ mysql-test/r/ps_3innodb.result | 98 ++------------------ mysql-test/r/ps_4heap.result | 98 ++------------------ mysql-test/r/ps_5merge.result | 196 ++++------------------------------------ mysql-test/r/ps_6bdb.result | 98 ++------------------ mysql-test/r/ps_7ndb.result | 98 ++------------------ 8 files changed, 72 insertions(+), 627 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc index f61fb7db1c9..03d93b6190d 100644 --- a/mysql-test/include/ps_conv.inc +++ b/mysql-test/include/ps_conv.inc @@ -1190,13 +1190,13 @@ execute stmt1 using @arg00 ; ######## SELECT .. WHERE column(year)=value(DOUBLE(m,n)/DOUBLE) ######## set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index 3ebe3c7b5a1..e02d0d5bf96 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -540,6 +540,10 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; --enable_metadata prepare stmt1 from @stmt ; +# +# Result log was disabled upon test case failure in the optimized build. +# +--disable_result_log execute stmt1 ; --disable_metadata execute stmt1 ; @@ -588,6 +592,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, --disable_metadata execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; +--enable_result_log drop table t2 ; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index ee861b257ea..68e0a53fdba 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -908,53 +908,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -977,56 +935,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3192,17 +3108,21 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 33b793d91e6..90cd5e39f9c 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -908,53 +908,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -977,56 +935,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3175,17 +3091,21 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index b2d01af019f..feef6bcf83e 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -909,53 +909,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -978,56 +936,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3176,17 +3092,21 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 125fa84e671..8f87343c894 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -951,53 +951,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -1020,56 +978,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3115,19 +3031,23 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9 ; create table t1 ( @@ -4039,53 +3959,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -4108,56 +3986,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -18 1 0 1 -2 0 1 0 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -6203,18 +6039,22 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t1_1, t1_2, t9_1, t9_2, t9; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 88e4d701acf..52009dcf82a 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -908,53 +908,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -2.0000 0 1 0 -18.0000 1 0 1 -18.0000 1 0 1 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -2.0000 0 1 0 -2.0000 0 1 0 -18.0000 1 0 1 -18.0000 1 0 1 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -977,56 +935,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -2 0 1 0 -2 0 1 0 -18 1 0 1 -18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -2 0 1 0 -2 0 1 0 -18 1 0 1 -18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -1 PRIMARY t9 ALL NULL NULL NULL NULL 3 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3175,17 +3091,21 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index eaadafdf339..decfc08b555 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -909,53 +909,11 @@ FROM t9, (select c25 x, c32 y from t2) tt WHERE x = c25 ' ; prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 21 7 Y 32768 4 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 -execute stmt1 ; -scalar_s exists_s in_s in_row_s -18.0000 1 0 1 -2.0000 0 1 0 -18.0000 1 0 1 -2.0000 0 1 0 +execute stmt1 ; set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort set @stmt= ' SELECT (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 GROUP BY t9.c15 LIMIT 1) as scalar_s, @@ -978,56 +936,14 @@ set @arg09= 40e-1 ; prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def scalar_s 5 23 2 Y 32768 31 8 -def exists_s 8 1 1 N 32769 0 8 -def in_s 8 21 1 Y 32768 0 8 -def in_row_s 8 21 1 Y 32768 0 8 -scalar_s exists_s in_s in_row_s -18 1 0 1 -2 0 1 0 -18 1 0 1 -2 0 1 0 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -scalar_s exists_s in_s in_row_s -18 1 0 1 -2 0 1 0 -18 1 0 1 -2 0 1 0 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 8 -def table 253 64 10 N 1 31 8 -def type 253 10 3 N 1 31 8 -def possible_keys 253 4096 0 Y 0 31 8 -def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 8 -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t9 ALL NULL NULL NULL NULL 2 -1 PRIMARY ALL NULL NULL NULL NULL 2 Using where -6 DERIVED t2 ALL NULL NULL NULL NULL 2 -5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort drop table t2 ; select 1 < (select a from t1) ; ERROR 21000: Subquery returns more than 1 row @@ -3154,17 +3070,21 @@ found true set @arg00= 1.991e+3 ; select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3 ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; found +true select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; +where c1= 20 and abs(c17 - @arg00) < 0.01 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1.991e+3" ; +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; execute stmt1 ; found +true prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; +where c1= 20 and abs(c17 - ?) < 0.01" ; execute stmt1 using @arg00 ; found +true drop table t1, t9; -- cgit v1.2.1 From c53591348a1539e63eb946adea4ebf2c6857b73a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 19:12:44 +0000 Subject: mysql-test-run.sh: test mysql-test/mysql-test-run.sh: test --- mysql-test/mysql-test-run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 707a6c76f8d..6ceb930afc2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -200,6 +200,7 @@ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH MASTER_RUNNING=0 MASTER1_RUNNING=0 MASTER_MYPORT=9306 +MASTER_MYPORT1=9307 SLAVE_RUNNING=0 SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves @@ -431,6 +432,7 @@ MANAGER_PID_FILE="$MYRUN_DIR/manager.pid" MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data" MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock" +MASTER_MYSOCK1=$MYSQL_MYSOCK"1" MASTER_MYPID="$MYRUN_DIR/master.pid" MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/master.log" MASTER_MYERR="$MYSQL_TEST_DIR/var/log/master.err" @@ -444,7 +446,7 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err" CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test" SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" -export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK +export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR -- cgit v1.2.1 From bc4f1137e99b99c9819bdaff4364db6e091c8033 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Sep 2004 23:40:20 +0000 Subject: multiple servers for cluster --- mysql-test/include/have_ndb.inc | 5 +++-- mysql-test/mysql-test-run.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 366b2e38b5a..7567a0ca362 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -2,5 +2,6 @@ disable_query_log; show variables like "have_ndbcluster"; enable_query_log; -connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT"1",); +connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,$MASTER_MYSOCK1); +connection server1; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8ee15c148e3..3c04fa6eb66 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -254,9 +254,9 @@ while test $# -gt 0; do --extern) USE_RUNNING_SERVER="1" ;; --with-ndbcluster) USE_NDBCLUSTER="--ndbcluster" ;; - --ndbconnectstring=*) + --ndb-connectstring=*) USE_NDBCLUSTER="--ndbcluster" ; - USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndbconnectstring=;;"` ;; + USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;; --local-master) MASTER_MYPORT=3306; @@ -1038,7 +1038,7 @@ EOF -title "Master" -e gdb -x $GDB_MASTER_INIT $MASTER_MYSQLD fi else - manager_launch master$1 $MASTER_MYSQLD $master_args + manager_launch master $MASTER_MYSQLD $master_args fi sleep_until_file_created $MASTER_MYPID$1 $wait_for_master wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER @@ -1225,7 +1225,7 @@ stop_master () # MASTER_RUNNING=0 to get cleanup when calling start_master(). if [ x$USE_EMBEDDED_SERVER != x1 ] ; then pid=`$CAT $MASTER_MYPID$1` - manager_term $pid master + manager_term $pid master $1 if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ] then # try harder! $ECHO "master not cooperating with mysqladmin, will try manual kill" @@ -1386,7 +1386,7 @@ run_testcase () stop_master 1 echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master - if [ ! -z "$USE_NDBCLUSTER" ] ; then + if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 fi TZ=$MY_TZ; export TZ @@ -1402,7 +1402,7 @@ run_testcase () stop_master 1 echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master - if [ ! -z "$USE_NDBCLUSTER" ] ; then + if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 fi else -- cgit v1.2.1 From e599132704fff18c219f495f997c1922a351ef38 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Sep 2004 14:20:14 +0200 Subject: WL#1424 Added more advanced test cases for autodiscovery mysql-test/mysql-test-run.sh: Create and export an NDB_CONNECSTRING that can be used for NDB_TOOLS to connect to NDB mysql-test/r/ndb_autodiscover.result: Added more advanced test cases for ndb_autodiscover mysql-test/t/ndb_autodiscover.test: Added more advanced test cases for ndb_autodiscover --- mysql-test/mysql-test-run.sh | 3 + mysql-test/r/ndb_autodiscover.result | 124 ++++++++++++++++++++- mysql-test/t/ndb_autodiscover.test | 206 +++++++++++++++++++++++++++-------- 3 files changed, 285 insertions(+), 48 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8300af48ca7..c41e2d38543 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1467,10 +1467,13 @@ then fi ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" + NDB_CONNECTSTRING="localhost:$NDBCLUSTER_PORT" else USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" + NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" echo "Using ndbcluster at $USE_NDBCLUSTER" fi + export NDB_CONNECTSTRING fi start_manager diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 09ad82b7a6b..031be91fcb2 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3,t4,t5,t6,t7,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; flush status; create table t1( id int not null primary key, @@ -151,6 +151,128 @@ Variable_name Value Handler_discover 2 drop table t6, t7; flush status; +create table t4( +id int not null primary key, +name char(27) +) engine=ndb; +insert into t4 values (1, "Automatic"); +select * from t4; +id name +1 Automatic +select * from t4; +ERROR 42S02: Table 'test.t4' doesn't exist +select * from t4; +ERROR 42S02: Table 'test.t4' doesn't exist +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 0 +drop table t4; +flush status; +create table t4( +id int not null primary key, +id2 int, +name char(27) +) engine=ndb; +insert into t4 values (1, 76, "Automatic2"); +select * from t4; +id id2 name +1 76 Automatic2 +flush tables; +SHOW TABLES; +Tables_in_test +select * from t4; +ERROR 42S02: Table 'test.t4' doesn't exist +flush status; +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); +SHOW TABLES; +Tables_in_test +t1 +t2 +t4 +t8 +t9 +t7 +t6 +select * from t6; +id +6 +select * from t7; +id +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +drop table t1, t2, t4, t6, t7, t8, t9; +flush status; +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); +SHOW TABLES LIKE 't6'; +Tables_in_test (t6) +t6 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 1 +create table t3(a int); +ERROR 42S01: Table 't3' already exists +create table t5(a int); +ERROR 42S01: Table 't5' already exists +SHOW TABLES LIKE 't%'; +Tables_in_test (t%) +t1 +t2 +t4 +t6 +t8 +t9 +t7 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 2 +drop table t1, t2, t4, t6, t7, t8, t9; +flush status; +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=ndbcluster; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +insert into t1 values (1); +insert into t2 values (2, "table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t4 values (4); +flush tables; +select * from t1, t2, t3, t4; +id id b id c id +1 2 table 2 3 ndb table 3 4 +show status like 'handler_discover%'; +Variable_name Value +Handler_discover 3 +drop table t1, t2, t3, t4; +flush status; show status like 'handler_discover%'; Variable_name Value Handler_discover 0 diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 50c94d7a6e4..13ec01cfb85 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings ################################################ @@ -189,38 +189,27 @@ drop table t6, t7; # saying "No such table existed" # -# Commented out, to be fixed -# +flush status; + +create table t4( + id int not null primary key, + name char(27) +) engine=ndb; +insert into t4 values (1, "Automatic"); +select * from t4; -#flush status; -# -#create table t4( -# id int not null primary key, -# name char(27) -#) engine=ndb; -#insert into t4 values (1, "Automatic"); -#select * from t4; -# # Remove the table from NDB -#system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; -#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; # # Test that correct error is returned -#--error 1146 -#select * from t4; -#--error 1146 -#select * from t4; -# -#show status like 'handler_discover%'; -#drop table t4; -# -# -# system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; -# -# -# -#show tables; +--error 1146 +select * from t4; +--error 1146 +select * from t4; + +show status like 'handler_discover%'; +drop table t4; ####################################################### @@ -228,29 +217,153 @@ drop table t6, t7; # but still exists on disk is deleted from disk # when SHOW TABLES is called # + +flush status; + +create table t4( + id int not null primary key, + id2 int, + name char(27) +) engine=ndb; +insert into t4 values (1, 76, "Automatic2"); +select * from t4; +flush tables; + +# Remove the table from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; + +SHOW TABLES; + +--error 1146 +select * from t4; + +####################################################### +# Test SHOW TABLES ability to detect new and delete old +# tables. Test all at once using many tables # -#flush status; + +flush status; + +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; + +# Populate tables +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); + +# Remove t3, t5 from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +# Remove t6, t7 from disk +system rm var/master-data/test/t6.frm > /dev/null ; +system rm var/master-data/test/t7.frm > /dev/null ; + +SHOW TABLES; + +select * from t6; +select * from t7; + +show status like 'handler_discover%'; + +drop table t1, t2, t4, t6, t7, t8, t9; + +####################################################### +# Test SHOW TABLES LIKE ability to detect new and delete old +# tables. Test all at once using many tables. # -#create table t4( -# id int not null primary key, -# id2 int, -# name char(27) -#) engine=ndb; -#insert into t4 values (1, 76, "Automatic2"); -#select * from t4; -#flush tables; + +flush status; + +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; + +# Populate tables +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); + +# Remove t3, t5 from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +# Remove t6, t7 from disk +system rm var/master-data/test/t6.frm > /dev/null ; +system rm var/master-data/test/t7.frm > /dev/null ; + + +SHOW TABLES LIKE 't6'; + +show status like 'handler_discover%'; + +# Check that t3 or t5 can't be created +# frm files for these tables is stilll on disk +--error 1050 +create table t3(a int); +--error 1050 +create table t5(a int); + +SHOW TABLES LIKE 't%'; + +show status like 'handler_discover%'; + +drop table t1, t2, t4, t6, t7, t8, t9; + + + +###################################################### +# Test that several tables can be discovered when +# one statement access several table at once. # -# Remove the table from NDB -#system exec ../ndb/tools/ndb_drop_table -c localhost:9350 -d test t4 > /dev/null ; -#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; +flush status; -#SHOW TABLES; +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=ndbcluster; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; + +# Populate tables +insert into t1 values (1); +insert into t2 values (2, "table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t4 values (4); + +# Remove t1, t2, t3 from disk +system rm var/master-data/test/t1.frm > /dev/null ; +system rm var/master-data/test/t2.frm > /dev/null ; +system rm var/master-data/test/t3.frm > /dev/null ; +flush tables; -# Is there another way to find out that the file is gone? -#--error 1146 -#select * from t4; +# Select from the table which only exists in NDB. +select * from t1, t2, t3, t4; +# 3 table should have been discovered +show status like 'handler_discover%'; + +drop table t1, t2, t3, t4; ######################################################### @@ -334,6 +447,5 @@ system rm var/master-data/test/t9.frm ; # MySQL Server will have been restarted because it has a # ndb_autodiscover2-master.opt file. -#TODO -#SLECT * FROM t1, t2, t4; -#handler discover 3; + + -- cgit v1.2.1 From 570923ebeb92cb624bb2ffd0681560a5d7960e7a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Sep 2004 16:28:17 +0400 Subject: Final solution for bug# 4302 "Ambiguos order by when renamed column is identical to another in result" According to SQL standard queries like "select t1.a as col from t1, t2 order by a" should return an error if both tables contain field a. mysql-test/r/order_by.result: Updated test to conform SQL-standard. mysql-test/t/order_by.test: Updated test to conform SQL-standard. sql/item.cc: find_item_in_list() has now one more out parameter which is not used in item.cc functions. sql/mysql_priv.h: find_item_in_list(): Added boolean out parameter "unaliased" which indicates that we have found field by its original name and not by its alias in item (select) list. sql/sql_base.cc: find_item_in_list(): Added boolean out parameter "unaliased" which indicates that we have found field by its original name and not by its alias in item (select) list. This means that additional check is required to ensure there will be no ambiguity if we would search for this field in all tables. sql/sql_select.cc: find_order_in_list(): If we have found field in select list by its original name and not by its alias then we should perform additional check to ensure that there will be no ambiguity if we will search for this field in all tables. Also small cleanup. --- mysql-test/r/order_by.result | 9 +++------ mysql-test/t/order_by.test | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 69ce69ad499..94d56bbc2fa 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -680,6 +680,9 @@ order by col; ERROR 23000: Column 'col' in order clause is ambiguous select col1 from t1, t2 where t1.col1=t2.col2 order by col; ERROR 23000: Column 'col' in order clause is ambiguous +select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 +order by col; +ERROR 23000: Column 'col' in order clause is ambiguous select t1.col as t1_col, t2.col from t1, t2 where t1.col1=t2.col2 order by col; t1_col col @@ -696,12 +699,6 @@ col col2 1 3 2 2 3 1 -select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 -order by col; -t1_col col2 -1 1 -2 2 -3 3 select t2.col2, t2.col, t2.col from t2 order by col; col2 col col 3 1 1 diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 1d65ce9003a..988c106bf21 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -472,13 +472,14 @@ select t1.col as c1, t2.col as c2 from t1, t2 where t1.col1=t2.col2 order by col; --error 1052 select col1 from t1, t2 where t1.col1=t2.col2 order by col; +--error 1052 +select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 + order by col; select t1.col as t1_col, t2.col from t1, t2 where t1.col1=t2.col2 order by col; select col2 as c, col as c from t2 order by col; select col2 as col, col as col2 from t2 order by col; -select t1.col as t1_col, t2.col2 from t1, t2 where t1.col1=t2.col2 - order by col; select t2.col2, t2.col, t2.col from t2 order by col; select t2.col2 as col from t2 order by t2.col; -- cgit v1.2.1 From 74d83445acd7f4b8278a724bf20f02ded974a129 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Sep 2004 19:40:33 +0200 Subject: mysql_protocols.test: --exec now checks return code, make all command lines succeed mysql-test/t/mysql_protocols.test: --exec now checks return code, make all command lines succeed --- mysql-test/t/mysql_protocols.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/mysql_protocols.test b/mysql-test/t/mysql_protocols.test index 942ba2722d8..e5158586124 100644 --- a/mysql-test/t/mysql_protocols.test +++ b/mysql-test/t/mysql_protocols.test @@ -4,7 +4,7 @@ --exec echo "select ' ok' as ''" | $MYSQL --exec echo "select ' ok' as 'TCP'" | $MYSQL --protocol=TCP --exec echo "select ' ok' as 'SOCKET'" | $MYSQL --protocol=SOCKET ---exec echo "select ' ok' as 'PIPE'" | $MYSQL --protocol=PIPE 2>&1 ---exec echo "select ' ok' as 'MEMORY'" | $MYSQL --protocol=MEMORY 2>&1 ---exec echo "select ' ok' as 'NullS'" | $MYSQL --protocol=NullS 2>&1 +--exec echo "select ' ok' as 'PIPE'" | $MYSQL --protocol=PIPE 2>&1 || true +--exec echo "select ' ok' as 'MEMORY'" | $MYSQL --protocol=MEMORY 2>&1 || true +--exec echo "select ' ok' as 'NullS'" | $MYSQL --protocol=NullS 2>&1 || true -- cgit v1.2.1 From 214d20a679fea2a1b8c44d6794776665d3fc4ebe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Sep 2004 21:36:25 +0000 Subject: bug#5782 --- mysql-test/r/ndb_limit.result | 41 +++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_limit.test | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_limit.result b/mysql-test/r/ndb_limit.result index 6574aa0bb1a..da1ec3b61c3 100644 --- a/mysql-test/r/ndb_limit.result +++ b/mysql-test/r/ndb_limit.result @@ -29,3 +29,44 @@ count(*) select * from t2 limit 0; a b c drop table t2; +CREATE TABLE `t2` ( +`views` int(11) NOT NULL default '0', +`clicks` int(11) NOT NULL default '0', +`day` date NOT NULL default '0000-00-00', +`hour` tinyint(4) NOT NULL default '0', +`bannerid` smallint(6) NOT NULL default '0', +`zoneid` smallint(6) NOT NULL default '0', +`source` varchar(50) NOT NULL default '', +PRIMARY KEY (`day`,`hour`,`bannerid`,`zoneid`,`source`), +KEY `bannerid_day` (`bannerid`,`day`), +KEY `zoneid` (`zoneid`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t2` VALUES +( 1,0,'2004-09-17', 5,100,100,''), +( 1,0,'2004-09-18', 7,100,100,''), +( 17,0,'2004-09-27',20,132,100,''), +( 4,0,'2004-09-16',23,132,100,''), +( 86,0,'2004-09-18', 7,196,196,''), +( 11,0,'2004-09-16',16,132,100,''), +(140,0,'2004-09-18', 0,100,164,''), +( 2,0,'2004-09-17', 7,132,100,''), +(846,0,'2004-09-27',11,132,164,''), +( 1,0,'2004-09-18', 8,132,100,''), +( 22,0,'2004-09-27', 9,164,132,''), +(711,0,'2004-09-27', 9,100,164,''), +( 11,0,'2004-09-18', 0,196,132,''), +( 41,0,'2004-09-27',15,196,132,''), +( 57,0,'2004-09-18', 2,164,196,''); +SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y') +as date_formatted FROM t2 GROUP BY day ORDER BY day DESC; +date date_formatted +20040927 27-09-2004 +20040918 18-09-2004 +20040917 17-09-2004 +20040916 16-09-2004 +SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y') +as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2; +date date_formatted +20040927 27-09-2004 +20040918 18-09-2004 +drop table t2; diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/t/ndb_limit.test index b0b6f3c4f17..c2d7a0ecfec 100644 --- a/mysql-test/t/ndb_limit.test +++ b/mysql-test/t/ndb_limit.test @@ -42,3 +42,41 @@ select count(*) from t2 where c=12345678 limit 1000; select * from t2 limit 0; drop table t2; + +CREATE TABLE `t2` ( + `views` int(11) NOT NULL default '0', + `clicks` int(11) NOT NULL default '0', + `day` date NOT NULL default '0000-00-00', + `hour` tinyint(4) NOT NULL default '0', + `bannerid` smallint(6) NOT NULL default '0', + `zoneid` smallint(6) NOT NULL default '0', + `source` varchar(50) NOT NULL default '', + PRIMARY KEY (`day`,`hour`,`bannerid`,`zoneid`,`source`), + KEY `bannerid_day` (`bannerid`,`day`), + KEY `zoneid` (`zoneid`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO `t2` VALUES +( 1,0,'2004-09-17', 5,100,100,''), +( 1,0,'2004-09-18', 7,100,100,''), +( 17,0,'2004-09-27',20,132,100,''), +( 4,0,'2004-09-16',23,132,100,''), +( 86,0,'2004-09-18', 7,196,196,''), +( 11,0,'2004-09-16',16,132,100,''), +(140,0,'2004-09-18', 0,100,164,''), +( 2,0,'2004-09-17', 7,132,100,''), +(846,0,'2004-09-27',11,132,164,''), +( 1,0,'2004-09-18', 8,132,100,''), +( 22,0,'2004-09-27', 9,164,132,''), +(711,0,'2004-09-27', 9,100,164,''), +( 11,0,'2004-09-18', 0,196,132,''), +( 41,0,'2004-09-27',15,196,132,''), +( 57,0,'2004-09-18', 2,164,196,''); + +SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y') +as date_formatted FROM t2 GROUP BY day ORDER BY day DESC; + +SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y') +as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2; + +drop table t2; -- cgit v1.2.1 From da599f9be2907ea63ddc6520fd9e9cb04237eae6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 00:32:42 +0200 Subject: client_test.test: Use TESTS_BINDIR to point out bin dir for "client_test" mysql-test-run.sh: Export TESTS_BINDIR to be used from --exec mysql-test/mysql-test-run.sh: Export TESTS_BINDIR to be used from --exec mysql-test/t/client_test.test: Use TESTS_BINDIR to point out bin dir for "client_test" --- mysql-test/mysql-test-run.sh | 4 +++- mysql-test/t/client_test.test | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5cb491b43c4..c447e96590f 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -507,6 +507,7 @@ if [ x$SOURCE_DIST = x1 ] ; then fi CLIENT_BINDIR="$BASEDIR/client" + TESTS_BINDIR="$BASEDIR/tests" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" WAIT_PID="$BASEDIR/extra/mysql_waitpid" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" @@ -525,6 +526,7 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" + TESTS_BINDIR="$BASEDIR/tests" MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" @@ -582,7 +584,7 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password= MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $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 --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR +export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR TESTS_BINDIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index eb053b6c902..50230d1dd16 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,2 @@ -- disable_result_log ---exec ../tests/client_test --testcase --user=root --socket=var/tmp/master.sock --port=$MYSQL_TCP_PORT +--exec $TESTS_BINDIR/client_test --testcase --user=root --socket=var/tmp/master.sock --port=$MYSQL_TCP_PORT -- cgit v1.2.1 From 67d884e03f5c26b5fdcf37463924caa4e550bdb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 11:16:49 +0000 Subject: bug#5349 ALTER TABLE corrupts TEXT (and blob?) --- mysql-test/r/ndb_blob.result | 21 +++++++++++++++++++++ mysql-test/t/ndb_blob.test | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 004713be718..bb606b46902 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -377,3 +377,24 @@ count(*) 0 drop table t1; drop database mysqltest; +set autocommit=1; +use test; +CREATE TABLE t1 ( +a int, +b text, +PRIMARY KEY (a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES +(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); +INSERT INTO t1 VALUES +(2,'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'); +select * from t1 order by a; +a b +1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +alter table t1 engine=ndb; +select * from t1 order by a; +a b +1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +drop table t1; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index e5a9f7446d4..afa1a2c1455 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -308,3 +308,21 @@ rollback; select count(*) from t1; drop table t1; drop database mysqltest; + +set autocommit=1; +use test; +CREATE TABLE t1 ( + a int, + b text, + PRIMARY KEY (a) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES +(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); +INSERT INTO t1 VALUES +(2,'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'); + +select * from t1 order by a; +alter table t1 engine=ndb; +select * from t1 order by a; +drop table t1; -- cgit v1.2.1 From 18ba5fb8e619068af6b116ae5a0cbbc70fcf4a72 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 16:23:54 +0500 Subject: delete.result, delete.test: A fix (bug #5733: Table handler error with self-join multi-table DELETE). records.cc: A fix (bug #5733: Table handler error with self-join multi-table DELETE). sql/records.cc: ]A fix (bug #5733: Table handler error with self-join multi-table DELETE). mysql-test/t/delete.test: A fix (bug #5733: Table handler error with self-join multi-table DELETE). mysql-test/r/delete.result: A fix (bug #5733: Table handler error with self-join multi-table DELETE). --- mysql-test/r/delete.result | 11 +++++++++++ mysql-test/t/delete.test | 10 ++++++++++ 2 files changed, 21 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index abc8245e69f..7353e687ae7 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -50,3 +50,14 @@ select count(*) from t1; count(*) 0 drop table t1; +create table t1 (a int not null auto_increment primary key, b char(32)); +insert into t1 (b) values ('apple'), ('apple'); +select * from t1; +a b +1 apple +2 apple +delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a; +select * from t1; +a b +1 apple +drop table t1; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 904d959d148..07cb9155b3f 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -61,3 +61,13 @@ select count(*) from t1; drop table t1; +# +# Bug #5733: Table handler error with self-join multi-table DELETE +# + +create table t1 (a int not null auto_increment primary key, b char(32)); +insert into t1 (b) values ('apple'), ('apple'); +select * from t1; +delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a; +select * from t1; +drop table t1; -- cgit v1.2.1 From 36d3f48cd305518dacbc66ce9acdba8f6a69bc5b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 14:23:31 +0200 Subject: Changed test to be independent on scan order --- mysql-test/r/ndb_alter_table.result | 27 ++++++++++++++------------- mysql-test/t/ndb_alter_table.test | 8 ++++---- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 2ee1bf4497b..28a50504064 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -134,20 +134,21 @@ a INT NOT NULL PRIMARY KEY, b INT NOT NULL ) ENGINE=ndbcluster; INSERT INTO t1 VALUES (0,1),(17,18); -select * from t1; +select * from t1 order by a; a b -17 18 0 1 +17 18 alter table t1 add c int not null unique auto_increment; -select * from t1 order by a; -a b c -0 1 2 -17 18 1 -INSERT INTO t1 VALUES (18,19,3),(20,21,0); -select * from t1 order by a; -a b c -0 1 2 -17 18 1 -18 19 3 -20 21 4 +select c from t1 order by c; +c +1 +2 +INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0); +select c from t1 order by c; +c +1 +2 +3 +4 +5 drop table t1; diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index aa3da77a1da..1c1ef670af2 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -107,11 +107,11 @@ CREATE TABLE t1 ( ) ENGINE=ndbcluster; INSERT INTO t1 VALUES (0,1),(17,18); -select * from t1; -alter table t1 add c int not null unique auto_increment; -select * from t1 order by a; -INSERT INTO t1 VALUES (18,19,3),(20,21,0); select * from t1 order by a; +alter table t1 add c int not null unique auto_increment; +select c from t1 order by c; +INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0); +select c from t1 order by c; drop table t1; #--disable_warnings -- cgit v1.2.1 From 13fc23903543ac26ba1b3fb779e38abb0f7fbbb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 07:50:26 -0500 Subject: logging_ok: Logging to logging@openlogging.org accepted sql_acl.cc, grant.test, grant.result: BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. mysql-test/r/grant.result: BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. mysql-test/t/grant.test: BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. sql/sql_acl.cc: BUG 5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- mysql-test/r/grant.result | 27 +++++++++++++++++++++++++++ mysql-test/t/grant.test | 29 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 35b90349804..b13ce0cf7ba 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -248,3 +248,30 @@ GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +SHOW GRANTS FOR testuser@localhost; +Grants for testuser@localhost +GRANT USAGE ON *.* TO 'testuser'@'localhost' +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index e1319690dc5..f5b0db2971f 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -189,3 +189,32 @@ show grants for test11@localhost; delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; +# +# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything +# +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +SHOW GRANTS FOR testuser@localhost; +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; + -- cgit v1.2.1 From b8f0b6f37b08d9ab1a16d0183f6903b518460aa6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 14:57:17 +0200 Subject: Added index cardinality check --- mysql-test/r/ndb_basic.result | 6 ++++++ mysql-test/t/ndb_basic.test | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 80e1aa7939a..9f8dcf3610a 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -6,7 +6,13 @@ attr1 INT NOT NULL, attr2 INT, attr3 VARCHAR(10) ) ENGINE=ndbcluster; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 pk1 A 0 NULL NULL BTREE INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 pk1 A 2 NULL NULL BTREE SELECT pk1 FROM t1 ORDER BY pk1; pk1 9410 diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 0487e18cdb9..5f32a8016bf 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -20,8 +20,9 @@ CREATE TABLE t1 ( attr3 VARCHAR(10) ) ENGINE=ndbcluster; +SHOW INDEX FROM t1; INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); - +SHOW INDEX FROM t1; SELECT pk1 FROM t1 ORDER BY pk1; SELECT * FROM t1 ORDER BY pk1; SELECT t1.* FROM t1 ORDER BY pk1; -- cgit v1.2.1 From c2a255218d60d2de645ff6ae0d8c52b4891d46f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 18:54:06 +0400 Subject: Support for TIMESTAMP columns holding NULL values. Unlike all other column types TIMESTAMP is NOT NULL by default, so in order to have TIMESTAMP column holding NULL valaues you have to specify NULL as one of its attributes (this needed for backward compatibility). Main changes: Replaced TABLE::timestamp_default_now/on_update_now members with TABLE::timestamp_auto_set_type flag which is used everywhere for determining if we should auto-set value of TIMESTAMP field during this operation or not. We are also use Field_timestamp::set_time() instead of handler::update_timestamp() in handlers. mysql-test/r/type_timestamp.result: Added test for TIMESTAMP columns which are able to store NULL values. mysql-test/t/type_timestamp.test: Added test for TIMESTAMP columns which are able to store NULL values. sql/field.cc: Added support for TIMESTAMP fields holding NULL values. We don't need Field_timestamp::set_timestamp_offsets() anymore. Instead we need Field_timestamp::get_auto_set_type() function which will convert TIMESTAMP auto-set type stored in Field in unireg_check to value from timestamp_auto_set_type_enum. (We can't replace this function with additional Field_timestamp member and some code in constructor because then we will have troubles with Field::new_field() method). We should also set field to not null in Field_timestamp::set_time() now. sql/field.h: Added support for TIMESTAMP fields holding NULL values. We don't need Field_timestamp::set_timestamp_offsets() anymore. Instead we need Field_timestamp::get_auto_set_type() function, which will convert TIMESTAMP auto-set type stored in Field in unireg_check to value from timestamp_auto_set_type_enum. We also have to support NULL values in Field_timestamp::get_timestamp() function. sql/field_conv.cc: Added comment clarifying behavior in case of TIMESTAMP fields which are able to store NULL values. sql/ha_berkeley.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_heap.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_innodb.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_isam.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_isammrg.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_myisam.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_myisammrg.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/ha_ndbcluster.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now for determining if we should auto-set value of TIMESTAMP field during this operation. We are also use Field_timestamp::set_time() instead of handler::update_timestamp(). sql/handler.cc: handler::update_timestamp() is no longer needed since now we use Field_timestamp::set_time() instead. (we can't use handler::update_timestamp() anyway since field position only is not enough for TIMESTAMP fields which are able to store NULLs) sql/handler.h: handler::update_timestamp() is no longer needed since now we use Field_timestamp::set_time() instead. sql/item_timefunc.cc: Since now TIMESTAMP fields can hold NULL values we should take this into account. sql/sql_base.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now. (Here we use Field_timestamp::get_auto_set_type() to setup its value before further statement execution). sql/sql_insert.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now. sql/sql_load.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now. sql/sql_parse.cc: Added support for TIMESTAMP fields holding NULL values. We should distinguish NULL default values and non-specified default values for such fields (because latter could mean DEFAULT NOW() ON UPDATE NOW() in some cases). sql/sql_show.cc: Added support for TIMESTAMP fields holding NULL values. Unlike all other fields these are NOT NULL by default so we have to specify NULL attribute explicitly for them. sql/sql_table.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now. sql/sql_update.cc: Now we use TABLE::timestamp_field_type instead of TABLE::timestamp_default_now/on_update_now. sql/sql_yacc.yy: Added support for TIMESTAMP fields holding NULL values. Unlike all other fields these are NOT NULL by default (so we have to set NOT_NULL_FLAG properly for them). sql/table.h: Added timestamp_auto_set_type enum which values are used for indicating during which operations we should automatically set TIMESTAPM field value to current timestamp. TABLE: Replaced timestamp_default_now/on_update_now members with timestamp_auto_set_type flag (Now when TIMESTAMP field are able to store NULL values, single position of field in record is not enough for updating this field anyway). --- mysql-test/r/type_timestamp.result | 29 +++++++++++++++++++++++++++++ mysql-test/t/type_timestamp.test | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 425e4a05586..a823049634f 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -365,6 +365,35 @@ select * from t1; t1 i 2004-04-01 00:00:00 10 drop table t1; +create table t1 (a timestamp null, b timestamp null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `b` timestamp NULL default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (NULL, NULL); +SET TIMESTAMP=1000000017; +insert into t1 values (); +select * from t1; +a b +NULL NULL +2001-09-09 04:46:57 NULL +drop table t1; +create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NULL default NULL, + `b` timestamp NULL default '2003-01-01 00:00:00' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (NULL, NULL); +insert into t1 values (DEFAULT, DEFAULT); +select * from t1; +a b +NULL NULL +NULL 2003-01-01 00:00:00 +drop table t1; create table t1 (ts timestamp(19)); show create table t1; Table Create Table diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index a644197f757..7c1258785b0 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -234,7 +234,27 @@ alter table t1 add i int default 10; select * from t1; drop table t1; +# +# Test for TIMESTAMP columns which are able to store NULLs +# (Auto-set property should work for them and NULL values +# should be OK as default values) +# +create table t1 (a timestamp null, b timestamp null); +show create table t1; +insert into t1 values (NULL, NULL); +SET TIMESTAMP=1000000017; +insert into t1 values (); +select * from t1; +drop table t1; +create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00'); +show create table t1; +insert into t1 values (NULL, NULL); +insert into t1 values (DEFAULT, DEFAULT); +select * from t1; +drop table t1; + +# # Test for bug #4491, TIMESTAMP(19) should be possible to create and not # only read in 4.0 # -- cgit v1.2.1 From 02bb3392064a71cdeb63ae870efc92c3dc3cafaf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 18:27:24 +0200 Subject: client_test.test: Temporarely disabled client_test test Use MASTER_MYSOCK to get socket path mysql-test/t/client_test.test: Temporarely disabled client_test test --- mysql-test/t/client_test.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index 50230d1dd16..9183740cd02 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,2 @@ -- disable_result_log ---exec $TESTS_BINDIR/client_test --testcase --user=root --socket=var/tmp/master.sock --port=$MYSQL_TCP_PORT +-- // exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT -- cgit v1.2.1 From e3540d5e5f04e66898ce033d88852b31c0203306 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 14:48:48 -0500 Subject: grant.test, grant.result, sql_acl.cc: BUG #5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. sql/sql_acl.cc: BUG #5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. mysql-test/r/grant.result: BUG #5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. mysql-test/t/grant.test: BUG #5831 Changed mysql_revoke_all() to successfully delete all privileges for a user in one pass. --- mysql-test/r/grant.result | 40 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/grant.test | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index b13ce0cf7ba..141e96c8424 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -259,6 +259,26 @@ CREATE TABLE t7 LIKE t1; CREATE TABLE t8 LIKE t1; CREATE TABLE t9 LIKE t1; CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; GRANT SELECT ON test.t1 TO testuser@localhost; GRANT SELECT ON test.t2 TO testuser@localhost; GRANT SELECT ON test.t3 TO testuser@localhost; @@ -269,9 +289,29 @@ GRANT SELECT ON test.t7 TO testuser@localhost; GRANT SELECT ON test.t8 TO testuser@localhost; GRANT SELECT ON test.t9 TO testuser@localhost; GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; SHOW GRANTS FOR testuser@localhost; Grants for testuser@localhost GRANT USAGE ON *.* TO 'testuser'@'localhost' DROP USER testuser@localhost; DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index f5b0db2971f..d9c281cfebc 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -203,6 +203,26 @@ CREATE TABLE t7 LIKE t1; CREATE TABLE t8 LIKE t1; CREATE TABLE t9 LIKE t1; CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; GRANT SELECT ON test.t1 TO testuser@localhost; GRANT SELECT ON test.t2 TO testuser@localhost; GRANT SELECT ON test.t3 TO testuser@localhost; @@ -213,8 +233,28 @@ GRANT SELECT ON test.t7 TO testuser@localhost; GRANT SELECT ON test.t8 TO testuser@localhost; GRANT SELECT ON test.t9 TO testuser@localhost; GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; SHOW GRANTS FOR testuser@localhost; DROP USER testuser@localhost; DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; -- cgit v1.2.1 From 308b67922c270dc5750b82aaa80d0146f6a7b484 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 3 Oct 2004 00:20:47 +0100 Subject: Bug#4118: multi-table UPDATE takes WRITE lock on read table Ensures that WRITE lock is not obtained on all tables referenced. mysql-test/r/lock_multi.result: Bug#4118 New test for multi-update locking mysql-test/r/multi_update.result: Bug#4118 Fix test mysql-test/t/lock_multi.test: Bug#4118 New test for multi-update locking mysql-test/t/multi_update.test: Bug#4118 Fix test sql/sql_parse.cc: Bug#4118 Split multi-update to its own case statement in sql_parse.cc sql/sql_update.cc: Bug#4118 Overview of locking checking: 1. Open and acquire READ lock 2. Check to see which tables need WRITE lock 3. Unlock tables and relock sql/sql_yacc.yy: Bug#4118 Split multi-update to its own case statement in sql_parse.cc --- mysql-test/r/lock_multi.result | 12 ++++++++++++ mysql-test/r/multi_update.result | 1 - mysql-test/t/lock_multi.test | 24 ++++++++++++++++++++++++ mysql-test/t/multi_update.test | 2 -- 4 files changed, 36 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index b808fca0acf..b5672fe1791 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -17,6 +17,18 @@ unlock tables; n 1 drop table t1; +create table t1 (a int, b int); +create table t2 (c int, d int); +insert into t1 values(1,1); +insert into t1 values(2,2); +insert into t2 values(1,2); +lock table t1 read; + update t1,t2 set c=a where b=d; +select c from t2; +c +2 +drop table t1; +drop table t2; create table t1 (a int); create table t2 (a int); lock table t1 write, t2 write; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 12cb965f045..fc414f2f46b 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -151,7 +151,6 @@ Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; -Table 't2' was locked with a READ lock and can't be updated unlock tables; LOCK TABLES t1 write, t2 write; UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 0295fca29e7..e20f8163751 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -50,6 +50,30 @@ connection reader; reap; drop table t1; +# +# Test problem when using locks with multi-updates +# It should not block when multi-update is reading on a read-locked table +# + +connection locker; +create table t1 (a int, b int); +create table t2 (c int, d int); +insert into t1 values(1,1); +insert into t1 values(2,2); +insert into t2 values(1,2); +lock table t1 read; +connection writer; +--sleep 2 +send update t1,t2 set c=a where b=d; +connection reader; +--sleep 2 +select c from t2; +connection writer; +reap; +connection locker; +drop table t1; +drop table t2; + # # Test problem when using locks on many tables and droping a table that # is to-be-locked by another thread diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 39ea136bde1..3494126f890 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -151,8 +151,6 @@ LOCK TABLES t1 write, t2 read; DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n; --error 1099 UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; -# The following should be fixed to not give an error ---error 1099 UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; unlock tables; LOCK TABLES t1 write, t2 write; -- cgit v1.2.1 From b16d37db7b9ea2346d72d7cc8c8f640151f80577 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 3 Oct 2004 23:41:15 +0000 Subject: make sure old mysqld's are shutdown --- mysql-test/mysql-test-run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 930087f880a..19649166822 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1543,14 +1543,17 @@ then then # Ensure that no old mysqld test servers are running $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 + $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK1 -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 $MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 + $MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT1 -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 $MYSQLADMIN --no-defaults --host=$hostname --port=$SLAVE_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 $MYSQLADMIN --no-defaults --host=$hostname --port=`expr $SLAVE_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1 sleep_until_file_deleted 0 $MASTER_MYPID + sleep_until_file_deleted 0 $MASTER_MYPID"1" sleep_until_file_deleted 0 $SLAVE_MYPID else - rm $MASTER_MYPID $SLAVE_MYPID + rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID fi # Kill any running managers -- cgit v1.2.1 From 5d4379665a1b43829126d66c0a35b01481e5f07e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 00:10:33 +0000 Subject: better cleanup of cluster processes with test failure --- mysql-test/mysql-test-run.sh | 68 +++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 30 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index c447e96590f..87140b3fd91 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -913,6 +913,41 @@ EOF abort_if_failed "Could not execute manager command" } +start_ndbcluster() +{ + if [ ! -z "$USE_NDBCLUSTER" ] + then + if [ -z "$USE_RUNNING_NDBCLUSTER" ] + then + echo "Starting ndbcluster" + if [ "$DO_BENCH" = 1 ] + then + NDBCLUSTER_OPTS="" + else + NDBCLUSTER_OPTS="--small" + fi + ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" + else + USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" + echo "Using ndbcluster at $USE_NDBCLUSTER" + fi + fi + +} + +stop_ndbcluster() +{ + if [ ! -z "$USE_NDBCLUSTER" ] + then + if [ -z "$USE_RUNNING_NDBCLUSTER" ] + then + # Kill any running ndbcluster stuff + ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop + fi + fi +} + # The embedded server needs the cleanup so we do some of the start work # but stop before actually running mysqld or anything. @@ -921,6 +956,7 @@ start_master() if [ x$MASTER_RUNNING = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then return fi + # Remove stale binary logs except for 2 tests which need them if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ] then @@ -1156,6 +1192,7 @@ mysql_start () # start_master # start_slave cd $MYSQL_TEST_DIR + start_ndbcluster return 1 } @@ -1242,7 +1279,7 @@ mysql_stop () stop_slave 1 stop_slave 2 $ECHO "Slave shutdown finished" - + stop_ndbcluster return 1 } @@ -1553,25 +1590,6 @@ then $ECHO "Installing Test Databases" mysql_install_db - if [ ! -z "$USE_NDBCLUSTER" ] - then - if [ -z "$USE_RUNNING_NDBCLUSTER" ] - then - echo "Starting ndbcluster" - if [ "$DO_BENCH" = 1 ] - then - NDBCLUSTER_OPTS="" - else - NDBCLUSTER_OPTS="--small" - fi - ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 - USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" - else - USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" - echo "Using ndbcluster at $USE_NDBCLUSTER" - fi - fi - start_manager # Do not automagically start daemons if we are in gdb or running only one test @@ -1667,16 +1685,6 @@ if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then mysql_stop fi - -if [ ! -z "$USE_NDBCLUSTER" ] -then -if [ -z "$USE_RUNNING_NDBCLUSTER" ] -then - # Kill any running ndbcluster stuff - ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop -fi -fi - stop_manager report_stats $ECHO -- cgit v1.2.1 From e4de5a86528491b5c3b991224f14c9abd0b39033 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 00:25:04 +0000 Subject: use new function stop_ndbcluster --- mysql-test/mysql-test-run.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 87140b3fd91..024ec6b8179 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1569,14 +1569,7 @@ then fi fi - if [ ! -z "$USE_NDBCLUSTER" ] - then - if [ -z "$USE_RUNNING_NDBCLUSTER" ] - then - # Kill any running ndbcluster stuff - ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop - fi - fi + stop_ndbcluster # Remove files that can cause problems $RM -rf $MYSQL_TEST_DIR/var/ndbcluster -- cgit v1.2.1 From 6052df4c7ac7159a6ef5f56cf0117f67d9e8c8e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 12:26:26 +0000 Subject: bug #5872, transactions should only be restarted with transaction.on flag off if execute_commit has been performed added testcase for this use force send for all executes mysql-test/r/ndb_blob.result: added testcase for alter table of blob from ndb to myisam mysql-test/t/ndb_blob.test: added testcase for alter table of blob from ndb to myisam sql/ha_ndbcluster.cc: bug #5872, transactions should only be restarted with transaction.on flag off if execute_commit has been performed use force send for all executes --- mysql-test/r/ndb_blob.result | 5 +++++ mysql-test/t/ndb_blob.test | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index bb606b46902..cf64ec41ae3 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -397,4 +397,9 @@ select * from t1 order by a; a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +alter table t1 engine=myisam; +select * from t1 order by a; +a b +1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB drop table t1; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index afa1a2c1455..5454dd91d26 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -309,6 +309,7 @@ select count(*) from t1; drop table t1; drop database mysqltest; +# bug #5349 set autocommit=1; use test; CREATE TABLE t1 ( @@ -325,4 +326,8 @@ INSERT INTO t1 VALUES select * from t1 order by a; alter table t1 engine=ndb; select * from t1 order by a; + +# bug #5872 +alter table t1 engine=myisam; +select * from t1 order by a; drop table t1; -- cgit v1.2.1 From 2cb2efc261936a2c24db28eb4597fbcb5078d698 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 17:13:31 +0400 Subject: Made TIMESTAMP NULL columns without explicit DEFAULT value to be always treated as DEFAULT NULL columns (independently from their position in table). (still to be discussed with Monty, Brian, Trudy et al. before push) mysql-test/r/type_timestamp.result: Update test after making TIMESTAMP NULL columns without explicit DEFAULT value to be always treated as DEFAULT NULL columns (independently from their position in table). mysql-test/t/type_timestamp.test: Update test after making TIMESTAMP NULL columns without explicit DEFAULT value to be always treated as DEFAULT NULL columns (independently from their position in table). sql/sql_parse.cc: add_field_to_list(): made TIMESTAMP NULL columns without explicit DEFAULT value to be always treated as DEFAULT NULL columns (independently from their position in table). This also simplifies code a bit. --- mysql-test/r/type_timestamp.result | 19 +++++++++++++++++-- mysql-test/t/type_timestamp.test | 15 +++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index a823049634f..6a7cecdd460 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -369,7 +369,7 @@ create table t1 (a timestamp null, b timestamp null); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `a` timestamp NULL default NULL, `b` timestamp NULL default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL, NULL); @@ -378,7 +378,22 @@ insert into t1 values (); select * from t1; a b NULL NULL -2001-09-09 04:46:57 NULL +NULL NULL +drop table t1; +create table t1 (a timestamp null default current_timestamp on update current_timestamp, b timestamp null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `b` timestamp NULL default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (NULL, NULL); +SET TIMESTAMP=1000000018; +insert into t1 values (); +select * from t1; +a b +NULL NULL +2001-09-09 04:46:58 NULL drop table t1; create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00'); show create table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 7c1258785b0..3f0b41d7221 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -236,9 +236,10 @@ drop table t1; # # Test for TIMESTAMP columns which are able to store NULLs -# (Auto-set property should work for them and NULL values -# should be OK as default values) # + +# Unlike for default TIMESTAMP fields we don't interpret first field +# in this table as TIMESTAMP with DEFAULT NOW() ON UPDATE NOW() properties. create table t1 (a timestamp null, b timestamp null); show create table t1; insert into t1 values (NULL, NULL); @@ -247,6 +248,16 @@ insert into t1 values (); select * from t1; drop table t1; +# But explicit auto-set properties still should be OK. +create table t1 (a timestamp null default current_timestamp on update current_timestamp, b timestamp null); +show create table t1; +insert into t1 values (NULL, NULL); +SET TIMESTAMP=1000000018; +insert into t1 values (); +select * from t1; +drop table t1; + +# It is also OK to specify NULL as default explicitly for such fields. create table t1 (a timestamp null default null, b timestamp null default '2003-01-01 00:00:00'); show create table t1; insert into t1 values (NULL, NULL); -- cgit v1.2.1 From 469778e6580166f964a65f8b75c8739b29423a9a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 13:53:36 +0000 Subject: corrected merge error rgarding NDB_CONNECTSTRING --- mysql-test/mysql-test-run.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 2079398e942..b12f7afb9f1 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -942,13 +942,14 @@ start_ndbcluster() NDBCLUSTER_OPTS="--small" fi ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 - USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"host=localhost:$NDBCLUSTER_PORT\"" + NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else - USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$USE_RUNNING_NDBCLUSTER\"" - echo "Using ndbcluster at $USE_NDBCLUSTER" + NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" + echo "Using ndbcluster at $NDB_CONNECTSTRING" fi + USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\"" + export NDB_CONNECTSTRING fi - } stop_ndbcluster() -- cgit v1.2.1 From 6fc954ce9176ebe704e1bac482276416410dc21e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Oct 2004 12:17:42 +0200 Subject: wl2135 - index restart mysql-test/r/ndb_index_ordered.result: test case mysql-test/t/ndb_index_ordered.test: test case ndb/include/kernel/signaldata/ScanTab.hpp: Split exclusive/keyinfo ndb/include/ndbapi/NdbIndexScanOperation.hpp: Add possibility retreive sorted flag ndb/include/ndbapi/NdbOperation.hpp: Add possibility retreive lock mode ndb/include/ndbapi/NdbResultSet.hpp: Add possibility to get operation ndb/src/common/debugger/signaldata/ScanTab.cpp: Split exclusive/keyinfo ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Store flags in ScanFragReq::requestInfo format ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Store flags in ScanFragReq::requestInfo format ndb/src/ndbapi/NdbOperationDefine.cpp: Keep theLockMode up-to-date ndb/src/ndbapi/NdbScanOperation.cpp: Keep theLockMode up-to-date sql/ha_ndbcluster.cc: Use NdbIndexScanOperation::reset_bounds when performing second index access --- mysql-test/r/ndb_index_ordered.result | 8 ++++++++ mysql-test/t/ndb_index_ordered.test | 3 +++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 2a3050e5dea..e0c486ee2c5 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -37,6 +37,14 @@ a b c 1 2 3 2 3 5 3 4 6 +select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.c; +a b c +6 7 2 +5 6 2 +1 2 3 +2 3 5 +3 4 6 +4 5 8 update t1 set c = 3 where b = 3; select * from t1 order by a; a b c diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 2a94475df13..e1766f6e624 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -23,6 +23,9 @@ select * from t1 where b > 4 order by b; select * from t1 where b < 4 order by b; select * from t1 where b <= 4 order by b; +# Test of reset_bounds +select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.c; + # # Here we should add some "explain select" to verify that the ordered index is # used for these queries. -- cgit v1.2.1 From 438cc71abfeff4839017a67d3401774eaf210bf1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Oct 2004 17:02:09 +0400 Subject: Fix for bug #5555: "GROUP BY enum_field" returns incorrect results --- mysql-test/r/func_group.result | 26 ++++++++++++++++++++++++++ mysql-test/t/func_group.test | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 011a47874c2..c25f89d4df3 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -693,3 +693,29 @@ SELECT MIN(a) FROM t1 WHERE a < 0; MIN(a) NULL DROP TABLE t1; +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL auto_increment, +val enum('one','two','three') NOT NULL default 'one', +PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); +select val, count(*) from t1 group by val; +val count(*) +one 2 +two 2 +three 1 +drop table t1; +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL auto_increment, +val set('one','two','three') NOT NULL default 'one', +PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); +select val, count(*) from t1 group by val; +val count(*) +one 2 +two 2 +three 1 +drop table t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 7f48f2b92bd..3e001961f90 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -431,6 +431,30 @@ SELECT MIN(a) FROM t1 WHERE a < 0; DROP TABLE t1; +# +# Bug #5555 GROUP BY enum_field" returns incorrect results +# + +CREATE TABLE t1 ( + id int(10) unsigned NOT NULL auto_increment, + val enum('one','two','three') NOT NULL default 'one', + PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); + +select val, count(*) from t1 group by val; +drop table t1; +CREATE TABLE t1 ( + id int(10) unsigned NOT NULL auto_increment, + val set('one','two','three') NOT NULL default 'one', + PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); +select val, count(*) from t1 group by val; +drop table t1; -- cgit v1.2.1 From d143ad2d0295b874538efc07587f858e1f644c11 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Oct 2004 21:22:14 +0500 Subject: Bug #5832 SELECT doesn't return records in some cases --- mysql-test/r/bdb.result | 24 ++++++++++++++++++++++++ mysql-test/r/ctype_utf8.result | 24 ++++++++++++++++++++++++ mysql-test/t/bdb.test | 20 ++++++++++++++++++++ mysql-test/t/ctype_utf8.test | 20 ++++++++++++++++++++ 4 files changed, 88 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 846adaf53ef..6da3dbb929d 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1260,3 +1260,27 @@ a length(a) char_length(a) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 510 255 drop table t1; SET NAMES latin1; +CREATE TABLE t1 ( +id int unsigned NOT NULL auto_increment, +list_id smallint unsigned NOT NULL, +term TEXT NOT NULL, +PRIMARY KEY(id), +INDEX(list_id, term(4)) +) ENGINE=BDB CHARSET=utf8; +INSERT INTO t1 SET list_id = 1, term = "letterc"; +INSERT INTO t1 SET list_id = 1, term = "letterb"; +INSERT INTO t1 SET list_id = 1, term = "lettera"; +INSERT INTO t1 SET list_id = 1, term = "letterd"; +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc"); +id +1 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); +id +2 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); +id +3 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); +id +4 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 0c9ea42a0f1..0b98d9432ae 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -726,3 +726,27 @@ length(subject) 3 432 DROP TABLE t1; +CREATE TABLE t1 ( +id int unsigned NOT NULL auto_increment, +list_id smallint unsigned NOT NULL, +term TEXT NOT NULL, +PRIMARY KEY(id), +INDEX(list_id, term(4)) +) ENGINE=MYISAM CHARSET=utf8; +INSERT INTO t1 SET list_id = 1, term = "letterc"; +INSERT INTO t1 SET list_id = 1, term = "letterb"; +INSERT INTO t1 SET list_id = 1, term = "lettera"; +INSERT INTO t1 SET list_id = 1, term = "letterd"; +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc"); +id +1 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); +id +2 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); +id +3 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); +id +4 +DROP TABLE t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 86214ecd5a8..069ec758ba2 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -909,3 +909,23 @@ insert into t1 values (@a); select a, length(a), char_length(a) from t1; drop table t1; SET NAMES latin1; + +# +# Bug #5832 SELECT doesn't return records in some cases +# +CREATE TABLE t1 ( + id int unsigned NOT NULL auto_increment, + list_id smallint unsigned NOT NULL, + term TEXT NOT NULL, + PRIMARY KEY(id), + INDEX(list_id, term(4)) +) ENGINE=BDB CHARSET=utf8; +INSERT INTO t1 SET list_id = 1, term = "letterc"; +INSERT INTO t1 SET list_id = 1, term = "letterb"; +INSERT INTO t1 SET list_id = 1, term = "lettera"; +INSERT INTO t1 SET list_id = 1, term = "letterd"; +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 40709443d62..4a8eb63ed36 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -572,3 +572,23 @@ INSERT INTO t1 VALUES ('aaa','bbb'); SELECT length(subject) FROM t1; SELECT length(subject) FROM t1 ORDER BY 1; DROP TABLE t1; + +# +# Bug #5832 SELECT doesn't return records in some cases +# +CREATE TABLE t1 ( + id int unsigned NOT NULL auto_increment, + list_id smallint unsigned NOT NULL, + term TEXT NOT NULL, + PRIMARY KEY(id), + INDEX(list_id, term(4)) +) ENGINE=MYISAM CHARSET=utf8; +INSERT INTO t1 SET list_id = 1, term = "letterc"; +INSERT INTO t1 SET list_id = 1, term = "letterb"; +INSERT INTO t1 SET list_id = 1, term = "lettera"; +INSERT INTO t1 SET list_id = 1, term = "letterd"; +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); +DROP TABLE t1; -- cgit v1.2.1 From c34368d649d87cb72acaa13b9acf4da84482c41d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Oct 2004 11:00:09 +0200 Subject: testcase for bug#5736 fix of changed clo to mysql-test-run ndb/test/run-test/atrt-mysql-test-run: Fix options to mysql-test-run --- mysql-test/r/ndb_subquery.result | 42 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_subquery.test | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 mysql-test/r/ndb_subquery.result create mode 100644 mysql-test/t/ndb_subquery.test (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/r/ndb_subquery.result new file mode 100644 index 00000000000..8c89805a765 --- /dev/null +++ b/mysql-test/r/ndb_subquery.result @@ -0,0 +1,42 @@ +drop table if exists t1; +drop table if exists t2; +create table t1 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; +create table t2 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; +insert into t1 values (1,1,1),(2,2,2),(3,3,3); +insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); +explain select * from t2 where p NOT IN (select p from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index +select * from t2 where p NOT IN (select p from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select u from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func 1 Using index +select * from t2 where p NOT IN (select u from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select o from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func 1 Using index +select * from t2 where p NOT IN (select o from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select p+0 from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +select * from t2 where p NOT IN (select p+0 from t1); +p u o +4 4 4 +5 5 5 +drop table t1; +drop table t2; diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test new file mode 100644 index 00000000000..f1f8edfbd8f --- /dev/null +++ b/mysql-test/t/ndb_subquery.test @@ -0,0 +1,38 @@ +#-- source include/have_ndb.inc + +--disable_warnings +drop table if exists t1; +drop table if exists t2; +--enable_warnings + +########## +# bug#5367 +create table t1 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +create table t2 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +insert into t1 values (1,1,1),(2,2,2),(3,3,3); +insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); + +# Use pk +explain select * from t2 where p NOT IN (select p from t1); +select * from t2 where p NOT IN (select p from t1); + +# Use unique index +explain select * from t2 where p NOT IN (select u from t1); +select * from t2 where p NOT IN (select u from t1); + +# Use ordered index +explain select * from t2 where p NOT IN (select o from t1); +select * from t2 where p NOT IN (select o from t1); + +# Use scan +explain select * from t2 where p NOT IN (select p+0 from t1); +select * from t2 where p NOT IN (select p+0 from t1); + +drop table t1; +drop table t2; +# bug#5367 +########## -- cgit v1.2.1 From 6708264ac4d2184944f30e3d3771ae6f4bab9f56 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Oct 2004 13:18:55 +0000 Subject: bug#5736, subqueries and not in and testcases ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: bug#5736, subqueries and not in sql/ha_ndbcluster.cc: bug#5736, subqueries and not in --- mysql-test/r/ndb_subquery.result | 42 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_subquery.test | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 mysql-test/r/ndb_subquery.result create mode 100644 mysql-test/t/ndb_subquery.test (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/r/ndb_subquery.result new file mode 100644 index 00000000000..8c89805a765 --- /dev/null +++ b/mysql-test/r/ndb_subquery.result @@ -0,0 +1,42 @@ +drop table if exists t1; +drop table if exists t2; +create table t1 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; +create table t2 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; +insert into t1 values (1,1,1),(2,2,2),(3,3,3); +insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); +explain select * from t2 where p NOT IN (select p from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index +select * from t2 where p NOT IN (select p from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select u from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func 1 Using index +select * from t2 where p NOT IN (select u from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select o from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func 1 Using index +select * from t2 where p NOT IN (select o from t1); +p u o +4 4 4 +5 5 5 +explain select * from t2 where p NOT IN (select p+0 from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +select * from t2 where p NOT IN (select p+0 from t1); +p u o +4 4 4 +5 5 5 +drop table t1; +drop table t2; diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test new file mode 100644 index 00000000000..e80d9b16b46 --- /dev/null +++ b/mysql-test/t/ndb_subquery.test @@ -0,0 +1,38 @@ +-- source include/have_ndb.inc + +--disable_warnings +drop table if exists t1; +drop table if exists t2; +--enable_warnings + +########## +# bug#5367 +create table t1 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +create table t2 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +insert into t1 values (1,1,1),(2,2,2),(3,3,3); +insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); + +# Use pk +explain select * from t2 where p NOT IN (select p from t1); +select * from t2 where p NOT IN (select p from t1); + +# Use unique index +explain select * from t2 where p NOT IN (select u from t1); +select * from t2 where p NOT IN (select u from t1); + +# Use ordered index +explain select * from t2 where p NOT IN (select o from t1); +select * from t2 where p NOT IN (select o from t1); + +# Use scan +explain select * from t2 where p NOT IN (select p+0 from t1); +select * from t2 where p NOT IN (select p+0 from t1); + +drop table t1; +drop table t2; +# bug#5367 +########## -- cgit v1.2.1 From 73950f75aa531e92930df5648ad526ea997df284 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 10:50:13 +0300 Subject: After merge fixes Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code include/hash.h: Added back function that's was used in 4.0 mysql-test/r/delete.result: Update results after merge mysql-test/r/flush_table.result: Update results after merge mysql-test/r/func_str.result: Update results after merge mysql-test/r/handler.result: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/r/multi_update.result: More startup cleanups mysql-test/r/rename.result: More startup-cleanups mysql-test/r/select.result: More startup cleanups mysql-test/r/show_check.result: More startup-cleanups mysql-test/t/ctype_latin1_de.test: Cleanup mysql-test/t/derived.test: Portability fix mysql-test/t/handler.test: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/t/multi_update.test: More startup cleanups mysql-test/t/range.test: More comments mysql-test/t/rename.test: More startup cleanups mysql-test/t/select.test: More startup cleanups mysql-test/t/show_check.test: More startup cleanups mysql-test/t/type_timestamp.test: Add back test deleted during merge sql/item_cmpfunc.cc: After merge fixes sql/item_func.cc: Remove compiler warning sql/mysql_priv.h: After merge fixes sql/mysqld.cc: After merge fixes sql/sql_acl.cc: More debugging sql/sql_base.cc: After merge fixes (This fix was needed bacause of multi-table-update reopens tables) sql/sql_handler.cc: After merge fixes sql/sql_lex.h: After merge fixes sql/sql_select.cc: After merge fixes sql/sql_show.cc: After merge fixes sql/sql_table.cc: After merge fixes Simple cleanup of mysql_discard_or_import_tablespace sql/sql_update.cc: After merge fixes Rework mysql_multi_update to take into account derived tables. sql/sql_yacc.yy: After merge fixes --- mysql-test/r/delete.result | 22 ++++++------ mysql-test/r/flush_table.result | 7 ++-- mysql-test/r/func_str.result | 1 + mysql-test/r/handler.result | 70 ++++++++++++++++++--------------------- mysql-test/r/multi_update.result | 4 ++- mysql-test/r/rename.result | 2 +- mysql-test/r/select.result | 1 + mysql-test/r/show_check.result | 3 ++ mysql-test/t/ctype_latin1_de.test | 1 - mysql-test/t/derived.test | 2 +- mysql-test/t/handler.test | 30 +++++++++-------- mysql-test/t/multi_update.test | 11 ++++-- mysql-test/t/range.test | 3 ++ mysql-test/t/rename.test | 2 +- mysql-test/t/select.test | 2 ++ mysql-test/t/show_check.test | 4 +++ mysql-test/t/type_timestamp.test | 12 ++++++- 17 files changed, 103 insertions(+), 74 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 48cfa47b75c..5575ee1bf98 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -58,6 +58,17 @@ select count(*) from t1; count(*) 0 drop table t1; +create table t1 (a int not null auto_increment primary key, b char(32)); +insert into t1 (b) values ('apple'), ('apple'); +select * from t1; +a b +1 apple +2 apple +delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a; +select * from t1; +a b +1 apple +drop table t1; create table t11 (a int NOT NULL, b int, primary key (a)); create table t12 (a int NOT NULL, b int, primary key (a)); create table t2 (a int NOT NULL, b int, primary key (a)); @@ -130,14 +141,3 @@ select * from t1; a b 7 7 drop table t1; -create table t1 (a int not null auto_increment primary key, b char(32)); -insert into t1 (b) values ('apple'), ('apple'); -select * from t1; -a b -1 apple -2 apple -delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a; -select * from t1; -a b -1 apple -drop table t1; diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result index 7d2e9ab0b8d..2ef4ab5b52b 100644 --- a/mysql-test/r/flush_table.result +++ b/mysql-test/r/flush_table.result @@ -42,11 +42,11 @@ table_id test.t2 handler t1 open as a1; -Not unique table/alias: 'a1' +ERROR 42000: Not unique table/alias: 'a1' handler t1 open as a2; -Not unique table/alias: 'a2' +ERROR 42000: Not unique table/alias: 'a2' handler t2 open; -Not unique table/alias: 't2' +ERROR 42000: Not unique table/alias: 't2' handler a1 read first limit 9; table_id test.t1 @@ -74,7 +74,6 @@ test.t2 flush table t2; handler t2 close; -ERROR 42S02: Unknown table 't2' in HANDLER drop table t1; drop table t2; create table t1(table_id char(20) primary key); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index ab99b2dcbdd..4a3a70274fd 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -321,6 +321,7 @@ trim(trailing 'foo' from 'foo') select trim(leading 'foo' from 'foo'); trim(leading 'foo' from 'foo') + select 1=_latin1'1'; 1=_latin1'1' 1 diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index dcbf558ac3f..072d4582cbc 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -230,40 +230,36 @@ create table t1(table_id char(20) primary key); insert into t1 values ('test.t1'); insert into t1 values (''); handler t1 open; -Not unique table/alias: 't1' +ERROR 42000: Not unique table/alias: 't1' use test; handler test.t1 read first limit 9; -Unknown table 'test.t1' in HANDLER +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 'read first limit 9' at line 1 handler test_test.t1 read first limit 9; -table_id -test_test.t1 - +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 'read first limit 9' at line 1 handler t1 read first limit 9; table_id test_test.t1 handler test_test.t2 read first limit 9; -table_id -test_test.t2 - +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 'read first limit 9' at line 1 handler t2 read first limit 9; table_id test_test.t2 handler test_test.t1 close; +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 'close' at line 1 handler t1 close; -Unknown table 't1' in HANDLER drop table test_test.t1; handler test_test.t2 close; +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 'close' at line 1 handler t2 close; -Unknown table 't2' in HANDLER drop table test_test.t2; drop database test_test; use test; handler test.t1 close; -Unknown table 'test.t1' in HANDLER +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 'close' at line 1 handler t1 close; -Unknown table 't1' in HANDLER +ERROR 42S02: Unknown table 't1' in HANDLER drop table test.t1; drop database if exists test_test; drop table if exists t1; @@ -291,20 +287,20 @@ insert into t1 values ('t1'); insert into t2 values ('t2'); insert into t3 values ('t3'); handler t1 open; -Not unique table/alias: 't1' +ERROR 42000: Not unique table/alias: 't1' handler t2 open t1; -Not unique table/alias: 't1' +ERROR 42000: Not unique table/alias: 't1' handler t3 open t1; -Not unique table/alias: 't1' +ERROR 42000: Not unique table/alias: 't1' handler t1 read first limit 9; c1 test_test.t1 handler test.t1 close; -Unknown table 'test.t1' in HANDLER +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 'close' at line 1 handler test.t1 open h1; -Not unique table/alias: 'h1' +ERROR 42000: Not unique table/alias: 'h1' handler test_test.t1 open h1; -Not unique table/alias: 'h1' +ERROR 42000: Not unique table/alias: 'h1' handler test_test.t3 open h3; handler test.t1 open h2; handler t1 read first limit 9; @@ -319,24 +315,24 @@ t1 handler h3 read first limit 9; c1 test_test.t3 -handler test.h2 read first limit 9; +handler h2 read first limit 9; c1 t1 handler test.h1 close; -Unknown table 'test.h1' in HANDLER -handler test_test.t1 close; -handler test_test.h1 close; +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 'close' at line 1 +handler t1 close; +handler h1 close; handler h2 close; handler t1 read first limit 9; -Unknown table 't1' in HANDLER +ERROR 42S02: Unknown table 't1' in HANDLER handler h1 read first limit 9; -Unknown table 'h1' in HANDLER +ERROR 42S02: Unknown table 'h1' in HANDLER handler h2 read first limit 9; -Unknown table 'h2' in HANDLER +ERROR 42S02: Unknown table 'h2' in HANDLER handler h3 read first limit 9; c1 test_test.t3 -handler test_test.h3 read first limit 9; +handler h3 read first limit 9; c1 test_test.t3 use test_test; @@ -344,8 +340,8 @@ handler h3 read first limit 9; c1 test_test.t3 handler test.h3 read first limit 9; -Unknown table 'test.h3' in HANDLER -handler test_test.h3 close; +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 'read first limit 9' at line 1 +handler h3 close; use test; drop table t3; drop table t2; @@ -383,7 +379,7 @@ c1 t5 alter table t1 engine=MyISAM; handler h1 read first limit 9; -Unknown table 'h1' in HANDLER +ERROR 42S02: Unknown table 'h1' in HANDLER handler h2 read first limit 9; c1 t2 @@ -398,7 +394,7 @@ c1 t5 alter table t5 engine=MyISAM; handler h1 read first limit 9; -Unknown table 'h1' in HANDLER +ERROR 42S02: Unknown table 'h1' in HANDLER handler h2 read first limit 9; c1 t2 @@ -409,20 +405,20 @@ handler h4 read first limit 9; c1 t4 handler h5 read first limit 9; -Unknown table 'h5' in HANDLER +ERROR 42S02: Unknown table 'h5' in HANDLER alter table t3 engine=MyISAM; handler h1 read first limit 9; -Unknown table 'h1' in HANDLER +ERROR 42S02: Unknown table 'h1' in HANDLER handler h2 read first limit 9; c1 t2 handler h3 read first limit 9; -Unknown table 'h3' in HANDLER +ERROR 42S02: Unknown table 'h3' in HANDLER handler h4 read first limit 9; c1 t4 handler h5 read first limit 9; -Unknown table 'h5' in HANDLER +ERROR 42S02: Unknown table 'h5' in HANDLER handler h2 close; handler h4 close; handler t1 open as h1_1; @@ -439,11 +435,11 @@ c1 t1 alter table t1 engine=MyISAM; handler h1_1 read first limit 9; -Unknown table 'h1_1' in HANDLER +ERROR 42S02: Unknown table 'h1_1' in HANDLER handler h1_2 read first limit 9; -Unknown table 'h1_2' in HANDLER +ERROR 42S02: Unknown table 'h1_2' in HANDLER handler h1_3 read first limit 9; -Unknown table 'h1_3' in HANDLER +ERROR 42S02: Unknown table 'h1_3' in HANDLER drop table t1; drop table t2; drop table t3; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 780ceb36ad6..045a1b05e47 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -1,5 +1,8 @@ drop table if exists t1,t2,t3; drop database if exists mysqltest; +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +delete from mysql.user where user=_binary'mysqltest_1'; create table t1(id1 int not null auto_increment primary key, t char(12)); create table t2(id2 int not null, t char(12)); create table t3(id3 int not null, t char(12), index(id3)); @@ -152,7 +155,6 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; ERROR HY000: Table 't2' was locked with a READ lock and can't be updated UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; -ERROR HY000: Table 't2' was locked with a READ lock and can't be updated unlock tables; LOCK TABLES t1 write, t2 write; UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n; diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result index ec36f015412..76c0f4422fe 100644 --- a/mysql-test/r/rename.result +++ b/mysql-test/r/rename.result @@ -1,5 +1,5 @@ drop table if exists t0,t1,t2,t3,t4; -drop table if exists t0,t5,t6,t7,t8,t9; +drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2; create table t0 SELECT 1,"table 1"; create table t2 SELECT 2,"table 2"; create table t3 SELECT 3,"table 3"; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index f0618c0f153..ba0a80331b1 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8b52e6efedc..8256c8d692a 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1,5 +1,8 @@ drop table if exists t1,t2; drop database if exists mysqltest; +delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +flush privileges; create table t1 (a int not null primary key, b int not null,c int not null, key(b,c)); insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); check table t1 fast; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 472a3db648e..1c9576c1c56 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -89,7 +89,6 @@ drop table t1; # # Bug #5447 Select does not find records # -DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( autor varchar(80) NOT NULL default '', PRIMARY KEY (autor) diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index fbfd3ccdef1..64e3fe8929b 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -101,7 +101,7 @@ SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1; # # Connect without a database create table t1 select 1 as a; -connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); +connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK); connection con1; --error 1046 select 2 as a from (select * from t1) b; diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index b7fe5d10297..3de8e8ae784 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -174,30 +174,34 @@ handler t1 open; # Check accesibility of all the tables. # use test; ---error 1109; +--error 1064 handler test.t1 read first limit 9; +--error 1064 handler test_test.t1 read first limit 9; handler t1 read first limit 9; +--error 1064 handler test_test.t2 read first limit 9; handler t2 read first limit 9; + # # Cleanup. # +--error 1064 handler test_test.t1 close; ---error 1109; handler t1 close; drop table test_test.t1; +--error 1064 handler test_test.t2 close; ---error 1109; handler t2 close; drop table test_test.t2; drop database test_test; + # use test; ---error 1109; +--error 1064 handler test.t1 close; ---error 1109; +--error 1109 handler t1 close; drop table test.t1; @@ -234,7 +238,7 @@ handler t2 open t1; --error 1066 handler t3 open t1; handler t1 read first limit 9; ---error 1109 +--error 1064 handler test.t1 close; --error 1066 handler test.t1 open h1; @@ -246,11 +250,11 @@ handler t1 read first limit 9; handler h1 read first limit 9; handler h2 read first limit 9; handler h3 read first limit 9; -handler test.h2 read first limit 9; ---error 1109 +handler h2 read first limit 9; +--error 1064 handler test.h1 close; -handler test_test.t1 close; -handler test_test.h1 close; +handler t1 close; +handler h1 close; handler h2 close; --error 1109 handler t1 read first limit 9; @@ -259,12 +263,12 @@ handler h1 read first limit 9; --error 1109 handler h2 read first limit 9; handler h3 read first limit 9; -handler test_test.h3 read first limit 9; +handler h3 read first limit 9; use test_test; handler h3 read first limit 9; ---error 1109 +--error 1064 handler test.h3 read first limit 9; -handler test_test.h3 close; +handler h3 close; use test; drop table t3; drop table t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index e56636bd2ba..e2aebd014f8 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -5,6 +5,11 @@ --disable_warnings drop table if exists t1,t2,t3; drop database if exists mysqltest; +--error 0,1141 +revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; +--error 0,1141 +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +delete from mysql.user where user=_binary'mysqltest_1'; --enable_warnings create table t1(id1 int not null auto_increment primary key, t char(12)); @@ -383,10 +388,10 @@ select * from t2; drop table t1, t2; # -# prevelege chexk for multiupdate with other tables +# privilege check for multiupdate with other tables # -connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root; --disable_warnings create database mysqltest; @@ -396,7 +401,7 @@ create table mysqltest.t2 (a int, b int, primary key (a)); create table mysqltest.t3 (a int, b int, primary key (a)); grant select on mysqltest.* to mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost; -connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); +connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK); connection user1; update t1, t2 set t1.b=1 where t1.a=t2.a; update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 61886221fcf..cd6620f7126 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -423,6 +423,9 @@ select count(*) from t1 where x=0; select count(*) from t1 where x<0; select count(*) from t1 where x < -16; select count(*) from t1 where x = -16; +# The following query returns wrong value because the range optimizer can't +# handle search on a signed value for an unsigned parameter. This will be fixed in +# 5.0 select count(*) from t1 where x > -16; select count(*) from t1 where x = 18446744073709551601; diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test index e6dc6ce9456..497ff721c99 100644 --- a/mysql-test/t/rename.test +++ b/mysql-test/t/rename.test @@ -5,7 +5,7 @@ --disable_warnings drop table if exists t0,t1,t2,t3,t4; # Clear up from other tests (to ensure that SHOW TABLES below is right) -drop table if exists t0,t5,t6,t7,t8,t9; +drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2; --enable_warnings create table t0 SELECT 1,"table 1"; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 4490f97765b..c260c7777e2 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -8,6 +8,8 @@ --disable_warnings drop table if exists t1,t2,t3,t4; +# The following may be left from older tests +drop table if exists t1_1,t1_2,t9_1,t9_2; --enable_warnings CREATE TABLE t1 ( diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 759ed7d22b3..681127eab5e 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -5,6 +5,10 @@ --disable_warnings drop table if exists t1,t2; drop database if exists mysqltest; + +delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; +flush privileges; --enable_warnings create table t1 (a int not null primary key, b int not null,c int not null, key(b,c)); diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index d3bda858b8b..5978c24ddc4 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -62,6 +62,17 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000); SELECT * FROM t1; drop table t1; +create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), + t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), + t14 timestamp(14)); +insert t1 values (0,0,0,0,0,0,0), +("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59"); +select * from t1; +select * from t1; +drop table t1; + # # Let us check if we properly treat wrong datetimes and produce proper warnings # (for both strings and numbers) @@ -270,7 +281,6 @@ drop table t1; # Test for bug #4131, TIMESTAMP columns missing minutes and seconds when # using GROUP BY in @@new=1 mode. # -set new=1; create table t1 (a char(2), t timestamp); insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'), ('b', '2004-02-01 00:00:00'); -- cgit v1.2.1 From c08064f63906ef2f8f23c91f99df287117c62bbe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 08:42:11 +0000 Subject: adder order by --- mysql-test/r/ndb_subquery.result | 8 ++++---- mysql-test/t/ndb_subquery.test | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/r/ndb_subquery.result index 8c89805a765..f65f09b71b3 100644 --- a/mysql-test/r/ndb_subquery.result +++ b/mysql-test/r/ndb_subquery.result @@ -10,7 +10,7 @@ explain select * from t2 where p NOT IN (select p from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index -select * from t2 where p NOT IN (select p from t1); +select * from t2 where p NOT IN (select p from t1) order by p; p u o 4 4 4 5 5 5 @@ -18,7 +18,7 @@ explain select * from t2 where p NOT IN (select u from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where 2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func 1 Using index -select * from t2 where p NOT IN (select u from t1); +select * from t2 where p NOT IN (select u from t1) order by p; p u o 4 4 4 5 5 5 @@ -26,7 +26,7 @@ explain select * from t2 where p NOT IN (select o from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where 2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func 1 Using index -select * from t2 where p NOT IN (select o from t1); +select * from t2 where p NOT IN (select o from t1) order by p; p u o 4 4 4 5 5 5 @@ -34,7 +34,7 @@ explain select * from t2 where p NOT IN (select p+0 from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where 2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where -select * from t2 where p NOT IN (select p+0 from t1); +select * from t2 where p NOT IN (select p+0 from t1) order by p; p u o 4 4 4 5 5 5 diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test index e80d9b16b46..cebc1920eaa 100644 --- a/mysql-test/t/ndb_subquery.test +++ b/mysql-test/t/ndb_subquery.test @@ -18,19 +18,19 @@ insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); # Use pk explain select * from t2 where p NOT IN (select p from t1); -select * from t2 where p NOT IN (select p from t1); +select * from t2 where p NOT IN (select p from t1) order by p; # Use unique index explain select * from t2 where p NOT IN (select u from t1); -select * from t2 where p NOT IN (select u from t1); +select * from t2 where p NOT IN (select u from t1) order by p; # Use ordered index explain select * from t2 where p NOT IN (select o from t1); -select * from t2 where p NOT IN (select o from t1); +select * from t2 where p NOT IN (select o from t1) order by p; # Use scan explain select * from t2 where p NOT IN (select p+0 from t1); -select * from t2 where p NOT IN (select p+0 from t1); +select * from t2 where p NOT IN (select p+0 from t1) order by p; drop table t1; drop table t2; -- cgit v1.2.1 From bf533c4e050c4b22df0a0b3008964cfb5bf6f726 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 13:02:39 +0400 Subject: Fix for bug #5915 "ALTER TABLE behaves differently when converting column to auto_increment in 4.1". Now we are enforcing NO_AUTO_VALUE_ON_ZERO mode during ALTER TABLE only if we are converting one auto_increment column to another auto_increment column (this also includes most common case when we don't do anything with such column). Also now when we convert some column to TIMESTAMP NOT NULL column with ALTER TABLE we convert NULL values to current timestamp, (as we do this in INSERT). One can still get old behavior by setting system TIMESTAMP variable to 0. mysql-test/r/auto_increment.result: Added tests for ALTER TABLE converting columns containing NULL and 0 values to AUTO_INCREMENT columns. mysql-test/r/type_timestamp.result: Removed test for creation of TIMESTAMP(19) columns (it is 4.0 specific). Added test for ALTER TABLE converting columns containing NULL values to TIMESTAMP columns. mysql-test/t/auto_increment.test: Added tests for ALTER TABLE converting columns containing NULL and 0 values to AUTO_INCREMENT columns. mysql-test/t/type_timestamp.test: Removed test for creation of TIMESTAMP(19) columns (it is 4.0 specific). Added test for ALTER TABLE converting columns containing NULL values to TIMESTAMP columns. sql/field_conv.cc: Fix bug #5915 "ALTER TABLE behaves differently when converting column to auto_increment in 4.1". Also now when we are converting some column to TIMESTAMP column, we are converting NULL values to CURRENT_TIMESTAMP (as it was initially planned). do_copy_timestamp(): Fixed comment. do_copy_next_number(): We should also set auto_increment_field_not_null to FALSE if we have NULL in source field. Copy_field::set(): Moved setting of copy functions for TIMESTAMP and AUTO_INCREMENT fields to proper place (this was dead code before). sql/sql_table.cc: Fix for bug #5915 "ALTER TABLE behaves differently when converting column to auto_increment in 4.1". Instead of always forcing NO_AUTO_VALUE_ON_ZERO in ALTER TABLE it is better to do this only if we are converting one auto_increment column to another auto_increment column (this also includes most common case when we don't do anything with such column). --- mysql-test/r/auto_increment.result | 52 ++++++++++++++++++++++++++++++++++++++ mysql-test/r/type_timestamp.result | 17 +++++-------- mysql-test/t/auto_increment.test | 38 ++++++++++++++++++++++++++++ mysql-test/t/type_timestamp.test | 12 ++++----- 4 files changed, 103 insertions(+), 16 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index f5ec5f1f852..428b2769fdb 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -289,3 +289,55 @@ a b 0 13 500 14 drop table t1; +create table t1 (a bigint); +insert into t1 values (1), (2), (3), (NULL), (NULL); +alter table t1 modify a bigint not null auto_increment primary key; +select * from t1; +a +1 +2 +3 +4 +5 +drop table t1; +create table t1 (a bigint); +insert into t1 values (1), (2), (3), (0), (0); +alter table t1 modify a bigint not null auto_increment primary key; +select * from t1; +a +1 +2 +3 +4 +5 +drop table t1; +create table t1 (a bigint); +insert into t1 values (0), (1), (2), (3); +set sql_mode=NO_AUTO_VALUE_ON_ZERO; +alter table t1 modify a bigint not null auto_increment primary key; +set sql_mode= ''; +select * from t1; +a +0 +1 +2 +3 +drop table t1; +create table t1 (a int auto_increment primary key , b int null); +set sql_mode=NO_AUTO_VALUE_ON_ZERO; +insert into t1 values (0,1),(1,2),(2,3); +select * from t1; +a b +0 1 +1 2 +2 3 +set sql_mode= ''; +alter table t1 modify b varchar(255); +insert into t1 values (0,4); +select * from t1; +a b +0 1 +1 2 +2 3 +3 4 +drop table t1; diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 6a7cecdd460..ab007901526 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -409,15 +409,12 @@ a b NULL NULL NULL 2003-01-01 00:00:00 drop table t1; -create table t1 (ts timestamp(19)); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -set TIMESTAMP=1000000000; -insert into t1 values (); +create table t1 (a bigint, b bigint); +insert into t1 values (NULL, NULL), (20030101000000, 20030102000000); +set timestamp=1000000019; +alter table t1 modify a timestamp, modify b timestamp; select * from t1; -ts -2001-09-09 04:46:40 +a b +2001-09-09 04:46:59 2001-09-09 04:46:59 +2003-01-01 00:00:00 2003-01-02 00:00:00 drop table t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index e5986e6755d..8e11a3d68a5 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -168,3 +168,41 @@ update t1 set a=NULL where b=13; update t1 set a=500 where b=14; select * from t1 order by b; drop table t1; + +# +# Test of behavior of ALTER TABLE when coulmn containing NULL or zeroes is +# converted to AUTO_INCREMENT column +# +create table t1 (a bigint); +insert into t1 values (1), (2), (3), (NULL), (NULL); +alter table t1 modify a bigint not null auto_increment primary key; +select * from t1; +drop table t1; + +create table t1 (a bigint); +insert into t1 values (1), (2), (3), (0), (0); +alter table t1 modify a bigint not null auto_increment primary key; +select * from t1; +drop table t1; + +# We still should be able to preserve zero in NO_AUTO_VALUE_ON_ZERO mode +create table t1 (a bigint); +insert into t1 values (0), (1), (2), (3); +set sql_mode=NO_AUTO_VALUE_ON_ZERO; +alter table t1 modify a bigint not null auto_increment primary key; +set sql_mode= ''; +select * from t1; +drop table t1; + +# It also sensible to preserve zeroes if we are converting auto_increment +# column to auto_increment column (or not touching it at all, which is more +# common case probably) +create table t1 (a int auto_increment primary key , b int null); +set sql_mode=NO_AUTO_VALUE_ON_ZERO; +insert into t1 values (0,1),(1,2),(2,3); +select * from t1; +set sql_mode= ''; +alter table t1 modify b varchar(255); +insert into t1 values (0,4); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 3f0b41d7221..d0e8f729b5d 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -266,12 +266,12 @@ select * from t1; drop table t1; # -# Test for bug #4491, TIMESTAMP(19) should be possible to create and not -# only read in 4.0 +# Let us test behavior of ALTER TABLE when it converts columns +# containing NULL to TIMESTAMP columns. # -create table t1 (ts timestamp(19)); -show create table t1; -set TIMESTAMP=1000000000; -insert into t1 values (); +create table t1 (a bigint, b bigint); +insert into t1 values (NULL, NULL), (20030101000000, 20030102000000); +set timestamp=1000000019; +alter table t1 modify a timestamp, modify b timestamp; select * from t1; drop table t1; -- cgit v1.2.1 From ed1b0c8d43b13cf598f5e82775d060cd43065e4b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 09:27:39 +0000 Subject: added order by to give same order results on different endian and different sized clusters --- mysql-test/include/ps_query.inc | 42 ++++---- mysql-test/r/ps_2myisam.result | 62 ++++++------ mysql-test/r/ps_3innodb.result | 62 ++++++------ mysql-test/r/ps_4heap.result | 62 ++++++------ mysql-test/r/ps_5merge.result | 124 ++++++++++++------------ mysql-test/r/ps_6bdb.result | 62 ++++++------ mysql-test/r/ps_7ndb.result | 210 ++++++++++++++++++++-------------------- mysql-test/t/ps_7ndb.test | 4 +- 8 files changed, 314 insertions(+), 314 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index e02d0d5bf96..d1c54464b54 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -104,13 +104,13 @@ prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; execute stmt1 using @arg00 ; # variations on 'concat' set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; # BUG#3796 Prepared statement, select concat(,),wrong result -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; # -select a , concat(b,@arg00) from t1 ; -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +select a , concat(b,@arg00) from t1 order by a ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; # variations on 'group_concat' @@ -147,7 +147,7 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; @@ -216,8 +216,8 @@ execute stmt1 using @arg00 ; # parameter in IN set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +select a FROM t1 where a in (@arg00,@arg01) order by a; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; # case derived from client_test.c: test_bug1500() set @arg00= 'one' ; @@ -270,9 +270,9 @@ execute stmt1 using @arg00 ; ##### parameter used in having clause set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; ##### parameter used in order clause @@ -327,10 +327,10 @@ select '------ join tests ------' as test_sequence ; # no parameter select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; # some parameters @@ -350,15 +350,15 @@ execute stmt1 using @arg00, @arg01, @arg02; drop table if exists t2 ; --enable_warnings create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; let $1= 9 ; while ($1) { @@ -424,7 +424,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; ######## correlated subquery # no parameter prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; # also Bug#4000 (only BDB tables) # Bug#4106 : ndb table, query with correlated subquery, wrong result execute stmt1 ; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 68e0a53fdba..a6c2c65a25e 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -165,26 +165,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -234,14 +234,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -307,11 +307,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -385,13 +385,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -470,7 +470,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -478,7 +478,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -517,17 +517,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -548,7 +548,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -569,7 +569,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -590,7 +590,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -611,7 +611,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -632,7 +632,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -653,7 +653,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -674,7 +674,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -695,7 +695,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -769,7 +769,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 90cd5e39f9c..ebba84f1a6c 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -165,26 +165,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -234,14 +234,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -307,11 +307,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -385,13 +385,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -470,7 +470,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -478,7 +478,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -517,17 +517,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -548,7 +548,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -569,7 +569,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -590,7 +590,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -611,7 +611,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -632,7 +632,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -653,7 +653,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -674,7 +674,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -695,7 +695,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -769,7 +769,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index feef6bcf83e..f82fc1a8312 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -166,26 +166,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -235,14 +235,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -308,11 +308,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -386,13 +386,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -471,7 +471,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -479,7 +479,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -518,17 +518,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -549,7 +549,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -570,7 +570,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -591,7 +591,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -612,7 +612,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -633,7 +633,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -654,7 +654,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -675,7 +675,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -696,7 +696,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -770,7 +770,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 8f87343c894..86f0fe874fd 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -208,26 +208,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -277,14 +277,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -350,11 +350,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -428,13 +428,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -513,7 +513,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -521,7 +521,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -560,17 +560,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -591,7 +591,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -612,7 +612,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -633,7 +633,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -654,7 +654,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -675,7 +675,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -696,7 +696,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -717,7 +717,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -738,7 +738,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -812,7 +812,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one @@ -3216,26 +3216,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -3285,14 +3285,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -3358,11 +3358,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -3436,13 +3436,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -3521,7 +3521,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -3529,7 +3529,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -3568,17 +3568,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -3599,7 +3599,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -3620,7 +3620,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -3641,7 +3641,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -3662,7 +3662,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -3683,7 +3683,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -3704,7 +3704,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -3725,7 +3725,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -3746,7 +3746,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -3820,7 +3820,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 52009dcf82a..0982baccd6a 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -165,26 +165,26 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) 1 MySQLone 2 MySQLtwo 3 MySQLthree 4 MySQLfour -select a , concat(b,@arg00) from t1 ; +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) 1 oneMySQL 2 twoMySQL 3 threeMySQL 4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) 1 oneMySQL @@ -234,14 +234,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -307,11 +307,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -385,13 +385,13 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b 1 one 3 three 4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b 1 one @@ -470,7 +470,7 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 1 1 2 2 @@ -478,7 +478,7 @@ a1 a2 4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 1 1 @@ -517,17 +517,17 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b @@ -548,7 +548,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b @@ -569,7 +569,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b @@ -590,7 +590,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b @@ -611,7 +611,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b @@ -632,7 +632,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b @@ -653,7 +653,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b @@ -674,7 +674,7 @@ a b a b 3 three 3 three 4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b @@ -695,7 +695,7 @@ a b 3 three 4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b @@ -769,7 +769,7 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b 1 one diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index decfc08b555..e274329388c 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -166,32 +166,32 @@ execute stmt1 using @arg00 ; substr('MySQL',1,?) MyS set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 ; +select a , concat(@arg00,b) from t1 order by a; a concat(@arg00,b) +1 MySQLone 2 MySQLtwo -4 MySQLfour 3 MySQLthree -1 MySQLone -prepare stmt1 from ' select a , concat(?,b) from t1 ' ; +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; execute stmt1 using @arg00; a concat(?,b) +1 MySQLone 2 MySQLtwo -4 MySQLfour 3 MySQLthree -1 MySQLone -select a , concat(b,@arg00) from t1 ; +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; a concat(b,@arg00) +1 oneMySQL 2 twoMySQL -4 fourMySQL 3 threeMySQL -1 oneMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 ' ; +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; execute stmt1 using @arg00; a concat(b,?) +1 oneMySQL 2 twoMySQL -4 fourMySQL 3 threeMySQL -1 oneMySQL +4 fourMySQL set @arg00='MySQL' ; select group_concat(@arg00,b) from t1 group by 'a' ; @@ -235,14 +235,14 @@ create table t5 (id1 int(11) not null default '0', value2 varchar(100), value1 varchar(100)) ; insert into t5 values (1,'hh','hh'),(2,'hh','hh'), (1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? ' ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; set @arg00=1 ; set @arg01='hh' ; execute stmt1 using @arg00, @arg01 ; id1 value1 1 hh -2 hh 1 ii +2 hh drop table t5 ; drop table if exists t5 ; create table t5(session_id char(9) not null) ; @@ -308,11 +308,11 @@ execute stmt1 using @arg00 ; a set @arg00=2 ; set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01); +select a FROM t1 where a in (@arg00,@arg01) order by a; a 2 3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) '; +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; execute stmt1 using @arg00, @arg01; a 2 @@ -386,18 +386,18 @@ a b 4 four set @arg00='two' ; select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 ; +AND b is not NULL having b <> @arg00 order by a ; a b -4 four -3 three 1 one +3 three +4 four prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? ' ; +AND b is not NULL having b <> ? order by a ' ; execute stmt1 using @arg00 ; a b -4 four -3 three 1 one +3 three +4 four set @arg00=1 ; select a,b FROM t1 where a is not NULL AND b is not NULL order by a - @arg00 ; @@ -471,21 +471,21 @@ test_sequence ------ join tests ------ select first.a as a1, second.a as a2 from t1 first, t1 second -where first.a = second.a ; +where first.a = second.a order by a1 ; a1 a2 +1 1 2 2 -4 4 3 3 -1 1 +4 4 prepare stmt1 from ' select first.a as a1, second.a as a2 from t1 first, t1 second - where first.a = second.a '; + where first.a = second.a order by a1 '; execute stmt1 ; a1 a2 +1 1 2 2 -4 4 3 3 -1 1 +4 4 set @arg00='ABC'; set @arg01='two'; set @arg02='one'; @@ -518,204 +518,204 @@ a ? a 4 ABC 4 drop table if exists t2 ; create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) ' ; -set @query2= 'SELECT * FROM t2 natural join t1 ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) ' ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; the join statement is: -SELECT * FROM t2 right join t1 using(a) +SELECT * FROM t2 right join t1 using(a) order by t2.a prepare stmt1 from @query9 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 natural right join t1 +SELECT * FROM t2 natural right join t1 order by t2.a prepare stmt1 from @query8 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query7 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 using(a) +SELECT * FROM t2 left join t1 using(a) order by t2.a prepare stmt1 from @query6 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 natural left join t1 +SELECT * FROM t2 natural left join t1 order by t2.a prepare stmt1 from @query5 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a prepare stmt1 from @query4 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 join t1 using(a) +SELECT * FROM t2 join t1 using(a) order by t2.a prepare stmt1 from @query3 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four the join statement is: -SELECT * FROM t2 natural join t1 +SELECT * FROM t2 natural join t1 order by t2.a prepare stmt1 from @query2 ; execute stmt1 ; a b +1 one 2 two -4 four 3 three -1 one +4 four execute stmt1 ; a b +1 one 2 two -4 four 3 three -1 one +4 four execute stmt1 ; a b +1 one 2 two -4 four 3 three -1 one +4 four the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a prepare stmt1 from @query1 ; execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four execute stmt1 ; a b a b +1 one 1 one 2 two 2 two -4 four 4 four 3 three 3 three -1 one 1 one +4 four 4 four drop table t2 ; test_sequence ------ subquery tests ------ @@ -770,13 +770,13 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) '; + a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; a b +1 one 2 two -4 four 3 three -1 one +4 four prepare stmt1 from ' SELECT a as ccc from t1 where a+1= (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; execute stmt1 ; @@ -1188,7 +1188,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; -select a,b from t1 where a=2; +select a,b from t1 where a=2 order by b; a b execute stmt1; insert into t1 values(0,NULL); @@ -1474,7 +1474,7 @@ set @arg02=82 ; set @arg03='8-2' ; prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; +select a,b from t1 where a in (@arg00,@arg02) order by a ; a b 81 8-1 82 8-2 diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index 848eac0080a..30e45f44a0e 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -55,7 +55,7 @@ select '------ delete tests ------' as test_sequence ; ## delete without parameter prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; -select a,b from t1 where a=2; +select a,b from t1 where a=2 order by b; # delete with row not found execute stmt1; @@ -270,7 +270,7 @@ set @arg02=82 ; set @arg03='8-2' ; prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; +select a,b from t1 where a in (@arg00,@arg02) order by a ; ## insert with two parameter in the set part set @arg00=9 ; -- cgit v1.2.1 From 3a0337da64943cfed4cc5c8951a392ee9078aa56 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 09:51:30 +0000 Subject: more order by for ndb --- mysql-test/include/ps_query.inc | 2 +- mysql-test/r/ps_2myisam.result | 2 +- mysql-test/r/ps_3innodb.result | 2 +- mysql-test/r/ps_4heap.result | 2 +- mysql-test/r/ps_5merge.result | 4 ++-- mysql-test/r/ps_6bdb.result | 2 +- mysql-test/r/ps_7ndb.result | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index d1c54464b54..27ab85410c8 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -297,7 +297,7 @@ execute stmt1 using @arg00; ##### parameter used in limit clause set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; # currently (May 2004, Version 4.1) it is impossible diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index a6c2c65a25e..63463baabfd 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -439,7 +439,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index ebba84f1a6c..70ba4a109d7 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -439,7 +439,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index f82fc1a8312..4c68f0c8593 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -440,7 +440,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 86f0fe874fd..af5d08d5eb4 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -482,7 +482,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b @@ -3490,7 +3490,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 0982baccd6a..75358bd201b 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -439,7 +439,7 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index e274329388c..e33bbd7002c 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -440,11 +440,11 @@ set @arg00=0 ; execute stmt1 using @arg00; ERROR 42S22: Unknown column '?' in 'order clause' set @arg00=1; -prepare stmt1 from ' select a,b from t1 +prepare stmt1 from ' select a,b from t1 order by a limit 1 '; execute stmt1 ; a b -2 two +1 one prepare stmt1 from ' select a,b from t1 limit ? '; 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 2 -- cgit v1.2.1 From d539ffc712b010da928249f26de9e5067d1726f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 11:57:48 +0200 Subject: Initialise "sorted" variable in constructor of QUICK_SELECT. The variable is set to 1 in test_if_skip_sort_order if we decide to optimize "order by" by uinsg index_read. mysql-test/r/ndb_index_ordered.result: Another test to check the use of "sorted" in combination with reset_bounds() mysql-test/t/ndb_index_ordered.test: Another test to check the use of "sorted" in combination with reset_bounds() sql/ha_ndbcluster.cc: Check that sorted is set to 0 or 1. sql/opt_range.cc: Initialise the sorted variable to zero QUICK_SELECT constructor. --- mysql-test/r/ndb_index_ordered.result | 10 ++++++++++ mysql-test/t/ndb_index_ordered.test | 2 ++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index e0c486ee2c5..2910161eb74 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -45,6 +45,16 @@ a b c 2 3 5 3 4 6 4 5 8 +select a, b, c from t1 where a!=2 and c=6; +a b c +3 4 6 +select a, b, c from t1 where a!=2 order by a; +a b c +1 2 3 +3 4 6 +4 5 8 +5 6 2 +6 7 2 update t1 set c = 3 where b = 3; select * from t1 order by a; a b c diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index e1766f6e624..67c42e29e0c 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -25,6 +25,8 @@ select * from t1 where b <= 4 order by b; # Test of reset_bounds select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.c; +select a, b, c from t1 where a!=2 and c=6; +select a, b, c from t1 where a!=2 order by a; # # Here we should add some "explain select" to verify that the ordered index is -- cgit v1.2.1 From ead6833469f13751bb3f7488382eb02b06a8fe96 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 12:36:37 +0000 Subject: more order by fixes --- mysql-test/include/ps_query.inc | 10 +++++----- mysql-test/r/ps_2myisam.result | 18 +++++++++--------- mysql-test/r/ps_3innodb.result | 18 +++++++++--------- mysql-test/r/ps_4heap.result | 18 +++++++++--------- mysql-test/r/ps_5merge.result | 36 ++++++++++++++++++------------------ mysql-test/r/ps_6bdb.result | 18 +++++++++--------- mysql-test/r/ps_7ndb.result | 30 +++++++++++++++--------------- mysql-test/t/ps_7ndb.test | 2 +- 8 files changed, 75 insertions(+), 75 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index 27ab85410c8..e807e897161 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -115,15 +115,15 @@ execute stmt1 using @arg00; # variations on 'group_concat' set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; # -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; @@ -223,7 +223,7 @@ execute stmt1 using @arg00, @arg01; set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; # parameter in LIKE prepare stmt1 from ' select b FROM t1 where b like ? '; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 63463baabfd..7abac3bfb48 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -192,23 +192,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -319,7 +319,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 70ba4a109d7..e404eb7e97b 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -192,23 +192,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -319,7 +319,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 4c68f0c8593..94c9b2c357a 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -193,23 +193,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -320,7 +320,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index af5d08d5eb4..f4903baf979 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -235,23 +235,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -362,7 +362,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one @@ -3243,23 +3243,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -3370,7 +3370,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 75358bd201b..0d5054dacdc 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -192,23 +192,23 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) +group_concat(@arg00,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b) from t1 +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) +group_concat(?,b order by a) MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00) from t1 +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) +group_concat(b,@arg00 order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) +group_concat(b,? order by a) oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; @@ -319,7 +319,7 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b one diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index e33bbd7002c..2d3fea3236e 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -193,24 +193,24 @@ a concat(b,?) 3 threeMySQL 4 fourMySQL set @arg00='MySQL' ; -select group_concat(@arg00,b) from t1 +select group_concat(@arg00,b order by a) from t1 group by 'a' ; -group_concat(@arg00,b) -MySQLtwo,MySQLfour,MySQLthree,MySQLone -prepare stmt1 from ' select group_concat(?,b) from t1 +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(?,b) -MySQLtwo,MySQLfour,MySQLthree,MySQLone -select group_concat(b,@arg00) from t1 +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 group by 'a' ; -group_concat(b,@arg00) -twoMySQL,fourMySQL,threeMySQL,oneMySQL -prepare stmt1 from ' select group_concat(b,?) from t1 +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 group by ''a'' ' ; execute stmt1 using @arg00; -group_concat(b,?) -twoMySQL,fourMySQL,threeMySQL,oneMySQL +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL set @arg00='first' ; set @arg01='second' ; set @arg02=NULL; @@ -320,11 +320,11 @@ a set @arg00= 'one' ; set @arg01= 'two' ; set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) ' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; execute stmt1 using @arg00, @arg01, @arg02 ; b -two one +two prepare stmt1 from ' select b FROM t1 where b like ? '; set @arg00='two' ; execute stmt1 using @arg00 ; @@ -1334,7 +1334,7 @@ prepare stmt1 from 'update t1 set a=? where b=? execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; affected rows: 0 info: Rows matched: 0 Changed: 0 Warnings: 0 -select a,b from t1 order by a; +select a,b from t1 order by a ; a b 1 one 2 two diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index 30e45f44a0e..af669a26400 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -177,7 +177,7 @@ prepare stmt1 from 'update t1 set a=? where b=? --enable_info execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; --disable_info -select a,b from t1 order by a; +select a,b from t1 order by a ; drop table t2 ; ## update with parameters in limit -- cgit v1.2.1 From b0729e59e7e2bfb79a5dc7146efc72903dc4c6a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Oct 2004 16:30:21 +0000 Subject: ndb_alter_table.result, ndb_alter_table.test: ... mysql-test/t/ndb_alter_table.test: ... mysql-test/r/ndb_alter_table.result: ... --- mysql-test/r/ndb_alter_table.result | 2 ++ mysql-test/t/ndb_alter_table.test | 2 ++ 2 files changed, 4 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 28a50504064..ee7c3b28fe2 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -116,7 +116,9 @@ select * from t1 order by a; a b 0 1 17 18 +SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; alter table t1 modify column a int not null auto_increment; +SET SQL_MODE=''; select * from t1 order by a; a b 0 1 diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 1c1ef670af2..22b1a0e476d 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -95,7 +95,9 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (0,1),(17,18); select * from t1 order by a; +SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; alter table t1 modify column a int not null auto_increment; +SET SQL_MODE=''; select * from t1 order by a; INSERT INTO t1 VALUES (0,19),(20,21); select * from t1 order by a; -- cgit v1.2.1 From 5eba8d3ae590348c6b5dceb6a83fa53ec58e557e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Oct 2004 02:21:19 +0400 Subject: A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": implementation for a generic item tree modifications registry. Every item tree modification which should be rolled back for subsequent execution of a prepared statement or stored procedure should be saved in the registry. All such modifications are rolled back at once during cleanup stage of PS. Actual fix for the bug just adds a call to register modifications to convert_constant_item. Post review fixes implemented. mysql-test/r/ps.result: A fix for bug#5748, test results fixed. mysql-test/t/ps.test: A test case for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld" sql/item.cc: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": First step in removing up item-specific cleanups: now all such tree modifications should be done using the genericm mechanism implemented in this changeset. sql/item.h: Fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": no need for an item-specific change record any more. sql/item_cmpfunc.cc: A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values crashes mysqld": register item tree transformation performed by convert_constant_item. sql/sql_class.cc: Implementation for item tree transformations registry. sql/sql_class.h: Declarations, necessary for the tree transformations registry. sql/sql_parse.cc: Assert that the item tree transformations registry is not used for conventional execution. sql/sql_prepare.cc: Use of the item tree modifications registry in prepared statements: rollback all modifications in the end of statement prepare and execute. Also we now always set thd->current_arena to be able to determine that this is an execution of prepared statement inside the registry code. tests/client_test.c: A typo fixed. --- mysql-test/r/ps.result | 11 +++++++++++ mysql-test/t/ps.test | 15 +++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 12337d358e1..8e63e0cdf00 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -297,3 +297,14 @@ execute stmt; 'abc' like convert('abc' using utf8) 1 deallocate prepare stmt; +create table t1 ( a bigint ); +prepare stmt from 'select a from t1 where a between ? and ?'; +set @a=1; +execute stmt using @a, @a; +a +execute stmt using @a, @a; +a +execute stmt using @a, @a; +a +drop table t1; +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 4b63a7db95f..c961251255d 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -314,3 +314,18 @@ prepare stmt from "select 'abc' like convert('abc' using utf8)"; execute stmt; execute stmt; deallocate prepare stmt; + +# +# BUG#5748 "Prepared statement with BETWEEN and bigint values crashes +# mysqld". Just another place where an item tree modification must be +# rolled back. +# +create table t1 ( a bigint ); +prepare stmt from 'select a from t1 where a between ? and ?'; +set @a=1; +execute stmt using @a, @a; +execute stmt using @a, @a; +execute stmt using @a, @a; +drop table t1; +deallocate prepare stmt; + -- cgit v1.2.1 From 451636cd97b40233e479da2af45e411b80900acc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Oct 2004 01:39:20 +0200 Subject: Makefile.am, client_test.test, mysql-test-run.sh: To make client_test work as mysql-test-run test case, needs to install it mysql-test/mysql-test-run.sh: To make client_test work as mysql-test-run test case, needs to install it mysql-test/t/client_test.test: To make client_test work as mysql-test-run test case, needs to install it tests/Makefile.am: To make client_test work as mysql-test-run test case, needs to install it --- mysql-test/mysql-test-run.sh | 2 +- mysql-test/t/client_test.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index b12f7afb9f1..dc567eeeb50 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -530,7 +530,7 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" - TESTS_BINDIR="$BASEDIR/tests" + TESTS_BINDIR="$BASEDIR/bin" MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index 9183740cd02..b56e8038d9b 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,2 @@ --- disable_result_log --- // exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT +--disable_result_log +--exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT -- cgit v1.2.1 From cb0a081e939c70e9354f9df48809fdbbff950e97 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Oct 2004 10:50:50 +0200 Subject: NDB wl-2151 Fix bounds setting table handler vs TUX mysql-test/ndb/ndb_range_bounds.pl: wl-2151 Fix bounds setting table handler vs TUX ndb/include/kernel/signaldata/TuxBound.hpp: wl-2151 Fix bounds setting table handler vs TUX ndb/include/ndbapi/NdbIndexScanOperation.hpp: wl-2151 Fix bounds setting table handler vs TUX ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: wl-2151 Fix bounds setting table handler vs TUX ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp: wl-2151 Fix bounds setting table handler vs TUX ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: wl-2151 Fix bounds setting table handler vs TUX ndb/test/ndbapi/testOIBasic.cpp: wl-2151 Fix bounds setting table handler vs TUX sql/ha_ndbcluster.cc: wl-2151 Fix bounds setting table handler vs TUX sql/ha_ndbcluster.h: wl-2151 Fix bounds setting table handler vs TUX --- mysql-test/ndb/ndb_range_bounds.pl | 133 +++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 mysql-test/ndb/ndb_range_bounds.pl (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndb_range_bounds.pl b/mysql-test/ndb/ndb_range_bounds.pl new file mode 100644 index 00000000000..264a543752b --- /dev/null +++ b/mysql-test/ndb/ndb_range_bounds.pl @@ -0,0 +1,133 @@ +# +# test range scan bounds +# output to mysql-test/t/ndb_range_bounds.test +# +# give option --all to generate all cases +# + +use strict; +use integer; + +my $all = shift; +!defined($all) || ($all eq '--all' && !defined(shift)) + or die "only available option is --all"; + +my $table = 't'; + +print < 1, + 'exp' => '9 = 9', + 'cnt' => scalar @$val, + }; +} + +sub mkone ($$$\@) { + my($col, $op, $key, $val) = @_; + my $cnt = scalar cut($op, $key, @$val); + return { + 'exp' => "$col $op $key", + 'cnt' => $cnt, + }; +} + +sub mktwo ($$$$$\@) { + my($col, $op1, $key1, $op2, $key2, $val) = @_; + my $cnt = scalar cut($op2, $key2, cut($op1, $key1, @$val)); + return { + 'exp' => "$col $op1 $key1 and $col $op2 $key2", + 'cnt' => $cnt, + }; +} + +sub mkall ($$$\@) { + my($col, $key1, $key2, $val) = @_; + my @a = (); + my $p = mkdummy(@$val); + push(@a, $p) if $all; + my @ops1 = $all ? qw(< <= = >= >) : qw(= >= >); + my @ops2 = $all ? qw(< <= = >= >) : qw(< <=); + for my $op1 (@ops1) { + my $p = mkone($col, $op1, $key1, @$val); + push(@a, $p) if $all || $p->{cnt} != 0; + for my $op2 (@ops2) { + my $p = mktwo($col, $op1, $key1, $op2, $key2, @$val); + push(@a, $p) if $all || $p->{cnt} != 0; + } + } + return \@a; +} + +for my $nn ("bcd", "") { + my %nn; + for my $x (qw(b c d)) { + $nn{$x} = $nn =~ /$x/ ? "not null" : "null"; + } + print <{cnt} * @val * @val; + print "select count(*) - $cnt1 from $table"; + print " where $p1->{exp};\n"; + for my $p2 (@$a2) { + my $cnt2 = $p1->{cnt} * $p2->{cnt} * @val; + print "select count(*) - $cnt2 from $table"; + print " where $p1->{exp} and $p2->{exp};\n"; + for my $p3 (@$a3) { + my $cnt3 = $p1->{cnt} * $p2->{cnt} * $p3->{cnt}; + print "select count(*) - $cnt3 from $table"; + print " where $p1->{exp} and $p2->{exp} and $p3->{exp};\n"; + } + } + } + print < Date: Fri, 8 Oct 2004 13:37:13 +0200 Subject: BUG#5973 ndb table belonging to different database shows up in SHOW TABLES mysql-test/r/ndb_autodiscover.result: Added test cases to check that SHOW TABLES only show tables in the selected db. mysql-test/t/ndb_autodiscover.test: Added test cases to check that SHOW TABLES only show tables in the selected db. sql/ha_ndbcluster.cc: Only find files for the current db Only add files to files list which can be created i.e has a valid frm blob. This prevents NDB$BLOB tables and tables created from NdbApi to show up. --- mysql-test/r/ndb_autodiscover.result | 28 ++++++++++++++++++++++++++++ mysql-test/t/ndb_autodiscover.test | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 031be91fcb2..4a2bc6e9d90 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -330,6 +330,34 @@ show status like 'handler_discover%'; Variable_name Value Handler_discover 0 drop table t6; +show tables; +Tables_in_test +create table t1 (a int) engine=ndb; +show tables; +Tables_in_test +t1 +create database test2; +use test2; +show tables; +Tables_in_test2 +select * from t1; +ERROR 42S02: Table 'test2.t1' doesn't exist +create table t2 (b int) engine=ndb; +use test; +select * from t1; +a +show tables; +Tables_in_test +t1 +drop table t1; +use test2; +drop table t2; +drop database test2; +show databases; +Database +mysql +test +use test; CREATE TABLE t9 ( a int NOT NULL PRIMARY KEY, b int diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 13ec01cfb85..f828b009af0 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -427,6 +427,31 @@ show status like 'handler_discover%'; drop table t6; +##################################################### +# Test that only tables in the current database shows +# up in SHOW TABLES +# + +show tables; + +create table t1 (a int) engine=ndb; +show tables; +create database test2; +use test2; +show tables; +--error 1146 +select * from t1; +create table t2 (b int) engine=ndb; +use test; +select * from t1; +show tables; +drop table t1; +use test2; +drop table t2; +drop database test2; +show databases; +use test; + ###################################################### # Note! This should always be the last step in this # file, the table t9 will be used and dropped -- cgit v1.2.1 From 6f00b4de9cc0541798a05e8085815c9ae0448a25 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Oct 2004 13:38:35 -0500 Subject: mysql-test-run.sh: Look for 'client_test' in tests/ not bin/ make_binary_distribution.sh: Copy 'client_test' into the dist scripts/make_binary_distribution.sh: Copy 'client_test' into the dist mysql-test/mysql-test-run.sh: Look for 'client_test' in tests/ not bin/ --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index dc567eeeb50..b12f7afb9f1 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -530,7 +530,7 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" - TESTS_BINDIR="$BASEDIR/bin" + TESTS_BINDIR="$BASEDIR/tests" MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" -- cgit v1.2.1 From bcc6f6157ef82d4e345eb3202da82c3fb7bab8de Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Oct 2004 02:39:22 +0400 Subject: A fix and test case for Bug#5987 "subselect in bool function crashes server (prepared statements)": the bug was that all boolean items always recovered its original arguments at statement cleanup stage. This collided with Item_subselect::select_transformer, which tries to permanently change the item tree to use a transformed subselect instead of original one. So we had this call sequence for prepare: mysql_stmt_prepare -> JOIN::prepare -> Item_subselect::fix_fields -> the item tree gets transformed -> Item_bool_rowready_func2::cleanup, item tree is recovered to original state, while it shouldn't have been; mysql_stmt_execute -> attempts to execute a broken tree -> crash. Now instead of bluntly recovering all arguments of bool functions in Item_bool_rowready_func2::cleanup, we recover only those which were changed, and do it in one place. There still would exist a possibility for a collision with subselect tranformation, if permanent and temporary changes were performed at the same stage. But fortunately subselect transformation is always done first, so it doesn't conflict with the optimization done by propogate_cond_constants. Now we have: mysql_stmt_prepare -> JOIN::prepare -> subselect transformation permanently changes the tree -> cleanup doesn't recover anything, because nothing was registered for recovery. mysql_stmt_execute -> JOIN::prepare (the tree is already transformed, so it doesn't change), JOIN::optimize -> propogate_cond_constants -> temporary changes the item tree with constants -> JOIN::execute -> cleanup -> the changes done by propogate_cond_constants are recovered, as they were registered for recovery. mysql-test/r/ps.result: Bug#5987: test results fixed. mysql-test/t/ps.test: A test for bug#5987 "subselect in bool function crashes server (prepared statements)" sql/item.cc: resolve_const_item is now responsible to register all changes of the item tree for recovery sql/item.h: resolve_const_item signagture changed sql/item_cmpfunc.h: Arguments of boolean functions are now recovered using the centralized registry of THD. sql/sql_class.cc: It's crucial to add new items to the beginning of the recovery list, so that the recovery is performed in LIFO mode: otherwise if we change one node of a tree twice, it will be recovered to some intermediate state. sql/sql_select.cc: change_cond_ref_to_const and propogate_cond_constants are now responsible to register all changes of the item tree for recovery. The recovery is done using the centralized THD registry of changed tree items. --- mysql-test/r/ps.result | 10 ++++++++++ mysql-test/t/ps.test | 14 ++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 8e63e0cdf00..c10cb7bb25a 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -308,3 +308,13 @@ execute stmt using @a, @a; a drop table t1; deallocate prepare stmt; +create table t1 (a int); +prepare stmt from "select * from t1 where 1 > (1 in (SELECT * FROM t1))"; +execute stmt; +a +execute stmt; +a +execute stmt; +a +drop table t1; +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index c961251255d..42f6d4d0f64 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -329,3 +329,17 @@ execute stmt using @a, @a; drop table t1; deallocate prepare stmt; +# +# Bug #5987 subselect in bool function crashes server (prepared statements): +# don't overwrite transformed subselects with old arguments of a bool +# function. +# +create table t1 (a int); +prepare stmt from "select * from t1 where 1 > (1 in (SELECT * FROM t1))"; +execute stmt; +execute stmt; +execute stmt; +drop table t1; +deallocate prepare stmt; + + -- cgit v1.2.1 From 5acf251b48ad805d3479f3834d4c71bc316c0132 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Oct 2004 12:10:53 +0500 Subject: Blob support for the group_concat() function. (Bug #4315: GROUP_CONCAT with ORDER BY returns strange results for TEXT fields Bug #5564: Strange behaviour with group_concat and distinct Bug #5970: group_concat doesn't print warnings) --- mysql-test/r/func_gconcat.result | 91 ++++++++++++++++++++++++++++++++++++++++ mysql-test/r/query_cache.result | 2 + mysql-test/t/func_gconcat.test | 37 ++++++++++++++++ 3 files changed, 130 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index e0883a6297e..aa202823c77 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -366,3 +366,94 @@ A_ID B_DESC 3 F DROP TABLE t1; DROP TABLE t2; +create table t1 (a int, b text); +insert into t1 values (1, 'bb'), (1, 'ccc'), (1, 'a'), (1, 'bb'), (1, 'ccc'); +insert into t1 values (2, 'BB'), (2, 'CCC'), (2, 'A'), (2, 'BB'), (2, 'CCC'); +select group_concat(b) from t1 group by a; +group_concat(b) +bb,ccc,a,bb,ccc +BB,CCC,A,BB,CCC +select group_concat(distinct b) from t1 group by a; +group_concat(distinct b) +bb,ccc,a +BB,CCC,A +select group_concat(b order by b) from t1 group by a; +group_concat(b order by b) +a,bb,bb,ccc,ccc +A,BB,BB,CCC,CCC +select group_concat(distinct b order by b) from t1 group by a; +group_concat(distinct b order by b) +a,bb,ccc +A,BB,CCC +set local group_concat_max_len=4; +select group_concat(b) from t1 group by a; +group_concat(b) +bb,c +BB,C +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(distinct b) from t1 group by a; +group_concat(distinct b) +bb,c +BB,C +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(b order by b) from t1 group by a; +group_concat(b order by b) +a,bb +A,BB +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(distinct b order by b) from t1 group by a; +group_concat(distinct b order by b) +a,bb +A,BB +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +insert into t1 values (1, concat(repeat('1', 300), '2')), +(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')), +(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')), +(2, concat(repeat('0', 300), '1')); +set local group_concat_max_len=1024; +select group_concat(b) from t1 group by a; +group_concat(b) +bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +select group_concat(distinct b) from t1 group by a; +group_concat(distinct b) +bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +select group_concat(b order by b) from t1 group by a; +group_concat(b order by b) +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,a,bb,bb,ccc,ccc +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,A,BB,BB,CCC,CCC +select group_concat(distinct b order by b) from t1 group by a; +group_concat(distinct b order by b) +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,a,bb,ccc +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,A,BB,CCC +set local group_concat_max_len=400; +select group_concat(b) from t1 group by a; +group_concat(b) +bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111 +BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111 +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(distinct b) from t1 group by a; +group_concat(distinct b) +bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(b order by b) from t1 group by a; +group_concat(b order by b) +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +select group_concat(distinct b order by b) from t1 group by a; +group_concat(distinct b order by b) +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +Warnings: +Warning 1260 2 line(s) were cut by GROUP_CONCAT() +drop table t1; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index ee4b97b8ea8..d68da39b19f 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -901,6 +901,8 @@ set group_concat_max_len=10; select group_concat(a) FROM t1 group by b; group_concat(a) 1234567890 +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() set group_concat_max_len=1024; select group_concat(a) FROM t1 group by b; group_concat(a) diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 3f671377c4e..e0737a42221 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -240,3 +240,40 @@ SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_I DROP TABLE t1; DROP TABLE t2; +# +# blobs +# + +create table t1 (a int, b text); +insert into t1 values (1, 'bb'), (1, 'ccc'), (1, 'a'), (1, 'bb'), (1, 'ccc'); +insert into t1 values (2, 'BB'), (2, 'CCC'), (2, 'A'), (2, 'BB'), (2, 'CCC'); +select group_concat(b) from t1 group by a; +select group_concat(distinct b) from t1 group by a; +select group_concat(b order by b) from t1 group by a; +select group_concat(distinct b order by b) from t1 group by a; +set local group_concat_max_len=4; +select group_concat(b) from t1 group by a; +select group_concat(distinct b) from t1 group by a; +select group_concat(b order by b) from t1 group by a; +select group_concat(distinct b order by b) from t1 group by a; + +# +# long blobs +# + +insert into t1 values (1, concat(repeat('1', 300), '2')), +(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')), +(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')), +(2, concat(repeat('0', 300), '1')); +set local group_concat_max_len=1024; +select group_concat(b) from t1 group by a; +select group_concat(distinct b) from t1 group by a; +select group_concat(b order by b) from t1 group by a; +select group_concat(distinct b order by b) from t1 group by a; +set local group_concat_max_len=400; +select group_concat(b) from t1 group by a; +select group_concat(distinct b) from t1 group by a; +select group_concat(b order by b) from t1 group by a; +select group_concat(distinct b order by b) from t1 group by a; + +drop table t1; -- cgit v1.2.1 From 95c21a2512ddff18d99db1831331796188e2c5e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Oct 2004 08:31:45 +0000 Subject: Fixes bug with tableImpl with blobs not being initialized properly w.r.t pointer to blob tableImpl in column added blob to test to see that blob tables don't show up in show tables auto increment setting need not fetch blob tables (will otherwise generate error during table creation) moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info changed addBlobTables to start from last column and break if all blobs added also addBlobTables will return -1 if failed (typically getTable) changed to using get_local_table_info with internal table name where applicable for efficiency added option to get_local_table_info wether to fetch blob tables or not getTable always fetches the blobtables moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only mysql-test/r/ndb_autodiscover.result: added blob to test to see that blob tables don't show up in show tables mysql-test/t/ndb_autodiscover.test: added blob to test to see that blob tables don't show up in show tables ndb/src/ndbapi/Ndb.cpp: auto increment setting need not fetch blob tables (will otherwise generate error during table creation) ndb/src/ndbapi/NdbDictionaryImpl.cpp: moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info changed addBlobTables to start from last column and break if all blobs added also addBlobTables will return -1 if failed (typically getTable) changed to using get_local_table_info with internal table name where applicable for efficiency ndb/src/ndbapi/NdbDictionaryImpl.hpp: added option to get_local_table_info wether to fetch blob tables or not getTable always fetches the blobtables moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only --- mysql-test/r/ndb_autodiscover.result | 6 +++--- mysql-test/t/ndb_autodiscover.test | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 4a2bc6e9d90..23f089b9bc0 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -332,7 +332,7 @@ Handler_discover 0 drop table t6; show tables; Tables_in_test -create table t1 (a int) engine=ndb; +create table t1 (a int,b longblob) engine=ndb; show tables; Tables_in_test t1 @@ -342,10 +342,10 @@ show tables; Tables_in_test2 select * from t1; ERROR 42S02: Table 'test2.t1' doesn't exist -create table t2 (b int) engine=ndb; +create table t2 (b int,c longblob) engine=ndb; use test; select * from t1; -a +a b show tables; Tables_in_test t1 diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index f828b009af0..95b616fc7b2 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -434,14 +434,14 @@ drop table t6; show tables; -create table t1 (a int) engine=ndb; +create table t1 (a int,b longblob) engine=ndb; show tables; create database test2; use test2; show tables; --error 1146 select * from t1; -create table t2 (b int) engine=ndb; +create table t2 (b int,c longblob) engine=ndb; use test; select * from t1; show tables; -- cgit v1.2.1 From 692c4ee4e421a64fb6a53c98a953a82cbb2d1672 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Oct 2004 14:40:24 +0500 Subject: A fix (bug #5382: Server crashes after writing INTO OUTFILE) --- mysql-test/r/outfile.result | 10 ++++++++++ mysql-test/t/outfile.test | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 mysql-test/r/outfile.result (limited to 'mysql-test') diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result new file mode 100644 index 00000000000..4dc09f65b7c --- /dev/null +++ b/mysql-test/r/outfile.result @@ -0,0 +1,10 @@ +drop table if exists t1; +CREATE TABLE t1 (a INT); +EXPLAIN +SELECT * +INTO OUTFILE '/tmp/t1.txt' + FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' + FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found +DROP TABLE t1; diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index a7b81d565e6..28d5ebfaf99 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -2,6 +2,10 @@ # test of into outfile|dumpfile # +--disable_warnings +drop table if exists t1; +--enable_warnings + # We need to check that we have 'file' privilege. #drop table if exists t1; @@ -26,3 +30,15 @@ #INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb"); #select * from t into outfile "check"; #drop table if exists t; + +# +# Bug #5382: 'explain select into outfile' crashes the server +# + +CREATE TABLE t1 (a INT); +EXPLAIN + SELECT * + INTO OUTFILE '/tmp/t1.txt' + FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' + FROM t1; +DROP TABLE t1; -- cgit v1.2.1 From 913e003b8604eef2390c5810a8bbe609868bbf40 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Oct 2004 15:29:06 +0500 Subject: clean-up, indentation fixes. mysql-test/t/outfile.test: this 'drop...' not needed anymore sql/sql_yacc.yy: indentation fixes --- mysql-test/t/outfile.test | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index 28d5ebfaf99..59ce6cc56fe 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -8,7 +8,6 @@ drop table if exists t1; # We need to check that we have 'file' privilege. -#drop table if exists t1; #create table t1 (`a` blob); #insert into t1 values("hello world"),("Hello mars"),(NULL); #select * into outfile "/tmp/select-test.1" from t1; -- cgit v1.2.1 From 71dc2bf9b09807fdc775ccf908a4b3f24fbea4f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Oct 2004 11:01:38 +0200 Subject: Fix for BUG#5949 "error code 1223 in binlog when using innobackup": when one connection had done FLUSH TABLES WITH READ LOCK, some updates, and then COMMIT, it was accepted but my_error() was called and so, while client got no error, error was logged in binlog. We now don't call my_error() in this case; we assume the connection know what it does. This problem was specific to 4.0.21. The change is needed to make replication work with existing versions of innobackup. sql/lock.cc: If a connection has done FLUSH TABLES WITH READ LOCK and now is doing COMMIT, don't give error (applies only if it's the same connection; others' COMMITs are still blocked). --- mysql-test/r/rpl_commit_after_flush.result | 13 +++++++++++++ mysql-test/t/rpl_commit_after_flush.test | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 mysql-test/r/rpl_commit_after_flush.result create mode 100644 mysql-test/t/rpl_commit_after_flush.test (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/r/rpl_commit_after_flush.result new file mode 100644 index 00000000000..8cdc7e986ab --- /dev/null +++ b/mysql-test/r/rpl_commit_after_flush.result @@ -0,0 +1,13 @@ +slave stop; +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; +slave start; +create table t1 (a int) type=innodb; +begin; +insert into t1 values(1); +flush tables with read lock; +commit; +unlock tables; +drop table t1; diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test new file mode 100644 index 00000000000..edbbd1bfad6 --- /dev/null +++ b/mysql-test/t/rpl_commit_after_flush.test @@ -0,0 +1,17 @@ +source include/master-slave.inc; +source include/have_innodb.inc; +create table t1 (a int) type=innodb; +begin; +insert into t1 values(1); +flush tables with read lock; +commit; +save_master_pos; +connection slave; +sync_with_master; +# cleanup +connection master; +unlock tables; +drop table t1; +save_master_pos; +connection slave; +sync_with_master; -- cgit v1.2.1 From 80f1a197608dde3a6c1149add532e74777112762 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Oct 2004 20:58:48 +0000 Subject: another order by fix for ndb --- mysql-test/include/ps_query.inc | 2 +- mysql-test/r/ps_2myisam.result | 2 +- mysql-test/r/ps_3innodb.result | 2 +- mysql-test/r/ps_4heap.result | 2 +- mysql-test/r/ps_5merge.result | 4 ++-- mysql-test/r/ps_6bdb.result | 2 +- mysql-test/r/ps_7ndb.result | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc index e807e897161..e6f19c67138 100644 --- a/mysql-test/include/ps_query.inc +++ b/mysql-test/include/ps_query.inc @@ -45,7 +45,7 @@ select '------ simple select tests ------' as test_sequence ; ##### many column types, but no parameter # heavy modified case derived from client_test.c: test_func_fields() -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; --enable_metadata execute stmt1; --disable_metadata diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 7abac3bfb48..40b2516f0b9 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -46,7 +46,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index e404eb7e97b..11669b131a7 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -46,7 +46,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 94c9b2c357a..a3837650e0e 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -47,7 +47,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index f4903baf979..619b59e4e3d 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -89,7 +89,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 @@ -3097,7 +3097,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 0d5054dacdc..5c23a574f51 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -46,7 +46,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 2d3fea3236e..cf567750b85 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -47,7 +47,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; test_sequence ------ simple select tests ------ -prepare stmt1 from ' select * from t9 ' ; +prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 @@ -83,8 +83,8 @@ def test t9 t9 c30 c30 253 100 8 Y 0 0 8 def test t9 t9 c31 c31 254 5 3 Y 256 0 8 def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday set @arg00='SELECT' ; prepare stmt1 from ' ? a from t1 where a=1 '; 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 '? a from t1 where a=1' at line 1 -- cgit v1.2.1 From 253fec0f4cbd17d00d9a1189adbc14b94c0c6807 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2004 07:20:38 +0200 Subject: Fix order by --- mysql-test/r/ndb_index_ordered.result | 6 +++--- mysql-test/t/ndb_index_ordered.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 2910161eb74..2dc260ec43d 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -37,14 +37,14 @@ a b c 1 2 3 2 3 5 3 4 6 -select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.c; +select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.b; a b c -6 7 2 -5 6 2 1 2 3 2 3 5 3 4 6 4 5 8 +5 6 2 +6 7 2 select a, b, c from t1 where a!=2 and c=6; a b c 3 4 6 diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 67c42e29e0c..64291c8ab97 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -24,7 +24,7 @@ select * from t1 where b < 4 order by b; select * from t1 where b <= 4 order by b; # Test of reset_bounds -select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.c; +select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.b; select a, b, c from t1 where a!=2 and c=6; select a, b, c from t1 where a!=2 order by a; -- cgit v1.2.1 From 24db339f00af764de461ac0ef2762720a8cb0470 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2004 16:00:50 +0200 Subject: New tests for prepared statements: - 'ps_10nestset' uses a "nested set" approach for an employee hierarchy, then does arithmetic on the "salary" field; (soon) to be extended by inserts / deletes which imply mass updates on the "l"/"r" fields showing the set inclusion, - 'ps_11bugs' will get (some of ?) those bug DB entries which refer to prepared statements, but whose number does not appear in a test file comment - so it will also be extended. --- mysql-test/r/ps_10nestset.result | 68 ++++++++++++++++++++++++++++++++++++++++ mysql-test/r/ps_11bugs.result | 21 +++++++++++++ mysql-test/t/ps_10nestset.test | 63 +++++++++++++++++++++++++++++++++++++ mysql-test/t/ps_11bugs.test | 32 +++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 mysql-test/r/ps_10nestset.result create mode 100644 mysql-test/r/ps_11bugs.result create mode 100644 mysql-test/t/ps_10nestset.test create mode 100644 mysql-test/t/ps_11bugs.test (limited to 'mysql-test') diff --git a/mysql-test/r/ps_10nestset.result b/mysql-test/r/ps_10nestset.result new file mode 100644 index 00000000000..10f0a741b54 --- /dev/null +++ b/mysql-test/r/ps_10nestset.result @@ -0,0 +1,68 @@ +use test; +drop table if exists personnel; +Warnings: +Note 1051 Unknown table 'personnel' +create table personnel ( +id INTEGER AUTO_INCREMENT PRIMARY KEY, +emp CHAR(10) NOT NULL, +salary DECIMAL(6,2) NOT NULL, +l INTEGER NOT NULL, +r INTEGER NOT NULL); +prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; +set @arg_nam= 'Jerry'; +set @arg_sal= 1000; +set @arg_l= 1; +set @arg_r= 12; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Bert'; +set @arg_sal= 900; +set @arg_l= 2; +set @arg_r= 3; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Chuck'; +set @arg_sal= 900; +set @arg_l= 4; +set @arg_r= 11; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Donna'; +set @arg_sal= 800; +set @arg_l= 5; +set @arg_r= 6; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Eddie'; +set @arg_sal= 700; +set @arg_l= 7; +set @arg_r= 8; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Fred'; +set @arg_sal= 600; +set @arg_l= 9; +set @arg_r= 10; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +select * from personnel; +id emp salary l r +1 Jerry 1000.00 1 12 +2 Bert 900.00 2 3 +3 Chuck 900.00 4 11 +4 Donna 800.00 5 6 +5 Eddie 700.00 7 8 +6 Fred 600.00 9 10 +prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; +prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; +set @arg_percent= .10; +set @arg_amount= 100; +execute st_raise_base using @arg_percent; +execute st_raise_mgr using @arg_amount; +execute st_raise_base using @arg_percent; +execute st_raise_mgr using @arg_amount; +execute st_raise_base using @arg_percent; +execute st_raise_mgr using @arg_amount; +select * from personnel; +id emp salary l r +1 Jerry 1300.00 1 12 +2 Bert 1197.90 2 3 +3 Chuck 1200.00 4 11 +4 Donna 1064.80 5 6 +5 Eddie 931.70 7 8 +6 Fred 798.60 9 10 +drop table personnel; diff --git a/mysql-test/r/ps_11bugs.result b/mysql-test/r/ps_11bugs.result new file mode 100644 index 00000000000..2aa0df6a431 --- /dev/null +++ b/mysql-test/r/ps_11bugs.result @@ -0,0 +1,21 @@ +use test; +drop table if exists test_select; +Warnings: +Note 1051 Unknown table 'test_select' +CREATE TABLE test_select(session_id char(9) NOT NULL); +INSERT INTO test_select VALUES ("abc"); +SELECT * FROM test_select; +session_id +abc +prepare st_1180 from 'SELECT * FROM test_select WHERE ?="1111" and session_id = "abc"'; +set @arg1= 'abc'; +execute st_1180 using @arg1; +session_id +set @arg1= '1111'; +execute st_1180 using @arg1; +session_id +abc +set @arg1= 'abc'; +execute st_1180 using @arg1; +session_id +drop table test_select; diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test new file mode 100644 index 00000000000..2c6009af9de --- /dev/null +++ b/mysql-test/t/ps_10nestset.test @@ -0,0 +1,63 @@ +############################################### +# # +# Prepared Statements test on # +# "nested sets" representing hierarchies # +# # +############################################### + +# Source: http://kris.koehntopp.de/artikel/sql-self-references (dated 1999) +# Source: http://dbmsmag.com/9603d06.html (dated 1996) + +use test; + +drop table if exists personnel; + +# "Nested Set": This table represents an employee list with a hierarchy tree. +# The tree is not modeled by "parent" links but rather by showing the "left" +# and "right" border of any person's "region". By convention, "l" < "r". +# As it is a tree, these "regions" of two persons A and B are either disjoint, +# or A's region is completely contained in B's (B is A's boss), or vice versa. +# See the references for more info. + +create table personnel ( + id INTEGER AUTO_INCREMENT PRIMARY KEY, + emp CHAR(10) NOT NULL, + salary DECIMAL(6,2) NOT NULL, + l INTEGER NOT NULL, + r INTEGER NOT NULL); + +prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; + +# Initial employee list: +# Jerry ( Bert ( ) Chuck ( Donna ( ) Eddie ( ) Fred ( ) ) ) +set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; set @arg_r= 12; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Bert'; set @arg_sal= 900; set @arg_l= 2; set @arg_r= 3; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Chuck'; set @arg_sal= 900; set @arg_l= 4; set @arg_r= 11; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Donna'; set @arg_sal= 800; set @arg_l= 5; set @arg_r= 6; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Eddie'; set @arg_sal= 700; set @arg_l= 7; set @arg_r= 8; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; +set @arg_nam= 'Fred'; set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; +execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; + +select * from personnel; + +# Three successive raises, each one is 100 units for managers, 10 percent for others. +prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; +prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; +let $1= 3; +set @arg_percent= .10; +set @arg_amount= 100; +while ($1) +{ + execute st_raise_base using @arg_percent; + execute st_raise_mgr using @arg_amount; + dec $1; +} + +select * from personnel; + +drop table personnel; diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test new file mode 100644 index 00000000000..53afc8b5a78 --- /dev/null +++ b/mysql-test/t/ps_11bugs.test @@ -0,0 +1,32 @@ +############################################### +# # +# Prepared Statements # +# re-testing bug DB entries # +# # +############################################### + +use test; + +# bug#1180: optimized away part of WHERE clause cause incorect prepared satatement results + +drop table if exists test_select; + +CREATE TABLE test_select(session_id char(9) NOT NULL); +INSERT INTO test_select VALUES ("abc"); +SELECT * FROM test_select; + +prepare st_1180 from 'SELECT * FROM test_select WHERE ?="1111" and session_id = "abc"'; + +# Must not find a row +set @arg1= 'abc'; +execute st_1180 using @arg1; + +# Now, it should find one row +set @arg1= '1111'; +execute st_1180 using @arg1; + +# Back to non-matching +set @arg1= 'abc'; +execute st_1180 using @arg1; + +drop table test_select; -- cgit v1.2.1 From febdbf18221b62b032a251d308224dfccfbac21b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2004 21:16:07 +0400 Subject: ps.test, ps.result: a test case for Bug#6042 "constants propogation works only once (prepared statements)". mysql-test/r/ps.result: Test case for Bug#6042: test results fixed mysql-test/t/ps.test: A test case for Bug#6042 "constants propogation works only once (prepared statements). --- mysql-test/r/ps.result | 18 ++++++++++++++++++ mysql-test/t/ps.test | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index c10cb7bb25a..df5fa5fe999 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -318,3 +318,21 @@ execute stmt; a drop table t1; deallocate prepare stmt; +create table t1 (a int, b int); +insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2); +prepare stmt from +"explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?"; +set @v=5; +execute stmt using @v; +id select_type table type possible_keys key key_len ref rows Extra +- - - - - - - - NULL Impossible WHERE +set @v=0; +execute stmt using @v; +id select_type table type possible_keys key key_len ref rows Extra +- - - - - - - - 4 Using where +set @v=5; +execute stmt using @v; +id select_type table type possible_keys key key_len ref rows Extra +- - - - - - - - NULL Impossible WHERE +drop table t1; +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 42f6d4d0f64..76c7fb7c2e7 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -342,4 +342,25 @@ execute stmt; drop table t1; deallocate prepare stmt; +# +# Test case for Bug#6042 "constants propogation works only once (prepared +# statements): check that the query plan changes whenever we change +# placeholder value. +# +create table t1 (a int, b int); +insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2); +prepare stmt from +"explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?"; +--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - +set @v=5; +execute stmt using @v; +--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - +set @v=0; +execute stmt using @v; +--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - +set @v=5; +execute stmt using @v; +drop table t1; +deallocate prepare stmt; + -- cgit v1.2.1 From b37f86a3b8c0958755ba51707fb133de8e86285d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Oct 2004 00:38:43 +0000 Subject: fix for some build/test errors for 4.1.6 --- mysql-test/include/have_ndb.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 7567a0ca362..84e60657876 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -2,6 +2,6 @@ disable_query_log; show variables like "have_ndbcluster"; enable_query_log; -connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); -connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,$MASTER_MYSOCK1); -connection server1; +#connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +#connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,$MASTER_MYSOCK1); +#connection server1; -- cgit v1.2.1 From aebb938a9ad399bf5b0464b350de3309a8ed073a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Oct 2004 10:08:18 +0200 Subject: Bug#6020, any lock >= write_allow_write is a write lock mysql-test/r/ndb_lock.result: Add testcases for table locks mysql-test/t/ndb_lock.test: Add testcases for table locks --- mysql-test/r/ndb_lock.result | 35 +++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_lock.test | 29 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/r/ndb_lock.result index 56661913e22..b8c2c58aac4 100644 --- a/mysql-test/r/ndb_lock.result +++ b/mysql-test/r/ndb_lock.result @@ -28,3 +28,38 @@ x y 2 two 3 three commit; +drop table t1; +create table t1 (pk integer not null primary key, u int not null, o int not null, +unique(u), key(o)) engine = ndb; +insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); +lock tables t1 write; +delete from t1 where pk = 1; +unlock tables; +select * from t1 order by pk; +pk u o +2 2 2 +3 3 3 +4 4 4 +5 5 5 +insert into t1 values (1,1,1); +lock tables t1 write; +delete from t1 where u = 1; +unlock tables; +select * from t1 order by pk; +pk u o +2 2 2 +3 3 3 +4 4 4 +5 5 5 +insert into t1 values (1,1,1); +lock tables t1 write; +delete from t1 where o = 1; +unlock tables; +select * from t1 order by pk; +pk u o +2 2 2 +3 3 3 +4 4 4 +5 5 5 +insert into t1 values (1,1,1); +drop table t1; diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/t/ndb_lock.test index c0389dced44..39a8655b972 100644 --- a/mysql-test/t/ndb_lock.test +++ b/mysql-test/t/ndb_lock.test @@ -39,3 +39,32 @@ commit; connection con2; select * from t1 order by x; commit; + +drop table t1; + +### +# Bug#6020 +create table t1 (pk integer not null primary key, u int not null, o int not null, + unique(u), key(o)) engine = ndb; +insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5); + +lock tables t1 write; +delete from t1 where pk = 1; +unlock tables; +select * from t1 order by pk; +insert into t1 values (1,1,1); + +lock tables t1 write; +delete from t1 where u = 1; +unlock tables; +select * from t1 order by pk; +insert into t1 values (1,1,1); + +lock tables t1 write; +delete from t1 where o = 1; +unlock tables; +select * from t1 order by pk; +insert into t1 values (1,1,1); + +drop table t1; + -- cgit v1.2.1 From e7a0d543d2a80c80e34abab106e8e09800a3680e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 02:53:59 +0400 Subject: A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)" crashes server." The fix makes Item_func_rand prepared-statements aware plus it fixes the case when RAND is used in prepared statements and replication is on (as well as several similar issues). Until now we did not reset THD before every execution of a prepared statement, so if some execution had set thd->time_zone_used or thd->rand_used they would not be reset until next mysql_parse. Some of post-review fixes done. mysql-test/r/ps.result: A test case for Bug#5985: test results fixed. mysql-test/t/ps.test: A test case for Bug#5985 "prepare stmt from "select rand(?)" crashes server." sql/item_func.cc: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/item_func.h: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/mysql_priv.h: We need a separate call to reset THD state before every execute of a prepared statement. Otherwise things like THD->user_var_events are never cleaned up and bloat binary log (as the list of events grows from execution to execution). sql/sql_class.cc: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_class.h: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_lex.cc: Move the part responsible for initializing LEX from mysql_init_query to lex_start. sql/sql_lex.h: All lex-related initialization is now in lex_start. Move thd->select_number to lex->select_number to be able to use it easily in lex_start. sql/sql_parse.cc: Split mysql_init_query into two functions: mysql_reset_thd_for_next_query, which is used in PS and conventional execution, and lex_start, used only when we want to parse something. Fix init_connect to use initialized THD. sql/sql_prepare.cc: Deploy mysql_reset_thd_for_next_query to reset THD state before execution of a prepared statement. Normally this should have been added to just one place, but we have to reset thd before assigning placeholders from variables, thus we can't do that in execute_stmt (yuck). --- mysql-test/r/ps.result | 39 +++++++++++++++++++++++++++++++++++++++ mysql-test/t/ps.test | 28 +++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index df5fa5fe999..0aba0c4672e 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -336,3 +336,42 @@ id select_type table type possible_keys key key_len ref rows Extra - - - - - - - - NULL Impossible WHERE drop table t1; deallocate prepare stmt; +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4); +set @precision=10000000000; +select rand(), +cast(rand(10)*@precision as unsigned integer), +cast(rand(a)*@precision as unsigned integer) from t1; +rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) +- 6570515219 - +- 1282061302 - +- 6698761160 - +- 9647622201 - +prepare stmt from +"select rand(), + cast(rand(10)*@precision as unsigned integer), + cast(rand(a)*@precision as unsigned integer), + cast(rand(?)*@precision as unsigned integer) from t1"; +set @var=1; +execute stmt using @var; +rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) +- 6570515219 - 4054035371 +- 1282061302 - 8716141803 +- 6698761160 - 1418603212 +- 9647622201 - 944590960 +set @var=2; +execute stmt using @var; +rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) +- 6570515219 1559528654 6555866465 +- 1282061302 6238114970 1223466192 +- 6698761160 6511989195 6449731873 +- 9647622201 3845601374 8578261098 +set @var=3; +execute stmt using @var; +rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) +- 6570515219 1559528654 9057697559 +- 1282061302 6238114970 3730790581 +- 6698761160 6511989195 1480860534 +- 9647622201 3845601374 6211931236 +drop table t1; +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 76c7fb7c2e7..7cbcd50245f 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -363,4 +363,30 @@ execute stmt using @v; drop table t1; deallocate prepare stmt; - +# +# A test case for Bug#5985 prepare stmt from "select rand(?)" crashes +# server. Check that Item_func_rand is prepared-statements friendly. +# +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4); +set @precision=10000000000; +--replace_column 1 - 3 - +select rand(), + cast(rand(10)*@precision as unsigned integer), + cast(rand(a)*@precision as unsigned integer) from t1; +prepare stmt from +"select rand(), + cast(rand(10)*@precision as unsigned integer), + cast(rand(a)*@precision as unsigned integer), + cast(rand(?)*@precision as unsigned integer) from t1"; +set @var=1; +--replace_column 1 - 3 - +execute stmt using @var; +set @var=2; +--replace_column 1 - +execute stmt using @var; +set @var=3; +--replace_column 1 - +execute stmt using @var; +drop table t1; +deallocate prepare stmt; -- cgit v1.2.1 From 11ce341f0cd214b5a2b2186d36dae1ed6c40d78f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 14:14:50 +0500 Subject: Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table --- mysql-test/r/ctype_utf8.result | 29 +++++++++++++++++++++++++++++ mysql-test/t/ctype_utf8.test | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 0b98d9432ae..0ed3444581c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -750,3 +750,32 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); id 4 DROP TABLE t1; +SET NAMES latin1; +CREATE TABLE t1 ( +id int unsigned NOT NULL auto_increment, +list_id smallint unsigned NOT NULL, +term text NOT NULL, +PRIMARY KEY(id), +INDEX(list_id, term(19)) +) TYPE=MyISAM CHARSET=utf8; +Warnings: +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +INSERT INTO t1 set list_id = 1, term = "testtest"; +INSERT INTO t1 set list_id = 1, term = "testetest"; +INSERT INTO t1 set list_id = 1, term = "testtest"; +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +id term +1 testtest +2 testetest +3 testtest +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest"); +id term +1 testtest +2 testetest +3 testtest +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +id term +1 testtest +2 testetest +3 testtest +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 4a8eb63ed36..36aeec7145e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -592,3 +592,23 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); DROP TABLE t1; + + +# +# Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table +# +SET NAMES latin1; +CREATE TABLE t1 ( + id int unsigned NOT NULL auto_increment, + list_id smallint unsigned NOT NULL, + term text NOT NULL, + PRIMARY KEY(id), + INDEX(list_id, term(19)) +) TYPE=MyISAM CHARSET=utf8; +INSERT INTO t1 set list_id = 1, term = "testtest"; +INSERT INTO t1 set list_id = 1, term = "testetest"; +INSERT INTO t1 set list_id = 1, term = "testtest"; +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest"); +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +DROP TABLE t1; -- cgit v1.2.1 From db43ed04c73c5e60f788db7a0458dac9547d4fbb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 15:29:07 +0500 Subject: ctype_utf8.test: Bug#6086 "ctype_utf8" test fails when MySQL does not include InnoDB support mysql-test/t/ctype_utf8.test: Bug#6086 "ctype_utf8" test fails when MySQL does not include InnoDB support --- mysql-test/t/ctype_utf8.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 36aeec7145e..ae8db92e3f9 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -221,7 +221,9 @@ drop table t1; # Bug 4521: unique key prefix interacts poorly with utf8 # InnoDB: keys with prefix compression, case insensitive collation. # +--disable_warnings create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; +--enable_warnings insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); --error 1062 @@ -269,7 +271,9 @@ drop table t1; # Bug 4521: unique key prefix interacts poorly with utf8 # InnoDB: fixed length keys, case insensitive collation # +--disable_warnings create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; +--enable_warnings insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); @@ -504,10 +508,12 @@ drop table t1; # Bug#4594: column index make = failed for gbk, but like works # Check InnoDB # +--disable_warnings create table t1 ( str varchar(255) character set utf8 not null, key str (str(2)) ) engine=innodb; +--enable_warnings INSERT INTO t1 VALUES ('str'); INSERT INTO t1 VALUES ('str2'); select * from t1 where str='str'; @@ -563,10 +569,12 @@ DROP TABLE t1; # Bug #5723: length() returns varying results # SET NAMES utf8; +--disable_warnings CREATE TABLE t1 ( subject varchar(255) character set utf8 collate utf8_unicode_ci, p varchar(15) character set utf8 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +--enable_warnings INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); INSERT INTO t1 VALUES ('aaa','bbb'); SELECT length(subject) FROM t1; -- cgit v1.2.1 From 24017e7ae22b749514752b10e26dda7b1f7e6550 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 13:22:25 +0200 Subject: There were no tests for bug#1644 and bug#1676, added them now. mysql-test/r/ps_11bugs.result: Expected results of the added tests for bug#1644 and bug#1676. mysql-test/t/ps_11bugs.test: Added tests for bug#1644 and bug#1676, also minor comments. --- mysql-test/r/ps_11bugs.result | 107 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/ps_11bugs.test | 101 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps_11bugs.result b/mysql-test/r/ps_11bugs.result index 2aa0df6a431..0f942f6ba78 100644 --- a/mysql-test/r/ps_11bugs.result +++ b/mysql-test/r/ps_11bugs.result @@ -19,3 +19,110 @@ set @arg1= 'abc'; execute st_1180 using @arg1; session_id drop table test_select; +drop table if exists tab_many_null; +Warnings: +Note 1051 Unknown table 'tab_many_null' +create table tab_many_null ( +c_01 char(6), c_02 integer, c_03 real, c_04 int(3), c_05 varchar(20), +c_06 date, c_07 char(1), c_08 real, c_09 int(11), c_10 time, +c_11 char(6), c_12 integer, c_13 real, c_14 int(3), c_15 varchar(20), +c_16 date, c_17 char(1), c_18 real, c_19 int(11), c_20 text); +prepare st_1644 from 'insert into tab_many_null values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; +set @arg01= 'row_1'; +set @arg02= 1; +set @arg03= 1.1; +set @arg04= 111; +set @arg05= 'row_one'; +set @arg06= '2004-10-12'; +set @arg07= '1'; +set @arg08= 1.1; +set @arg09= '100100100'; +set @arg10= '12:34:56'; +set @arg11= 'row_1'; +set @arg12= 1; +set @arg13= 1.1; +set @arg14= 111; +set @arg15= 'row_one'; +set @arg16= '2004-10-12'; +set @arg17= '1'; +set @arg18= 1.1; +set @arg19= '100100100'; +set @arg20= '12:34:56'; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, +@arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; +set @arg01= NULL; +set @arg02= NULL; +set @arg03= NULL; +set @arg04= NULL; +set @arg05= NULL; +set @arg06= NULL; +set @arg07= NULL; +set @arg08= NULL; +set @arg09= NULL; +set @arg10= NULL; +set @arg11= NULL; +set @arg12= NULL; +set @arg13= NULL; +set @arg14= NULL; +set @arg15= NULL; +set @arg16= NULL; +set @arg17= NULL; +set @arg18= NULL; +set @arg19= NULL; +set @arg20= NULL; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, +@arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; +set @arg01= 'row_3'; +set @arg02= 3; +set @arg03= 3.3; +set @arg04= 333; +set @arg05= 'row_three'; +set @arg06= '2004-10-12'; +set @arg07= '3'; +set @arg08= 3.3; +set @arg09= '300300300'; +set @arg10= '12:34:56'; +set @arg11= 'row_3'; +set @arg12= 3; +set @arg13= 3.3; +set @arg14= 333; +set @arg15= 'row_three'; +set @arg16= '2004-10-12'; +set @arg17= '3'; +set @arg18= 3.3; +set @arg19= '300300300'; +set @arg20= '12:34:56'; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, +@arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; +select * from tab_many_null; +c_01 c_02 c_03 c_04 c_05 c_06 c_07 c_08 c_09 c_10 c_11 c_12 c_13 c_14 c_15 c_16 c_17 c_18 c_19 c_20 +row_1 1 1.1 111 row_one 2004-10-12 1 1.1 100100100 12:34:56 row_1 1 1.1 111 row_one 2004-10-12 1 1.1 100100100 12:34:56 +NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +row_3 3 3.3 333 row_three 2004-10-12 3 3.3 300300300 12:34:56 row_3 3 3.3 333 row_three 2004-10-12 3 3.3 300300300 12:34:56 +drop table tab_many_null; +drop table if exists table1, table2; +Warnings: +Note 1051 Unknown table 'table1' +Note 1051 Unknown table 'table2' +create table table1( +cola varchar(50) not null, +colb varchar(8) not null, +colc varchar(12) not null, +cold varchar(2) not null, +primary key (cola, colb, cold)); +create table table2( +cola varchar(50) not null, +colb varchar(8) not null, +colc varchar(2) not null, +cold float, +primary key (cold)); +insert into table1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); +insert into table2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); +prepare st_1676 from 'select a.cola, a.colb, a.cold from table1 a, table2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; +set @arg0= "aaaa"; +set @arg1= "yyyy"; +set @arg2= "R"; +execute st_1676 using @arg0, @arg1, @arg2; +cola colb cold +aaaa yyyy R +drop table table1, table2; diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test index 53afc8b5a78..f62d91bc2b6 100644 --- a/mysql-test/t/ps_11bugs.test +++ b/mysql-test/t/ps_11bugs.test @@ -3,6 +3,10 @@ # Prepared Statements # # re-testing bug DB entries # # # +# The bugs are reported as "closed". # +# Command sequences taken from bug report. # +# No other test contains the bug# as comment. # +# # ############################################### use test; @@ -30,3 +34,100 @@ set @arg1= 'abc'; execute st_1180 using @arg1; drop table test_select; + +# end of bug#1180 + + +# bug#1644: Insertion of more than 3 NULL columns with parameter binding fails + +# Using prepared statements, insertion of more than three columns with NULL +# values fails to insert additional NULLS. After the third column NULLS will +# be inserted into the database as zeros. +# First insert four columns of a value (i.e. 22) to verify binding is working +# correctly. Then Bind to each columns bind parameter an is_null value of 1. +# Then insert four more columns of integers, just for sanity. +# A subsequent select on the server will result in this: +# mysql> select * from foo_dfr; +# +------+------+------+------+ +# | col1 | col2 | col3 | col4 | +# +------+------+------+------+ +# | 22 | 22 | 22 | 22 | +# | NULL | NULL | NULL | 0 | +# | 88 | 88 | 88 | 88 | +# +------+------+------+------+ + +# Test is extended to more columns - code stores bit vector in bytes. + +drop table if exists tab_many_null; + +create table tab_many_null ( + c_01 char(6), c_02 integer, c_03 real, c_04 int(3), c_05 varchar(20), + c_06 date, c_07 char(1), c_08 real, c_09 int(11), c_10 time, + c_11 char(6), c_12 integer, c_13 real, c_14 int(3), c_15 varchar(20), + c_16 date, c_17 char(1), c_18 real, c_19 int(11), c_20 text); +# Do not use "timestamp" type, because it has a non-NULL default as of 4.1.2 + +prepare st_1644 from 'insert into tab_many_null values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + +set @arg01= 'row_1'; set @arg02= 1; set @arg03= 1.1; set @arg04= 111; set @arg05= 'row_one'; +set @arg06= '2004-10-12'; set @arg07= '1'; set @arg08= 1.1; set @arg09= '100100100'; set @arg10= '12:34:56'; +set @arg11= 'row_1'; set @arg12= 1; set @arg13= 1.1; set @arg14= 111; set @arg15= 'row_one'; +set @arg16= '2004-10-12'; set @arg17= '1'; set @arg18= 1.1; set @arg19= '100100100'; set @arg20= '12:34:56'; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, + @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; + +set @arg01= NULL; set @arg02= NULL; set @arg03= NULL; set @arg04= NULL; set @arg05= NULL; +set @arg06= NULL; set @arg07= NULL; set @arg08= NULL; set @arg09= NULL; set @arg10= NULL; +set @arg11= NULL; set @arg12= NULL; set @arg13= NULL; set @arg14= NULL; set @arg15= NULL; +set @arg16= NULL; set @arg17= NULL; set @arg18= NULL; set @arg19= NULL; set @arg20= NULL; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, + @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; + +set @arg01= 'row_3'; set @arg02= 3; set @arg03= 3.3; set @arg04= 333; set @arg05= 'row_three'; +set @arg06= '2004-10-12'; set @arg07= '3'; set @arg08= 3.3; set @arg09= '300300300'; set @arg10= '12:34:56'; +set @arg11= 'row_3'; set @arg12= 3; set @arg13= 3.3; set @arg14= 333; set @arg15= 'row_three'; +set @arg16= '2004-10-12'; set @arg17= '3'; set @arg18= 3.3; set @arg19= '300300300'; set @arg20= '12:34:56'; +execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, + @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; + +select * from tab_many_null; + +drop table tab_many_null; + +# end of bug#1644 + + +# bug#1677: Prepared statement two-table join returns no rows when one is expected + +drop table if exists table1, table2; + +create table table1( + cola varchar(50) not null, + colb varchar(8) not null, + colc varchar(12) not null, + cold varchar(2) not null, + primary key (cola, colb, cold)); + +create table table2( + cola varchar(50) not null, + colb varchar(8) not null, + colc varchar(2) not null, + cold float, + primary key (cold)); + +insert into table1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); + +insert into table2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); + +prepare st_1676 from 'select a.cola, a.colb, a.cold from table1 a, table2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; + +set @arg0= "aaaa"; +set @arg1= "yyyy"; +set @arg2= "R"; + +execute st_1676 using @arg0, @arg1, @arg2; + +drop table table1, table2; + +# end of bug#1676 + -- cgit v1.2.1 From 04e60bbfa09c455beb08d326bbf0d81c91b1ae02 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 13:23:57 +0200 Subject: NDB dbtux minor change ndb/src/kernel/blocks/dbtux/Dbtux.hpp: remove TreePos::m_ent ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp: remove TreePos::m_ent ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: remove TreePos::m_ent mysql-test/ndb/ndb_range_bounds.pl: more options --- mysql-test/ndb/ndb_range_bounds.pl | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndb_range_bounds.pl b/mysql-test/ndb/ndb_range_bounds.pl index 264a543752b..75b7f8a33e1 100644 --- a/mysql-test/ndb/ndb_range_bounds.pl +++ b/mysql-test/ndb/ndb_range_bounds.pl @@ -7,10 +7,12 @@ use strict; use integer; +use Getopt::Long; -my $all = shift; -!defined($all) || ($all eq '--all' && !defined(shift)) - or die "only available option is --all"; +my $opt_all = 0; +my $opt_cnt = 5; +GetOptions("all" => \$opt_all, "cnt=i" => \$opt_cnt) + or die "options are: --all --cnt=N"; my $table = 't'; @@ -67,15 +69,18 @@ sub mkall ($$$\@) { my($col, $key1, $key2, $val) = @_; my @a = (); my $p = mkdummy(@$val); - push(@a, $p) if $all; - my @ops1 = $all ? qw(< <= = >= >) : qw(= >= >); - my @ops2 = $all ? qw(< <= = >= >) : qw(< <=); + push(@a, $p) if $opt_all; + my @ops = qw(< <= = >= >); + for my $op (@ops) { + my $p = mkone($col, $op, $key1, @$val); + push(@a, $p) if $opt_all || $p->{cnt} != 0; + } + my @ops1 = $opt_all ? @ops : qw(= >= >); + my @ops2 = $opt_all ? @ops : qw(<= <); for my $op1 (@ops1) { - my $p = mkone($col, $op1, $key1, @$val); - push(@a, $p) if $all || $p->{cnt} != 0; for my $op2 (@ops2) { my $p = mktwo($col, $op1, $key1, $op2, $key2, @$val); - push(@a, $p) if $all || $p->{cnt} != 0; + push(@a, $p) if $opt_all || $p->{cnt} != 0; } } return \@a; @@ -95,7 +100,7 @@ create table $table ( index (b, c, d) ) engine=ndb; EOF - my @val = (0..4); + my @val = (0..($opt_cnt-1)); my $v0 = 0; for my $v1 (@val) { for my $v2 (@val) { -- cgit v1.2.1 From e04d735733a29147b72c25d39840793e350c3414 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 16:36:29 +0500 Subject: Bug #6019 SELECT tries to use too short prefix index on utf8 data --- mysql-test/r/ctype_utf8.result | 11 +++++++++++ mysql-test/t/ctype_utf8.test | 15 +++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 0ed3444581c..e52b6f9a609 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -779,3 +779,14 @@ id term 2 testetest 3 testtest DROP TABLE t1; +set names utf8; +create table t1 ( +a int primary key, +b varchar(6), +index b3(b(3)) +) engine=myisam character set=utf8; +insert into t1 values(1,'foo'),(2,'foobar'); +select * from t1 where b like 'foob%'; +a b +2 foobar +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index ae8db92e3f9..0da52054aac 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -620,3 +620,18 @@ SELECT id, term FROM t1 where (list_id = 1) AND (term = "test SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest"); SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); DROP TABLE t1; + +# +# Bug #6019 SELECT tries to use too short prefix index on utf8 data +# +set names utf8; +--disable_warnings +create table t1 ( + a int primary key, + b varchar(6), + index b3(b(3)) +) engine=myisam character set=utf8; +--enable_warnings +insert into t1 values(1,'foo'),(2,'foobar'); +select * from t1 where b like 'foob%'; +drop table t1; -- cgit v1.2.1 From b9766ad45a8115e808410c58f07a7950dcf11d60 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 16:40:03 +0500 Subject: ctype_utf8.test, ctype_utf8.result: Wrong handler. mysql-test/r/ctype_utf8.result: Wrong handler. mysql-test/t/ctype_utf8.test: Wrong handler. --- mysql-test/r/ctype_utf8.result | 2 +- mysql-test/t/ctype_utf8.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e52b6f9a609..2e8bbc8fa92 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -784,7 +784,7 @@ create table t1 ( a int primary key, b varchar(6), index b3(b(3)) -) engine=myisam character set=utf8; +) engine=innodb character set=utf8; insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; a b diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 0da52054aac..fc6eb88ad68 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -630,7 +630,7 @@ create table t1 ( a int primary key, b varchar(6), index b3(b(3)) -) engine=myisam character set=utf8; +) engine=innodb character set=utf8; --enable_warnings insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; -- cgit v1.2.1 From 059ad42f918b629537419ca285e7cc842e3862ba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Oct 2004 15:36:36 +0300 Subject: This patch removes unnecessary lock from the supremum record, takes X-locks on duplicates also on LOAD DATA...REPLACE clause and fixes a bug #6086 adding --disable_warnings and --enable_warnings around the create table clauses in ctype_utf8 tests for InnoDB. innobase/dict/dict0dict.c: Remove static. innobase/include/dict0dict.h: Add prototype for a function dict_scan_to innobase/row/row0ins.c: Add support for a LOAD DATA INFILE 'xxx' REPLACE INTO TABLE x. We should take X-locks on both REPLACE and LOAD DATA...REPLACE queries to duplicate records. innobase/row/row0sel.c: If innodb_locks_unsafe_for_binlog options is used we do not lock gaps. Supremum record is really a dummy record i.e. gap, therefore we do set locks there. mysql-test/t/ctype_utf8.test: Fix bug #6086: Add --disable_warnings and --enable_warnings around the create table where engine=innodb. --- mysql-test/t/ctype_utf8.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 4a8eb63ed36..55d84ffee53 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -221,7 +221,9 @@ drop table t1; # Bug 4521: unique key prefix interacts poorly with utf8 # InnoDB: keys with prefix compression, case insensitive collation. # +--disable_warnings create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb; +--enable_warnings insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); --error 1062 @@ -269,7 +271,9 @@ drop table t1; # Bug 4521: unique key prefix interacts poorly with utf8 # InnoDB: fixed length keys, case insensitive collation # +--disable_warnings create table t1 (c char(3) character set utf8, unique (c(2))) engine=innodb; +--enable_warnings insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); insert into t1 values ('a'); insert into t1 values ('aa'); @@ -504,10 +508,12 @@ drop table t1; # Bug#4594: column index make = failed for gbk, but like works # Check InnoDB # +--disable_warnings create table t1 ( str varchar(255) character set utf8 not null, key str (str(2)) ) engine=innodb; +--enable_warnings INSERT INTO t1 VALUES ('str'); INSERT INTO t1 VALUES ('str2'); select * from t1 where str='str'; @@ -562,11 +568,13 @@ DROP TABLE t1; # # Bug #5723: length() returns varying results # +--disable_warnings SET NAMES utf8; CREATE TABLE t1 ( subject varchar(255) character set utf8 collate utf8_unicode_ci, p varchar(15) character set utf8 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +--enable_warnings INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); INSERT INTO t1 VALUES ('aaa','bbb'); SELECT length(subject) FROM t1; -- cgit v1.2.1 From deed55179489668c169d0fa0554e8507acf57699 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Oct 2004 12:56:57 +0200 Subject: New tests for bug#1644 and bug#1676, test for bug#1180 changed to table naming scheme 't#'. mysql-test/r/ps_11bugs.result: Expected results of new tests for bug#1644 and bug#1676, test for bug#1180 changed to table naming scheme 't#'. mysql-test/t/ps_11bugs.test: New tests to check bug#1644 and bug#1676, test for bug#1180 changed to table naming scheme 't#'. --- mysql-test/r/ps_11bugs.result | 42 ++++++++++++++++-------------------------- mysql-test/t/ps_11bugs.test | 42 ++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 48 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps_11bugs.result b/mysql-test/r/ps_11bugs.result index 0f942f6ba78..c0d7fe502af 100644 --- a/mysql-test/r/ps_11bugs.result +++ b/mysql-test/r/ps_11bugs.result @@ -1,13 +1,10 @@ -use test; -drop table if exists test_select; -Warnings: -Note 1051 Unknown table 'test_select' -CREATE TABLE test_select(session_id char(9) NOT NULL); -INSERT INTO test_select VALUES ("abc"); -SELECT * FROM test_select; +drop table if exists t1, t2; +CREATE TABLE t1(session_id char(9) NOT NULL); +INSERT INTO t1 VALUES ("abc"); +SELECT * FROM t1; session_id abc -prepare st_1180 from 'SELECT * FROM test_select WHERE ?="1111" and session_id = "abc"'; +prepare st_1180 from 'SELECT * FROM t1 WHERE ?="1111" and session_id = "abc"'; set @arg1= 'abc'; execute st_1180 using @arg1; session_id @@ -18,16 +15,13 @@ abc set @arg1= 'abc'; execute st_1180 using @arg1; session_id -drop table test_select; -drop table if exists tab_many_null; -Warnings: -Note 1051 Unknown table 'tab_many_null' -create table tab_many_null ( +drop table t1; +create table t1 ( c_01 char(6), c_02 integer, c_03 real, c_04 int(3), c_05 varchar(20), c_06 date, c_07 char(1), c_08 real, c_09 int(11), c_10 time, c_11 char(6), c_12 integer, c_13 real, c_14 int(3), c_15 varchar(20), c_16 date, c_17 char(1), c_18 real, c_19 int(11), c_20 text); -prepare st_1644 from 'insert into tab_many_null values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; +prepare st_1644 from 'insert into t1 values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; set @arg01= 'row_1'; set @arg02= 1; set @arg03= 1.1; @@ -94,35 +88,31 @@ set @arg19= '300300300'; set @arg20= '12:34:56'; execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; -select * from tab_many_null; +select * from t1; c_01 c_02 c_03 c_04 c_05 c_06 c_07 c_08 c_09 c_10 c_11 c_12 c_13 c_14 c_15 c_16 c_17 c_18 c_19 c_20 row_1 1 1.1 111 row_one 2004-10-12 1 1.1 100100100 12:34:56 row_1 1 1.1 111 row_one 2004-10-12 1 1.1 100100100 12:34:56 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL row_3 3 3.3 333 row_three 2004-10-12 3 3.3 300300300 12:34:56 row_3 3 3.3 333 row_three 2004-10-12 3 3.3 300300300 12:34:56 -drop table tab_many_null; -drop table if exists table1, table2; -Warnings: -Note 1051 Unknown table 'table1' -Note 1051 Unknown table 'table2' -create table table1( +drop table t1; +create table t1( cola varchar(50) not null, colb varchar(8) not null, colc varchar(12) not null, cold varchar(2) not null, primary key (cola, colb, cold)); -create table table2( +create table t2( cola varchar(50) not null, colb varchar(8) not null, colc varchar(2) not null, cold float, primary key (cold)); -insert into table1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); -insert into table2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); -prepare st_1676 from 'select a.cola, a.colb, a.cold from table1 a, table2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; +insert into t1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); +insert into t2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); +prepare st_1676 from 'select a.cola, a.colb, a.cold from t1 a, t2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; set @arg0= "aaaa"; set @arg1= "yyyy"; set @arg2= "R"; execute st_1676 using @arg0, @arg1, @arg2; cola colb cold aaaa yyyy R -drop table table1, table2; +drop table t1, t2; diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test index f62d91bc2b6..d0aeaf265bb 100644 --- a/mysql-test/t/ps_11bugs.test +++ b/mysql-test/t/ps_11bugs.test @@ -7,19 +7,21 @@ # Command sequences taken from bug report. # # No other test contains the bug# as comment. # # # +# Tests drop/create tables 't1', 't2', ... # +# # ############################################### -use test; +--disable_warnings +drop table if exists t1, t2; +--enable_warnings # bug#1180: optimized away part of WHERE clause cause incorect prepared satatement results -drop table if exists test_select; - -CREATE TABLE test_select(session_id char(9) NOT NULL); -INSERT INTO test_select VALUES ("abc"); -SELECT * FROM test_select; +CREATE TABLE t1(session_id char(9) NOT NULL); +INSERT INTO t1 VALUES ("abc"); +SELECT * FROM t1; -prepare st_1180 from 'SELECT * FROM test_select WHERE ?="1111" and session_id = "abc"'; +prepare st_1180 from 'SELECT * FROM t1 WHERE ?="1111" and session_id = "abc"'; # Must not find a row set @arg1= 'abc'; @@ -33,7 +35,7 @@ execute st_1180 using @arg1; set @arg1= 'abc'; execute st_1180 using @arg1; -drop table test_select; +drop table t1; # end of bug#1180 @@ -58,16 +60,14 @@ drop table test_select; # Test is extended to more columns - code stores bit vector in bytes. -drop table if exists tab_many_null; - -create table tab_many_null ( +create table t1 ( c_01 char(6), c_02 integer, c_03 real, c_04 int(3), c_05 varchar(20), c_06 date, c_07 char(1), c_08 real, c_09 int(11), c_10 time, c_11 char(6), c_12 integer, c_13 real, c_14 int(3), c_15 varchar(20), c_16 date, c_17 char(1), c_18 real, c_19 int(11), c_20 text); # Do not use "timestamp" type, because it has a non-NULL default as of 4.1.2 -prepare st_1644 from 'insert into tab_many_null values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; +prepare st_1644 from 'insert into t1 values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; set @arg01= 'row_1'; set @arg02= 1; set @arg03= 1.1; set @arg04= 111; set @arg05= 'row_one'; set @arg06= '2004-10-12'; set @arg07= '1'; set @arg08= 1.1; set @arg09= '100100100'; set @arg10= '12:34:56'; @@ -90,36 +90,34 @@ set @arg16= '2004-10-12'; set @arg17= '3'; set @arg18= 3.3; set @arg19= '3003003 execute st_1644 using @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, @arg17, @arg18, @arg19, @arg20; -select * from tab_many_null; +select * from t1; -drop table tab_many_null; +drop table t1; # end of bug#1644 # bug#1677: Prepared statement two-table join returns no rows when one is expected -drop table if exists table1, table2; - -create table table1( +create table t1( cola varchar(50) not null, colb varchar(8) not null, colc varchar(12) not null, cold varchar(2) not null, primary key (cola, colb, cold)); -create table table2( +create table t2( cola varchar(50) not null, colb varchar(8) not null, colc varchar(2) not null, cold float, primary key (cold)); -insert into table1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); +insert into t1 values ('aaaa', 'yyyy', 'yyyy-dd-mm', 'R'); -insert into table2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); +insert into t2 values ('aaaa', 'yyyy', 'R', 203), ('bbbb', 'zzzz', 'C', 201); -prepare st_1676 from 'select a.cola, a.colb, a.cold from table1 a, table2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; +prepare st_1676 from 'select a.cola, a.colb, a.cold from t1 a, t2 b where a.cola = ? and a.colb = ? and a.cold = ? and b.cola = a.cola and b.colb = a.colb and b.colc = a.cold'; set @arg0= "aaaa"; set @arg1= "yyyy"; @@ -127,7 +125,7 @@ set @arg2= "R"; execute st_1676 using @arg0, @arg1, @arg2; -drop table table1, table2; +drop table t1, t2; # end of bug#1676 -- cgit v1.2.1 From ce7146768eaff664f23b8f187d2761a9d8263bef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Oct 2004 15:23:24 +0500 Subject: Bug #6040 can't retrieve records with umlaut characters in case insensitive manner --- mysql-test/r/ctype_utf8.result | 9 +++++++++ mysql-test/t/ctype_utf8.test | 8 ++++++++ 2 files changed, 17 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 2e8bbc8fa92..e65eb96cb68 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -63,6 +63,15 @@ select 'A' like 'a' collate utf8_bin; select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%') 1 +select convert(_latin1'Gnter Andr' using utf8) like CONVERT(_latin1'GNTER%' USING utf8); +convert(_latin1'Gnter Andr' using utf8) like CONVERT(_latin1'GNTER%' USING utf8) +1 +select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8); +CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8) +1 +select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8); +CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8) +1 SELECT 'a' = 'a '; 'a' = 'a ' 1 diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index c74bb59ae6b..238cd6daef3 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -33,6 +33,14 @@ select 'A' like 'a'; select 'A' like 'a' collate utf8_bin; select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); +# Bug #6040: can't retrieve records with umlaut +# characters in case insensitive manner. +# Case insensitive search LIKE comparison +# was broken for multibyte characters: +select convert(_latin1'Gnter Andr' using utf8) like CONVERT(_latin1'GNTER%' USING utf8); +select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8); +select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8); + # # Check the following: # "a" == "a " -- cgit v1.2.1 From c0abb5a98ffe68ab3f5972cddb87683c78625024 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Oct 2004 17:56:25 +0500 Subject: Bug #6139 UNION doesn't understand collate in the column of second select --- mysql-test/r/union.result | 78 +++++++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/union.test | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index fbd4f8e11dc..7820cd1d6ff 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1033,3 +1033,81 @@ a No aaa,bbb drop table t1,t2,t3,t4; +create table t1 as +(select _latin1'test') union +(select _latin1'TEST') union +(select _latin1'TeST'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `test` char(4) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select count(*) from t1; +count(*) +1 +drop table t1; +create table t1 as +(select _latin1'test' collate latin1_bin) union +(select _latin1'TEST') union +(select _latin1'TeST'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `_latin1'test' collate latin1_bin` char(4) character set latin1 collate latin1_bin NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select count(*) from t1; +count(*) +3 +drop table t1; +create table t1 as +(select _latin1'test') union +(select _latin1'TEST' collate latin1_bin) union +(select _latin1'TeST'); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `test` char(4) character set latin1 collate latin1_bin NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select count(*) from t1; +count(*) +3 +drop table t1; +create table t1 as +(select _latin1'test') union +(select _latin1'TEST') union +(select _latin1'TeST' collate latin1_bin); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `test` char(4) character set latin1 collate latin1_bin NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select count(*) from t1; +count(*) +3 +drop table t1; +create table t2 ( +a char character set latin1 collate latin1_swedish_ci, +b char character set latin1 collate latin1_bin); +create table t1 as +(select a from t2) union +(select b from t2); +ERROR HY000: Illegal mix of collations for operation 'UNION' +create table t1 as +(select a collate latin1_german1_ci from t2) union +(select b from t2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a collate latin1_german1_ci` char(1) character set latin1 collate latin1_german1_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 as +(select a from t2) union +(select b collate latin1_german1_ci from t2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) character set latin1 collate latin1_german1_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +drop table t2; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index c5e72e85835..6e16a2b02aa 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -595,3 +595,58 @@ select a as a from t3 union select "1"; select a as a from t4 union select a from t3; select a as a from t1 union select a from t4; drop table t1,t2,t3,t4; + +# +# Bug #6139 UNION doesn't understand collate in the column of second select +# +create table t1 as +(select _latin1'test') union +(select _latin1'TEST') union +(select _latin1'TeST'); +show create table t1; +select count(*) from t1; +drop table t1; + +create table t1 as +(select _latin1'test' collate latin1_bin) union +(select _latin1'TEST') union +(select _latin1'TeST'); +show create table t1; +select count(*) from t1; +drop table t1; + +create table t1 as +(select _latin1'test') union +(select _latin1'TEST' collate latin1_bin) union +(select _latin1'TeST'); +show create table t1; +select count(*) from t1; +drop table t1; + +create table t1 as +(select _latin1'test') union +(select _latin1'TEST') union +(select _latin1'TeST' collate latin1_bin); +show create table t1; +select count(*) from t1; +drop table t1; + +create table t2 ( +a char character set latin1 collate latin1_swedish_ci, +b char character set latin1 collate latin1_bin); +--error 1271 +create table t1 as +(select a from t2) union +(select b from t2); +create table t1 as +(select a collate latin1_german1_ci from t2) union +(select b from t2); +show create table t1; +drop table t1; +create table t1 as +(select a from t2) union +(select b collate latin1_german1_ci from t2); +show create table t1; +drop table t1; +drop table t2; + -- cgit v1.2.1 From 0d873f9080cf79b1aad6a7cfcc1d496d741832d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 11:24:08 +0300 Subject: Code cleanups (done during review of new code) Rename innodb_table_locks_old_behavior -> innodb_table_locks Set innodb_table_locks to off by default to get same behaviour as in MySQL 4.0.20 (This means that Innodb ignore table locks by default, which makes it easier to combine MyISAM and InnoDB to simulate a transaction) libmysql/libmysql.c: Use ulong instead of unsigned long Reuse _dig_vec() myisam/myisampack.c: Simplify code mysql-test/r/innodb-lock.result: new test case mysql-test/t/innodb-lock.test: new test case sql/ha_innodb.cc: Rename innodb_table_locks_old_behavior -> innodb_table_locks sql/mysqld.cc: Rename innodb_table_locks_old_behavior -> innodb_table_locks Set this off by default to get same behaviour as in MySQL 4.0.20 sql/set_var.cc: Rename innodb_table_locks_old_behavior -> innodb_table_locks sql/sql_class.h: Rename innodb_table_locks_old_behavior -> innodb_table_locks --- mysql-test/r/innodb-lock.result | 26 +++++++++++++++++++++++ mysql-test/t/innodb-lock.test | 46 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index cf00adb30ae..f87f221ea66 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,4 +1,30 @@ drop table if exists t1; +select @@innodb_table_locks; +@@innodb_table_locks +0 +set @@innodb_table_locks=1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; +id x +0 0 +set autocommit=0; +lock table t1 write; +update t1 set x=1 where id = 0; +select * from t1; +id x +0 1 +commit; +update t1 set x=2 where id = 0; +commit; +unlock tables; +select * from t1; +id x +0 2 +commit; +drop table t1; +set @@innodb_table_locks=0; create table t1 (id integer, x integer) engine=INNODB; insert into t1 values(0, 0); set autocommit=0; diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 43a175508b4..11395b301c4 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -5,10 +5,54 @@ connect (con2,localhost,root,,); drop table if exists t1; # -# Testing of explicit table locks +# Check and select innodb lock type # +select @@innodb_table_locks; + +# +# Testing of explicit table locks with enforced table locks +# + +set @@innodb_table_locks=1; + +connection con1; +create table t1 (id integer, x integer) engine=INNODB; +insert into t1 values(0, 0); +set autocommit=0; +SELECT * from t1 where id = 0 FOR UPDATE; + +connection con2; +set autocommit=0; + +# The following statement should hang because con1 is locking the page +--send +lock table t1 write; +--sleep 2; + connection con1; +update t1 set x=1 where id = 0; +select * from t1; +commit; + +connection con2; +reap; +update t1 set x=2 where id = 0; +commit; +unlock tables; + +connection con1; +select * from t1; +commit; + +drop table t1; + +# +# Try with old lock method (where LOCK TABLE is ignored) +# + +set @@innodb_table_locks=0; + create table t1 (id integer, x integer) engine=INNODB; insert into t1 values(0, 0); set autocommit=0; -- cgit v1.2.1 From 4dbb88306779ac82faf0db038c501c3f37825435 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 16:04:43 +0400 Subject: Fix for bug #6173 "One can circumvent missing UPDATE privilege if he has SELECT and INSERT privileges for table with primary key" Now we set lex->duplicates= DUP_UPDATE right in parser if INSERT has ON DUPLICATE KEY UPDATE clause, this simplifies insert_precheck() function (this also fixes a bug) and some other code. mysql-test/r/grant2.result: Added test for bug #6173 "One can circumvent missing UPDATE privilege if he has SELECT and INSERT privileges for table with primary key" mysql-test/t/grant2.test: Added test for bug #6173 "One can circumvent missing UPDATE privilege if he has SELECT and INSERT privileges for table with primary key" sql/mysql_priv.h: insert_precheck() don't need "update" parameter any longer since now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE KEY UPDATE clause. sql/sql_parse.cc: insert_precheck() don't need "update" parameter any longer since now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE KEY UPDATE clause, so it can determine whenever it is needed to require UPDATE_ACL by itself. Also calling of mysql_insert() is simplified. sql/sql_prepare.cc: insert_precheck() don't need "update" parameter any longer since now we set lex->duplicates to DUP_UPDATE if INSERT has ON DUPLICATE KEY UPDATE clause, so it can determine whenever it is needed to require UPDATE_ACL by itself. Also calling of mysql_insert() is simplified. sql/sql_yacc.yy: It is better to set Lex->duplicates= DUP_UPDATE right in parser if we have INSERT with ON DUPLICATE KEY UPDATE clause, rather doing this later. --- mysql-test/r/grant2.result | 27 +++++++++++++++++++++++++++ mysql-test/t/grant2.test | 44 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 68 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index 31e506d2679..a31fa2ac3dc 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -1,6 +1,9 @@ SET NAMES binary; +drop database if exists mysqltest; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option; select current_user(); @@ -25,3 +28,27 @@ ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'loca delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; +create database mysqltest; +grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost; +flush privileges; +use mysqltest; +create table t1 (id int primary key, data varchar(255)); +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +use mysqltest; +insert into t1 values (1, 'I can''t change it!'); +update t1 set data='I can change it!' where id = 1; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' +insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' +select * from t1; +id data +1 I can't change it! +drop table t1; +drop database mysqltest; +use test; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 3a9afa7453b..f86be0c95b9 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -6,13 +6,21 @@ SET NAMES binary; # +# prepare playground before tests +--disable_warnings +drop database if exists mysqltest; +--enable_warnings +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; + + # # wild_compare fun # -delete from mysql.user where user like 'mysqltest\_%'; -delete from mysql.db where user like 'mysqltest\_%'; -flush privileges; grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option; connect (user1,localhost,mysqltest_1,,); connection user1; @@ -31,3 +39,33 @@ delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; + +# +# Bug #6173: One can circumvent missing UPDATE privilege if he has SELECT +# and INSERT privilege for table with primary key +# +create database mysqltest; +grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost; +flush privileges; +use mysqltest; +create table t1 (id int primary key, data varchar(255)); + +connect (mrbad, localhost, mysqltest_1,,); +connection mrbad; +show grants for current_user(); +use mysqltest; +insert into t1 values (1, 'I can''t change it!'); +--error 1044 +update t1 set data='I can change it!' where id = 1; +# This should not be allowed since it too require UPDATE privilege. +--error 1044 +insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; +select * from t1; + +connection default; +drop table t1; +drop database mysqltest; +use test; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; -- cgit v1.2.1 From 0a505ccc080eca79903103d081da8214bcd51d47 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 16:04:28 +0300 Subject: Fix test case for innodb-lock mysql-test/r/innodb-lock.result: Fix test case (old one didn't test things correctly) mysql-test/t/innodb-lock.test: Fix test case (old one didn't test things correctly) mysys/thr_lock.c: More debugging information sql/mysqld.cc: Enable innodb_table_locks as default, as otherwise there is a possibility for deadlocks sql/sql_base.cc: More debug information --- mysql-test/r/innodb-lock.result | 30 ++++++++++++++--------- mysql-test/t/innodb-lock-master.opt | 1 + mysql-test/t/innodb-lock.test | 47 +++++++++++++++++++++++-------------- 3 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 mysql-test/t/innodb-lock-master.opt (limited to 'mysql-test') diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index f87f221ea66..407a85ed038 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,7 +1,7 @@ -drop table if exists t1; select @@innodb_table_locks; @@innodb_table_locks -0 +1 +drop table if exists t1; set @@innodb_table_locks=1; create table t1 (id integer, x integer) engine=INNODB; insert into t1 values(0, 0); @@ -25,24 +25,32 @@ id x commit; drop table t1; set @@innodb_table_locks=0; -create table t1 (id integer, x integer) engine=INNODB; -insert into t1 values(0, 0); -set autocommit=0; +create table t1 (id integer primary key, x integer) engine=INNODB; +insert into t1 values(0, 0),(1,1),(2,2); +commit; SELECT * from t1 where id = 0 FOR UPDATE; id x 0 0 set autocommit=0; +set @@innodb_table_locks=0; lock table t1 write; -update t1 set x=1 where id = 0; -select * from t1; +update t1 set x=10 where id = 2; +SELECT * from t1 where id = 2; id x -0 1 +2 2 +UPDATE t1 set x=3 where id = 2; commit; -update t1 set x=2 where id = 0; +SELECT * from t1; +id x +0 0 +1 1 +2 3 commit; unlock tables; +commit; select * from t1; id x -0 2 -commit; +0 0 +1 1 +2 10 drop table t1; diff --git a/mysql-test/t/innodb-lock-master.opt b/mysql-test/t/innodb-lock-master.opt new file mode 100644 index 00000000000..403fcde87ed --- /dev/null +++ b/mysql-test/t/innodb-lock-master.opt @@ -0,0 +1 @@ +--innodb-table-lock=1 diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 11395b301c4..430369f4fda 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -1,9 +1,5 @@ -- source include/have_innodb.inc -connect (con1,localhost,root,,); -connect (con2,localhost,root,,); -drop table if exists t1; - # # Check and select innodb lock type # @@ -14,6 +10,14 @@ select @@innodb_table_locks; # Testing of explicit table locks with enforced table locks # +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +drop table if exists t1; + +# +# Testing of explicit table locks with enforced table locks +# + set @@innodb_table_locks=1; connection con1; @@ -48,37 +52,44 @@ commit; drop table t1; # -# Try with old lock method (where LOCK TABLE is ignored) +# Try with old lock method (where LOCK TABLE is ignored by InnoDB) # set @@innodb_table_locks=0; -create table t1 (id integer, x integer) engine=INNODB; -insert into t1 values(0, 0); -set autocommit=0; +create table t1 (id integer primary key, x integer) engine=INNODB; +insert into t1 values(0, 0),(1,1),(2,2); +commit; SELECT * from t1 where id = 0 FOR UPDATE; connection con2; set autocommit=0; +set @@innodb_table_locks=0; -# The following statement should hang because con1 is locking the page ---send +# The following statement should work becase innodb doesn't check table locks lock table t1 write; ---sleep 2; connection con1; -update t1 set x=1 where id = 0; -select * from t1; -commit; + +# This will be locked by MySQL +--send +update t1 set x=10 where id = 2; +--sleep 2 connection con2; -reap; -update t1 set x=2 where id = 0; + +# Note that we will get a deadlock if we try to select any rows marked +# for update by con1 ! + +SELECT * from t1 where id = 2; +UPDATE t1 set x=3 where id = 2; +commit; +SELECT * from t1; commit; unlock tables; connection con1; -select * from t1; +reap; commit; - +select * from t1; drop table t1; -- cgit v1.2.1 From 901cf0f0dafb32a834a13573bc3817be48545c6f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 17:28:40 +0300 Subject: After merge fixes --- mysql-test/r/rpl_commit_after_flush.result | 6 +++--- mysql-test/t/rpl_commit_after_flush.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/r/rpl_commit_after_flush.result index 8cdc7e986ab..d3aba779219 100644 --- a/mysql-test/r/rpl_commit_after_flush.result +++ b/mysql-test/r/rpl_commit_after_flush.result @@ -1,10 +1,10 @@ -slave stop; +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; -slave start; -create table t1 (a int) type=innodb; +start slave; +create table t1 (a int) engine=innodb; begin; insert into t1 values(1); flush tables with read lock; diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test index edbbd1bfad6..62c89b3aae6 100644 --- a/mysql-test/t/rpl_commit_after_flush.test +++ b/mysql-test/t/rpl_commit_after_flush.test @@ -1,6 +1,6 @@ source include/master-slave.inc; source include/have_innodb.inc; -create table t1 (a int) type=innodb; +create table t1 (a int) engine=innodb; begin; insert into t1 values(1); flush tables with read lock; -- cgit v1.2.1 From ef02c4f550b7fcd816cbe2dd3718641da078e4be Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 15:56:57 +0000 Subject: fix for wrong use of shell test --- mysql-test/ndb/ndbcluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 7485e42923e..294d32ac4be 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -205,7 +205,7 @@ if [ -f "$fs_ndb/$pidfile" ] ; then fi done kill_pids=$new_kill_pid - if [ "$kill_pids" == "" ] ; then + if [ -z "$kill_pids" ] ; then break fi sleep 1 -- cgit v1.2.1 From 0b79f68e4894423f2542ce9f2febbdc7d425d06f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 17:22:58 +0000 Subject: fix so that ndb handler can cope with char(0), mapped to char(1) for now --- mysql-test/r/ndb_basic.result | 19 +++++++++++++++++++ mysql-test/t/ndb_basic.test | 13 +++++++++++++ 2 files changed, 32 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 9f8dcf3610a..abe1b98b536 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -395,3 +395,22 @@ b attr1 9413 9412 drop table test.t1, t2; drop database mysqltest; +use test; +create table t1 (a int primary key, b char(0)); +insert into t1 values (1,""); +insert into t1 values (2,NULL); +select * from t1 order by a; +a b +1 +2 NULL +select * from t1 order by b; +a b +2 NULL +1 +select * from t1 where b IS NULL; +a b +2 NULL +select * from t1 where b IS NOT NULL; +a b +1 +drop table t1; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 5f32a8016bf..e79815bbeb1 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -358,3 +358,16 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a; drop table test.t1, t2; drop database mysqltest; +# +# test support of char(0) +# + +use test; +create table t1 (a int primary key, b char(0)); +insert into t1 values (1,""); +insert into t1 values (2,NULL); +select * from t1 order by a; +select * from t1 order by b; +select * from t1 where b IS NULL; +select * from t1 where b IS NOT NULL; +drop table t1; -- cgit v1.2.1 From e99343ca2a8782f3b90a9277804fdeae09bcdf98 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 12:17:59 +0500 Subject: Allow cp932 characters to be stored in a SJIS column --- mysql-test/r/ctype_sjis.result | 6 ++++++ mysql-test/t/ctype_sjis.test | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 1e3e28784a5..26a45dd28e8 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -41,3 +41,9 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF select hex(CONVERT(@utf84 USING sjis)); hex(CONVERT(@utf84 USING sjis)) D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF +create table t1 (a char(10) character set sjis); +insert into t1 values (0x878A); +select hex(a) from t1; +hex(a) +878A +drop table t1; diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 1dd363c4910..68f4f7010e0 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -32,3 +32,12 @@ select hex(CONVERT(@utf81 USING sjis)); select hex(CONVERT(@utf82 USING sjis)); select hex(CONVERT(@utf83 USING sjis)); select hex(CONVERT(@utf84 USING sjis)); + +# +# Allow to insert extra CP932 characters +# into a SJIS column +# +create table t1 (a char(10) character set sjis); +insert into t1 values (0x878A); +select hex(a) from t1; +drop table t1; -- cgit v1.2.1 From 8c54ce35372653761d6409f1c6267da86216740c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 14:48:37 +0500 Subject: Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters --- mysql-test/t/ctype_uca.test | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index cbb2bd7ba4b..708a31d637e 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -7,8 +7,35 @@ DROP TABLE IF EXISTS t1; # # Test Unicode collations. # - set names utf8; + +# +# Check trailing spaces +# +set collation_connection=utf8_unicode_ci; + +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; + +select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; +select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; + +select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; +select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; + +select 'a a' > 'a', 'a \t' < 'a'; + +# +# Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters +# +CREATE TABLE t ( + c char(20) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t VALUES ('a'),('ab'),('aba'); +ALTER TABLE t ADD INDEX (c); +SELECT c FROM t WHERE c LIKE 'a%'; +#should find 3 rows but only found 2 +DROP TABLE t; + create table t1 (c1 char(10) character set utf8 collate utf8_bin); # -- cgit v1.2.1 From da93a44d583ce5c493badcad291225f86fc47d09 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 14:54:17 +0500 Subject: ctype_uca.result: Forgot to commit in the previous changeset mysql-test/r/ctype_uca.result: Forgot to commit in the previous changeset --- mysql-test/r/ctype_uca.result | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 7e4a03e96cc..90681795513 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -1,5 +1,35 @@ DROP TABLE IF EXISTS t1; set names utf8; +set collation_connection=utf8_unicode_ci; +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; +'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a' +0 1 0 +select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; +'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a ' +0 1 0 +select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; +'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t' +0 0 1 +select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; +'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t' +0 0 1 +select 'a a' > 'a', 'a \t' < 'a'; +'a a' > 'a' 'a \t' < 'a' +1 1 +CREATE TABLE t ( +c char(20) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t VALUES ('a'),('ab'),('aba'); +ALTER TABLE t ADD INDEX (c); +SELECT c FROM t WHERE c LIKE 'a%'; +c +a +ab +aba +DROP TABLE t; create table t1 (c1 char(10) character set utf8 collate utf8_bin); insert into t1 values ('A'),('a'); insert into t1 values ('B'),('b'); -- cgit v1.2.1 From 8991333f19f383db0bd3fdc541e0fdce214deeef Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 16:02:12 +0200 Subject: Adapt 'ps_10nestset' to standard test style; correct a typing error in 'ps_11bugs'. mysql-test/r/ps_10nestset.result: Correct the expected protocol according to the test changes. mysql-test/t/ps_10nestset.test: Improve comments; adapt to standard test style: disable warnings around 'drop table', use 't#' table name scheme. mysql-test/t/ps_11bugs.test: Corrected a typing error in the bug number comment. --- mysql-test/r/ps_10nestset.result | 19 ++++++++----------- mysql-test/t/ps_10nestset.test | 35 ++++++++++++++++++++++------------- mysql-test/t/ps_11bugs.test | 2 +- 3 files changed, 31 insertions(+), 25 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps_10nestset.result b/mysql-test/r/ps_10nestset.result index 10f0a741b54..68f58a03674 100644 --- a/mysql-test/r/ps_10nestset.result +++ b/mysql-test/r/ps_10nestset.result @@ -1,14 +1,11 @@ -use test; -drop table if exists personnel; -Warnings: -Note 1051 Unknown table 'personnel' -create table personnel ( +drop table if exists t1; +create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); -prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; +prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; @@ -39,7 +36,7 @@ set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; -select * from personnel; +select * from t1; id emp salary l r 1 Jerry 1000.00 1 12 2 Bert 900.00 2 3 @@ -47,8 +44,8 @@ id emp salary l r 4 Donna 800.00 5 6 5 Eddie 700.00 7 8 6 Fred 600.00 9 10 -prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; -prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; +prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; +prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; set @arg_percent= .10; set @arg_amount= 100; execute st_raise_base using @arg_percent; @@ -57,7 +54,7 @@ execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; -select * from personnel; +select * from t1; id emp salary l r 1 Jerry 1300.00 1 12 2 Bert 1197.90 2 3 @@ -65,4 +62,4 @@ id emp salary l r 4 Donna 1064.80 5 6 5 Eddie 931.70 7 8 6 Fred 798.60 9 10 -drop table personnel; +drop table t1; diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test index 2c6009af9de..d2adaca689e 100644 --- a/mysql-test/t/ps_10nestset.test +++ b/mysql-test/t/ps_10nestset.test @@ -8,28 +8,29 @@ # Source: http://kris.koehntopp.de/artikel/sql-self-references (dated 1999) # Source: http://dbmsmag.com/9603d06.html (dated 1996) -use test; - -drop table if exists personnel; +--disable_warnings +drop table if exists t1; +--enable_warnings # "Nested Set": This table represents an employee list with a hierarchy tree. # The tree is not modeled by "parent" links but rather by showing the "left" # and "right" border of any person's "region". By convention, "l" < "r". # As it is a tree, these "regions" of two persons A and B are either disjoint, -# or A's region is completely contained in B's (B is A's boss), or vice versa. -# See the references for more info. +# or A's region is completely contained in B's (B.l < A.l < A.r < B.r: +# B is A's boss), or vice versa. +# Any other overlaps violate the model. See the references for more info. -create table personnel ( +create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); -prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; +prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; # Initial employee list: -# Jerry ( Bert ( ) Chuck ( Donna ( ) Eddie ( ) Fred ( ) ) ) +# Jerry ( Bert () Chuck ( Donna () Eddie () Fred () ) ) set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; set @arg_r= 12; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; set @arg_nam= 'Bert'; set @arg_sal= 900; set @arg_l= 2; set @arg_r= 3; @@ -43,11 +44,11 @@ execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; set @arg_nam= 'Fred'; set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; -select * from personnel; +select * from t1; # Three successive raises, each one is 100 units for managers, 10 percent for others. -prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; -prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; +prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; +prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; let $1= 3; set @arg_percent= .10; set @arg_amount= 100; @@ -58,6 +59,14 @@ while ($1) dec $1; } -select * from personnel; +select * from t1; + +# Waiting for the resolution of bug#6138 +# # Now, increase salary to a multiple of 50 +# prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; +# set @arg_round= 50; +# execute st_round using @arg_round, @arg_round; +# +# select * from t1; -drop table personnel; +drop table t1; diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test index d0aeaf265bb..5945b140645 100644 --- a/mysql-test/t/ps_11bugs.test +++ b/mysql-test/t/ps_11bugs.test @@ -97,7 +97,7 @@ drop table t1; # end of bug#1644 -# bug#1677: Prepared statement two-table join returns no rows when one is expected +# bug#1676: Prepared statement two-table join returns no rows when one is expected create table t1( cola varchar(50) not null, -- cgit v1.2.1 From 3c4c309088ca674305f31b4c069b28b69ee593ca Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 19:52:55 +0500 Subject: A fix (bug #6138: MOD operator should not round non-integral argument). --- mysql-test/r/func_test.result | 9 +++++++++ mysql-test/t/func_test.test | 13 +++++++++++++ 2 files changed, 22 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index c3fe1de15db..8a28312b348 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -174,3 +174,12 @@ SELECT GREATEST(d,d) FROM t1 WHERE k=2; GREATEST(d,d) NULL DROP TABLE t1; +select 1197.90 mod 50; +1197.90 mod 50 +47.90 +select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; +5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 +2.1 2.1 -2.1 -2.1 +select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; +5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 +2 2 -2 -2 diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index e7bcd81a15e..eb506a58870 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -94,3 +94,16 @@ CREATE TABLE t1 (d varchar(6), k int); INSERT INTO t1 VALUES (NULL, 2); SELECT GREATEST(d,d) FROM t1 WHERE k=2; DROP TABLE t1; + +# +# Bug #6138: mod and doubles +# + +select 1197.90 mod 50; +select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; + +# +# Test for mod and signed integers +# + +select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; -- cgit v1.2.1 From 3a0260d59060c7c58c94afb8bb94e489d2e7d404 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 22:18:00 +0400 Subject: Fix for bug #6116 "SET time_zone := ... requires access to mysql.time_zone* tables". We are excluding implicitly used time zone tables from privilege checking. mysql-test/r/timezone2.result: Added test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" mysql-test/t/timezone2.test: Added test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" sql/sql_parse.cc: check_table_access(): we should avoid privilege checking for implicitly used time zone tables. sql/tztime.cc: Indicated dependancy between my_tz_get_table_list() function and my_tz_check_n_skip_implicit_tables() function. sql/tztime.h: Added my_tz_check_n_skip_implicit_tables() function which allows easily determine whenever we have found beggining of the list of implicitly used time zone tables and fast-forward to its end. --- mysql-test/r/timezone2.result | 20 ++++++++++++++++++++ mysql-test/t/timezone2.test | 28 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 02406b77a65..86264bf5b7e 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -251,3 +251,23 @@ select convert_tz(ts, @@time_zone, 'Japan') from t1; convert_tz(ts, @@time_zone, 'Japan') 2001-09-09 10:46:40 drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; +grant usage on mysqltest.* to mysqltest_1@localhost; +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); +convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') +2004-10-21 15:00:00 +select * from mysql.time_zone_name; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' +select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' +delete from mysql.user where user like 'mysqltest\_%'; +flush privileges; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 15ac3416b29..ad8089e1a37 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -199,3 +199,31 @@ insert into t1 (ts) values (now()); select convert_tz(ts, @@time_zone, 'Japan') from t1; drop table t1; +# +# Test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone +# tables". We should allow implicit access to time zone description tables +# even for unprivileged users. +# + +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; + +grant usage on mysqltest.* to mysqltest_1@localhost; +connect (tzuser, localhost, mysqltest_1,,); +connection tzuser; +show grants for current_user(); +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); +# But still these two statements should not work: +--error 1044 +select * from mysql.time_zone_name; +--error 1044 +select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; + +connection default; +delete from mysql.user where user like 'mysqltest\_%'; +flush privileges; -- cgit v1.2.1 From ecbfad58a517be3b9ef96f7c4517505c99096d68 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 22:17:10 +0200 Subject: BUG#6151 - myisam index corruption. Removed the assumption of a certain key order. Since 4.1, keys are padded with blanks for comparison. Hence, shorter keys sort behind longer keys, if the data bytes have values below BLANK. mysql-test/r/key.result: BUG#6151 - myisam index corruption. The test results. mysql-test/t/key.test: BUG#6151 - myisam index corruption. Added the test case as derived from the original data. --- mysql-test/r/key.result | 23 +++++++++++++++++++++++ mysql-test/t/key.test | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 967ff47e1ea..e076c59a76c 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -267,3 +267,26 @@ select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; t ??!"#???? drop table t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 ( +c1 int, +c2 varbinary(240), +UNIQUE KEY (c1), +KEY (c2) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); +INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); +INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); +select c1 from t1 where c2='\Z\Z\Z\Z'; +c1 +1 +3 +DELETE FROM t1 WHERE (c1 = 1); +select c1 from t1 where c2='\Z\Z\Z\Z'; +c1 +3 +DELETE FROM t1 WHERE (c1 = 3); +select c1 from t1 where c2='\Z\Z\Z\Z'; +c1 diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index ce10f07cf07..5c365ccf965 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -252,3 +252,22 @@ select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1; select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; drop table t1; +# +# BUG#6151 - myisam index corruption +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + c1 int, + c2 varbinary(240), + UNIQUE KEY (c1), + KEY (c2) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); +INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); +INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); +select c1 from t1 where c2='\Z\Z\Z\Z'; +DELETE FROM t1 WHERE (c1 = 1); +select c1 from t1 where c2='\Z\Z\Z\Z'; +DELETE FROM t1 WHERE (c1 = 3); +select c1 from t1 where c2='\Z\Z\Z\Z'; + -- cgit v1.2.1 From b50b1dd3a4b9cf5e4e9a6c33961b007becbda6bc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 23:56:12 +0300 Subject: Check of temporary tables hiding for query fetched from QC (BUG#6084) mysql-test/r/query_cache.result: hiding real table stored in query cache by temporary table mysql-test/t/query_cache.test: hiding real table stored in query cache by temporary table sql/sql_cache.cc: Check of temporary tables hiding for query fetched from QC sql/sql_cache.h: Key length now stored in table record of query cache --- mysql-test/r/query_cache.result | 13 +++++++++++++ mysql-test/t/query_cache.test | 12 ++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index a9e9f167e5f..85fe77b1f10 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -704,4 +704,17 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +id +1 +2 +3 +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +a +drop table t1; +drop table t1; set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 8a07c0a53a0..61fbadde1e1 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -521,4 +521,16 @@ unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +# +# hiding real table stored in query cache by temporary table +# +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +drop table t1; +drop table t1; + set GLOBAL query_cache_size=0; -- cgit v1.2.1 From f6ec064fdbdb893dcd41bcd4da0d7edcd80f1e6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 05:56:27 +0200 Subject: mysqltest.c, mysqltest.result, mysqltest.test: Added SQLSTATE matching support to test engine mysqltest.result, mysqltest.test: new file mysql-test/t/mysqltest.test: Added SQLSTATE matching support to test engine mysql-test/r/mysqltest.result: Added SQLSTATE matching support to test engine client/mysqltest.c: Added SQLSTATE matching support to test engine --- mysql-test/r/mysqltest.result | 23 +++++++++++++ mysql-test/t/mysqltest.test | 78 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 mysql-test/r/mysqltest.result create mode 100644 mysql-test/t/mysqltest.test (limited to 'mysql-test') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result new file mode 100644 index 00000000000..4e30d5bc110 --- /dev/null +++ b/mysql-test/r/mysqltest.result @@ -0,0 +1,23 @@ +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select otto from (select 1 as otto) as t1; +otto +1 +select otto from (select 1 as otto) as t1; +otto +1 +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' +select friedrich from (select 1 as otto) as t1; +ERROR 42S22: Unknown column 'friedrich' in 'field list' diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test new file mode 100644 index 00000000000..c18dfe1e25c --- /dev/null +++ b/mysql-test/t/mysqltest.test @@ -0,0 +1,78 @@ + +# ============================================================================ +# +# Test of mysqltest itself +# +# ============================================================================ + +# ---------------------------------------------------------------------------- +# Positive case(statement) +# ---------------------------------------------------------------------------- + +select otto from (select 1 as otto) as t1; +# expectation = response +!$0 select otto from (select 1 as otto) as t1; +--error 0 +select otto from (select 1 as otto) as t1; + +# expectation <> response +-- // !$1054 select otto from (select 1 as otto) as t1; +-- // --error 1054 +-- // select otto from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Negative case(statement): +# The dervied table t1 does not contain a column named 'friedrich' . +# --> ERROR 42S22: Unknown column 'friedrich' in 'field list and +# --> 1054: Unknown column 'friedrich' in 'field list' +# ---------------------------------------------------------------------------- + +# expectation <> response +#!$0 select friedrich from (select 1 as otto) as t1; +#--error 0 +#select friedrich from (select 1 as otto) as t1; + +# expectation = response +!$1054 select friedrich from (select 1 as otto) as t1; +--error 1054 +select friedrich from (select 1 as otto) as t1; + +# The following unmasked unsuccessful statement must give +# 1. mysqltest gives a 'failed' +# 2. does not produce a r/.reject file !!! +# PLEASE uncomment it and check it's effect +#select friedrich from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Tests for the new feature - SQLSTATE error code matching +# Positive case(statement) +# ---------------------------------------------------------------------------- + +# expectation = response +!S00000 select otto from (select 1 as otto) as t1; + +--error S00000 +select otto from (select 1 as otto) as t1; + +# expectation <> response +#!S42S22 select otto from (select 1 as otto) as t1; +#--error S42S22 +#select otto from (select 1 as otto) as t1; + + +# ---------------------------------------------------------------------------- +# Negative case(statement) +# ---------------------------------------------------------------------------- + +# expectation = response +!S42S22 select friedrich from (select 1 as otto) as t1; +--error S42S22 +select friedrich from (select 1 as otto) as t1; + +# expectation !=response +#!S00000 select friedrich from (select 1 as otto) as t1; +#--error S00000 +#select friedrich from (select 1 as otto) as t1; + -- cgit v1.2.1 From f306f414b3b513c9e787f948ed6a35b392968fa0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 14:47:35 +0400 Subject: A fix and test case for Bug#6050 "EXECUTE stmt reports ambiguous field names with ident. tables fr. diff. schemata": revise all uses of Item_field and make them prepared-statements friendly when necessary. mysql-test/r/ps.result: Test results fixed: the test case for Bug#6050 mysql-test/r/ps_1general.result: Test results fixed: in prepared statements we expand '*' to a list of fully qualified fields (db.table.column). mysql-test/t/ps.test: A test for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with ident. tables fr. diff. schemata" sql/item.cc: Revise all Item_field constructors: we need to make sure that no Item_field object points to unaccessible memory in prepared statements. sql/item.h: Revise all Item_field constructors: we need to make sure that no Item_field object points to unaccessible memory in prepared statements. sql/sql_base.cc: Item_field use changed to be prepared statements friendly. sql/sql_class.h: New check of Item_arena state. sql/sql_union.cc: Fixing the problem with name resolving in UNION and prepared statements: In case of SELECT a, b, c FROM t1 UNION SELECT a, b, c FROM t2 the list of selected items is represented as a List, where each Item_field points to a field of temporary table. But the temporary table is created anew on each execution of the prepared statement. So on each subsequent execution we should reset Item_field items to point to fields from freshly-created temporary table. sql/table.h: Comment TABLE member. --- mysql-test/r/ps.result | 35 +++++++++++++++++++++++++++++++++++ mysql-test/r/ps_1general.result | 2 +- mysql-test/t/ps.test | 25 +++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0aba0c4672e..0950a066e64 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -375,3 +375,38 @@ rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as - 9647622201 3845601374 6211931236 drop table t1; deallocate prepare stmt; +create database mysqltest1; +create table t1 (a int); +create table mysqltest1.t1 (a int); +select * from t1, mysqltest1.t1; +a a +prepare stmt from "select * from t1, mysqltest1.t1"; +execute stmt; +a a +execute stmt; +a a +execute stmt; +a a +drop table t1; +drop table mysqltest1.t1; +drop database mysqltest1; +deallocate prepare stmt; +select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'; +a a +1.1 1.2 +2.1 2.2 +prepare stmt from +"select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'"; +execute stmt; +a a +1.1 1.2 +2.1 2.2 +execute stmt; +a a +1.1 1.2 +2.1 2.2 +execute stmt; +a a +1.1 1.2 +2.1 2.2 +deallocate prepare stmt; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 6dcdb0feab1..ccf2945d488 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -184,7 +184,7 @@ f3 int ); insert into t5( f1, f2, f3) values( 9, 'recreated table', 9); execute stmt2 ; -ERROR 42S22: Unknown column 't5.a' in 'field list' +ERROR 42S22: Unknown column 'test.t5.a' in 'field list' drop table t5 ; prepare stmt1 from ' select * from t1 where a <= 2 ' ; execute stmt1 ; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 7cbcd50245f..04ab8aa62a8 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -390,3 +390,28 @@ set @var=3; execute stmt using @var; drop table t1; deallocate prepare stmt; + +# +# A test case for Bug#6050 "EXECUTE stmt reports ambiguous fieldnames with +# identical tables from different schemata" +# Check that field name resolving in prepared statements works OK. +# +create database mysqltest1; +create table t1 (a int); +create table mysqltest1.t1 (a int); +select * from t1, mysqltest1.t1; +prepare stmt from "select * from t1, mysqltest1.t1"; +execute stmt; +execute stmt; +execute stmt; +drop table t1; +drop table mysqltest1.t1; +drop database mysqltest1; +deallocate prepare stmt; +select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'; +prepare stmt from +"select '1.1' as a, '1.2' as a UNION SELECT '2.1', '2.2'"; +execute stmt; +execute stmt; +execute stmt; +deallocate prepare stmt; -- cgit v1.2.1 From 3bfa0e9caa77dda2470d4430e1c1d2dc69ba7dd5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 18:44:51 +0300 Subject: Fix compiler warnings (detected by Intel's C++ compiler) Fixed checking of privilege handling in CREATE ... SELECT (Bug #6094) client/mysql.cc: Fix compiler warnings client/mysqltest.c: Fix wrong counting of lines Remove compiler warnings heap/hp_hash.c: Fix compiler warnings innobase/dict/dict0load.c: Fix compiler warnings innobase/include/mem0mem.h: Fix compiler warnings libmysql/client_settings.h: Fix compiler warnings myisam/ft_nlq_search.c: Add comments about compiler warnings myisam/rt_index.c: Add comments about compiler warnings myisam/rt_mbr.c: Add comments about compiler warnings mysql-test/r/ps.result: Test case for bug#6094 mysql-test/t/ps.test: Test case for bug#6094 mysys/hash.c: Fix compiler warnings mysys/my_handler.c: Add comments about compiler warnings mysys/my_thr_init.c: Add comments about compiler warnings ndb/include/mgmapi/mgmapi.h: Fix compiler warnings regex/main.c: Fix compiler warnings sql/item.h: Fix compiler warnings sql/item_func.h: Add comments about compiler warnings sql/spatial.h: Add comments about compiler warnings sql/sql_lex.h: Fix compiler warning sql/sql_list.h: Fix compiler warning sql/sql_parse.cc: Move testing of access rights of tables in CREATE ... SELECT to create_table_precheck() to fix privilege checking in CREATE ... SELECT (Bug #6094) sql/sql_prepare.cc: Remove not needed empty line sql/sql_string.h: Fix compiler warnings strings/ctype-mb.c: Fix compiler warnings --- mysql-test/r/ps.result | 14 ++++++++++++++ mysql-test/t/ps.test | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0950a066e64..a416ba5c482 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -410,3 +410,17 @@ a a 1.1 1.2 2.1 2.2 deallocate prepare stmt; +create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 select * from t1; +PREPARE my_stmt FROM 'create table t2 select * from t1'; +drop table t2; +execute my_stmt; +drop table t2; +execute my_stmt; +execute my_stmt; +ERROR 42S01: Table 't2' already exists +drop table t2; +execute my_stmt; +drop table t1,t2; +deallocate prepare my_stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 04ab8aa62a8..9546a698e58 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -415,3 +415,21 @@ execute stmt; execute stmt; execute stmt; deallocate prepare stmt; + +# +# Test CREATE TABLE ... SELECT (Bug #6094) +# +create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 select * from t1; +PREPARE my_stmt FROM 'create table t2 select * from t1'; +drop table t2; +execute my_stmt; +drop table t2; +execute my_stmt; +--error 1050 +execute my_stmt; +drop table t2; +execute my_stmt; +drop table t1,t2; +deallocate prepare my_stmt; -- cgit v1.2.1 From 28ea3debe0b7cdc1d942b62408f2dfb3b48d9951 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 22:51:16 +0400 Subject: A fix and test case for Bug#6088 "FOUND_ROWS returns wrong values for prepared statements when LIMIT is used" and post-review comments. The fix changes the approach we calculate the need for ORDER BY in UNION: the previous was not PS friendly, as it damaged SELECT_LEX options in case of single select. mysql-test/r/ps.result: Test results fixed: the test case for Bug#6088 mysql-test/r/subselect.result: Test results fixed: now we don't perform ORDER BY for parts of UNION if there is no LIMIT clause. mysql-test/t/ps.test: A test case for Bug#6088 "FOUND_ROWS returns wrong values for prepared statements when LIMIT is used". sql/sql_union.cc: The actual fix for Bug#6088: - don't modify SELECT_LEX'es - use boolean variable can_skip_order_by to check if we can skip ORDER BY in UNION --- mysql-test/r/ps.result | 24 ++++++++++++++++++++++++ mysql-test/r/subselect.result | 6 +++--- mysql-test/t/ps.test | 14 ++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 0950a066e64..036d50efbba 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -410,3 +410,27 @@ a a 1.1 1.2 2.1 2.2 deallocate prepare stmt; +create table t1 (a int); +insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +prepare stmt from "select sql_calc_found_rows * from t1 limit 2"; +execute stmt; +a +1 +2 +select found_rows(); +found_rows() +10 +execute stmt; +a +1 +2 +select found_rows(); +found_rows() +10 +execute stmt; +a +1 +2 +select found_rows(); +found_rows() +10 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 8bcf7f9bff2..04c5f685f58 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -176,17 +176,17 @@ a b a b 1 7 2 7 -3 8 4 8 +3 8 explain extended (select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using filesort -3 UNION t4 ALL NULL NULL NULL NULL 3 Using where; Using filesort +3 UNION t4 ALL NULL NULL NULL NULL 3 Using where 4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 NULL UNION RESULT ALL NULL NULL NULL NULL NULL Warnings: -Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by test.t4.a) +Note 1003 (select test.t2.a AS `a`,test.t2.b AS `b` from test.t2 where (test.t2.b = (select test.t3.a AS `a` from test.t3 order by test.t3.a desc limit 1))) union (select test.t4.a AS `a`,test.t4.b AS `b` from test.t4 where (test.t4.b = (select (max(test.t2.a) * 4) AS `max(t2.a)*4` from test.t2)) order by a) select (select a from t3 where a Date: Fri, 22 Oct 2004 23:05:48 +0400 Subject: Post merge fix (test results) --- mysql-test/r/ps.result | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 036d50efbba..e1391a496c6 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -411,6 +411,20 @@ a a 2.1 2.2 deallocate prepare stmt; create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 select * from t1; +prepare stmt FROM 'create table t2 select * from t1'; +drop table t2; +execute stmt; +drop table t2; +execute stmt; +execute stmt; +ERROR 42S01: Table 't2' already exists +drop table t2; +execute stmt; +drop table t1,t2; +deallocate prepare stmt; +create table t1 (a int); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); prepare stmt from "select sql_calc_found_rows * from t1 limit 2"; execute stmt; @@ -434,3 +448,5 @@ a select found_rows(); found_rows() 10 +deallocate prepare stmt; +drop table t1; -- cgit v1.2.1 From b6eadaa20e5bee144b3fbc365d554b62edf7791a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 23:23:02 +0200 Subject: test fixed --- mysql-test/r/key.result | 7 +++++++ mysql-test/t/key.test | 3 +++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e076c59a76c..89307cf7080 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -284,9 +284,16 @@ c1 1 3 DELETE FROM t1 WHERE (c1 = 1); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK select c1 from t1 where c2='\Z\Z\Z\Z'; c1 3 DELETE FROM t1 WHERE (c1 = 3); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK select c1 from t1 where c2='\Z\Z\Z\Z'; c1 +drop table t1; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 5c365ccf965..620b8e415b8 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -267,7 +267,10 @@ INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 1); +check table t1; select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 3); +check table t1; select c1 from t1 where c2='\Z\Z\Z\Z'; +drop table t1; -- cgit v1.2.1 From 4486659c8b664ffac8bf4011de084a49be93189a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Oct 2004 03:30:27 +0300 Subject: Fixed wrong range test code for HEAP tables. This caused a crash when doing a range test with a key that didn't have lower or upper bound (Bug #6082) More test cases mysql-test/r/heap.result: Test for bug #6082 (delete with NOT NULL) mysql-test/r/key.result: More tests for BUG#6151 - myisam index corruption mysql-test/r/ps.result: Test of bug #6047 "Permission problem when executing mysql_stmt_execute with derived table" mysql-test/t/heap.test: Test for bug #6082 (delete with NOT NULL) mysql-test/t/key.test: More tests for BUG#6151 - myisam index corruption mysql-test/t/ps.test: Test of bug #6047 "Permission problem when executing mysql_stmt_execute with derived table" sql/ha_heap.cc: Fixed wrong range test code for HEAP tables. This caused a crash when doing a range test with a key that didn't have lower or upper bound --- mysql-test/r/heap.result | 6 ++++++ mysql-test/r/key.result | 8 ++++++++ mysql-test/r/ps.result | 6 ++++++ mysql-test/t/heap.test | 10 ++++++++++ mysql-test/t/key.test | 11 +++++++++++ mysql-test/t/ps.test | 13 +++++++++++++ 6 files changed, 54 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index c49c9abb368..92b694b5117 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -227,3 +227,9 @@ SELECT MAX(job_title_id) FROM job_titles; MAX(job_title_id) NULL DROP TABLE job_titles; +CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP; +INSERT INTO t1 VALUES(1,1), (1,NULL); +SELECT * FROM t1 WHERE B is not null; +a B +1 1 +DROP TABLE t1; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 89307cf7080..e3b341fcaf8 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -296,4 +296,12 @@ Table Op Msg_type Msg_text test.t1 check status OK select c1 from t1 where c2='\Z\Z\Z\Z'; c1 +truncate table t1; +insert into t1 values(1,"aaaa"),(2,"aaab"),(3,"aaac"),(4,"aaccc"); +delete from t1 where c1=3; +delete from t1 where c1=1; +delete from t1 where c1=4; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK drop table t1; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index e1391a496c6..6cad58282a2 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -450,3 +450,9 @@ found_rows() 10 deallocate prepare stmt; drop table t1; +CREATE TABLE t1 (N int, M tinyint); +INSERT INTO t1 VALUES (1,0),(1,0),(2,0),(2,0),(3,0); +PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVING COUNT(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 37fc5a43227..e1776245d9e 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -164,3 +164,13 @@ CREATE TABLE `job_titles` ( SELECT MAX(job_title_id) FROM job_titles; DROP TABLE job_titles; + +# +# Test of delete with NOT NULL +# (Bug #6082) +# + +CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP; +INSERT INTO t1 VALUES(1,1), (1,NULL); +SELECT * FROM t1 WHERE B is not null; +DROP TABLE t1; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 620b8e415b8..662baa5ea9d 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -272,5 +272,16 @@ select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 3); check table t1; select c1 from t1 where c2='\Z\Z\Z\Z'; + +# +# test delete of keys in a different order +# +truncate table t1; +insert into t1 values(1,"aaaa"),(2,"aaab"),(3,"aaac"),(4,"aaccc"); +delete from t1 where c1=3; +delete from t1 where c1=1; +delete from t1 where c1=4; +check table t1; + drop table t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 76da86dc6df..978ce2bc2c3 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -449,3 +449,16 @@ execute stmt; select found_rows(); deallocate prepare stmt; drop table t1; + +# +# Bug#6047 "permission problem when executing mysql_stmt_execute with derived +# table" +# + +CREATE TABLE t1 (N int, M tinyint); +INSERT INTO t1 VALUES (1,0),(1,0),(2,0),(2,0),(3,0); +PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVING COUNT(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + -- cgit v1.2.1 From a971db11a2df9a91d6c8264b6a965506ab7e95cf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Oct 2004 17:51:26 +0500 Subject: Bug#6202: ENUMs are not case sensitive even if declared BINARY --- mysql-test/r/type_enum.result | 18 ++++++++++++++++++ mysql-test/t/type_enum.test | 13 +++++++++++++ 2 files changed, 31 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index a94e90885db..27539953aa9 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1677,3 +1677,21 @@ Field Type Null Key Default Extra a int(11) YES 1 b enum('value','_value','') value drop table t1; +CREATE TABLE t1 (c enum('a', 'A') BINARY); +Warnings: +Note 1291 Column 'c' has duplicated value 'a' in ENUM +INSERT INTO t1 VALUES ('a'),('A'); +SELECT * FROM t1; +c +a +A +DROP TABLE t1; +CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); +INSERT INTO t1 VALUES (''),(''),(''),(''); +SELECT * FROM t1; +c +ae +oe +ue +ss +DROP TABLE t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 2f1e11810af..dc2e4d0f469 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -59,3 +59,16 @@ CREATE TABLE t1 ( show create table t1; show columns from t1; drop table t1; + +# +# Bugs #6154, 6206: ENUMs are not case sensitive even if declared BINARY +# +CREATE TABLE t1 (c enum('a', 'A') BINARY); +INSERT INTO t1 VALUES ('a'),('A'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); +INSERT INTO t1 VALUES (''),(''),(''),(''); +SELECT * FROM t1; +DROP TABLE t1; -- cgit v1.2.1 From dcee528a07cd2076ea3801e1c6165df706c5b9ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 09:13:52 +0500 Subject: Reuse more code: two equal pieces for ENUM and SET where moved into a function. --- mysql-test/r/ctype_utf8.result | 13 +++++++++++++ mysql-test/t/ctype_utf8.test | 12 ++++++++++++ 2 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e65eb96cb68..858ba84bbe0 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -799,3 +799,16 @@ select * from t1 where b like 'foob%'; a b 2 foobar drop table t1; +create table t1 ( +a enum('петя','вася','анюта') character set utf8 not null default 'анюта', +b set('петя','вася','анюта') character set utf8 not null default 'анюта' +); +create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` char(5) character set utf8 NOT NULL default '', + `b` char(15) character set utf8 NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2; +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 238cd6daef3..1b85379353a 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -644,3 +644,15 @@ create table t1 ( insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; drop table t1; + +# +# Test for calculate_interval_lengths() function +# +create table t1 ( + a enum('петя','вася','анюта') character set utf8 not null default 'анюта', + b set('петя','вася','анюта') character set utf8 not null default 'анюта' +); +create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1; +show create table t2; +drop table t2; +drop table t1; -- cgit v1.2.1 From ad4e6a0b47fca224aadaa7c54fd8d16bfed3ab9f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 10:41:14 +0500 Subject: - Check ENUM/SET duplicate values taking in account charset/collation. --- mysql-test/r/ctype_sjis.result | 13 +++++++++++++ mysql-test/r/type_enum.result | 2 -- mysql-test/t/ctype_sjis.test | 10 ++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 26a45dd28e8..b0edbed1a41 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -47,3 +47,16 @@ select hex(a) from t1; hex(a) 878A drop table t1; +create table t1(c enum(0x9353,0x9373) character set sjis); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` enum('S','s') character set sjis default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (0x9353); +insert into t1 values (0x9373); +select hex(c) from t1; +hex(c) +9353 +9373 +drop table t1; diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 27539953aa9..da85ffe6495 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1678,8 +1678,6 @@ a int(11) YES 1 b enum('value','_value','') value drop table t1; CREATE TABLE t1 (c enum('a', 'A') BINARY); -Warnings: -Note 1291 Column 'c' has duplicated value 'a' in ENUM INSERT INTO t1 VALUES ('a'),('A'); SELECT * FROM t1; c diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 68f4f7010e0..c910812ef8a 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -41,3 +41,13 @@ create table t1 (a char(10) character set sjis); insert into t1 values (0x878A); select hex(a) from t1; drop table t1; + +# +# Bug #6206 ENUMs are not case sensitive even if declared BINARY +# +create table t1(c enum(0x9353,0x9373) character set sjis); +show create table t1; +insert into t1 values (0x9353); +insert into t1 values (0x9373); +select hex(c) from t1; +drop table t1; -- cgit v1.2.1 From 4a7dc4d3450a3e0bc35cb8afaaf73bb248d3d606 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 12:16:35 +0400 Subject: Fix for bug #6166: index prefix length of 0 not rejected --- mysql-test/r/key.result | 2 ++ mysql-test/t/key.test | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e3b341fcaf8..e74bda23da9 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -305,3 +305,5 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (c char(10), index (c(0))); +ERROR HY000: Key part 'c' length cannot be 0 diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 662baa5ea9d..4be34cac30e 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -285,3 +285,14 @@ check table t1; drop table t1; +# +# Bug 6166: index prefix length of 0 not rejected +# +# this test should fail in 5.0 +# to fix it, remove #ifdef in +# file sql_yacc.yy(key_part) +# create dedicated error code for this and +# and change my_printf_error() to my_error + +--error 1105 +create table t1 (c char(10), index (c(0))); -- cgit v1.2.1 From 812b723af10bd93d8eff97a3f2a36d1aa694fd6c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 13:17:37 +0500 Subject: Bug 6206: ENUMs are not case sensitive even if declared BINARY The same problem with SET columns: find_set() now executes find_type2() to do charset aware search, instead of always using system_charset_info comparison. --- mysql-test/r/type_set.result | 33 +++++++++++++++++++++++++++++++++ mysql-test/t/type_set.test | 21 +++++++++++++++++++++ 2 files changed, 54 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 084e004cd47..9c82f59fc69 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -15,3 +15,36 @@ t1 CREATE TABLE `t1` ( drop table t1; CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8; DROP TABLE t1; +set names latin1; +create table t1 (s set ('a','A') character set latin1 collate latin1_bin); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s` set('a','A') character set latin1 collate latin1_bin default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('a'),('a,A'),('A,a'),('A'); +select s from t1 order by s; +s +a +A +a,A +a,A +drop table t1; +CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci); +INSERT INTO t1 VALUES (''),(''),(''),(''); +INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss'); +INSERT INTO t1 VALUES (',,,'); +INSERT INTO t1 VALUES ('ae,oe,ue,ss'); +SELECT c FROM t1 ORDER BY c; +c +ae +ae +oe +oe +ue +ue +ss +ss +ae,oe,ue,ss +ae,oe,ue,ss +DROP TABLE t1; diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index 60aa8dcfcf2..e4aeecb2c79 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -14,3 +14,24 @@ show create table t1; drop table t1; CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8; DROP TABLE t1; + +# +# Check that SET is case sensitive with a binary collation +# +set names latin1; +create table t1 (s set ('a','A') character set latin1 collate latin1_bin); +show create table t1; +insert into t1 values ('a'),('a,A'),('A,a'),('A'); +select s from t1 order by s; +drop table t1; + +# +# Check that SET honors a more complex collation correctly +# +CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci); +INSERT INTO t1 VALUES (''),(''),(''),(''); +INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss'); +INSERT INTO t1 VALUES (',,,'); +INSERT INTO t1 VALUES ('ae,oe,ue,ss'); +SELECT c FROM t1 ORDER BY c; +DROP TABLE t1; -- cgit v1.2.1 From 8255e5a367b588f73a0e7c6dcfbdac22a2cc7103 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 19:30:01 +0300 Subject: A lot of fixes for prepared statements (PS): New mysqltest that can run mysqltest with PS Added support for ZEROFILL in PS Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result() Updated test cases to support --ps-protocol (Some tests are still run using old protocol) Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2... Fixed crash in PS when using sub queries Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries) Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new PS query group_concat(...ORDER BY) didn't work with PS Fixed problem with test suite when not using innodb BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87: Delete: mysql-test/t/innodb-lock-master.opt client/Makefile.am: mysqltest now uses regex client/mysqltest.c: Added support for testing of prepared statements (with --ps-protocol) Main code was done by Kent, I did mainly some cleanups and minor bug fixes New test commands: --disable_ps_protocol --enable_ps_protocol NOTE: new code still has some things that needs to be cleaned up. For example run_query_stmt_handle_error() should be made more general so that same code can be used also by 'normal' queries configure.in: mysqltest now uses regex libmysql/libmysql.c: Reset warning_count after prepare (safety). In the future we should also provide warnings on prepare integer -> string conversion now handles ZEROFILL double -> string conversion is now closer to the one in the server Fixed crash when one called mysql_stmt_store_result() without preceding mysql_stmt_bind_result() libmysqld/examples/Makefile.am: mysqltest now uses regex mysql-test/include/have_query_cache.inc: Fixes for --ps-protocol mysql-test/include/ps_conv.inc: Fixes for --ps-protocol mysql-test/mysql-test-run.sh: Added options --ps-protocol mysql-test/r/ctype_utf8.result: Fixed test case mysql-test/r/fulltext_cache.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_left_join.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_multi.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/innodb-lock.result: Fixed test to work even if Innodb is not compiled in. mysql-test/t/create.test: Fixes for --ps-protocol mysql-test/t/ctype_utf8.test: Remove warnings mysql-test/t/date_formats.test: Fixes for --ps-protocol mysql-test/t/fulltext_cache.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_left_join.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_multi.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/func_group.test: Fixes for --ps-protocol mysql-test/t/func_sapdb.test: Fixes for --ps-protocol mysql-test/t/innodb-lock.test: Fixed test to work even if Innodb is not compiled in. mysql-test/t/insert.test: Fixes for --ps-protocol mysql-test/t/insert_select.test: Fixes for --ps-protocol mysql-test/t/insert_update.test: Fixes for --ps-protocol mysql-test/t/metadata.test: Fixes for --ps-protocol mysql-test/t/multi_statement.test: Fixes for --ps-protocol mysql-test/t/ps_1general.test: Fixes for --ps-protocol mysql-test/t/rollback.test: Fixes for --ps-protocol mysql-test/t/rpl_redirect.test: Fixes for --ps-protocol mysql-test/t/rpl_user_variables.test: Fixes for --ps-protocol mysql-test/t/select.test: Fixes for --ps-protocol mysql-test/t/status.test: Fixes for --ps-protocol mysql-test/t/type_blob.test: Fixes for --ps-protocol mysql-test/t/type_float.test: Fixes for --ps-protocol mysql-test/t/union.test: Fixes for --ps-protocol mysql-test/t/warnings.test: Fixes for --ps-protocol mysys/my_alloc.c: More debugging information sql-common/client.c: More debugging information sql-common/my_time.c: TIME didn't support full range with PS sql/field.cc: TIME didn't support full range with PS sql/item_cmpfunc.cc: IN(constants,...) didn't work with PS sql/item_subselect.cc: Some subqueries didn't work with PS sql/item_sum.cc: group_concat(...ORDER BY) didn't work with PS Removed variable warning_available as 'warning' can be used for this. sql/item_sum.h: Removed not needed variable sql/protocol.cc: TIME didn't support full range with PS sql/set_var.cc: Style fix sql/sql_base.cc: setup_wild() didn't properly restore old arena, which caused core dump in PS when using SELECT * FROM t1 NATURAL JOIN t2... sql/sql_class.cc: Style fix sql/sql_error.cc: Style fix sql/sql_insert.cc: Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" sql/sql_lex.h: Fix for PS and procedures sql/sql_parse.cc: More debugging information Make a copy of 'db' in PS as this may change Fixed wrong permissions check in PS and multi-table updates sql/sql_prepare.cc: Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new query sql/sql_union.cc: Fixes for PS and SELECT ... PROCEDURE Reset 'with_wild' as 'wild' is resolved on prepare --- mysql-test/include/have_query_cache.inc | 3 +++ mysql-test/include/ps_conv.inc | 2 ++ mysql-test/mysql-test-run.sh | 2 ++ mysql-test/r/ctype_utf8.result | 4 +--- mysql-test/r/fulltext_cache.result | 36 ++++++++++++++++----------------- mysql-test/r/fulltext_left_join.result | 12 +++++------ mysql-test/r/fulltext_multi.result | 30 +++++++++++++-------------- mysql-test/r/innodb-lock.result | 1 + mysql-test/t/create.test | 3 +++ mysql-test/t/ctype_utf8.test | 2 +- mysql-test/t/date_formats.test | 10 ++++++++- mysql-test/t/fulltext_cache.test | 4 ++-- mysql-test/t/fulltext_left_join.test | 2 +- mysql-test/t/fulltext_multi.test | 6 +++--- mysql-test/t/func_group.test | 4 ++++ mysql-test/t/func_sapdb.test | 18 ++++++++++++++++- mysql-test/t/innodb-lock-master.opt | 1 - mysql-test/t/innodb-lock.test | 2 ++ mysql-test/t/insert.test | 3 +++ mysql-test/t/insert_select.test | 3 +++ mysql-test/t/insert_update.test | 4 ++-- mysql-test/t/metadata.test | 2 ++ mysql-test/t/multi_statement.test | 3 +++ mysql-test/t/ps_1general.test | 3 +++ mysql-test/t/rollback.test | 2 ++ mysql-test/t/rpl_redirect.test | 2 ++ mysql-test/t/rpl_user_variables.test | 3 +++ mysql-test/t/select.test | 6 ++++++ mysql-test/t/status.test | 2 ++ mysql-test/t/type_blob.test | 3 +++ mysql-test/t/type_float.test | 3 +++ mysql-test/t/union.test | 4 ++++ mysql-test/t/warnings.test | 13 +++++++++++- 33 files changed, 143 insertions(+), 55 deletions(-) delete mode 100644 mysql-test/t/innodb-lock-master.opt (limited to 'mysql-test') diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index e5e6052c9a7..39549157849 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -1,4 +1,7 @@ -- require r/have_query_cache.require +# As PS are not cached we disable them to ensure the we get the right number +# of query cache hits +-- disable_ps_protocol disable_query_log; show variables like "have_query_cache"; enable_query_log; diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc index 03d93b6190d..0a5bec26fe7 100644 --- a/mysql-test/include/ps_conv.inc +++ b/mysql-test/include/ps_conv.inc @@ -73,7 +73,9 @@ create table t5 as select show create table t5 ; --vertical_results --enable_metadata +--disable_ps_protocol select * from t5 ; +--enable_ps_protocol --disable_metadata --horizontal_results drop table t5 ; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index b12f7afb9f1..6b40fb3e974 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -321,6 +321,8 @@ while test $# -gt 0; do EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; + --ps-protocol) + EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e65eb96cb68..482a6502490 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -766,9 +766,7 @@ list_id smallint unsigned NOT NULL, term text NOT NULL, PRIMARY KEY(id), INDEX(list_id, term(19)) -) TYPE=MyISAM CHARSET=utf8; -Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +) ENGINE=MyISAM CHARSET=utf8; INSERT INTO t1 set list_id = 1, term = "testtest"; INSERT INTO t1 set list_id = 1, term = "testetest"; INSERT INTO t1 set list_id = 1, term = "testtest"; diff --git a/mysql-test/r/fulltext_cache.result b/mysql-test/r/fulltext_cache.result index c489bdefeb8..6a94189d8b4 100644 --- a/mysql-test/r/fulltext_cache.result +++ b/mysql-test/r/fulltext_cache.result @@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.92378664 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 +aaaaaaaaa dsaass de Feijoada 3 0.00000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 +ssde df s fsda sad er um copo de Vodka 5 0.00000000 +ssde df s fsda sad er um chocolate Snickers 6 0.00000000 +aaaaaaaaa dsaass de Bife 7 0.00000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x @@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ssde df s fsda sad er um chocolate Snickers 6 0 aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0 -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.92378664 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 +aaaaaaaaa dsaass de Feijoada 3 0.00000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 +ssde df s fsda sad er um copo de Vodka 5 0.00000000 +ssde df s fsda sad er um chocolate Snickers 6 0.00000000 +aaaaaaaaa dsaass de Bife 7 0.00000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result index bf3fe73690a..f3dad290525 100644 --- a/mysql-test/r/fulltext_left_join.result +++ b/mysql-test/r/fulltext_left_join.result @@ -16,13 +16,13 @@ author VARCHAR(255) NOT NULL INSERT INTO t2 VALUES('123', 'moi'); INSERT INTO t2 VALUES('123', 'lui'); INSERT INTO t2 VALUES('456', 'lui'); -select match(t1.texte,t1.sujet,t1.motsclefs) against('droit') +select round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) from t1 left join t2 on t2.id=t1.id; -match(t1.texte,t1.sujet,t1.motsclefs) against('droit') -0 -0 -0.67003107070923 -0 +round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) +0.00000 +0.00000 +0.67003 +0.00000 select match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) from t1 left join t2 on t2.id=t1.id; match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) diff --git a/mysql-test/r/fulltext_multi.result b/mysql-test/r/fulltext_multi.result index 968b00020e2..289ee004395 100644 --- a/mysql-test/r/fulltext_multi.result +++ b/mysql-test/r/fulltext_multi.result @@ -11,19 +11,19 @@ FULLTEXT KEY a(b,c) INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -a MATCH b AGAINST ('lala lkjh') -1 0.67003107070923 -2 0 -3 0 -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -a MATCH c AGAINST ('lala lkjh') -1 0 -2 0.67756325006485 -3 0 -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; -a MATCH b,c AGAINST ('lala lkjh') -1 0.64840710163116 -2 0.66266459226608 -3 0 +SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH b AGAINST ('lala lkjh'),5) +1 0.67003 +2 0.00000 +3 0.00000 +SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH c AGAINST ('lala lkjh'),5) +1 0.00000 +2 0.67756 +3 0.00000 +SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH b,c AGAINST ('lala lkjh'),5) +1 0.64841 +2 0.66266 +3 0.00000 drop table t1; diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index 407a85ed038..4ace4065c34 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,3 +1,4 @@ +set global innodb_table_locks=1; select @@innodb_table_locks; @@innodb_table_locks 1 diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 26c527ca7cb..6f222eedec1 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -272,8 +272,11 @@ insert into t2 values(10),(20); create table t3 like t1; show create table t3; select * from t3; +# Disable PS becasue of @@warning_count +--disable_ps_protocol create table if not exists t3 like t1; select @@warning_count; +--enable_ps_protocol create temporary table t3 like t2; show create table t3; select * from t3; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 238cd6daef3..2ee796eeb67 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -621,7 +621,7 @@ CREATE TABLE t1 ( term text NOT NULL, PRIMARY KEY(id), INDEX(list_id, term(19)) -) TYPE=MyISAM CHARSET=utf8; +) ENGINE=MyISAM CHARSET=utf8; INSERT INTO t1 set list_id = 1, term = "testtest"; INSERT INTO t1 set list_id = 1, term = "testetest"; INSERT INTO t1 set list_id = 1, term = "testtest"; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index f769fe7af04..c369a9c85d5 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -118,8 +118,11 @@ SET datetime_format=default; # Test of str_to_date # +# PS doesn't support fraction of a seconds +--disable_ps_protocol select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); +--enable_ps_protocol create table t1 (date char(30), format char(30) not null); insert into t1 values @@ -153,7 +156,8 @@ insert into t1 values ('15-01-20', '%d-%m-%y'), ('15-2001-1', '%d-%Y-%c'); -# Use through protocol functions +# PS doesn't support fractional seconds +--disable_ps_protocol select date,format,str_to_date(date, format) as str_to_date from t1; # Use as a string select date,format,concat('',str_to_date(date, format)) as con from t1; @@ -198,6 +202,7 @@ select date,format,str_to_date(date, format) as str_to_date from t1; select date,format,concat(str_to_date(date, format),'') as con from t1; drop table t1; +--enable_ps_protocol # # Test of get_format @@ -221,6 +226,8 @@ insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1; drop table t1; +# PS doesn't support fractional seconds +--disable_ps_protocol select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a; @@ -249,3 +256,4 @@ select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1 select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; +--enable_ps_protocol diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index 15f32fdb5a0..234deab91e6 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test index f8dcfb2aad6..96751ef8678 100644 --- a/mysql-test/t/fulltext_left_join.test +++ b/mysql-test/t/fulltext_left_join.test @@ -24,7 +24,7 @@ INSERT INTO t2 VALUES('123', 'moi'); INSERT INTO t2 VALUES('123', 'lui'); INSERT INTO t2 VALUES('456', 'lui'); -select match(t1.texte,t1.sujet,t1.motsclefs) against('droit') +select round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) from t1 left join t2 on t2.id=t1.id; select match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) from t1 left join t2 on t2.id=t1.id; diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test index c312a5938b2..3a622a551bc 100644 --- a/mysql-test/t/fulltext_multi.test +++ b/mysql-test/t/fulltext_multi.test @@ -17,7 +17,7 @@ INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; +SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1; +SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1; +SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1; drop table t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 3e001961f90..8d8779e9d1b 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -30,7 +30,11 @@ select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a create table t2 (grp int, a bigint unsigned, c char(10)); insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; + +# REPLACE ... SELECT doesn't yet work with PS +--disable_ps_protocol replace into t2 select grp, a, c from t1 limit 2,1; +--enable_ps_protocol select * from t2; drop table t1,t2; diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 24028437fde..2ae3c438243 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -47,17 +47,23 @@ select subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); select subtime("01:00:00.999999", "02:00:00.999998"); select subtime("02:01:01.999999", "01:01:01.999999"); +# PS doesn't support fractional seconds +--disable_ps_protocol select timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +--enable_ps_protocol select maketime(10,11,12); select maketime(25,11,12); select maketime(-25,11,12); -#Extraction functions +# Extraction functions + +# PS doesn't support fractional seconds +--disable_ps_protocol select timestamp("2001-12-01", "01:01:01.999999"); select timestamp("2001-13-01", "01:01:01.000001"); select timestamp("2001-12-01", "25:01:01"); @@ -69,6 +75,7 @@ select date("1997-13-31 23:59:59.000001"); select time("1997-12-31 23:59:59.000001"); select time("1997-12-31 25:59:59.000001"); select microsecond("1997-12-31 23:59:59.000001"); +--enable_ps_protocol create table t1 select makedate(1997,1) as f1, @@ -81,7 +88,10 @@ select makedate(1997,1) as f1, date("1997-12-31 23:59:59.000001") as f8, time("1997-12-31 23:59:59.000001") as f9; describe t1; +# PS doesn't support fractional seconds +--disable_ps_protocol select * from t1; +--enable_ps_protocol create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values @@ -94,7 +104,10 @@ insert into test values ('2001-01-01 01:01:01', '01:01:01', '1 01:01:01', '2001-01-01 01:01:01'); SELECT ADDTIME(t1,t2) As ttt, ADDTIME(t2, t3) As qqq from test; +# PS doesn't support fractional seconds +--disable_ps_protocol SELECT TIMEDIFF(t1,t4) As ttt, TIMEDIFF(t2, t3) As qqq from test; +--enable_ps_protocol drop table t1, test; @@ -102,4 +115,7 @@ select addtime("-01:01:01.01", "-23:59:59.1") as a; select microsecond("1997-12-31 23:59:59.01") as a; select microsecond(19971231235959.01) as a; select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; +# PS doesn't support fractional seconds +--disable_ps_protocol select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); +--enable_ps_protocol diff --git a/mysql-test/t/innodb-lock-master.opt b/mysql-test/t/innodb-lock-master.opt deleted file mode 100644 index 403fcde87ed..00000000000 --- a/mysql-test/t/innodb-lock-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-table-lock=1 diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 2bbbac82ad5..a3b6f8993f2 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -4,6 +4,8 @@ # Check and select innodb lock type # +set global innodb_table_locks=1; + select @@innodb_table_locks; # diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index fd728c453aa..54379685731 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -92,6 +92,8 @@ drop database mysqltest; # Test of wrong values for float data (bug #2082) # +# PS gives sligthly different numbers for max-float/max-double +--disable_ps_protocol use test; create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned); @@ -140,3 +142,4 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val --query_vertical select * from t1 where number =last_insert_id() drop table t1; +--enable_ps_protocol diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 234a5ec0eef..db5dc8d91da 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -122,7 +122,10 @@ insert into t2 values (2,"t2:2"), (3,"t2:3"); --error 1062 insert into t1 select * from t2; select * from t1; +# REPLACE .. SELECT is not yet supported by PS +--disable_ps_protocol replace into t1 select * from t2; +--enable_ps_protocol select * from t1; drop table t1,t2; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index d2a70208022..fc54ce88f8a 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -35,10 +35,10 @@ create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); select * from t1; -enable_info; +--enable_info insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18) on duplicate key update b=b+10; -disable_info; +--disable_info select * from t1; diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index c426ab9864b..d11cb62b04e 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -6,6 +6,8 @@ drop table if exists t1,t2; --enable_warnings --enable_metadata +# PS protocol gives slightly different metadata +--disable_ps_protocol # # First some simple tests diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index bd90275c9f5..862f2294641 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -1,3 +1,6 @@ +# PS doesn't support multi-statements +--disable_ps_protocol + select 1; delimiter ||||; select 2; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index f27aca7a452..9e4acc2bf24 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -501,6 +501,8 @@ prepare stmt1 from ' KILL 0 '; ## simple explain # cases derived from client_test.c: test_explain_bug() prepare stmt1 from ' explain select a from t1 order by b '; +# PS protocol gives slightly different metadata +--disable_ps_protocol --enable_metadata execute stmt1; --disable_metadata @@ -509,6 +511,7 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; --enable_metadata execute stmt1 using @arg00; --disable_metadata +--enable_ps_protocol ## parameters with probably problematic characters (quote, double quote) # cases derived from client_test.c: test_logs() diff --git a/mysql-test/t/rollback.test b/mysql-test/t/rollback.test index 87f59417d90..3cb1ea3024b 100644 --- a/mysql-test/t/rollback.test +++ b/mysql-test/t/rollback.test @@ -5,6 +5,8 @@ --disable_warnings drop table if exists t1; --enable_warnings +# PS doesn't work with BEGIN ... ROLLBACK +--disable_ps_protocol create table t1 (n int not null primary key) engine=myisam; begin work; diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test index 3b5ad6ba88d..c533c0052f0 100644 --- a/mysql-test/t/rpl_redirect.test +++ b/mysql-test/t/rpl_redirect.test @@ -3,6 +3,8 @@ # source include/master-slave.inc; +# We disable this for now as PS doesn't handle redirection +--disable_ps_protocol #first, make sure the slave has had enough time to register save_master_pos; diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test index 35fbec72ac8..73b3ace473e 100644 --- a/mysql-test/t/rpl_user_variables.test +++ b/mysql-test/t/rpl_user_variables.test @@ -2,6 +2,9 @@ # Test of replicating user variables # source include/master-slave.inc; +# Disable PS as the log positions differs +--disable_ps_protocol + # Clean up old slave's binlogs. # The slave is started with --log-slave-updates diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index c260c7777e2..5bae44796dc 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1706,12 +1706,18 @@ select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.compan 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; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 7be494bd0e7..31d9c8154d5 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -5,6 +5,8 @@ # connection in a separate thread. # --source include/not_embedded.inc +# PS causes different statistics +--disable_ps_protocol connect (con1,localhost,root,,); connect (con2,localhost,root,,); diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index bd571deff49..b67fa7a552d 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -16,7 +16,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000)); show columns from t1; +# PS doesn't give errors on prepare yet +--disable_ps_protocol CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); +--enable_ps_protocol show columns from t2; create table t3 (a long, b long byte); show create TABLE t3; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 4b627ea9b99..216d5bbd286 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -39,7 +39,10 @@ create table t1 (c1 double, c2 varchar(20)); insert t1 values (121,"16"); select c1 + c1 * (c2 / 100) as col from t1; create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1; +# Floats are a bit different in PS +--disable_ps_protocol select * from t2; +--enable_ps_protocol show create table t2; drop table t1,t2; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 6e16a2b02aa..36027e8c4cb 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -5,6 +5,9 @@ --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6; --enable_warnings +# PS doesn't work correctly with found_rows: to be fixed +--disable_ps_protocol + CREATE TABLE t1 (a int not null, b char (10) not null); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); @@ -73,6 +76,7 @@ select * from t1 union select SQL_BUFFER_RESULT * from t2; # Test CREATE, INSERT and REPLACE create table t3 select a,b from t1 union all select a,b from t2; insert into t3 select a,b from t1 union all select a,b from t2; +# PS can't handle REPLACE ... SELECT replace into t3 select a,b as c from t1 union all select a,b from t2; drop table t1,t2,t3; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index b6042df51f1..4bd659606f6 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -26,8 +26,11 @@ show warnings limit 1; drop database if exists not_exists_db; show count(*) warnings; create table t1(id int); +# PS doesn't give warnings on prepare +--disable_ps_protocol create table if not exists t1(id int); select @@warning_count; +--enable_ps_protocol drop table t1; # @@ -36,7 +39,10 @@ drop table t1; create table t1(a tinyint, b int not null, c date, d char(5)); load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; +# PS doesn't work good with @@warning_count +--disable_ps_protocol select @@warning_count; +--enable_ps_protocol drop table t1; # @@ -74,7 +80,9 @@ enable_query_log; alter table t1 add b char; set max_error_count=10; update t1 set b=a; +--disable_ps_protocol select @@warning_count; +--enable_ps_protocol # # Test for handler type @@ -87,12 +95,15 @@ drop table t1; # # Test for deprecated TYPE= syntax # + +# PS doesn't give warnings on prepare +--disable_ps_protocol create table t1 (id int) type=heap; alter table t1 type=myisam; drop table t1; +--enable_ps_protocol # # Test for deprecated table_type variable # set table_type=MYISAM; - -- cgit v1.2.1 From 2d33c969c3653cfbc52cc0e649f0f8e88bf28b8d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 20:31:41 +0200 Subject: Bug #6019 - SELECT tries to use too short prefix index on utf8 data Field_string::pack should respect max_length as Field_string::pack_key does --- mysql-test/r/ctype_utf8.result | 4 ++++ mysql-test/t/ctype_utf8.test | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e65eb96cb68..68e3247ee16 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -798,4 +798,8 @@ insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; a b 2 foobar +alter table t1 engine=bdb; +select * from t1 where b like 'foob%'; +a b +2 foobar drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 238cd6daef3..c6954af8cf4 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -643,4 +643,8 @@ create table t1 ( --enable_warnings insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; +--disable_warnings +alter table t1 engine=bdb; +select * from t1 where b like 'foob%'; +--enable_warnings drop table t1; -- cgit v1.2.1 From b1789bea9c1c05083b887f98941be71076bb8c6d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2004 22:41:45 +0200 Subject: after merge fix --- mysql-test/r/ctype_utf8.result | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 024ad5148a3..945ec8eae99 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -801,7 +801,6 @@ select * from t1 where b like 'foob%'; a b 2 foobar drop table t1; -drop table t1; create table t1 ( a enum('петя','вася','анюта') character set utf8 not null default 'анюта', b set('петя','вася','анюта') character set utf8 not null default 'анюта' -- cgit v1.2.1 From 89dce2fb8c299e6a99c953e9a650ec7bd4409bcb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 18:57:49 +0300 Subject: Fix when compiling without InnoDB BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87: Delete: mysql-test/t/innodb-lock-master.opt --- mysql-test/r/innodb-lock.result | 1 + mysql-test/t/innodb-lock-master.opt | 1 - mysql-test/t/innodb-lock.test | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 mysql-test/t/innodb-lock-master.opt (limited to 'mysql-test') diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index 407a85ed038..4ace4065c34 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,3 +1,4 @@ +set global innodb_table_locks=1; select @@innodb_table_locks; @@innodb_table_locks 1 diff --git a/mysql-test/t/innodb-lock-master.opt b/mysql-test/t/innodb-lock-master.opt deleted file mode 100644 index 403fcde87ed..00000000000 --- a/mysql-test/t/innodb-lock-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-table-lock=1 diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 430369f4fda..a3b6f8993f2 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -4,6 +4,8 @@ # Check and select innodb lock type # +set global innodb_table_locks=1; + select @@innodb_table_locks; # @@ -12,7 +14,10 @@ select @@innodb_table_locks; connect (con1,localhost,root,,); connect (con2,localhost,root,,); + +--disable_warnings drop table if exists t1; +--enable_warnings # # Testing of explicit table locks with enforced table locks -- cgit v1.2.1 From 05a95f4db57a639b7ff54f42c41630a94f980cbe Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 21:11:06 +0300 Subject: removed incorrect error message about aggregate functions improved mechanisn of detection posibility to be NULL for single row queries switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions (changes to make subselects test working with PS protocol) mysql-test/r/subselect.result: removed incorrect error message about aggregate functions improved mechanisn of detection posibility to be NULL for single row queries mysql-test/t/subselect.test: removed incorrect error message about aggregate functions sql/item_subselect.cc: removed incorrect error message about aggregate functions switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions improved mechanisn of detection posibility to be NULL for single row queries sql/item_subselect.h: new method to help in NULL ability detection --- mysql-test/r/subselect.result | 15 +++++++++------ mysql-test/t/subselect.test | 5 ++--- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 04c5f685f58..32d482f5a32 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -55,7 +55,7 @@ SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 SELECT (SELECT 1), a; -ERROR 42S22: Unknown column 'a' in 'checking transformed subquery' +ERROR 42S22: Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; a 1 @@ -999,7 +999,9 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function +select * from t1; +i +1 drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; @@ -1084,7 +1086,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL default '0', - `(SELECT a)` bigint(20) default NULL + `(SELECT a)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; @@ -1102,7 +1104,7 @@ a SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) default NULL + `a` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); @@ -1186,11 +1188,12 @@ PRIMARY KEY (`i`) ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); ERROR 42S02: Unknown table 't' in field list +select * from t1; +i +1 drop table t1; CREATE TABLE t1 ( id int(11) default NULL diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 5e3aa4064e4..e0f6fcbf515 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -543,8 +543,8 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +select * from t1; drop table t1; #test of uncacheable subqueries @@ -689,12 +689,11 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -- error 1109 UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); +select * from t1; drop table t1; # -- cgit v1.2.1 From e27f6a502eebce1a0ddef4436d6615dfc0a64503 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 15:21:20 +0500 Subject: Produce a "truncated" warning if a value cannot be converted into the column character set on INSERT/UPDATE. sql/sql_string.cc: New argument to report an error. sql/sql_string.h: New argument to report an error. --- mysql-test/r/alter_table.result | 1 + mysql-test/r/ctype_recoding.result | 8 ++++++++ mysql-test/r/fulltext.result | 5 +++++ mysql-test/t/alter_table.test | 1 + mysql-test/t/ctype_recoding.test | 10 ++++++++++ 5 files changed, 25 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index e85ad303564..89b8bd66848 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -349,6 +349,7 @@ alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; a hex(a) D4C5D3D4 +delete from t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index be792c007fc..72d19885101 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -166,3 +166,11 @@ ERROR HY000: Invalid utf8 character string: ' SET NAMES utf8; CREATE TABLE `good` (a int); ERROR HY000: Invalid utf8 character string: '` (a int)' +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('',''); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +drop table t1; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 30c4c75f3d1..d07e4df6e73 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -356,6 +356,11 @@ SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAIN t collation(t) MATCH t AGAINST ('Osnabruck') aus Osnabrck utf8_general_ci 1.591139793396 alter table t1 modify t varchar(200) collate latin1_german2_ci not null; +Warnings: +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 5 +Warning 1265 Data truncated for column 't' at row 6 SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); t collation(t) aus Osnabrck latin1_german2_ci diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index eb35aa90fe2..e46027ae8d9 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -207,6 +207,7 @@ alter table t1 change a a text character set cp1251; select a,hex(a) from t1; alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; +delete from t1; # # Test ALTER TABLE .. CHARACTER SET .. diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 82d0643b577..5f417352d95 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -121,3 +121,13 @@ CREATE TABLE `good SET NAMES utf8; --error 1300 CREATE TABLE `good` (a int); + + +# +# Test that we produce a warnign when conversion loses data. +# +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('',''); +drop table t1; -- cgit v1.2.1