------------------------------------------------------------
revno: 2660
revision-id: kgeorge@stripped
parent: kgeorge@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: merge-6.0-bugteam
timestamp: Wed 2008-05-28 18:13:18 +0300
message:
fixed a resolve problem
modified:
.bzr-mysql/default.conf default.conf-20080521211852-kry0hytlir1epmpv-2
------------------------------------------------------------
revno: 2659
revision-id: kgeorge@stripped
parent: mhansson@stripped
parent: kgeorge@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: merge-6.0-bugteam
timestamp: Wed 2008-05-28 18:04:33 +0300
message:
automatically merged
added:
BUILD/compile-pentium-valgrind-max-no-ndb
compilepentiumvalgri-20080527153353-yxd5dqy0v0aoz8zk-1
modified:
.bzr-mysql/default.conf default.conf-20080521211852-kry0hytlir1epmpv-2
configure.in
sp1f-configure.in-19700101030959-mgdpoxtnh2ewmvusvfpkreuhwvffkcjw
include/mysql_com.h
sp1f-mysql_com.h-19700101030959-a255cet4ojn7jbd4gb4wadueimhj57r7
libmysqld/lib_sql.cc
sp1f-lib_sql.cc-20010411110351-gt5febleap73tqvapkesopvqtuht5sf5
mysql-test/r/ps_ddl.result
sp1f-ps_ddl.result-20071215004622-7wxecn5bjzrz7scbog54tuaaobpayisn
mysql-test/r/status.result
sp1f-status.result-20010127030042-xmcayiu3ythpazhcl57hxwab2xefawxh
mysql-test/r/variables.result
sp1f-variables.result-20001228015635-w5m2doorn7gzhyyhpqrlqsupnwn6f6xh
mysql-test/suite/rpl/r/rpl_slave_status.result
sp1f-rpl_slave_status.res-20050729010733-s3lzb3iemutgv2ailvyfmsce2ygry5m3
mysql-test/suite/rpl/t/rpl_slave_status.test
sp1f-rpl_slave_status.tes-20050729011045-rnv2rndnge76rklrsjgbc5xgfmlmc6xx
mysql-test/t/disabled.def
sp1f-disabled.def-20050315184020-inpdp4hiogithilv62snllppjz2dcing
mysql-test/t/ps_ddl.test
sp1f-ps_ddl.test-20071215004622-2fkvss6xi7zvoksbhhmbwak3gs54jnbo
mysql-test/t/variables.test
sp1f-variables.test-20001228015637-u4toadkin7aellpwwz75e5h5zuutteid
sql/mysqld.cc
sp1f-mysqld.cc-19700101030959-zpswdvekpvixxzxf7gdtofzel7nywtfj
sql/share/charsets/README
sp1f-readme-19700101030959-biiq664z5e4hu6e76gmanzfplb7dqfv5
sql/share/errmsg.txt
sp1f-errmsg.txt-20041213212820-do5w642w224ja7ctyqhyl6iihdmpkzv5
sql/sql_prepare.cc
sp1f-sql_prepare.cc-20020612210720-gtqjjiu7vpmfxb5xct2qke7urmqcabli
strings/CHARSET_INFO.txt
sp1f-charset_info.txt-20041018102512-ynunzmkv53gcy2f575oi7kp7isj5tbfi
tests/mysql_client_test.c
sp1f-client_test.c-20020614002636-eqy2zzksgelocknwbbogfuwxfwqy7q5x
------------------------------------------------------------
revno: 2497.237.7
revision-id: kgeorge@stripped
parent: kgeorge@stripped
parent: kgeorge@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: merge-5.1-bugteam
timestamp: Wed 2008-05-28 17:33:27 +0300
message:
automatically merged
------------------------------------------------------------
revno: 1810.3738.2
revision-id: kgeorge@stripped
parent: kgeorge@stripped
parent: bar@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: B36887-5.0-bugteam
timestamp: Wed 2008-05-28 17:26:26 +0300
message:
automatically merged
modified:
sql/share/charsets/README
sp1f-readme-19700101030959-biiq664z5e4hu6e76gmanzfplb7dqfv5
strings/CHARSET_INFO.txt
sp1f-charset_info.txt-20041018102512-ynunzmkv53gcy2f575oi7kp7isj5tbfi
------------------------------------------------------------
revno: 1810.3738.1
revision-id: kgeorge@stripped
parent: chad@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: B36887-5.0-bugteam
timestamp: Tue 2008-05-27 14:33:08 +0300
message:
Bug #36887: Typo in mysql_client_test.c uses bind instead of my_bind
There was a typo in a error check causing wrong thing to be ckecked
and a possible error not being caught.
Fixed by using the correct variable to test for malloc() errors.
modified:
tests/mysql_client_test.c
sp1f-client_test.c-20020614002636-eqy2zzksgelocknwbbogfuwxfwqy7q5x
------------------------------------------------------------
revno: 2497.237.6
revision-id: kgeorge@stripped
parent: davi@stripped
parent: bar@stripped
committer: Georgi Kodinov <kgeorge@stripped>
branch nick: merge-5.1-bugteam
timestamp: Wed 2008-05-28 17:18:24 +0300
message:
merged 5.0-bugteam to 5.1-bugteam
modified:
sql/share/charsets/README
sp1f-readme-19700101030959-biiq664z5e4hu6e76gmanzfplb7dqfv5
strings/CHARSET_INFO.txt
sp1f-charset_info.txt-20041018102512-ynunzmkv53gcy2f575oi7kp7isj5tbfi
------------------------------------------------------------
revno: 1810.3737.2
revision-id: bar@stripped
parent: chad@stripped
committer: Alexander Barkov <bar@stripped>
branch nick: mysql-5.0-bugteam
timestamp: Wed 2008-05-28 15:03:47 +0500
message:
Updating charset doc files.
Thanks to Paul for preparing the up-to-date files
reflecting 4.1 changes.
modified:
sql/share/charsets/README
sp1f-readme-19700101030959-biiq664z5e4hu6e76gmanzfplb7dqfv5
strings/CHARSET_INFO.txt
sp1f-charset_info.txt-20041018102512-ynunzmkv53gcy2f575oi7kp7isj5tbfi
------------------------------------------------------------
revno: 1810.3737.1
revision-id: chad@stripped
parent: sp1r-gshchepa/uchum@stripped
parent: cmiller@stripped
committer: Chad MILLER <chad@stripped>
branch nick: mysql-5.0-bugteam
timestamp: Fri 2008-05-23 20:56:39 +0200
message:
Merge from 5.0 trunk. Adding mailer metainfo.
added:
.bzr-mysql/ bzrmysql-20080521211852-kry0hytlir1epmpv-1
.bzr-mysql/default.conf default.conf-20080521211852-kry0hytlir1epmpv-2
------------------------------------------------------------
revno: 2497.237.5
revision-id: davi@stripped
parent: davi@stripped
parent: sven@stripped
committer: Davi Arnaut <davi@stripped>
branch nick: 37003-5.1
timestamp: Tue 2008-05-27 12:47:12 -0300
message:
Merge.
modified:
mysql-test/suite/rpl/r/rpl_slave_status.result
sp1f-rpl_slave_status.res-20050729010733-s3lzb3iemutgv2ailvyfmsce2ygry5m3
mysql-test/suite/rpl/t/rpl_slave_status.test
sp1f-rpl_slave_status.tes-20050729011045-rnv2rndnge76rklrsjgbc5xgfmlmc6xx
------------------------------------------------------------
revno: 2497.238.1
revision-id: sven@stripped
parent: chad@stripped
committer: Sven Sandberg <sven@stripped>
branch nick: 5.1-bugteam
timestamp: Mon 2008-05-26 15:06:49 +0200
message:
BUG#36826: rpl_slave_status fails sporadically in pushbuild
rpl_slave_status failed on pushbuild. The slave stopped with an
error. Adding sync_slave_with_master fixes the problem. Updated
test case.
modified:
mysql-test/suite/rpl/r/rpl_slave_status.result
sp1f-rpl_slave_status.res-20050729010733-s3lzb3iemutgv2ailvyfmsce2ygry5m3
mysql-test/suite/rpl/t/rpl_slave_status.test
sp1f-rpl_slave_status.tes-20050729011045-rnv2rndnge76rklrsjgbc5xgfmlmc6xx
------------------------------------------------------------
revno: 2497.237.4
revision-id: davi@stripped
parent: chad@stripped
committer: Davi Arnaut <davi@stripped>
branch nick: 37003-5.1
timestamp: Tue 2008-05-27 12:35:35 -0300
message:
Add variation of compile-pentium-valgrind-max which does not build ndb.
added:
BUILD/compile-pentium-valgrind-max-no-ndb
compilepentiumvalgri-20080527153353-yxd5dqy0v0aoz8zk-1
------------------------------------------------------------
revno: 2497.237.3
revision-id: chad@stripped
parent: chad@stripped
parent: chad@stripped
committer: Chad MILLER <chad@stripped>
branch nick: mysql-5.1-bugteam
timestamp: Fri 2008-05-23 22:08:22 +0200
message:
Merge from mysql-5.1, which adds metainfo for mailer plugin.
added:
.bzr-mysql/ bzrmysql-20080521211852-kry0hytlir1epmpv-1
.bzr-mysql/default.conf default.conf-20080521211852-kry0hytlir1epmpv-2
------------------------------------------------------------
revno: 2497.237.2
revision-id: chad@stripped
parent: chad@stripped
parent: mleich@stripped
committer: Chad MILLER <chad@stripped>
branch nick: mysql-5.1-bugteam
timestamp: Fri 2008-05-23 18:45:04 +0200
message:
Merged from trunk.
modified:
mysql-test/r/func_misc.result
sp1f-func_misc.result-20001228015633-4sy6dzzt7xcs4ubzcxloyguc7zhougbr
mysql-test/t/func_misc.test
sp1f-func_misc.test-20001228015635-kayguwcdgtjnekzavvdzbsnqcdwfm36c
------------------------------------------------------------
revno: 2497.237.1
revision-id: chad@stripped
parent: kpettersson@stripped
parent: sp1r-dfischer/mysqldev@stripped/production.mysql.com-20080521075958-12847
committer: Chad MILLER <chad@stripped>
branch nick: mysql-5.1-bugteam
timestamp: Fri 2008-05-23 18:42:54 +0200
message:
Merge from bk tree. Resolved addition of same files in both trees.
added:
mysql-test/r/ps_ddl1.result
sp1f-ps_ddl1.result-20080418191851-urtz67646gvgvv34f4paoytse3ms5wlg
mysql-test/t/ps_ddl1.test
sp1f-ps_ddl1.test-20080418191851-wxj7j2cicvawocpreihfnjgmisbnvqdh
modified:
Makefile.am
sp1f-makefile.am-19700101030959-jbbpiygwpgybyqknlavdxxupbrjonu7h
configure.in
sp1f-configure.in-19700101030959-mgdpoxtnh2ewmvusvfpkreuhwvffkcjw
include/errmsg.h
sp1f-errmsg.h-19700101030959-44ijemeizug43venmrod52pfo6k5sxiz
include/my_global.h
sp1f-my_global.h-20010915021246-4vawdgfw4vg3tuxq6mejt7lrchcnceha
include/my_sys.h
sp1f-my_sys.h-19700101030959-lyllvna5vzqfcjnmlcrutgqocylhtb54
include/mysql_com.h
sp1f-mysql_com.h-19700101030959-a255cet4ojn7jbd4gb4wadueimhj57r7
libmysql/errmsg.c
sp1f-errmsg.c-19700101030959-fjm737sxlztiozvjun2g5h3k5q57qppf
libmysql/libmysql.c
sp1f-libmysql.c-19700101030959-ba4gwsjdmik5puh2qyrfpvoflwer257l
libmysqld/lib_sql.cc
sp1f-lib_sql.cc-20010411110351-gt5febleap73tqvapkesopvqtuht5sf5
mysql-test/r/general_log_file_basic.result
sp1f-general_log_file_bas-20080410131243-3rfmd6i546eaywmtp33l5qcbhx6khrbk
mysql-test/r/grant.result
sp1f-grant.result-20020905131705-2gfwpyej777fcllxzcvadzd6tqdxfho3
mysql-test/r/log_output_basic.result
sp1f-log_output_basic.res-20080410131334-g3c5e3h766gexuddt5iskbur7wsudwea
mysql-test/r/log_state.result
sp1f-log_state.result-20060619133046-ko34v6o7hastqm66z4ertb73xrymffyb
mysql-test/r/ps.result
sp1f-ps.result-20040405154119-efxzt5onloys45nfjak4gt44kr4awkdi
mysql-test/r/ps_1general.result
sp1f-ps_1general.result-20040701142628-mnroykiputkb67hocznz5eijpxjhx4da
mysql-test/r/ps_ddl.result
sp1f-ps_ddl.result-20071215004622-7wxecn5bjzrz7scbog54tuaaobpayisn
mysql-test/r/query_cache_merge.result
sp1f-query_cache_merge.re-20030822010738-2zakbz2cym5ituizcsbijndpnajh4fkl
mysql-test/r/slow_query_log_file_basic.result
sp1f-slow_query_log_file_-20080410131341-zyv2iqqnj5i2suwlla7s4b2ejpjketqw
mysql-test/r/table_definition_cache_basic.result
sp1f-table_definition_cac-20080410131344-tav5ikdz7gxnpghzanztweci4cxmdoih
mysql-test/r/trigger.result
sp1f-trigger.result-20040907122911-6m6f5d2ijohoqspgy53ybn6kavj4zefi
mysql-test/r/variables.result
sp1f-variables.result-20001228015635-w5m2doorn7gzhyyhpqrlqsupnwn6f6xh
mysql-test/t/disabled.def
sp1f-disabled.def-20050315184020-inpdp4hiogithilv62snllppjz2dcing
mysql-test/t/general_log_file_basic.test
sp1f-general_log_file_bas-20080410131352-pozu6g3m7claeita7ejl6yl22alifma2
mysql-test/t/grant.test
sp1f-grant.test-20020905131705-iadu5zcjshnxgtjx7qpmfrs77bl75suy
mysql-test/t/log_output_basic.test
sp1f-log_output_basic.tes-20080410131359-jpsdynofuyx2kr6bnx3db2kdtxfp6bjc
mysql-test/t/log_state.test
sp1f-log_state.test-20060619133047-oxccm3cl6hoogmd3usgmhegs6swnix3p
mysql-test/t/ps.test
sp1f-ps.test-20040405154119-4zqf6po44yypvz5foa2osprg5kb5ok63
mysql-test/t/ps_1general.test
sp1f-ps_1general.test-20040701142629-uercv4waq47fhxqndu7nflbatw6gcmoy
mysql-test/t/ps_ddl.test
sp1f-ps_ddl.test-20071215004622-2fkvss6xi7zvoksbhhmbwak3gs54jnbo
mysql-test/t/query_cache_merge.test
sp1f-query_cache_merge.te-20030822010739-lp5enqy5wop4adawh4eqs4zefcihl7pr
mysql-test/t/slow_query_log_file_basic.test
sp1f-slow_query_log_file_-20080410131407-3tc2odut7lwep6gl3xc5b5qhcakctm7o
mysql-test/t/trigger.test
sp1f-trigger.test-20040907122911-eamsjnplirl554ohkncdnwi765xm2hbk
mysql-test/t/variables.test
sp1f-variables.test-20001228015637-u4toadkin7aellpwwz75e5h5zuutteid
mysys/my_alloc.c
sp1f-my_alloc.c-19700101030959-2elyak7fz3lr6z6agqmrqfm3zhgayb4x
sql/item.cc
sp1f-item.cc-19700101030959-u7hxqopwpfly4kf5ctlyk2dvrq4l3dhn
sql/item.h
sp1f-item.h-19700101030959-rrkb43htudd62batmoteashkebcwykpa
sql/my_decimal.h
sp1f-my_decimal.h-20050208224937-z6shzy3pf5uyso4mvtc2f6pckjzfeg5f
sql/mysql_priv.h
sp1f-mysql_priv.h-19700101030959-4fl65tqpop5zfgxaxkqotu2fa2ree5ci
sql/mysqld.cc
sp1f-mysqld.cc-19700101030959-zpswdvekpvixxzxf7gdtofzel7nywtfj
sql/opt_range.cc
sp1f-opt_range.cc-19700101030959-afe3wtevb7zwrg4xyibt35uamov5r7ds
sql/set_var.cc
sp1f-set_var.cc-20020723153119-nwbpg2pwpz55pfw7yfzaxt7hsszzy7y3
sql/set_var.h
sp1f-set_var.h-20020723153119-2yomygq3s4xjbqvuue3cdlpbjtj3kwmk
sql/share/errmsg.txt
sp1f-errmsg.txt-20041213212820-do5w642w224ja7ctyqhyl6iihdmpkzv5
sql/sp.cc
sp1f-sp.cc-20021212121421-6xwuvxq5bku2b4yv655kp2e5gsvautd5
sql/sp.h
sp1f-sp.h-20021212121421-eh5y7kpcb3hkgy4wjuh3q3non36itye5
sql/sp_head.cc
sp1f-sp_head.cc-20021208185920-jtgc5wvyqdnu2gvcdus3gazrfhxbofxd
sql/sql_acl.cc
sp1f-sql_acl.cc-19700101030959-c4hku3uqxzujthqnndeprbrhamqy6a4i
sql/sql_base.cc
sp1f-sql_base.cc-19700101030959-w7tul2gb2n4jzayjwlslj3ybmf3uhk6a
sql/sql_class.cc
sp1f-sql_class.cc-19700101030959-rpotnweaff2pikkozh3butrf7mv3oero
sql/sql_class.h
sp1f-sql_class.h-19700101030959-jnqnbrjyqsvgncsibnumsmg3lyi7pa5s
sql/sql_cursor.cc
sp1f-sql_cursor.cc-20050921221059-bbaoove6aneee3jlqberlbdxsq7k3qrl
sql/sql_parse.cc
sp1f-sql_parse.cc-19700101030959-ehcre3rwhv5l3mlxqhaxg36ujenxnrcd
sql/sql_prepare.cc
sp1f-sql_prepare.cc-20020612210720-gtqjjiu7vpmfxb5xct2qke7urmqcabli
sql/sql_table.cc
sp1f-sql_table.cc-19700101030959-tzdkvgigezpuaxnldqh3fx2h7h2ggslu
sql/sql_update.cc
sp1f-sql_update.cc-19700101030959-edlgskfuer2ylczbw2znrr5gzfefiyw7
sql/sql_yacc.yy
sp1f-sql_yacc.yy-19700101030959-wvn4qyy2drpmge7kaq3dysprbhlrv27j
sql/table.h
sp1f-table.h-19700101030959-dv72bajftxj5fbdjuajquappanuv2ija
storage/myisam/mi_create.c
sp1f-mi_create.c-19700101030959-i6lazhpsyf7ggr2yjukf6xxybhraxup3
tests/mysql_client_test.c
sp1f-client_test.c-20020614002636-eqy2zzksgelocknwbbogfuwxfwqy7q5x
=== added file 'BUILD/compile-pentium-valgrind-max-no-ndb'
--- a/BUILD/compile-pentium-valgrind-max-no-ndb 1970-01-01 00:00:00 +0000
+++ b/BUILD/compile-pentium-valgrind-max-no-ndb 2008-05-27 15:35:35 +0000
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
+
+. "$path/FINISH.sh"
+
+if test -z "$just_print"
+then
+ set +v +x
+ echo "\
+******************************************************************************
+Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
+--enable-assembler. When Valgrind detects an error involving an assembly
+function (for example an uninitialized value used as an argument of an
+assembly function), Valgrind will not print the stacktrace and 'valgrind
+--gdb-attach=yes' will not work either. If you need a stacktrace in those
+cases, you have to run BUILD/compile-pentium-valgrind-max with the
+--disable-assembler argument.
+******************************************************************************"
+fi
=== modified file 'configure.in'
--- a/configure.in 2008-05-21 10:17:29 +0000
+++ b/configure.in 2008-05-28 15:04:33 +0000
@@ -9,7 +9,11 @@
# remember to also update version.c in ndb
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
+<<<<<<< TREE
AM_INIT_AUTOMAKE(mysql, 6.0.6-alpha)
+=======
+AM_INIT_AUTOMAKE(mysql, 5.1.26-rc)
+>>>>>>> MERGE-SOURCE
AM_CONFIG_HEADER([include/config.h:config.h.in])
NDB_VERSION_MAJOR=6
=== modified file 'include/mysql_com.h'
--- a/include/mysql_com.h 2008-05-21 10:17:29 +0000
+++ b/include/mysql_com.h 2008-05-28 15:04:33 +0000
@@ -207,6 +207,7 @@
#define SERVER_STATUS_LAST_ROW_SENT 128
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
+<<<<<<< TREE
/**
Sent to the client if after a prepared statement reprepare
we discovered that the new statement returns a different
@@ -232,6 +233,27 @@
SERVER_QUERY_NO_INDEX_USED|\
SERVER_MORE_RESULTS_EXISTS|\
SERVER_STATUS_METADATA_CHANGED)
+=======
+/**
+ Sent to the client if after a prepared statement reprepare
+ we discovered that the new statement returns a different
+ number of result set columns.
+*/
+#define SERVER_STATUS_METADATA_CHANGED 1024
+
+/**
+ Server status flags that must be cleared when starting
+ execution of a new SQL statement.
+ Flags from this set are only added to the
+ current server status by the execution engine, but
+ never removed -- the execution engine expects them
+ to disappear automagically by the next command.
+*/
+#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
+ SERVER_QUERY_NO_INDEX_USED|\
+ SERVER_MORE_RESULTS_EXISTS|\
+ SERVER_STATUS_METADATA_CHANGED)
+>>>>>>> MERGE-SOURCE
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc 2008-05-21 10:17:29 +0000
+++ b/libmysqld/lib_sql.cc 2008-05-28 15:04:33 +0000
@@ -285,6 +285,10 @@
my_bool res;
int4store(header, stmt->stmt_id);
+<<<<<<< TREE
+=======
+ header[4]= (uchar) stmt->flags;
+>>>>>>> MERGE-SOURCE
thd= (THD*)stmt->mysql->thd;
thd->client_param_count= stmt->param_count;
thd->client_params= stmt->params;
=== modified file 'mysql-test/r/ps_ddl.result'
--- a/mysql-test/r/ps_ddl.result 2008-05-21 19:44:56 +0000
+++ b/mysql-test/r/ps_ddl.result 2008-05-28 15:04:33 +0000
@@ -1526,667 +1526,1346 @@
drop table t_27690_1;
drop view v_27690_1;
drop table v_27690_2;
-deallocate prepare stmt;
-#=====================================================================
-# TODO: fix the below two bugs and modify their tests
-#
-# Bug#21294 Executing a prepared statement that executes
-# a stored function which was recreat
-#
-create function f1() returns int return 10;
-prepare stmt from "select f1()";
-execute stmt;
-f1()
-10
-drop function f1;
-create function f1() returns int return 10;
-execute stmt;
-ERROR 42000: FUNCTION test.f1 does not exist
-drop function f1;
-create function f1() returns int return 20;
-execute stmt;
-ERROR 42000: FUNCTION test.f1 does not exist
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop function f1;
-deallocate prepare stmt;
-#
-# Bug#12093 SP not found on second PS execution if another thread drops
-# other SP in between
-#
-drop table if exists t_12093;
-drop function if exists f_12093;
-drop function if exists f_12093_unrelated;
-drop procedure if exists p_12093;
-create table t_12093 (a int);
-create function f_12093() returns int return (select count(*) from t_12093);
-create procedure p_12093(a int) select * from t_12093;
-create function f_12093_unrelated() returns int return 2;
-create procedure p_12093_unrelated() begin end;
-prepare stmt_sf from 'select f_12093();';
-prepare stmt_sp from 'call p_12093(f_12093())';
-execute stmt_sf;
-f_12093()
-0
-execute stmt_sp;
-a
-drop function f_12093_unrelated;
-drop procedure p_12093_unrelated;
-# XXX: bug
-execute stmt_sf;
-ERROR 42000: FUNCTION test.f_12093 does not exist
-# XXX: bug
-execute stmt_sp;
-ERROR 42000: PROCEDURE test.p_12093 does not exist
-# XXX: bug
-execute stmt_sf;
-ERROR 42000: FUNCTION test.f_12093 does not exist
-# XXX: bug
-execute stmt_sp;
-ERROR 42000: PROCEDURE test.p_12093 does not exist
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t_12093;
-drop function f_12093;
-drop procedure p_12093;
-deallocate prepare stmt_sf;
-deallocate prepare stmt_sp;
-=====================================================================
-Ensure that metadata validation is performed for every type of
-SQL statement where it is needed.
-=====================================================================
-#
-# SQLCOM_SELECT
-#
-#
-# SQLCOM_CREATE_TABLE
-#
-drop table if exists t1;
-drop table if exists t2;
-create table t1 (a int);
-prepare stmt from 'create table t2 as select * from t1';
-execute stmt;
-drop table t2;
-execute stmt;
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-execute stmt;
-ERROR 42S01: Table 't2' already exists
-call p_verify_reprepare_count(1);
-SUCCESS
-
-execute stmt;
-ERROR 42S01: Table 't2' already exists
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-create temporary table t2 (a int);
-execute stmt;
-ERROR 42S01: Table 't2' already exists
-call p_verify_reprepare_count(1);
-SUCCESS
-
-execute stmt;
-ERROR 42S01: Table 't2' already exists
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop temporary table t2;
-execute stmt;
-call p_verify_reprepare_count(1);
-SUCCESS
-
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-create view t2 as select 1;
-execute stmt;
-Got one of the listed errors
-call p_verify_reprepare_count(1);
-SUCCESS
-
-execute stmt;
-Got one of the listed errors
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop view t2;
-drop table t1;
-create table t1 (x varchar(20));
-execute stmt;
-call p_verify_reprepare_count(1);
-SUCCESS
-
-select * from t2;
-x
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-alter table t1 add column y decimal(10,3);
-execute stmt;
-call p_verify_reprepare_count(1);
-SUCCESS
-
-select * from t2;
-x y
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t1;
-deallocate prepare stmt;
-# XXX: no validation of the first table in case of
-# CREATE TEMPORARY TABLE. This is a shortcoming of the current code,
-# but since validation is not strictly necessary, nothing is done
-# about it.
-# Will be fixed as part of work on Bug#21431 "Incomplete support of
-# temporary tables"
-create table t1 (a int);
-insert into t1 (a) values (1);
-prepare stmt from "create temporary table if not exists t2 as select * from t1";
-execute stmt;
-drop table t2;
-execute stmt;
-execute stmt;
-Warnings:
-Note 1050 Table 't2' already exists
-select * from t2;
-a
-1
-1
-execute stmt;
-Warnings:
-Note 1050 Table 't2' already exists
-select * from t2;
-a
-1
-1
-1
-drop table t2;
-create temporary table t2 (a varchar(10));
-execute stmt;
-Warnings:
-Note 1050 Table 't2' already exists
-select * from t2;
-a
-1
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Warnings:
-Note 1050 Table 't2' already exists
-call p_verify_reprepare_count(1);
-SUCCESS
-
-execute stmt;
-Warnings:
-Note 1050 Table 't2' already exists
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t1;
-drop temporary table t2;
-drop table t2;
-deallocate prepare stmt;
-create table t1 (a int);
-prepare stmt from "create table t2 like t1";
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-drop table t1;
-execute stmt;
-ERROR 42S02: Table 'test.t1' doesn't exist
-call p_verify_reprepare_count(0);
-SUCCESS
-
-execute stmt;
-ERROR 42S02: Table 'test.t1' doesn't exist
-call p_verify_reprepare_count(0);
-SUCCESS
-
-create table t1 (x char(17));
-execute stmt;
-call p_verify_reprepare_count(1);
-SUCCESS
-
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t2;
-alter table t1 add column y time;
-execute stmt;
-call p_verify_reprepare_count(1);
-SUCCESS
-
-select * from t2;
-x y
-drop table t2;
-execute stmt;
-call p_verify_reprepare_count(0);
-SUCCESS
-
-drop table t1;
-drop table t2;
-deallocate prepare stmt;
-#
-# SQLCOM_UPDATE
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "update t2 set a=a+1 where (1) in (select * from t1)";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_INSERT
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "insert into t2 set a=((1) in (select * from t1))";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_INSERT_SELECT
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "insert into t2 select * from t1";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_REPLACE
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "replace t2 set a=((1) in (select * from t1))";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_REPLACE_SELECT
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "replace t2 select * from t1";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_DELETE
-#
-drop table if exists t1, t2;
-create table t1 (a int);
-create table t2 (a int);
-prepare stmt from "delete from t2 where (1) in (select * from t1)";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2;
-deallocate prepare stmt;
-#
-# SQLCOM_DELETE_MULTI
-#
-drop table if exists t1, t2, t3;
-create table t1 (a int);
-create table t2 (a int);
-create table t3 (a int);
-prepare stmt from "delete t2, t3 from t2, t3 where (1) in (select * from t1)";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2, t3;
-deallocate prepare stmt;
-#
-# SQLCOM_UPDATE_MULTI
-#
-drop table if exists t1, t2, t3;
-create table t1 (a int);
-create table t2 (a int);
-create table t3 (a int);
-prepare stmt from "update t2, t3 set t3.a=t2.a, t2.a=null where (1) in (select * from
t1)";
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1, t2, t3;
-deallocate prepare stmt;
-# Intermediate results: 8 SQLCOMs tested, 8 automatic reprepares
-call p_verify_reprepare_count(8);
-SUCCESS
-
-#
-# SQLCOM_LOAD
-#
-drop table if exists t1;
-create table t1 (a varchar(20));
-prepare stmt from "load data infile '../std_data_ln/words.dat' into table t1";
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-drop table t1;
-#
-# SQLCOM_SHOW_DATABASES
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show databases where (1) in (select * from t1)";
-execute stmt;
-Database
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Database
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_TABLES
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show tables where (1) in (select * from t1)";
-execute stmt;
-Tables_in_test
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Tables_in_test
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_FIELDS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show fields from t1 where (1) in (select * from t1)";
-execute stmt;
-Field Type Null Key Default Extra
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Field Type Null Key Default Extra
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_KEYS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show keys from t1 where (1) in (select * from t1)";
-execute stmt;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_VARIABLES
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show variables where (1) in (select * from t1)";
-execute stmt;
-Variable_name Value
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Variable_name Value
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_STATUS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show status where (1) in (select * from t1)";
-execute stmt;
-Variable_name Value
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Variable_name Value
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_LOGS,
-# SQLCOM_SHOW_ENGINE_MUTEX, SQLCOM_SHOW_PROCESSLIST
-#
-# Currently can not have a where clause, need to be covered
-# with tests
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show engine all status where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
-prepare stmt from "show engine all logs where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
-prepare stmt from "show engine all mutex where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
-prepare stmt from "show processlist where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
-drop table t1;
-#
-# SQLCOM_SHOW_CHARSETS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show charset where (1) in (select * from t1)";
-execute stmt;
-Charset Description Default collation Maxlen
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Charset Description Default collation Maxlen
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_COLLATIONS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show collation where (1) in (select * from t1)";
-execute stmt;
-Collation Charset Id Default Compiled Sortlen
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Collation Charset Id Default Compiled Sortlen
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_TABLE_STATUS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show table status where (1) in (select * from t1)";
-execute stmt;
-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
-drop table t1;
-create table t1 (x int);
-execute stmt;
-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
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_TRIGGERS
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show triggers where (1) in (select * from t1)";
-execute stmt;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_OPEN_TABLES
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show open tables where (1) in (select * from t1)";
-execute stmt;
-Database Table In_use Name_locked
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Database Table In_use Name_locked
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_STATUS_PROC
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show procedure status where (1) in (select * from t1)";
-execute stmt;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_STATUS_FUNC
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "show function status where (1) in (select * from t1)";
-execute stmt;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
-drop table t1;
-create table t1 (x int);
-execute stmt;
-Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_SHOW_EVENTS
-#
-#
-# Please see this test in ps.test, it requires not_embedded.inc
-#
-#
-# SQLCOM_SET_OPTION
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "set @a=((1) in (select * from t1))";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_DO
-#
-drop table if exists t1;
-create table t1 (a int);
-prepare stmt from "do ((1) in (select * from t1))";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1;
-deallocate prepare stmt;
-#
-# SQLCOM_CALL
-#
-drop table if exists t1;
-drop procedure if exists p1;
-create procedure p1(a int) begin end;
-create table t1 (a int);
-prepare stmt from "call p1((1) in (select * from t1))";
-execute stmt;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop table t1;
-drop procedure p1;
-deallocate prepare stmt;
-#
-# SQLCOM_CREATE_VIEW
-#
-drop table if exists t1;
-drop view if exists v1;
-create table t1 (a int);
-prepare stmt from "create view v1 as select * from t1";
-execute stmt;
-drop view v1;
-drop table t1;
-create table t1 (x int);
-execute stmt;
-drop view v1;
-drop table t1;
-deallocate prepare stmt;
-# Intermediate result: number of reprepares matches the number
-# of tests
-call p_verify_reprepare_count(17);
-SUCCESS
-
-#
-# SQLCOM_ALTER_VIEW
-#
-drop view if exists v1;
-create view v1 as select 1;
-prepare stmt from "alter view v1 as select 2";
-ERROR HY000: This command is not supported in the prepared statement protocol yet
-drop view v1;
-# Cleanup
-#
-drop temporary table if exists t1, t2, t3;
-drop table if exists t1, t2, t3, v1, v2;
-drop procedure if exists p_verify_reprepare_count;
-drop procedure if exists p1;
-drop function if exists f1;
-drop view if exists v1, v2;
+<<<<<<< TREE
+deallocate prepare stmt;
+#=====================================================================
+# TODO: fix the below two bugs and modify their tests
+#
+# Bug#21294 Executing a prepared statement that executes
+# a stored function which was recreat
+#
+create function f1() returns int return 10;
+prepare stmt from "select f1()";
+execute stmt;
+f1()
+10
+drop function f1;
+create function f1() returns int return 10;
+execute stmt;
+ERROR 42000: FUNCTION test.f1 does not exist
+drop function f1;
+create function f1() returns int return 20;
+execute stmt;
+ERROR 42000: FUNCTION test.f1 does not exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop function f1;
+deallocate prepare stmt;
+#
+# Bug#12093 SP not found on second PS execution if another thread drops
+# other SP in between
+#
+drop table if exists t_12093;
+drop function if exists f_12093;
+drop function if exists f_12093_unrelated;
+drop procedure if exists p_12093;
+create table t_12093 (a int);
+create function f_12093() returns int return (select count(*) from t_12093);
+create procedure p_12093(a int) select * from t_12093;
+create function f_12093_unrelated() returns int return 2;
+create procedure p_12093_unrelated() begin end;
+prepare stmt_sf from 'select f_12093();';
+prepare stmt_sp from 'call p_12093(f_12093())';
+execute stmt_sf;
+f_12093()
+0
+execute stmt_sp;
+a
+drop function f_12093_unrelated;
+drop procedure p_12093_unrelated;
+# XXX: bug
+execute stmt_sf;
+ERROR 42000: FUNCTION test.f_12093 does not exist
+# XXX: bug
+execute stmt_sp;
+ERROR 42000: PROCEDURE test.p_12093 does not exist
+# XXX: bug
+execute stmt_sf;
+ERROR 42000: FUNCTION test.f_12093 does not exist
+# XXX: bug
+execute stmt_sp;
+ERROR 42000: PROCEDURE test.p_12093 does not exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t_12093;
+drop function f_12093;
+drop procedure p_12093;
+deallocate prepare stmt_sf;
+deallocate prepare stmt_sp;
+=====================================================================
+Ensure that metadata validation is performed for every type of
+SQL statement where it is needed.
+=====================================================================
+#
+# SQLCOM_SELECT
+#
+#
+# SQLCOM_CREATE_TABLE
+#
+drop table if exists t1;
+drop table if exists t2;
+create table t1 (a int);
+prepare stmt from 'create table t2 as select * from t1';
+execute stmt;
+drop table t2;
+execute stmt;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+create temporary table t2 (a int);
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop temporary table t2;
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+create view t2 as select 1;
+execute stmt;
+Got one of the listed errors
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+Got one of the listed errors
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop view t2;
+drop table t1;
+create table t1 (x varchar(20));
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+alter table t1 add column y decimal(10,3);
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x y
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+deallocate prepare stmt;
+# XXX: no validation of the first table in case of
+# CREATE TEMPORARY TABLE. This is a shortcoming of the current code,
+# but since validation is not strictly necessary, nothing is done
+# about it.
+# Will be fixed as part of work on Bug#21431 "Incomplete support of
+# temporary tables"
+create table t1 (a int);
+insert into t1 (a) values (1);
+prepare stmt from "create temporary table if not exists t2 as select * from t1";
+execute stmt;
+drop table t2;
+execute stmt;
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+1
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+1
+1
+drop table t2;
+create temporary table t2 (a varchar(10));
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+drop temporary table t2;
+drop table t2;
+deallocate prepare stmt;
+create table t1 (a int);
+prepare stmt from "create table t2 like t1";
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+drop table t1;
+execute stmt;
+ERROR 42S02: Table 'test.t1' doesn't exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+execute stmt;
+ERROR 42S02: Table 'test.t1' doesn't exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+create table t1 (x char(17));
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+alter table t1 add column y time;
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x y
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+drop table t2;
+deallocate prepare stmt;
+#
+# SQLCOM_UPDATE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "update t2 set a=a+1 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_INSERT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_INSERT_SELECT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_REPLACE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_REPLACE_SELECT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_DELETE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "delete from t2 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_DELETE_MULTI
+#
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "delete t2, t3 from t2, t3 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+#
+# SQLCOM_UPDATE_MULTI
+#
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "update t2, t3 set t3.a=t2.a, t2.a=null where (1) in (select * from
t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+# Intermediate results: 8 SQLCOMs tested, 8 automatic reprepares
+call p_verify_reprepare_count(8);
+SUCCESS
+
+#
+# SQLCOM_LOAD
+#
+drop table if exists t1;
+create table t1 (a varchar(20));
+prepare stmt from "load data infile '../std_data_ln/words.dat' into table t1";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop table t1;
+#
+# SQLCOM_SHOW_DATABASES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show databases where (1) in (select * from t1)";
+execute stmt;
+Database
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Database
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show tables where (1) in (select * from t1)";
+execute stmt;
+Tables_in_test
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Tables_in_test
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_FIELDS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show fields from t1 where (1) in (select * from t1)";
+execute stmt;
+Field Type Null Key Default Extra
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Field Type Null Key Default Extra
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_KEYS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show keys from t1 where (1) in (select * from t1)";
+execute stmt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_VARIABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show variables where (1) in (select * from t1)";
+execute stmt;
+Variable_name Value
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Variable_name Value
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show status where (1) in (select * from t1)";
+execute stmt;
+Variable_name Value
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Variable_name Value
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_LOGS,
+# SQLCOM_SHOW_ENGINE_MUTEX, SQLCOM_SHOW_PROCESSLIST
+#
+# Currently can not have a where clause, need to be covered
+# with tests
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show engine all status where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show engine all logs where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show engine all mutex where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show processlist where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+drop table t1;
+#
+# SQLCOM_SHOW_CHARSETS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show charset where (1) in (select * from t1)";
+execute stmt;
+Charset Description Default collation Maxlen
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Charset Description Default collation Maxlen
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_COLLATIONS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show collation where (1) in (select * from t1)";
+execute stmt;
+Collation Charset Id Default Compiled Sortlen
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Collation Charset Id Default Compiled Sortlen
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TABLE_STATUS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show table status where (1) in (select * from t1)";
+execute stmt;
+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
+drop table t1;
+create table t1 (x int);
+execute stmt;
+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
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TRIGGERS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show triggers where (1) in (select * from t1)";
+execute stmt;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_OPEN_TABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show open tables where (1) in (select * from t1)";
+execute stmt;
+Database Table In_use Name_locked
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Database Table In_use Name_locked
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS_PROC
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show procedure status where (1) in (select * from t1)";
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS_FUNC
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show function status where (1) in (select * from t1)";
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_EVENTS
+#
+#
+# Please see this test in ps.test, it requires not_embedded.inc
+#
+#
+# SQLCOM_SET_OPTION
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "set @a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_DO
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "do ((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_CALL
+#
+drop table if exists t1;
+drop procedure if exists p1;
+create procedure p1(a int) begin end;
+create table t1 (a int);
+prepare stmt from "call p1((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+drop procedure p1;
+deallocate prepare stmt;
+#
+# SQLCOM_CREATE_VIEW
+#
+drop table if exists t1;
+drop view if exists v1;
+create table t1 (a int);
+prepare stmt from "create view v1 as select * from t1";
+execute stmt;
+drop view v1;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop view v1;
+drop table t1;
+deallocate prepare stmt;
+# Intermediate result: number of reprepares matches the number
+# of tests
+call p_verify_reprepare_count(17);
+SUCCESS
+
+#
+# SQLCOM_ALTER_VIEW
+#
+drop view if exists v1;
+create view v1 as select 1;
+prepare stmt from "alter view v1 as select 2";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop view v1;
+# Cleanup
+#
+drop temporary table if exists t1, t2, t3;
+drop table if exists t1, t2, t3, v1, v2;
+drop procedure if exists p_verify_reprepare_count;
+drop procedure if exists p1;
+drop function if exists f1;
+drop view if exists v1, v2;
+=======
+deallocate prepare stmt;
+#=====================================================================
+# TODO: fix the below two bugs and modify their tests
+#
+# Bug#21294 Executing a prepared statement that executes
+# a stored function which was recreat
+#
+create function f1() returns int return 10;
+prepare stmt from "select f1()";
+execute stmt;
+f1()
+10
+drop function f1;
+create function f1() returns int return 10;
+execute stmt;
+ERROR 42000: FUNCTION test.f1 does not exist
+drop function f1;
+create function f1() returns int return 20;
+execute stmt;
+ERROR 42000: FUNCTION test.f1 does not exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop function f1;
+deallocate prepare stmt;
+#
+# Bug#12093 SP not found on second PS execution if another thread drops
+# other SP in between
+#
+drop table if exists t_12093;
+drop function if exists f_12093;
+drop function if exists f_12093_unrelated;
+drop procedure if exists p_12093;
+create table t_12093 (a int);
+create function f_12093() returns int return (select count(*) from t_12093);
+create procedure p_12093(a int) select * from t_12093;
+create function f_12093_unrelated() returns int return 2;
+create procedure p_12093_unrelated() begin end;
+prepare stmt_sf from 'select f_12093();';
+prepare stmt_sp from 'call p_12093(f_12093())';
+execute stmt_sf;
+f_12093()
+0
+execute stmt_sp;
+a
+drop function f_12093_unrelated;
+drop procedure p_12093_unrelated;
+# XXX: bug
+execute stmt_sf;
+ERROR 42000: FUNCTION test.f_12093 does not exist
+# XXX: bug
+execute stmt_sp;
+ERROR 42000: PROCEDURE test.p_12093 does not exist
+# XXX: bug
+execute stmt_sf;
+ERROR 42000: FUNCTION test.f_12093 does not exist
+# XXX: bug
+execute stmt_sp;
+ERROR 42000: PROCEDURE test.p_12093 does not exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t_12093;
+drop function f_12093;
+drop procedure p_12093;
+deallocate prepare stmt_sf;
+deallocate prepare stmt_sp;
+=====================================================================
+Ensure that metadata validation is performed for every type of
+SQL statement where it is needed.
+=====================================================================
+#
+# SQLCOM_SELECT
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "select 1 as res from dual where (1) in (select * from t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+res
+drop table t1;
+deallocate prepare stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+#
+# SQLCOM_CREATE_TABLE
+#
+drop table if exists t1;
+drop table if exists t2;
+create table t1 (a int);
+prepare stmt from 'create table t2 as select * from t1';
+execute stmt;
+drop table t2;
+execute stmt;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+create temporary table t2 (a int);
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+ERROR 42S01: Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop temporary table t2;
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+create view t2 as select 1;
+execute stmt;
+Got one of the listed errors
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+Got one of the listed errors
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop view t2;
+drop table t1;
+create table t1 (x varchar(20));
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+alter table t1 add column y decimal(10,3);
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x y
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+deallocate prepare stmt;
+# XXX: no validation of the first table in case of
+# CREATE TEMPORARY TABLE. This is a shortcoming of the current code,
+# but since validation is not strictly necessary, nothing is done
+# about it.
+# Will be fixed as part of work on Bug#21431 "Incomplete support of
+# temporary tables"
+create table t1 (a int);
+insert into t1 (a) values (1);
+prepare stmt from "create temporary table if not exists t2 as select * from t1";
+execute stmt;
+drop table t2;
+execute stmt;
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+1
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+1
+1
+drop table t2;
+create temporary table t2 (a varchar(10));
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+select * from t2;
+a
+1
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+call p_verify_reprepare_count(1);
+SUCCESS
+
+execute stmt;
+Warnings:
+Note 1050 Table 't2' already exists
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+drop temporary table t2;
+drop table t2;
+deallocate prepare stmt;
+create table t1 (a int);
+prepare stmt from "create table t2 like t1";
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+drop table t1;
+execute stmt;
+ERROR 42S02: Table 'test.t1' doesn't exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+execute stmt;
+ERROR 42S02: Table 'test.t1' doesn't exist
+call p_verify_reprepare_count(0);
+SUCCESS
+
+create table t1 (x char(17));
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t2;
+alter table t1 add column y time;
+execute stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
+select * from t2;
+x y
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+SUCCESS
+
+drop table t1;
+drop table t2;
+deallocate prepare stmt;
+#
+# SQLCOM_UPDATE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "update t2 set a=a+1 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_INSERT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_INSERT_SELECT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_REPLACE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_REPLACE_SELECT
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_DELETE
+#
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "delete from t2 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+#
+# SQLCOM_DELETE_MULTI
+#
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "delete t2, t3 from t2, t3 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+#
+# SQLCOM_UPDATE_MULTI
+#
+drop table if exists t1, t2, t3;
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "update t2, t3 set t3.a=t2.a, t2.a=null where (1) in (select * from
t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+# Intermediate results: 8 SQLCOMs tested, 8 automatic reprepares
+call p_verify_reprepare_count(8);
+SUCCESS
+
+#
+# SQLCOM_LOAD
+#
+drop table if exists t1;
+create table t1 (a varchar(20));
+prepare stmt from "load data infile '../std_data_ln/words.dat' into table t1";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop table t1;
+#
+# SQLCOM_SHOW_DATABASES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show databases where (1) in (select * from t1)";
+execute stmt;
+Database
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Database
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show tables where (1) in (select * from t1)";
+execute stmt;
+Tables_in_test
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Tables_in_test
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_FIELDS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show fields from t1 where (1) in (select * from t1)";
+execute stmt;
+Field Type Null Key Default Extra
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Field Type Null Key Default Extra
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_KEYS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show keys from t1 where (1) in (select * from t1)";
+execute stmt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_VARIABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show variables where (1) in (select * from t1)";
+execute stmt;
+Variable_name Value
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Variable_name Value
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show status where (1) in (select * from t1)";
+execute stmt;
+Variable_name Value
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Variable_name Value
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_LOGS,
+# SQLCOM_SHOW_ENGINE_MUTEX, SQLCOM_SHOW_PROCESSLIST
+#
+# Currently can not have a where clause, need to be covered
+# with tests
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show engine all status where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show engine all logs where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show engine all mutex where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+prepare stmt from "show processlist where (1) in (select * from 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 'where (1) in (select * from
t1)' at line 1
+drop table t1;
+#
+# SQLCOM_SHOW_CHARSETS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show charset where (1) in (select * from t1)";
+execute stmt;
+Charset Description Default collation Maxlen
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Charset Description Default collation Maxlen
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_COLLATIONS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show collation where (1) in (select * from t1)";
+execute stmt;
+Collation Charset Id Default Compiled Sortlen
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Collation Charset Id Default Compiled Sortlen
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TABLE_STATUS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show table status where (1) in (select * from t1)";
+execute stmt;
+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
+drop table t1;
+create table t1 (x int);
+execute stmt;
+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
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_TRIGGERS
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show triggers where (1) in (select * from t1)";
+execute stmt;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_OPEN_TABLES
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show open tables where (1) in (select * from t1)";
+execute stmt;
+Database Table In_use Name_locked
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Database Table In_use Name_locked
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS_PROC
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show procedure status where (1) in (select * from t1)";
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_STATUS_FUNC
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "show function status where (1) in (select * from t1)";
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+create table t1 (x int);
+execute stmt;
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database
Collation
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_SHOW_EVENTS
+#
+#
+# Please see this test in ps.test, it requires not_embedded.inc
+#
+#
+# SQLCOM_SET_OPTION
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "set @a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_DO
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "do ((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+#
+# SQLCOM_CALL
+#
+drop table if exists t1;
+drop procedure if exists p1;
+create procedure p1(a int) begin end;
+create table t1 (a int);
+prepare stmt from "call p1((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+drop procedure p1;
+deallocate prepare stmt;
+#
+# SQLCOM_CREATE_VIEW
+#
+drop table if exists t1;
+drop view if exists v1;
+create table t1 (a int);
+prepare stmt from "create view v1 as select * from t1";
+execute stmt;
+drop view v1;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop view v1;
+drop table t1;
+deallocate prepare stmt;
+# Intermediate result: number of reprepares matches the number
+# of tests
+call p_verify_reprepare_count(17);
+SUCCESS
+
+#
+# SQLCOM_ALTER_VIEW
+#
+drop view if exists v1;
+create view v1 as select 1;
+prepare stmt from "alter view v1 as select 2";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+drop view v1;
+# Cleanup
+#
+drop temporary table if exists t1, t2, t3;
+drop table if exists t1, t2, t3, v1, v2;
+drop procedure if exists p_verify_reprepare_count;
+drop procedure if exists p1;
+drop function if exists f1;
+drop view if exists v1, v2;
+>>>>>>> MERGE-SOURCE
=== modified file 'mysql-test/r/status.result'
--- a/mysql-test/r/status.result 2008-05-27 14:51:23 +0000
+++ b/mysql-test/r/status.result 2008-05-28 15:04:33 +0000
@@ -180,6 +180,7 @@
Com_alter_function 0
Com_create_function 1
Com_drop_function 1
+<<<<<<< TREE
DROP VIEW IF EXISTS v1;
CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS
VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
@@ -192,3 +193,5 @@
SELECT * FROM v1 WHERE NAME = 'Threads_running' AND VALUE < @tr;
NAME VALUE
DROP VIEW v1;
+=======
+>>>>>>> MERGE-SOURCE
=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result 2008-05-14 23:24:13 +0000
+++ b/mysql-test/r/variables.result 2008-05-28 15:04:33 +0000
@@ -1012,6 +1012,7 @@
Variable_name Value
table_definition_cache #
table_lock_wait_timeout #
+<<<<<<< TREE
# --
# -- Bug#34820: log_output can be set to illegal value.
@@ -1024,3 +1025,15 @@
ERROR 42000: Variable 'log_output' can't be set to the value of 'NULL'
# -- End of Bug#34820.
+=======
+
+# --
+# -- Bug#34820: log_output can be set to illegal value.
+# --
+SET GLOBAL log_output = '';
+ERROR 42000: Variable 'log_output' can't be set to the value of ''
+SET GLOBAL log_output = 0;
+ERROR 42000: Variable 'log_output' can't be set to the value of '0'
+
+# -- End of Bug#34820.
+>>>>>>> MERGE-SOURCE
=== modified file 'mysql-test/suite/rpl/r/rpl_slave_status.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result 2008-04-16 08:02:48 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result 2008-05-28 15:04:33 +0000
@@ -4,59 +4,44 @@
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+==== Create new replication user ====
+[on master]
grant replication slave on *.* to rpl@stripped identified by 'rpl';
+<<<<<<< TREE
flush privileges;
+=======
+[on slave]
+>>>>>>> MERGE-SOURCE
stop slave;
change master to master_user='rpl',master_password='rpl';
start slave;
-drop table if exists t1;
+==== Do replication as new user ====
+[on master]
create table t1 (n int);
insert into t1 values (1);
+[on slave]
select * from t1;
n
1
-drop user rpl@stripped;
+<<<<<<< TREE
+drop user rpl@stripped;
+=======
+==== Delete new replication user ====
+[on master]
+drop user rpl@stripped;
+>>>>>>> MERGE-SOURCE
flush privileges;
+[on slave]
+==== Restart slave without privileges =====
stop slave;
start slave;
-show slave status;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User rpl
-Master_Port MASTER_MYPORT
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running No
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master NULL
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
+==== Verify that Slave_IO_Running = No ====
+Slave_IO_Running = No (should be No)
+==== Cleanup (Note that slave IO thread is not running) ====
drop table t1;
+<<<<<<< TREE
+=======
+delete from mysql.user where user='rpl';
+[on master]
+>>>>>>> MERGE-SOURCE
drop table t1;
=== modified file 'mysql-test/suite/rpl/t/rpl_slave_status.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test 2008-05-16 16:30:05 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test 2008-05-28 15:04:33 +0000
@@ -1,61 +1,88 @@
+# ==== Purpose ====
+#
+# Verify that a slave without replication privileges has
+# Slave_IO_Running = No
+#
+# ==== Method ====
+#
+# We do the following steps:
+# - Create a new replication user on master
+# - Connect to slave and start replication as this user.
+# - Verify that slave can replicate well, by creating a table and
+# inserting a row into it.
+# - Delete the user from the master.
+# - Stop and start the slave (this should fail).
+# - Check the Slave_IO_Running column of SHOW SLAVE STATUS.
+#
+# ==== Related bugs ====
+#
+# BUG#10780: slave can't connect to master - IO and SQL threads running
+
--source include/master-slave.inc
-############################################################################
-# Test case for BUG#10780
-#
-# REQUIREMENT
-# A slave without replication privileges should have Slave_IO_Running = No
-
-# 1. Create new replication user
+--echo ==== Create new replication user ====
+--echo [on master]
connection master;
grant replication slave on *.* to rpl@stripped identified by 'rpl';
flush privileges;
sync_slave_with_master;
+<<<<<<< TREE
+=======
+--echo [on slave]
+sync_slave_with_master;
+>>>>>>> MERGE-SOURCE
stop slave;
+source include/wait_for_slave_to_stop.inc;
change master to master_user='rpl',master_password='rpl';
start slave;
+source include/wait_for_slave_to_start.inc;
-# 2. Do replication as new user
+--echo ==== Do replication as new user ====
+--echo [on master]
connection master;
---disable_warnings
-drop table if exists t1;
---enable_warnings
create table t1 (n int);
insert into t1 values (1);
-save_master_pos;
-connection slave;
-sync_with_master;
+--echo [on slave]
+sync_slave_with_master;
select * from t1;
+<<<<<<< TREE
# 3. Delete new replication user
# note: drop user will be replicated on slave
+=======
+--echo ==== Delete new replication user ====
+--echo [on master]
+>>>>>>> MERGE-SOURCE
connection master;
drop user rpl@stripped;
flush privileges;
+<<<<<<< TREE
sync_slave_with_master;
# 4. Restart slave without privileges
+=======
+
+--echo [on slave]
+sync_slave_with_master;
+
+--echo ==== Restart slave without privileges =====
+>>>>>>> MERGE-SOURCE
# (slave.err will contain access denied error for this START SLAVE command)
stop slave;
source include/wait_for_slave_to_stop.inc;
start slave;
source include/wait_for_slave_sql_to_start.inc;
-# 5. Make sure Slave_IO_Running = No
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# Column 1 is replaced, since the output can be either
-# "Connecting to master" or "Waiting for master update"
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
-query_vertical show slave status;
+--echo ==== Verify that Slave_IO_Running = No ====
+let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
+--echo Slave_IO_Running = $result (should be No)
-# Cleanup (Note that slave IO thread is not running)
-connection slave;
+--echo ==== Cleanup (Note that slave IO thread is not running) ====
drop table t1;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
+--echo [on master]
connection master;
drop table t1;
-
-# end of 4.1 tests
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2008-05-23 21:39:20 +0000
+++ b/mysql-test/t/disabled.def 2008-05-28 15:04:33 +0000
@@ -13,6 +13,7 @@
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures
with varying differences
##order_by : WL#2475: spetrunia producing ordered streams is not handled
correctly
federated_transactions : Bug#29523 Transactions do not work
+<<<<<<< TREE
subselect2 : BUG#31464 SergeyP will fix
show_check : Bug #32682 Test show_check fails in 6.0
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
@@ -27,6 +28,8 @@
backup_security :BUG#34235 pending replacement of test facility with WL#4259
backup_snapshot :BUG#34235 pending replacement of test facility with WL#4259
backup_no_engine : Bug#36021 2008-04-13 rsomla server crashes when openning table
with unknown storage engine
+=======
+>>>>>>> MERGE-SOURCE
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL
columns in CSV tables
ctype_latin2_ch : BUG #33791 2008-01-18 mats Wrong ORDER BY with latin2_czech_cs
query_cache_wlock_invalidate_func: Bug#35390 causes not deterministic results.
@@ -34,6 +37,7 @@
cast : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
subselect_notembedded : Bug#35803, Bug#33506 2008-Apr-03 subselect_notembedded crashes
the server
user_limits : Bug#23921 random failure of user_limits.test
+<<<<<<< TREE
key_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on
64bit platorms
rpl_recovery_rank_basic_64 : Bug #36522: Some tests of system variables have diffs on
64bit platorms
sort_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on
64bit platorms
@@ -46,3 +50,88 @@
key_buffer_size_basic_32 : Bug#36876 main.key_buffer_size_basic_32 fails on some
systems
max_heap_table_size_basic_32 : Bug#36877 main.max_heap_table_size_basic_32 fails on some
systems
tmp_table_size_basic_32 : Bug#36878 main.tmp_table_size_basic_32 fails on some
systems
+=======
+thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly
+binlog_cache_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+bulk_insert_buffer_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+delayed_insert_limit_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+delayed_queue_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_concurrency_tickets_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_max_purge_lag_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_sync_spin_loops_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+join_buffer_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_buffer_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_age_threshold_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_block_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_division_limit_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+log_warnings_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_binlog_cache_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_connect_errors_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_heap_table_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_seeks_for_key_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_tmp_tables_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_write_lock_count_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+min_examined_row_limit_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+multi_range_count_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_max_sort_file_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_repair_threads_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_sort_buffer_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+net_retry_count_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_limit_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_min_res_unit_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_prealloc_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+range_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+rpl_recovery_rank_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+server_id_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+slave_transaction_retries_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+sort_buffer_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+sync_binlog_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+timestamp_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+tmp_table_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+transaction_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+transaction_prealloc_size_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+wait_timeout_basic_32 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+binlog_cache_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+bulk_insert_buffer_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+delayed_insert_limit_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+delayed_queue_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_concurrency_tickets_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_max_purge_lag_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+innodb_sync_spin_loops_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+join_buffer_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_buffer_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_age_threshold_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_block_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+key_cache_division_limit_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+log_warnings_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_binlog_cache_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_connect_errors_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_heap_table_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_seeks_for_key_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_tmp_tables_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+max_write_lock_count_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+min_examined_row_limit_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+multi_range_count_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_max_sort_file_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_repair_threads_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+myisam_sort_buffer_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+net_retry_count_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_limit_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_min_res_unit_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_cache_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+query_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+range_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+rpl_recovery_rank_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+server_id_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+slave_transaction_retries_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+sort_buffer_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+sync_binlog_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+timestamp_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+tmp_table_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+transaction_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+transaction_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+wait_timeout_basic_64 : Bug #36522: Some tests of system variables have
diffs on 64bit platorms
+>>>>>>> MERGE-SOURCE
=== modified file 'mysql-test/t/ps_ddl.test'
--- a/mysql-test/t/ps_ddl.test 2008-05-21 19:44:56 +0000
+++ b/mysql-test/t/ps_ddl.test 2008-05-28 15:04:33 +0000
@@ -1323,6 +1323,7 @@
drop table t_27690_1;
drop view v_27690_1;
drop table v_27690_2;
+<<<<<<< TREE
deallocate prepare stmt;
--echo #=====================================================================
@@ -2060,3 +2061,742 @@
drop function if exists f1;
drop view if exists v1, v2;
--enable_warnings
+=======
+deallocate prepare stmt;
+
+--echo #=====================================================================
+--echo # TODO: fix the below two bugs and modify their tests
+--echo #
+--echo # Bug#21294 Executing a prepared statement that executes
+--echo # a stored function which was recreat
+--echo #
+
+create function f1() returns int return 10;
+
+prepare stmt from "select f1()";
+execute stmt;
+
+drop function f1;
+create function f1() returns int return 10;
+
+# might pass or fail, implementation dependent
+--error ER_SP_DOES_NOT_EXIST
+execute stmt;
+
+drop function f1;
+create function f1() returns int return 20;
+
+--error ER_SP_DOES_NOT_EXIST
+execute stmt;
+call p_verify_reprepare_count(0);
+
+drop function f1;
+deallocate prepare stmt;
+
+--echo #
+--echo # Bug#12093 SP not found on second PS execution if another thread drops
+--echo # other SP in between
+--echo #
+--disable_warnings
+drop table if exists t_12093;
+drop function if exists f_12093;
+drop function if exists f_12093_unrelated;
+drop procedure if exists p_12093;
+--enable_warnings
+
+create table t_12093 (a int);
+
+create function f_12093() returns int return (select count(*) from t_12093);
+
+create procedure p_12093(a int) select * from t_12093;
+
+create function f_12093_unrelated() returns int return 2;
+create procedure p_12093_unrelated() begin end;
+
+prepare stmt_sf from 'select f_12093();';
+prepare stmt_sp from 'call p_12093(f_12093())';
+
+execute stmt_sf;
+execute stmt_sp;
+
+connect (con1,localhost,root,,);
+connection con1;
+
+drop function f_12093_unrelated;
+drop procedure p_12093_unrelated;
+
+connection default;
+
+--echo # XXX: bug
+--error ER_SP_DOES_NOT_EXIST
+execute stmt_sf;
+--echo # XXX: bug
+--error ER_SP_DOES_NOT_EXIST
+execute stmt_sp;
+
+--echo # XXX: bug
+--error ER_SP_DOES_NOT_EXIST
+execute stmt_sf;
+--echo # XXX: bug
+--error ER_SP_DOES_NOT_EXIST
+execute stmt_sp;
+call p_verify_reprepare_count(0);
+
+disconnect con1;
+
+drop table t_12093;
+drop function f_12093;
+drop procedure p_12093;
+deallocate prepare stmt_sf;
+deallocate prepare stmt_sp;
+
+
+--echo =====================================================================
+--echo Ensure that metadata validation is performed for every type of
+--echo SQL statement where it is needed.
+--echo =====================================================================
+
+--echo #
+--echo # SQLCOM_SELECT
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "select 1 as res from dual where (1) in (select * from t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+call p_verify_reprepare_count(1);
+
+--echo #
+--echo # SQLCOM_CREATE_TABLE
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+drop table if exists t2;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from 'create table t2 as select * from t1';
+execute stmt;
+drop table t2;
+execute stmt;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+# Base table with name of table to be created exists
+--error ER_TABLE_EXISTS_ERROR
+execute stmt;
+call p_verify_reprepare_count(1);
+--error ER_TABLE_EXISTS_ERROR
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+# Temporary table with name of table to be created exists
+create temporary table t2 (a int);
+--error ER_TABLE_EXISTS_ERROR
+execute stmt;
+call p_verify_reprepare_count(1);
+--error ER_TABLE_EXISTS_ERROR
+execute stmt;
+call p_verify_reprepare_count(0);
+drop temporary table t2;
+execute stmt;
+call p_verify_reprepare_count(1);
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+# View with name of table to be created exists
+# Attention:
+# We cannot print the error message because it contains a random filename.
+# Example: 1050: Table '<some_path>/var/tmp/#sql_6979_0' already exists
+# Therefore we mangle it via
+# "--error ER_TABLE_EXISTS_ERROR,9999" (9999 is currently not used)
+# to "Got one of the listed errors".
+create view t2 as select 1;
+--error ER_TABLE_EXISTS_ERROR,9999
+execute stmt;
+call p_verify_reprepare_count(1);
+--error ER_TABLE_EXISTS_ERROR,9999
+execute stmt;
+call p_verify_reprepare_count(0);
+drop view t2;
+drop table t1;
+# Table to be used recreated (drop,create) with different layout
+create table t1 (x varchar(20));
+execute stmt;
+call p_verify_reprepare_count(1);
+select * from t2;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+# Table to be used has a modified (alter table) layout
+alter table t1 add column y decimal(10,3);
+execute stmt;
+call p_verify_reprepare_count(1);
+select * from t2;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t1;
+deallocate prepare stmt;
+--echo # XXX: no validation of the first table in case of
+--echo # CREATE TEMPORARY TABLE. This is a shortcoming of the current code,
+--echo # but since validation is not strictly necessary, nothing is done
+--echo # about it.
+--echo # Will be fixed as part of work on Bug#21431 "Incomplete support of
+--echo # temporary tables"
+create table t1 (a int);
+insert into t1 (a) values (1);
+prepare stmt from "create temporary table if not exists t2 as select * from t1";
+execute stmt;
+drop table t2;
+execute stmt;
+execute stmt;
+select * from t2;
+execute stmt;
+select * from t2;
+drop table t2;
+create temporary table t2 (a varchar(10));
+execute stmt;
+select * from t2;
+call p_verify_reprepare_count(0);
+drop table t1;
+create table t1 (x int);
+execute stmt;
+call p_verify_reprepare_count(1);
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t1;
+drop temporary table t2;
+drop table t2;
+deallocate prepare stmt;
+
+create table t1 (a int);
+prepare stmt from "create table t2 like t1";
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+# Table to be used does not exist
+drop table t1;
+--error ER_NO_SUCH_TABLE
+execute stmt;
+call p_verify_reprepare_count(0);
+--error ER_NO_SUCH_TABLE
+execute stmt;
+call p_verify_reprepare_count(0);
+# Table to be used recreated (drop,create) with different layout
+create table t1 (x char(17));
+execute stmt;
+call p_verify_reprepare_count(1);
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t2;
+# Table to be used has a modified (alter table) layout
+alter table t1 add column y time;
+execute stmt;
+call p_verify_reprepare_count(1);
+select * from t2;
+drop table t2;
+execute stmt;
+call p_verify_reprepare_count(0);
+drop table t1;
+drop table t2;
+deallocate prepare stmt;
+
+
+--echo #
+--echo # SQLCOM_UPDATE
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "update t2 set a=a+1 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_INSERT
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_INSERT_SELECT
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "insert into t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_REPLACE
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 set a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_REPLACE_SELECT
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "replace t2 select * from t1";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_DELETE
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+prepare stmt from "delete from t2 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_DELETE_MULTI
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "delete t2, t3 from t2, t3 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_UPDATE_MULTI
+--echo #
+
+--disable_warnings
+drop table if exists t1, t2, t3;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+create table t3 (a int);
+prepare stmt from "update t2, t3 set t3.a=t2.a, t2.a=null where (1) in (select * from
t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1, t2, t3;
+deallocate prepare stmt;
+--echo # Intermediate results: 8 SQLCOMs tested, 8 automatic reprepares
+call p_verify_reprepare_count(8);
+
+--echo #
+--echo # SQLCOM_LOAD
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a varchar(20));
+--error ER_UNSUPPORTED_PS
+prepare stmt from "load data infile '../std_data_ln/words.dat' into table t1";
+drop table t1;
+
+--echo #
+--echo # SQLCOM_SHOW_DATABASES
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show databases where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_TABLES
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show tables where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_FIELDS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show fields from t1 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_KEYS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show keys from t1 where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_VARIABLES
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show variables where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_STATUS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show status where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_LOGS,
+--echo # SQLCOM_SHOW_ENGINE_MUTEX, SQLCOM_SHOW_PROCESSLIST
+--echo #
+
+--echo # Currently can not have a where clause, need to be covered
+--echo # with tests
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+--error ER_PARSE_ERROR
+prepare stmt from "show engine all status where (1) in (select * from t1)";
+--error ER_PARSE_ERROR
+prepare stmt from "show engine all logs where (1) in (select * from t1)";
+--error ER_PARSE_ERROR
+prepare stmt from "show engine all mutex where (1) in (select * from t1)";
+--error ER_PARSE_ERROR
+prepare stmt from "show processlist where (1) in (select * from t1)";
+drop table t1;
+
+--echo #
+--echo # SQLCOM_SHOW_CHARSETS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show charset where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_COLLATIONS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show collation where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_TABLE_STATUS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show table status where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_TRIGGERS
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show triggers where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_OPEN_TABLES
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show open tables where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_STATUS_PROC
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show procedure status where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_STATUS_FUNC
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "show function status where (1) in (select * from t1)";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_SHOW_EVENTS
+--echo #
+--echo #
+--echo # Please see this test in ps.test, it requires not_embedded.inc
+--echo #
+
+--echo #
+--echo # SQLCOM_SET_OPTION
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "set @a=((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_DO
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "do ((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_CALL
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+drop procedure if exists p1;
+--enable_warnings
+create procedure p1(a int) begin end;
+create table t1 (a int);
+prepare stmt from "call p1((1) in (select * from t1))";
+execute stmt;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+drop procedure p1;
+deallocate prepare stmt;
+
+--echo #
+--echo # SQLCOM_CREATE_VIEW
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+drop view if exists v1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "create view v1 as select * from t1";
+execute stmt;
+drop view v1;
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop view v1;
+drop table t1;
+deallocate prepare stmt;
+--echo # Intermediate result: number of reprepares matches the number
+--echo # of tests
+call p_verify_reprepare_count(17);
+
+--echo #
+--echo # SQLCOM_ALTER_VIEW
+--echo #
+
+--disable_warnings
+drop view if exists v1;
+--enable_warnings
+create view v1 as select 1;
+--error ER_UNSUPPORTED_PS
+prepare stmt from "alter view v1 as select 2";
+drop view v1;
+
+--echo # Cleanup
+--echo #
+--disable_warnings
+drop temporary table if exists t1, t2, t3;
+drop table if exists t1, t2, t3, v1, v2;
+drop procedure if exists p_verify_reprepare_count;
+drop procedure if exists p1;
+drop function if exists f1;
+drop view if exists v1, v2;
+--enable_warnings
+>>>>>>> MERGE-SOURCE
=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test 2008-05-14 20:29:02 +0000
+++ b/mysql-test/t/variables.test 2008-05-28 15:04:33 +0000
@@ -778,6 +778,7 @@
--replace_column 2 #
show global variables where Variable_name='table_definition_cache' or
Variable_name='table_lock_wait_timeout';
+<<<<<<< TREE
###########################################################################
@@ -799,3 +800,22 @@
--echo
--echo # -- End of Bug#34820.
+=======
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#34820: log_output can be set to illegal value.
+--echo # --
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_output = '';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_output = 0;
+
+--echo
+--echo # -- End of Bug#34820.
+
+>>>>>>> MERGE-SOURCE
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2008-05-21 10:17:29 +0000
+++ b/sql/mysqld.cc 2008-05-28 15:04:33 +0000
@@ -2975,8 +2975,13 @@
If a continue handler is found, the error message will be cleared
by the stored procedures code.
*/
+<<<<<<< TREE
if (!thd->is_fatal_error && thd->spcont &&
! (MyFlags & ME_NO_SP_HANDLER) &&
+=======
+ if (thd->spcont &&
+ ! (MyFlags & ME_NO_SP_HANDLER) &&
+>>>>>>> MERGE-SOURCE
thd->spcont->handle_error(error, MYSQL_ERROR::WARN_LEVEL_ERROR, thd))
{
/*
@@ -2986,8 +2991,13 @@
DBUG_VOID_RETURN;
}
+<<<<<<< TREE
if (!thd->is_fatal_error && !thd->no_warnings_for_error &&
!(MyFlags & ME_NO_WARNING_FOR_ERROR))
+=======
+ if (!thd->no_warnings_for_error &&
+ !(MyFlags & ME_NO_WARNING_FOR_ERROR))
+>>>>>>> MERGE-SOURCE
{
/*
Suppress infinite recursion if there a memory allocation error
=== modified file 'sql/share/charsets/README'
--- a/sql/share/charsets/README 2000-08-22 20:08:34 +0000
+++ b/sql/share/charsets/README 2008-05-28 10:03:47 +0000
@@ -1,28 +1,31 @@
-This directory holds configuration files which allow MySQL to work with
+This directory holds configuration files that enable MySQL to work with
different character sets. It contains:
-*.conf
- Each conf file contains four tables which describe character types,
+charset_name.xml
+ Each charset_name.xml file contains information for a simple character
+ set. The information in the file describes character types,
lower- and upper-case equivalencies and sorting orders for the
character values in the set.
-Index
- The Index file lists all of the available charset configurations.
-
- Each charset is paired with a number. The number is stored
- IN THE DATABASE TABLE FILES and must not be changed. Always
- add new character sets to the end of the list, so that the
- numbers of the other character sets will not be changed.
+Index.xml
+ The Index.xml file lists all of the available charset configurations,
+ including collations.
+
+ Each collation must have a unique number. The number is stored
+ IN THE DATABASE TABLE FILES and must not be changed.
+
+ The max-id attribute of the <charsets> element must be set to
+ the largest collation number.
Compiled in or configuration file?
When should a character set be compiled in to MySQL's string library
- (libmystrings), and when should it be placed in a configuration
- file?
+ (libmystrings), and when should it be placed in a charset_name.xml
+ configuration file?
If the character set requires the strcoll functions or is a
multi-byte character set, it MUST be compiled in to the string
library. If it does not require these functions, it should be
- placed in a configuration file.
+ placed in a charset_name.xml configuration file.
If the character set uses any one of the strcoll functions, it
must define all of them. Likewise, if the set uses one of the
@@ -30,11 +33,7 @@
more information on how to add a complex character set to MySQL.
Syntax of configuration files
- The syntax is very simple. Comments start with a '#' character and
- proceed to the end of the line. Words are separated by arbitrary
- amounts of whitespace.
-
- For the character set configuration files, every word must be a
- number in hexadecimal format. The ctype array takes up the first
- 257 words; the to_lower, to_upper and sort_order arrays take up 256
- words each after that.
+ The syntax is very simple. Words in <map> array elements are
+ separated by arbitrary amounts of whitespace. Each word must be a
+ number in hexadecimal format. The ctype array has 257 words; the
+ other arrays (lower, upper, etc.) take up 256 words each after that.
=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt 2008-05-21 10:17:29 +0000
+++ b/sql/share/errmsg.txt 2008-05-28 15:04:33 +0000
@@ -6121,11 +6121,13 @@
eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG
statement."
ER_SLAVE_CORRUPT_EVENT
eng "Corrupted replication event was detected"
+
ER_LOAD_DATA_INVALID_COLUMN
eng "Invalid column reference (%-.64s) in LOAD DATA"
ER_LOG_PURGE_NO_FILE
eng "Being purged log %s was not found"
+<<<<<<< TREE
ER_NEED_REPREPARE
eng "Prepared statement needs to be re-prepared"
ER_WARN_AUTO_CONVERT_LOCK
@@ -6263,3 +6265,8 @@
ER_BACKUP_TS_CHANGE
eng "Tablespace `%-.64s` needed by tables being restored has changed on the
server. The original definition of the required tablespace is '%-.256s' while the same
tablespace is defined on the server as '%-.256s'"
+=======
+
+ER_NEED_REPREPARE
+ eng "Prepared statement needs to be re-prepared"
+>>>>>>> MERGE-SOURCE
=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc 2008-05-21 19:44:56 +0000
+++ b/sql/sql_prepare.cc 2008-05-28 15:04:33 +0000
@@ -1449,6 +1449,7 @@
/**
+<<<<<<< TREE
Validate and prepare for execution CALL statement expressions.
@param stmt prepared statement
@@ -1487,6 +1488,45 @@
/**
+=======
+ Validate and prepare for execution CALL statement expressions.
+
+ @param stmt prepared statement
+ @param tables list of tables used in this query
+ @param value_list list of expressions
+
+ @retval FALSE success
+ @retval TRUE error, error message is set in THD
+*/
+
+static bool mysql_test_call_fields(Prepared_statement *stmt,
+ TABLE_LIST *tables,
+ List<Item> *value_list)
+{
+ DBUG_ENTER("mysql_test_call_fields");
+
+ List_iterator<Item> it(*value_list);
+ THD *thd= stmt->thd;
+ Item *item;
+
+ if (tables && check_table_access(thd, SELECT_ACL, tables, UINT_MAX, FALSE) ||
+ open_normal_and_derived_tables(thd, tables, 0))
+ goto err;
+
+ while ((item= it++))
+ {
+ if (!item->fixed && item->fix_fields(thd, it.ref()) ||
+ item->check_cols(1))
+ goto err;
+ }
+ DBUG_RETURN(FALSE);
+err:
+ DBUG_RETURN(TRUE);
+}
+
+
+/**
+>>>>>>> MERGE-SOURCE
Check internal SELECT of the prepared command.
@param stmt prepared statement
@@ -2508,10 +2548,17 @@
DBUG_VOID_RETURN;
}
+<<<<<<< TREE
DBUG_PRINT("info",("stmt: %p", stmt));
(void) stmt->execute_loop(&expanded_query, FALSE, NULL, NULL);
+=======
+ DBUG_PRINT("info",("stmt: 0x%lx", (long) stmt));
+
+ (void) stmt->execute_loop(&expanded_query, FALSE, NULL, NULL);
+
+>>>>>>> MERGE-SOURCE
DBUG_VOID_RETURN;
}
=== modified file 'strings/CHARSET_INFO.txt'
--- a/strings/CHARSET_INFO.txt 2006-10-12 10:42:05 +0000
+++ b/strings/CHARSET_INFO.txt 2008-05-28 14:18:24 +0000
@@ -3,9 +3,8 @@
============
A structure containing data for charset+collation pair implementation.
-Virtual functions which use this data are collected
-into separate structures MY_CHARSET_HANDLER and
-MY_COLLATION_HANDLER.
+Virtual functions that use this data are collected into separate
+structures, MY_CHARSET_HANDLER and MY_COLLATION_HANDLER.
typedef struct charset_info_st
@@ -56,7 +55,7 @@
parts of the code where we need to find the default collation
using its non-default counterpart for the given character set.
-binary_numner - ID of a charset+collation pair, which consists
+binary_number - ID of a charset+collation pair, which consists
of the same character set and the binary collation of this
character set. Not really used now.
@@ -65,15 +64,15 @@
csname - name of the character set for this charset+collation pair.
name - name of the collation for this charset+collation pair.
- comment - a text comment, dysplayed in "Description" column of
+ comment - a text comment, displayed in "Description" column of
SHOW CHARACTER SET output.
Conversion tables
-----------------
ctype - pointer to array[257] of "type of characters"
- bit mask for each chatacter, e.g. if a
- character is a digit or a letter or a separator, etc.
+ bit mask for each character, e.g., whether a
+ character is a digit, letter, separator, etc.
Monty 2004-10-21:
If you look at the macros, we use ctype[(char)+1].
@@ -87,17 +86,64 @@
to_upper - pointer to array[256] used in UCASE()
sort_order - pointer to array[256] used for strings comparison
+In all Asian charsets these arrays are set up as follows:
+
+- All bytes in the range 0x80..0xFF were marked as letters in the
+ ctype array.
+
+- The to_lower and to_upper arrays map only ASCII letters.
+ UPPER() and LOWER() doesn't really work for multi-byte characters.
+ Most of the characters in Asian character sets are ideograms
+ anyway and they don't have case mapping. However, there are
+ still some characters from European alphabets.
+ For example:
+ _ujis 0x8FAAF2 - LATIN CAPITAL LETTER Y WITH ACUTE
+ _ujis 0x8FABF2 - LATIN SMALL LETTER Y WITH ACUTE
+
+ But they don't map to each other with UPPER and LOWER operations.
+
+- The sort_order array is filled case insensitively for the
+ ASCII range 0x00..0x7F, and in "binary" fashion for the multi-byte
+ range 0x80..0xFF for these collations:
+
+ cp932_japanese_ci,
+ euckr_korean_ci,
+ eucjpms_japanese_ci,
+ gb2312_chinese_ci,
+ sjis_japanese_ci,
+ ujis_japanese_ci.
+
+ So multi-byte characters are sorted just according to their codes.
+
+
+- Two collations are still case insensitive for the ASCII characters,
+ but have special sorting order for multi-byte characters
+ (something more complex than just according to codes):
+
+ big5_chinese_ci
+ gbk_chinese_ci
+
+ So handlers for these collations use only the 0x00..0x7F part
+ of their sort_order arrays, and apply the special functions
+ for multi-byte characters
+
+In Unicode character sets we have full support of UPPER/LOWER mapping,
+for sorting order, and for character type detection.
+"utf8_general_ci" still has the "old-fashioned" arrays
+like to_upper, to_lower, sort_order and ctype, but they are
+not really used (maybe only in some rare legacy functions).
+
Unicode conversion data
-----------------------
-For 8bit character sets:
+For 8-bit character sets:
tab_to_uni : array[256] of charset->Unicode translation
tab_from_uni: a structure for Unicode->charset translation
-Non-8 bit charsets have their own structures per charset
-hidden in correspondent ctype-xxx.c file and don't use
+Non-8-bit charsets have their own structures per charset
+hidden in corresponding ctype-xxx.c file and don't use
tab_to_uni and tab_from_uni tables.
@@ -106,9 +152,9 @@
state_map[]
ident_map[]
- These maps are to quickly identify if a character is
-an identificator part, a digit, a special character,
-or a part of other SQL language lexical item.
+These maps are used to quickly identify whether a character is an
+identifier part, a digit, a special character, or a part of another
+SQL language lexical item.
Probably can be combined with ctype array in the future.
But for some reasons these two arrays are used in the parser,
@@ -116,32 +162,32 @@
code, like fulltext, etc.
-Misc fields
------------
+Miscellaneous fields
+--------------------
- strxfrm_multiply - how many times a sort key (i.e. a string
- which can be passed into memcmp() for comparison)
+ strxfrm_multiply - how many times a sort key (that is, a string
+ that can be passed into memcmp() for comparison)
can be longer than the original string.
Usually it is 1. For some complex
- collations it can be bigger. For example
+ collations it can be bigger. For example,
in latin1_german2_ci, a sort key is up to
- twice longer than the original string.
+ two times longer than the original string.
e.g. Letter 'A' with two dots above is
substituted with 'AE'.
- mbminlen - mininum multibyte sequence length.
- Now always 1 except ucs2. For ucs2
+ mbminlen - minimum multi-byte sequence length.
+ Now always 1 except for ucs2. For ucs2,
it is 2.
- mbmaxlen - maximum multibyte sequence length.
- 1 for 8bit charsets. Can be also 2 or 3.
+ mbmaxlen - maximum multi-byte sequence length.
+ 1 for 8-bit charsets. Can be also 2 or 3.
max_sort_char - for LIKE range
- in case of 8bit character sets - native code
+ in case of 8-bit character sets - native code
of maximum character (max_str pad byte);
in case of UTF8 and UCS2 - Unicode code of the maximum
possible character (usually U+FFFF). This code is
- converted to multibyte representation (usually 0xEFBFBF)
+ converted to multi-byte representation (usually 0xEFBFBF)
and then used as a pad sequence for max_str.
- in case of other multibyte character sets -
+ in case of other multi-byte character sets -
max_str pad byte (usually 0xFF).
MY_CHARSET_HANDLER
@@ -151,10 +197,10 @@
related routines. Defined in m_ctype.h. Have the
following set of functions:
-Multibyte routines
+Multi-byte routines
------------------
-ismbchar() - detects if the given string is a multibyte sequence
-mbcharlen() - returns length of multibyte sequence starting with
+ismbchar() - detects whether the given string is a multi-byte sequence
+mbcharlen() - returns length of multi-byte sequence starting with
the given character
numchars() - returns number of characters in the given string, e.g.
in SQL function CHAR_LENGTH().
@@ -163,29 +209,29 @@
INSERT()
well_formed_length()
- - finds the length of correctly formed multybyte beginning.
+ - finds the length of correctly formed multi-byte beginning.
Used in INSERTs to cut a beginning of the given string
which is
a) "well formed" according to the given character set.
- b) can fit into the given data type
+ b) can fit into the given data type
Terminates the string in the good position, taking in account
- multibyte character boundaries.
+ multi-byte character boundaries.
-lengthsp() - returns the length of the given string without traling spaces.
+lengthsp() - returns the length of the given string without trailing spaces.
Unicode conversion routines
---------------------------
-mb_wc - converts the left multibyte sequence into it Unicode code.
-mc_mb - converts the given Unicode code into multibyte sequence.
+mb_wc - converts the left multi-byte sequence into its Unicode code.
+mc_mb - converts the given Unicode code into multi-byte sequence.
Case and sort conversion
------------------------
-caseup_str - converts the given 0-terminated string into the upper case
-casedn_str - converts the given 0-terminated string into the lower case
-caseup - converts the given string into the lower case using length
-casedn - converts the given string into the lower case using length
+caseup_str - converts the given 0-terminated string to uppercase
+casedn_str - converts the given 0-terminated string to lowercase
+caseup - converts the given string to lowercase using length
+casedn - converts the given string to lowercase using length
Number-to-string conversion routines
------------------------------------
@@ -193,7 +239,7 @@
long10_to_str()
longlong10_to_str()
-The names are pretty self-descripting.
+The names are pretty self-describing.
String padding routines
-----------------------
@@ -201,7 +247,7 @@
with the given length. Used to pad the string, usually
with space character, according to the given charset.
-String-to-numner conversion routines
+String-to-number conversion routines
------------------------------------
strntol()
strntoul()
@@ -209,10 +255,10 @@
strntoull()
strntod()
-These functions are almost for the same thing with their
-STDLIB counterparts, but also:
+These functions are almost the same as their STDLIB counterparts,
+but also:
- accept length instead of 0-terminator
- - and are character set dependant
+ - are character set dependent
Simple scanner routines
-----------------------
@@ -230,8 +276,8 @@
like_range() - creates a LIKE range, for optimizer
wildcmp() - wildcard comparison, for LIKE
strcasecmp() - 0-terminated string comparison
-instr() - finds the first substring appearence in the string
-hash_sort() - calculates hash value taking in account
+instr() - finds the first substring appearance in the string
+hash_sort() - calculates hash value taking into account
the collation rules, e.g. case-insensitivity,
accent sensitivity, etc.
=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c 2008-05-21 10:17:29 +0000
+++ b/tests/mysql_client_test.c 2008-05-28 15:04:33 +0000
@@ -17390,6 +17390,7 @@
DBUG_VOID_RETURN;
}
+<<<<<<< TREE
static void test_wl4166_1()
{
@@ -17643,6 +17644,216 @@
DBUG_VOID_RETURN;
}
+=======
+static void test_wl4166_1()
+{
+ MYSQL_STMT *stmt;
+ int int_data;
+ char str_data[50];
+ char tiny_data;
+ short small_data;
+ longlong big_data;
+ float real_data;
+ double double_data;
+ ulong length[7];
+ my_bool is_null[7];
+ MYSQL_BIND my_bind[7];
+ int rc;
+ int i;
+
+ myheader("test_wl4166_1");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS table_4166");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE table_4166(col1 tinyint NOT NULL, "
+ "col2 varchar(15), col3 int, "
+ "col4 smallint, col5 bigint, "
+ "col6 float, col7 double, "
+ "colX varchar(10) default NULL)");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql,
+ "INSERT INTO table_4166(col1, col2, col3, col4, col5, col6, col7) "
+ "VALUES(?, ?, ?, ?, ?, ?, ?)");
+ check_stmt(stmt);
+
+ verify_param_count(stmt, 7);
+
+ bzero(my_bind, sizeof(my_bind));
+ /* tinyint */
+ my_bind[0].buffer_type= MYSQL_TYPE_TINY;
+ my_bind[0].buffer= (void *)&tiny_data;
+ /* string */
+ my_bind[1].buffer_type= MYSQL_TYPE_STRING;
+ my_bind[1].buffer= (void *)str_data;
+ my_bind[1].buffer_length= 1000; /* Max string length */
+ /* integer */
+ my_bind[2].buffer_type= MYSQL_TYPE_LONG;
+ my_bind[2].buffer= (void *)&int_data;
+ /* short */
+ my_bind[3].buffer_type= MYSQL_TYPE_SHORT;
+ my_bind[3].buffer= (void *)&small_data;
+ /* bigint */
+ my_bind[4].buffer_type= MYSQL_TYPE_LONGLONG;
+ my_bind[4].buffer= (void *)&big_data;
+ /* float */
+ my_bind[5].buffer_type= MYSQL_TYPE_FLOAT;
+ my_bind[5].buffer= (void *)&real_data;
+ /* double */
+ my_bind[6].buffer_type= MYSQL_TYPE_DOUBLE;
+ my_bind[6].buffer= (void *)&double_data;
+
+ for (i= 0; i < (int) array_elements(my_bind); i++)
+ {
+ my_bind[i].length= &length[i];
+ my_bind[i].is_null= &is_null[i];
+ is_null[i]= 0;
+ }
+
+ rc= mysql_stmt_bind_param(stmt, my_bind);
+ check_execute(stmt, rc);
+
+ int_data= 320;
+ small_data= 1867;
+ big_data= 1000;
+ real_data= 2;
+ double_data= 6578.001;
+
+ /* now, execute the prepared statement to insert 10 records.. */
+ for (tiny_data= 0; tiny_data < 10; tiny_data++)
+ {
+ length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data));
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ int_data += 25;
+ small_data += 10;
+ big_data += 100;
+ real_data += 1;
+ double_data += 10.09;
+ }
+
+ /* force a re-prepare with some DDL */
+
+ rc= mysql_query(mysql,
+ "ALTER TABLE table_4166 change colX colX varchar(20) default NULL");
+ myquery(rc);
+
+ /*
+ execute the prepared statement again,
+ without changing the types of parameters already bound.
+ */
+
+ for (tiny_data= 50; tiny_data < 60; tiny_data++)
+ {
+ length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data));
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ int_data += 25;
+ small_data += 10;
+ big_data += 100;
+ real_data += 1;
+ double_data += 10.09;
+ }
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE table_4166");
+ myquery(rc);
+}
+
+
+static void test_wl4166_2()
+{
+ MYSQL_STMT *stmt;
+ int c_int;
+ MYSQL_TIME d_date;
+ MYSQL_BIND bind_out[2];
+ int rc;
+
+ myheader("test_wl4166_2");
+
+ rc= mysql_query(mysql, "drop table if exists t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "create table t1 (c_int int, d_date date)");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "insert into t1 (c_int, d_date) values (42, '1948-05-15')");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql, "select * from t1");
+ check_stmt(stmt);
+
+ bzero(bind_out, sizeof(bind_out));
+ bind_out[0].buffer_type= MYSQL_TYPE_LONG;
+ bind_out[0].buffer= (void*) &c_int;
+
+ bind_out[1].buffer_type= MYSQL_TYPE_DATE;
+ bind_out[1].buffer= (void*) &d_date;
+
+ rc= mysql_stmt_bind_result(stmt, bind_out);
+ check_execute(stmt, rc);
+
+ /* int -> varchar transition */
+
+ rc= mysql_query(mysql,
+ "alter table t1 change column c_int c_int varchar(11)");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+
+ DIE_UNLESS(c_int == 42);
+ DIE_UNLESS(d_date.year == 1948);
+ DIE_UNLESS(d_date.month == 5);
+ DIE_UNLESS(d_date.day == 15);
+
+ rc= mysql_stmt_fetch(stmt);
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ /* varchar to int retrieval with truncation */
+
+ rc= mysql_query(mysql, "update t1 set c_int='abcde'");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute_r(stmt, rc);
+
+ DIE_UNLESS(c_int == 0);
+
+ rc= mysql_stmt_fetch(stmt);
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ /* alter table and increase the number of columns */
+ rc= mysql_query(mysql, "alter table t1 add column d_int int");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute_r(stmt, rc);
+
+ rc= mysql_stmt_reset(stmt);
+ check_execute(stmt, rc);
+
+ /* decrease the number of columns */
+ rc= mysql_query(mysql, "alter table t1 drop d_date, drop d_int");
+ myquery(rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute_r(stmt, rc);
+
+ mysql_stmt_close(stmt);
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+
+}
+
+>>>>>>> MERGE-SOURCE
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -17949,9 +18160,14 @@
{ "test_bug31418", test_bug31418 },
{ "test_bug31669", test_bug31669 },
{ "test_bug28386", test_bug28386 },
+<<<<<<< TREE
{ "test_wl4166_1", test_wl4166_1 },
{ "test_wl4166_2", test_wl4166_2 },
{ "test_bug36004", test_bug36004 },
+=======
+ { "test_wl4166_1", test_wl4166_1 },
+ { "test_wl4166_2", test_wl4166_2 },
+>>>>>>> MERGE-SOURCE
{ 0, 0 }
};
| Thread |
|---|
| • push into mysql-6.0 branch (kgeorge:2659 to 2660) Bug#36826 | Georgi Kodinov | 28 May |