Commit 9368c7bc authored by unknown's avatar unknown

Update mysqltest to latest version

 - ie. backport from 5.1
 - also update testcase error dected by new version


mysql-test/include/show_msg.inc:
  BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc
mysql-test/include/show_msg80.inc:
  BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc
BitKeeper/deleted/.del-rpl_chain_temp_table.test:
  Delete: mysql-test/t/rpl_chain_temp_table.test
BitKeeper/deleted/.del-rpl_chain_temp_table.result:
  Delete: mysql-test/r/rpl_chain_temp_table.result
BitKeeper/deleted/.del-rpl_failsafe.result:
  Delete: mysql-test/r/rpl_failsafe.result
BitKeeper/deleted/.del-rpl_failsafe.test:
  Delete: mysql-test/t/rpl_failsafe.test
BitKeeper/deleted/.del-rpl_heap.test:
  Delete: mysql-test/t/rpl_heap.test
BitKeeper/deleted/.del-rpl_heap.result:
  Delete: mysql-test/r/rpl_heap.result
BitKeeper/deleted/.del-rpl000018.result:
  Delete: mysql-test/r/rpl000018.result
BitKeeper/deleted/.del-rpl000018.test:
  Delete: mysql-test/t/rpl000018.test
client/Makefile.am:
  Link mysqltest with mysys/my_copy.c
client/mysqltest.c:
  Update mysqltest to latest version
mysql-test/include/have_multi_ndb.inc:
  Remove old syntax "@filename" in favor of "--require filename"
mysql-test/include/master-slave.inc:
  Remove old syntax "@filename" in favor of "--require filename"
mysql-test/include/ps_query.inc:
  Remove the comment about no output now when it does.
mysql-test/r/check.result:
  Update output from --send
mysql-test/r/connect.result:
  Update result file for connect test after backport form 5.1
mysql-test/r/flush.result:
  Update output from --send
mysql-test/r/flush_block_commit.result:
  Update output from --send
mysql-test/r/func_misc.result:
  Update output from --send
mysql-test/r/grant2.result:
  Update output from --send
mysql-test/r/handler.result:
  Update output from --send
mysql-test/r/kill.result:
  Update output from --send
mysql-test/r/lock_multi.result:
  Update output from --send
mysql-test/r/mix_innodb_myisam_binlog.result:
  Update output from --send
mysql-test/r/mysqltest.result:
  Update mysqltest.result after backport
mysql-test/r/ps_2myisam.result:
  Update result as the output from query is now printed
mysql-test/r/ps_3innodb.result:
  Update result as the output from query is now printed
mysql-test/r/ps_4heap.result:
  Update result as the output from query is now printed
mysql-test/r/ps_5merge.result:
  Update result as the output from query is now printed
mysql-test/r/ps_6bdb.result:
  Update result as the output from query is now printed
mysql-test/r/ps_7ndb.result:
  Update result as the output from query is now printed
mysql-test/r/rename.result:
  Update output from --send
mysql-test/r/rpl000001.result:
  Update output from --send
mysql-test/r/rpl_error_ignored_table.result:
  Update output from --send
mysql-test/r/rpl_master_pos_wait.result:
  Update output from --send
mysql-test/r/subselect.result:
  Update result file after adding missing ;
mysql-test/r/synchronization.result:
  Update output from --send
mysql-test/r/type_blob.result:
  Update result file after adding missing ;
mysql-test/t/connect.test:
  Backport test from 5.1
mysql-test/t/init_file.test:
  Update test so something is printed
mysql-test/t/mysql_client_test.test:
  Update test so result is sent to file and something is printed
mysql-test/t/mysqltest.test:
  Backport latest mysqltest.test file
mysql-test/t/ps.test:
  Move the --replace_column statement to just before the statetement it should replace
mysql-test/t/ps_1general.test:
  Move the --replace_column statement to just before the statetement it should replace
mysql-test/t/ps_grant.test:
  Remove the $DB, no other test uses it
mysql-test/t/rpl_flush_tables.test:
  Fetch $SERVER_VERSION from the db server
mysql-test/t/rpl_trunc_temp.test:
  Remove the selection of connection master after it's been disconnected already
mysql-test/t/subselect.test:
  Add missing ;
mysql-test/t/type_blob.test:
  Add missing ;
parent 6453d413
...@@ -30,7 +30,9 @@ mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc ...@@ -30,7 +30,9 @@ mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES = mysqladmin.cc mysqladmin_SOURCES = mysqladmin.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c mysqltest_SOURCES= mysqltest.c \
$(top_srcdir)/mysys/my_getsystime.c \
$(top_srcdir)/mysys/my_copy.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
mysqlmanagerc_SOURCES = mysqlmanagerc.c mysqlmanagerc_SOURCES = mysqlmanagerc.c
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -9,8 +9,10 @@ disable_query_log; ...@@ -9,8 +9,10 @@ disable_query_log;
drop table if exists t1, t2; drop table if exists t1, t2;
--enable_warnings --enable_warnings
flush tables; flush tables;
@r/have_ndb.require show variables like "have_ndbcluster"; --require r/have_ndb.require
# @r/server_id.require show variables like "server_id"; show variables like "have_ndbcluster";
#--require r/server_id.require
#show variables like "server_id";
enable_query_log; enable_query_log;
# Check that server2 has NDB support # Check that server2 has NDB support
...@@ -20,8 +22,10 @@ disable_query_log; ...@@ -20,8 +22,10 @@ disable_query_log;
drop table if exists t1, t2; drop table if exists t1, t2;
--enable_warnings --enable_warnings
flush tables; flush tables;
@r/have_ndb.require show variables like "have_ndbcluster"; --require r/have_ndb.require
# @r/server_id1.require show variables like "server_id"; show variables like "have_ndbcluster";
#--require r@r/server_id1.require
#show variables like "server_id";
enable_query_log; enable_query_log;
# Set the default connection to 'server1' # Set the default connection to 'server1'
......
...@@ -8,7 +8,8 @@ connection slave; ...@@ -8,7 +8,8 @@ connection slave;
--disable_warnings --disable_warnings
stop slave; stop slave;
--enable_warnings --enable_warnings
@r/slave-stopped.result show status like 'Slave_running'; --require r/slave-stopped.result
show status like 'Slave_running';
connection master; connection master;
--disable_warnings --disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
...@@ -21,7 +22,8 @@ reset slave; ...@@ -21,7 +22,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings --enable_warnings
start slave; start slave;
@r/slave-running.result show status like 'Slave_running'; --require r/slave-running.result
show status like 'Slave_running';
# Set the default connection to 'master' # Set the default connection to 'master'
connection master; connection master;
...@@ -52,7 +52,6 @@ execute stmt1; ...@@ -52,7 +52,6 @@ execute stmt1;
##### parameter used for keyword like SELECT (must fail) ##### parameter used for keyword like SELECT (must fail)
set @arg00='SELECT' ; set @arg00='SELECT' ;
# mysqltest gives no output for the next statement, Why ??
--error 1064 --error 1064
@arg00 a from t1 where a=1; @arg00 a from t1 where a=1;
--error 1064 --error 1064
......
#### include/show_msg.inc
#
# This file writes the value set in @message into the
# a protocol file as part of executing a test sequence
#
# Usage:
# Add the following to any *.test file:
# :
# let $message= <value>;
# --source include/show_msg.inc
# :
#
# Attention:
# - Please do not write any spaces between $message and the "=", because the
# assignment will not work.
# - Be careful with single quotes. They must be escaped like "''" or "\'".
#
# "include/show_msg80.inc" contains a detailed description and examples.
--disable_query_log
eval SET @utf8_message = CONVERT('$message' using utf8);
select @utf8_message as ""
union
select repeat(CONVERT('-' using utf8),char_length(@utf8_message));
--enable_query_log
#### include/show_msg80.inc
#
# This file writes the value set in @message into the a protocol file as part
# of executing a test sequence with a dash line that is fixed on 80 characters.
#
# This can be used in the case of long messages, multi line messages that
# exceed 80 or if an 80 char line is desired for short messages.
#
# Usage:
# Add the following to any *.test file:
# :
# let $message= <value>;
# --source include/show_msg80.inc
# :
#
# Attention:
# - Please do not write any spaces between $message and the "=", because the
# assignment will not work.
# - Be careful with single quotes within the value. They must be escaped like
# "''" or "\'".
# - Do not keep the value between single quotes.
#
#
# Content of "$message" and protocol output depending on the assignment:
# ----------------------------------------------------------------------
#
# I is assumed, that the value is not kept between double quotes.
#
# <x> first character after "$message=",
# where the content is not (space or tab)
# <y*> first character after beginning of the line,
# where the content is not (space or tab)
# <z> last char before ";"
# | beginning or end of line
#
# script: let $message= <x><whatever0>|
# | <y1><whatever1>|
# |................|
# | <yn><whatevern><z>;
# content: "<x><whatever0><new line><y1><whatever1><new line>
# ....<new line><yn><whatevern><z>"
# protocol output: |<x><whatever0>|
# |<y1><whatever1>|
# |.....|
# |<yn><whatevern><z>|
# |--- 80 dashes ---|
#
# Attention:
# <x> and <y*> set to characters like "-$#" which are also used
# to start comments, options and the names of mysqltest variables
# lead to syntax errors or mangled messages.
#
#
# Examples of messages:
# ---------------------
#
# Variant1 (ease of use):
# Several lines with indentation kept between double quotes
# script: |let $message=
# |" Testcase 3.1 : Ensure that Pi is not an|
# | integer number.|
# | Third line";
# protocol: |" Testcase 3.1 : Ensure that Pi is not an|
# | integer number.|
# | Third line"|
# |------ 80 dashes ----|
#
# Please mention that
# - the '"' preserves the indentation.
# - it is easy to write the script lines to get a fine indentation,
# if the value starts at the beginning of a new line
# - the '"' is printed
# - there are the least or no problems with characters like "-#$"
#
#
# Variant 2 (grep the messages from the protocol is easy):
# Several lines with indentation + auxiliary character (".")
# at the (non tab or space) beginning of every message line
# script: |let $message= . Testcase 3.1 : Ensure that Pi is not an|
# | . integer number.|
# | . Third line;
# protocol: |. Testcase 3.1 : Ensure that Pi is not an|
# |. integer number.|
# |. Third line|
# |------ 80 dashes ----|
# Please mention that
# - the auxiliary character preserves the indentation.
# - it is easy to write the script lines to get a fine indentation
# - the auxiliary character is printed
# - it is recommended to use "." as auxiliary character
# - auxiliary characters like "-'$#" cause problems
#
#
#
# Bad variant1: Several lines with lost indentation
# script: |let $message= Here is message line 1
# | message line 2;
# protocol: |Here is message line 1|
# |message line 2|
# |------ 80 dashes ----|
# Please mention, that the leading spaces of the message lines disappeared.
#
# Bad variant2: Several lines leading to a syntax error, because of "-"
# script: |let $message= - This is a message
# | - with a second and
# | - third line;
# protocol: | - third line;;
# |ERROR 42000: You have an error ... near '- third line'
# + several following errors
#
#
--disable_query_log
eval SET @utf8_message = CONVERT('$message' using utf8);
select @utf8_message as ""
union
select repeat(CONVERT('-' using utf8),80);
--enable_query_log
drop table if exists t1; drop table if exists t1;
create table t1(n int not null, key(n), key(n), key(n), key(n)); create table t1(n int not null, key(n), key(n), key(n), key(n));
check table t1 extended; check table t1 extended;
insert into t1 values (200000); insert into t1 values (200000);
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
......
...@@ -18,6 +18,10 @@ time_zone_transition_type ...@@ -18,6 +18,10 @@ time_zone_transition_type
user user
show tables; show tables;
Tables_in_test Tables_in_test
connect(localhost,root,z,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
connect(localhost,root,z,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling";
show tables; show tables;
...@@ -39,6 +43,14 @@ time_zone_transition_type ...@@ -39,6 +43,14 @@ time_zone_transition_type
user user
show tables; show tables;
Tables_in_test Tables_in_test
connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,,"",MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
update mysql.user set password=old_password("gambling2") where user=_binary"test"; update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges; flush privileges;
set password=""; set password="";
...@@ -64,6 +76,14 @@ time_zone_transition_type ...@@ -64,6 +76,14 @@ time_zone_transition_type
user user
show tables; show tables;
Tables_in_test Tables_in_test
connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
delete from mysql.user where user=_binary"test"; delete from mysql.user where user=_binary"test";
flush privileges; flush privileges;
create table t1 (id integer not null auto_increment primary key); create table t1 (id integer not null auto_increment primary key);
......
...@@ -9,13 +9,13 @@ n ...@@ -9,13 +9,13 @@ n
flush tables with read lock; flush tables with read lock;
drop table t2; drop table t2;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
drop table t2; drop table t2;
unlock tables; unlock tables;
create database mysqltest; create database mysqltest;
create table mysqltest.t1(n int); create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23); insert into mysqltest.t1 values (23);
flush tables with read lock; flush tables with read lock;
drop database mysqltest; drop database mysqltest;
select * from mysqltest.t1; select * from mysqltest.t1;
n n
23 23
......
...@@ -5,7 +5,7 @@ insert into t1 values(1); ...@@ -5,7 +5,7 @@ insert into t1 values(1);
flush tables with read lock; flush tables with read lock;
select * from t1; select * from t1;
a a
commit; commit;
select * from t1; select * from t1;
a a
unlock tables; unlock tables;
...@@ -14,8 +14,8 @@ select * from t1 for update; ...@@ -14,8 +14,8 @@ select * from t1 for update;
a a
1 1
begin; begin;
select * from t1 for update; select * from t1 for update;
flush tables with read lock; flush tables with read lock;
commit; commit;
a a
1 1
......
...@@ -69,7 +69,7 @@ FROM t1 ...@@ -69,7 +69,7 @@ FROM t1
WHERE conn = 'default'; WHERE conn = 'default';
IS_USED_LOCK('bug16501') = connection_id IS_USED_LOCK('bug16501') = connection_id
1 1
SELECT GET_LOCK('bug16501',600); SELECT GET_LOCK('bug16501',600);
SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID(); SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
IS_USED_LOCK('bug16501') = CONNECTION_ID() IS_USED_LOCK('bug16501') = CONNECTION_ID()
1 1
......
...@@ -123,12 +123,12 @@ drop database mysqltest_1; ...@@ -123,12 +123,12 @@ drop database mysqltest_1;
set password = password("changed"); set password = password("changed");
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql' ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
lock table mysql.user write; lock table mysql.user write;
flush privileges; flush privileges;
grant all on *.* to 'mysqltest_1'@'localhost'; grant all on *.* to 'mysqltest_1'@'localhost';
unlock tables; unlock tables;
lock table mysql.user write; lock table mysql.user write;
set password for 'mysqltest_1'@'localhost' = password(''); set password for 'mysqltest_1'@'localhost' = password('');
revoke all on *.* from 'mysqltest_1'@'localhost'; revoke all on *.* from 'mysqltest_1'@'localhost';
unlock tables; unlock tables;
drop user 'mysqltest_1'@'localhost'; drop user 'mysqltest_1'@'localhost';
insert into mysql.user (user, host) values insert into mysql.user (user, host) values
......
...@@ -452,7 +452,7 @@ handler t1 read first; ...@@ -452,7 +452,7 @@ handler t1 read first;
c1 c1
1 1
send the below to another connection, do not wait for the result send the below to another connection, do not wait for the result
optimize table t1; optimize table t1;
proceed with the normal connection proceed with the normal connection
handler t1 read next; handler t1 read next;
c1 c1
......
...@@ -24,7 +24,7 @@ create table t2 (id int unsigned not null); ...@@ -24,7 +24,7 @@ create table t2 (id int unsigned not null);
insert into t2 select id from t1; insert into t2 select id from t1;
create table t3 (kill_id int); create table t3 (kill_id int);
insert into t3 values(connection_id()); insert into t3 values(connection_id());
select id from t1 where id in (select distinct id from t2); select id from t1 where id in (select distinct id from t2);
select ((@id := kill_id) - kill_id) from t3; select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id) ((@id := kill_id) - kill_id)
0 0
......
...@@ -2,8 +2,8 @@ drop table if exists t1,t2; ...@@ -2,8 +2,8 @@ drop table if exists t1,t2;
create table t1(n int); create table t1(n int);
insert into t1 values (1); insert into t1 values (1);
lock tables t1 write; lock tables t1 write;
update low_priority t1 set n = 4; update low_priority t1 set n = 4;
select n from t1; select n from t1;
unlock tables; unlock tables;
n n
4 4
...@@ -11,8 +11,8 @@ drop table t1; ...@@ -11,8 +11,8 @@ drop table t1;
create table t1(n int); create table t1(n int);
insert into t1 values (1); insert into t1 values (1);
lock tables t1 read; lock tables t1 read;
update low_priority t1 set n = 4; update low_priority t1 set n = 4;
select n from t1; select n from t1;
unlock tables; unlock tables;
n n
1 1
...@@ -23,7 +23,7 @@ insert into t1 values(1,1); ...@@ -23,7 +23,7 @@ insert into t1 values(1,1);
insert into t1 values(2,2); insert into t1 values(2,2);
insert into t2 values(1,2); insert into t2 values(1,2);
lock table t1 read; lock table t1 read;
update t1,t2 set c=a where b=d; update t1,t2 set c=a where b=d;
select c from t2; select c from t2;
c c
2 2
...@@ -32,7 +32,7 @@ drop table t2; ...@@ -32,7 +32,7 @@ drop table t2;
create table t1 (a int); create table t1 (a int);
create table t2 (a int); create table t2 (a int);
lock table t1 write, t2 write; lock table t1 write, t2 write;
insert t1 select * from t2; insert t1 select * from t2;
drop table t2; drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1; drop table t1;
...@@ -193,7 +193,7 @@ select (@before:=unix_timestamp())*0; ...@@ -193,7 +193,7 @@ select (@before:=unix_timestamp())*0;
(@before:=unix_timestamp())*0 (@before:=unix_timestamp())*0
0 0
begin; begin;
select * from t1 for update; select * from t1 for update;
insert into t2 values (20); insert into t2 values (20);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select (@after:=unix_timestamp())*0; select (@after:=unix_timestamp())*0;
......
...@@ -16,7 +16,7 @@ otto ...@@ -16,7 +16,7 @@ otto
mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22... mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22...
select friedrich from (select 1 as otto) as t1; select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list' ERROR 42S22: Unknown column 'friedrich' in 'field list'
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000... mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22: 'Unknown column 'friedrich' in 'field list'', instead of 00000...
select otto from (select 1 as otto) as t1; select otto from (select 1 as otto) as t1;
otto otto
1 1
...@@ -133,8 +133,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist ...@@ -133,8 +133,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_!errno_masked_error" ; select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error after_!errno_masked_error
1146 1146
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000... mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1000...
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000...
garbage ; garbage ;
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 'garbage' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 1064 as "after_--enable_abort_on_error" ; select 1064 as "after_--enable_abort_on_error" ;
...@@ -142,8 +141,7 @@ after_--enable_abort_on_error ...@@ -142,8 +141,7 @@ after_--enable_abort_on_error
1064 1064
select 3 from t1 ; select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Table 'test.t1' doesn't exist
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1064... mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1064...
mysqltest: At line 1: query 'select 3 from t1' failed: 1146: Table 'test.t1' doesn't exist
hello hello
hello hello
;;;;;;;; ;;;;;;;;
...@@ -151,7 +149,24 @@ hello ...@@ -151,7 +149,24 @@ hello
mysqltest: At line 1: End of line junk detected: "6" mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: End of line junk detected: "6" mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: Missing delimiter mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: End of line junk detected: "sleep 7
# Another comment
"
mysqltest: At line 1: Extra delimiter ";" found mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
mysqltest: At line 1: The error name definition must start with an uppercase E
mysqltest: At line 1: Invalid argument to error: '9eeeee' - the errno may only consist of digits[0-9]
mysqltest: At line 1: Invalid argument to error: '1sssss' - the errno may only consist of digits[0-9]
mysqltest: At line 1: The sqlstate must be exactly 5 chars long
mysqltest: At line 1: The sqlstate may only consist of digits[0-9] and _uppercase_ letters
mysqltest: At line 1: The sqlstate must be exactly 5 chars long
mysqltest: At line 1: Not available in mysqltest for MySQL 4.1.22
mysqltest: At line 1: Invalid argument to error: '999e9' - the errno may only consist of digits[0-9]
mysqltest: At line 1: Invalid argument to error: '9b' - the errno may only consist of digits[0-9]
mysqltest: At line 1: Too many errorcodes specified
MySQL MySQL
"MySQL" "MySQL"
MySQL: The world''s most popular open source database MySQL: The world''s most popular open source database
...@@ -166,8 +181,8 @@ source database ...@@ -166,8 +181,8 @@ source database
- most popular open - most popular open
- source database - source database
- MySQL: The world''s - MySQL: The world''s
-- most popular open -- most popular
-- source database -- open source database
# MySQL: The # MySQL: The
--world''s --world''s
# most popular # most popular
...@@ -193,14 +208,20 @@ source database ...@@ -193,14 +208,20 @@ source database
# source database # source database
-- MySQL: The -- MySQL: The
-- world''s most -- world''s most
-- popular open -- popular
-- source database -- open source database
# MySQL: The # MySQL: The
- world''s most - world''s most
-- popular open -- popular open
# source database # source database
'$message' '# MySQL: The
"$message" - world''s most
-- popular open
# source database'
"# MySQL: The
- world''s most
-- popular open
# source database"
hej hej
hej hej
hej hej
...@@ -209,21 +230,32 @@ hej ...@@ -209,21 +230,32 @@ hej
a long variable content a long variable content
a long variable content a long variable content
a long $where variable content a long a long variable content variable content
a long \$where variable content
banana = banana
Not a banana: ba\$cat\$cat
mysqltest: At line 1: Missing arguments to let mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Variable name in hi=hi does not start with '$'
mysqltest: At line 1: Missing assignment operator in let mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing assignment operator in let mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing arguments to let mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Missing variable name in let mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Variable name in =hi does not start with '$'
mysqltest: At line 1: Missing assignment operator in let mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing file name in source # Execute: --echo # <whatever> success: $success
# <whatever> success: 1
# Execute: echo # <whatever> success: $success ;
# <whatever> success: 1
# The next two variants work fine and expand the content of $success
# Execute: --echo $success
1
# Execute: echo $success ;
1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: At line 1: Could not open file ./non_existingFile
mysqltest: In included file "./var/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "./var/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1 mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1
2 = outer loop variable after while 2 = outer loop variable after while
here is the sourced script here is the sourced script
...@@ -288,8 +320,8 @@ mysqltest: At line 1: Invalid argument to real_sleep "abc" ...@@ -288,8 +320,8 @@ mysqltest: At line 1: Invalid argument to real_sleep "abc"
101 101
hej hej
1 1
mysqltest: At line 1: Missing arguments to inc mysqltest: At line 1: Missing argument to inc
mysqltest: At line 1: First argument to inc must be a variable (start with $) mysqltest: At line 1: The argument to inc must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
4 4
4 4
...@@ -298,27 +330,31 @@ mysqltest: At line 1: End of line junk detected: "1000" ...@@ -298,27 +330,31 @@ mysqltest: At line 1: End of line junk detected: "1000"
99 99
hej hej
-1 -1
mysqltest: At line 1: Missing arguments to dec mysqltest: At line 1: Missing argument to dec
mysqltest: At line 1: First argument to dec must be a variable (start with $) mysqltest: At line 1: The argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: system command 'false' failed mysqltest: At line 1: system command 'false' failed
system command 'NonExistsinfComamdn 2> /dev/null' failed
test test
test2 test2
test3 test3
test4 test4
Counter is greater than 0, (counter=10)
Counter is not 0, (counter=0)
1 1
mysqltest: In included file "./include/mysqltest_while.inc": At line 64: Nesting too deeply Testing while with not
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while mysqltest: At line 1: missing ')' in while
mysqltest: At line 1: Missing '{' after while. Found "dec $i" mysqltest: At line 1: Missing '{' after while. Found "dec $i"
mysqltest: At line 1: Stray '}' - end of block before beginning mysqltest: At line 1: Stray '}' - end of block before beginning
mysqltest: At line 1: Stray 'end' command - end of block before beginning mysqltest: At line 1: Stray 'end' command - end of block before beginning
mysqltest: At line 1: query '' failed: 1065: Query was empty mysqltest: At line 1: query '{' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{' at line 1
mysqltest: At line 1: Missing '{' after while. Found "echo hej" mysqltest: At line 1: Missing '{' after while. Found "echo hej"
mysqltest: At line 3: Missing end of block mysqltest: At line 3: Missing end of block
mysqltest: At line 1: Missing newline between while and '{' mysqltest: At line 3: Missing end of block
mysqltest: At line 1: missing '(' in if mysqltest: At line 1: missing '(' in if
mysqltest: At line 1: Stray 'end' command - end of block before beginning mysqltest: At line 1: Stray 'end' command - end of block before beginning
select "b" bs col1, "c" bs col2; select "b" bs col1, "c" bs col2;
...@@ -331,6 +367,7 @@ mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_re ...@@ -331,6 +367,7 @@ mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_re
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a;' mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a;'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a' mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a ' mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a '
OK
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c' mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c ' mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c '
select "a" as col1, "c" as col2; select "a" as col1, "c" as col2;
...@@ -347,6 +384,18 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 ...@@ -347,6 +384,18 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1
mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a" mysqltest: At line 1: Invalid integer argument "a"
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
mysqltest: At line 1: Missing required argument 'host' to command 'connect'
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
OK
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 7: Connection limit exhausted, you can have max 128 connections
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
...@@ -358,3 +407,98 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp ...@@ -358,3 +407,98 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT 1 as a; SELECT 1 as a;
a a
1 1
select 1 as `a'b`, 2 as `a"b`;
a'b a"b
1 2
select 'aaa\\','aa''a',"aa""a";
aaa\ aa'a aa"a
aaa\ aa'a aa"a
Here comes a message
--------------------
root@localhost
--------------
"Here comes a very very long message that
- is longer then 80 characters and
- consists of several lines"
--------------------------------------------------------------------------------
. Here comes a very very long message that
. - is longer then 80 characters and
. - consists of several lines
--------------------------------------------------------------------------------
this will be executed
this will be executed
mysqltest: Result length mismatch
mysqltest: The test didn't produce any output
Failing multi statement query
mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1
drop table t1;
mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1
drop table t1;
Multi statement using expected error
create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz error query||||
select-me
select-me
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 'insertz error query' at line 1
drop table t1;
drop table t1;
sleep;
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 'sleep' at line 1
sleep;
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 'sleep' at line 1
;
ERROR 42000: Query was empty
select "b" as col1, "c" as col2;
col1 col2
b c
select "b" as col1, "b" as col2, "c" as col3;
col1 col2 col3
b b c
seled "b" bs col1, "d" bs col2;
col1 col2
b d
select "raspberry and strawberry","blackberry","tomato";
raspberry and strawberry blackberry tomato
raspberry and strawberry blackberry tomato
mysqltest: At line 1: Error parsing replace_regex "a"
mysqltest: At line 1: Error parsing replace_regex "a;"
mysqltest: At line 1: Error parsing replace_regex "a"
mysqltest: At line 1: Error parsing replace_regex "a "
mysqltest: At line 1: Error parsing replace_regex "a b"
mysqltest: At line 1: Error parsing replace_regex "/a b c"
mysqltest: At line 1: Error parsing replace_regex "/a /b c "
create table t1 (a int, b int);
insert into t1 values (1,3);
insert into t1 values (2,4);
select * from t1;
a D
1 1
1 4
drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
mysqltest: At line 1: End of line junk detected: "write_file filename ";
"
mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
hello
hello
hello
mysqltest: At line 1: Max delimiter length(16) exceeded
hello
hello
End of tests
...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -86,6 +86,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -86,6 +86,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -128,6 +128,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -128,6 +128,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
...@@ -3142,6 +3144,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -3142,6 +3144,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c ...@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday 9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
set @arg00='SELECT' ; set @arg00='SELECT' ;
@arg00 a from t1 where a=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a from t1 where a=1' at line 1
prepare stmt1 from ' ? a from t1 where a=1 '; prepare stmt1 from ' ? a from t1 where a=1 ';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1
set @arg00=1 ; set @arg00=1 ;
......
...@@ -43,7 +43,7 @@ Note 1051 Unknown table 't4' ...@@ -43,7 +43,7 @@ Note 1051 Unknown table 't4'
CREATE TABLE t1 (a int); CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int); CREATE TABLE t3 (a int);
FLUSH TABLES WITH READ LOCK; FLUSH TABLES WITH READ LOCK;
RENAME TABLE t1 TO t2, t3 to t4; RENAME TABLE t1 TO t2, t3 to t4;
show tables; show tables;
Tables_in_test Tables_in_test
t1 t1
......
...@@ -59,7 +59,7 @@ create table t2(id int); ...@@ -59,7 +59,7 @@ create table t2(id int);
insert into t2 values(connection_id()); insert into t2 values(connection_id());
create temporary table t3(n int); create temporary table t3(n int);
insert into t3 select get_lock('crash_lock%20C', 1) from t2; insert into t3 select get_lock('crash_lock%20C', 1) from t2;
update t1 set n = n + get_lock('crash_lock%20C', 2); update t1 set n = n + get_lock('crash_lock%20C', 2);
select (@id := id) - id from t2; select (@id := id) - id from t2;
(@id := id) - id (@id := id) - id
0 0
......
reset master;
reset slave;
start slave;
show binary logs;
Log_name
master-bin.000001
master-bin.000002
drop table if exists t1;
create table t1(n int);
insert into t1 values (3351);
select * from t1;
n
3351
drop table t1;
slave stop;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
reset master;
change master to master_host='127.0.0.1',master_port=9307, master_user='root';
start slave;
create temporary table t1 (a int);
create temporary table t1 (a int);
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 2
create temporary table t1 (a int);
create temporary table t1 (a int);
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 4
stop slave;
insert into t1 values(1);
create table t2 as select * from t1;
start slave;
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 4
select * from t2;
a
1
drop table t2;
...@@ -20,7 +20,7 @@ create table t2 (a int primary key); ...@@ -20,7 +20,7 @@ create table t2 (a int primary key);
insert into t2 values(1); insert into t2 values(1);
create table t3 (id int); create table t3 (id int);
insert into t3 values(connection_id()); insert into t3 values(connection_id());
update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
select (@id := id) - id from t3; select (@id := id) - id from t3;
(@id := id) - id (@id := id) - id
0 0
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 1
show status like 'Rpl_status';
Variable_name Value
Rpl_status AUTH_MASTER
create table t1(n int);
drop table t1;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 2
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 3
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 4
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
reset master;
drop table if exists t1;
create table t1 type=HEAP select 10 as a;
insert into t1 values(11);
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use `test`; create table t1 type=HEAP select 10 as a
master-bin.001 154 Query 1 154 use `test`; insert into t1 values(11)
reset slave;
start slave;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(2) NOT NULL default '0'
) TYPE=HEAP
select * from t1;
a
10
11
select * from t1;
a
select * from t1 limit 10;
a
show binlog events in 'master-bin.002' from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.002 79 Query 1 79 use `test`; DELETE FROM `test`.`t1`
select * from t1;
a
drop table t1;
...@@ -12,7 +12,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -12,7 +12,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings: Warnings:
Note 1003 select sql_no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)` Note 1003 select sql_no_cache master_pos_wait(_latin1'master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
select master_pos_wait('master-bin.999999',0); select master_pos_wait('master-bin.999999',0);
stop slave sql_thread; stop slave sql_thread;
master_pos_wait('master-bin.999999',0) master_pos_wait('master-bin.999999',0)
NULL NULL
...@@ -2697,8 +2697,7 @@ select (1,2,3) = (select * from t1); ...@@ -2697,8 +2697,7 @@ select (1,2,3) = (select * from t1);
ERROR 21000: Operand should contain 3 column(s) ERROR 21000: Operand should contain 3 column(s)
select (select * from t1) = (1,2,3); select (select * from t1) = (1,2,3);
ERROR 21000: Operand should contain 2 column(s) ERROR 21000: Operand should contain 2 column(s)
drop table t1 drop table t1;
#;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`itemid` bigint(20) unsigned NOT NULL auto_increment, `itemid` bigint(20) unsigned NOT NULL auto_increment,
`sessionid` bigint(20) unsigned default NULL, `sessionid` bigint(20) unsigned default NULL,
......
CREATE TABLE t1 (x1 int); CREATE TABLE t1 (x1 int);
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -7,7 +7,7 @@ t2 CREATE TABLE `t2` ( ...@@ -7,7 +7,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -15,7 +15,7 @@ t2 CREATE TABLE `t2` ( ...@@ -15,7 +15,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -23,7 +23,7 @@ t2 CREATE TABLE `t2` ( ...@@ -23,7 +23,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -31,7 +31,7 @@ t2 CREATE TABLE `t2` ( ...@@ -31,7 +31,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -39,7 +39,7 @@ t2 CREATE TABLE `t2` ( ...@@ -39,7 +39,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -47,7 +47,7 @@ t2 CREATE TABLE `t2` ( ...@@ -47,7 +47,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -55,7 +55,7 @@ t2 CREATE TABLE `t2` ( ...@@ -55,7 +55,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -63,7 +63,7 @@ t2 CREATE TABLE `t2` ( ...@@ -63,7 +63,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -71,7 +71,7 @@ t2 CREATE TABLE `t2` ( ...@@ -71,7 +71,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -79,7 +79,7 @@ t2 CREATE TABLE `t2` ( ...@@ -79,7 +79,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -87,7 +87,7 @@ t2 CREATE TABLE `t2` ( ...@@ -87,7 +87,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -95,7 +95,7 @@ t2 CREATE TABLE `t2` ( ...@@ -95,7 +95,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -103,7 +103,7 @@ t2 CREATE TABLE `t2` ( ...@@ -103,7 +103,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -111,7 +111,7 @@ t2 CREATE TABLE `t2` ( ...@@ -111,7 +111,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -119,7 +119,7 @@ t2 CREATE TABLE `t2` ( ...@@ -119,7 +119,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -127,7 +127,7 @@ t2 CREATE TABLE `t2` ( ...@@ -127,7 +127,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -135,7 +135,7 @@ t2 CREATE TABLE `t2` ( ...@@ -135,7 +135,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -143,7 +143,7 @@ t2 CREATE TABLE `t2` ( ...@@ -143,7 +143,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -151,7 +151,7 @@ t2 CREATE TABLE `t2` ( ...@@ -151,7 +151,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) default NULL `xx` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 int;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
......
...@@ -24,8 +24,7 @@ t3 CREATE TABLE `t3` ( ...@@ -24,8 +24,7 @@ t3 CREATE TABLE `t3` (
`a` mediumtext, `a` mediumtext,
`b` mediumblob `b` mediumblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2,t3 drop table t1,t2,t3;
#;
CREATE TABLE t1 (a char(257) default "hello"); CREATE TABLE t1 (a char(257) default "hello");
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead
CREATE TABLE t2 (a blob default "hello"); CREATE TABLE t2 (a blob default "hello");
......
# This test is to check various cases of connections # This test is to check various cases of connections
# with right and wrong password, with and without database # with right and wrong password, with and without database
# Unfortunately the check is incomplete as we can't handle errors on connect # Unfortunately the check is incomplete as we can't connect without database
# Also we can't connect without database
# This test makes no sense with the embedded server # This test makes no sense with the embedded server
--source include/not_embedded.inc --source include/not_embedded.inc
...@@ -10,69 +9,73 @@ ...@@ -10,69 +9,73 @@
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings --enable_warnings
#connect (con1,localhost,root,,""); #connect (con1,localhost,root,,"");
#show tables; #show tables;
connect (con1,localhost,root,,mysql); connect (con1,localhost,root,,mysql);
show tables; show tables;
connect (con1,localhost,root,,test); connect (con2,localhost,root,,test);
show tables; show tables;
# Re enable this one day if error handling on connect will take place --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
#connect (con1,localhost,root,z,test2); connect (fail_con,localhost,root,z,test2);
#--error 1045 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
#connect (con1,localhost,root,z,); --error 1045
#--error 1045 connect (fail_con,localhost,root,z,);
grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling";
# Now check this user with different databases # Now check this user with different databases
#connect (con1,localhost,test,gambling,""); #connect (con1,localhost,test,gambling,"");
#show tables; #show tables;
connect (con1,localhost,test,gambling,mysql); connect (con3,localhost,test,gambling,mysql);
show tables; show tables;
connect (con1,localhost,test,gambling,test); connect (con4,localhost,test,gambling,test);
show tables; show tables;
# Re enable this one day if error handling on connect will take place --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
#connect (con1,localhost,test,,test2); connect (fail_con,localhost,test,,test2);
#--error 1045 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
#connect (con1,localhost,test,,""); --error 1045
#--error 1045 connect (fail_con,localhost,test,,"");
#connect (con1,localhost,test,zorro,test2); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
#--error 1045 --error 1045
#connect (con1,localhost,test,zorro,); connect (fail_con,localhost,test,zorro,test2);
#--error 1045 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
connect (fail_con,localhost,test,zorro,);
# check if old password version also works # check if old password version also works
update mysql.user set password=old_password("gambling2") where user=_binary"test"; update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges; flush privileges;
#connect (con1,localhost,test,gambling2,""); connect (con10,localhost,test,gambling2,);
#show tables; connect (con5,localhost,test,gambling2,mysql);
connect (con1,localhost,test,gambling2,mysql); connection con5;
set password=""; set password="";
--error 1105 --error 1105
set password='gambling3'; set password='gambling3';
set password=old_password('gambling3'); set password=old_password('gambling3');
show tables; show tables;
connect (con1,localhost,test,gambling3,test); connect (con6,localhost,test,gambling3,test);
show tables; show tables;
# Re enable this one day if error handling on connect will take place --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
#connect (con1,localhost,test,,test2); connect (fail_con,localhost,test,,test2);
#--error 1045 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
#connect (con1,localhost,test,,); --error 1045
#--error 1045 connect (fail_con,localhost,test,,);
#connect (con1,localhost,test,zorro,test2); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
#--error 1045 --error 1045
#connect (con1,localhost,test,zorro,); connect (fail_con,localhost,test,zorro,test2);
#--error 1045 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
connect (fail_con,localhost,test,zorro,);
# remove user 'test' so that other tests which may use 'test' # remove user 'test' so that other tests which may use 'test'
...@@ -84,13 +87,13 @@ flush privileges; ...@@ -84,13 +87,13 @@ flush privileges;
# #
# Bug#12517: Clear user variables and replication events before # Bug#12517: Clear user variables and replication events before
# closing temp tables in thread cleanup. # closing temp tables in thread cleanup.
connect (con2,localhost,root,,test); connect (con7,localhost,root,,test);
connection con2; connection con7;
create table t1 (id integer not null auto_increment primary key); create table t1 (id integer not null auto_increment primary key);
create temporary table t2(id integer not null auto_increment primary key); create temporary table t2(id integer not null auto_increment primary key);
set @id := 1; set @id := 1;
delete from t1 where id like @id; delete from t1 where id like @id;
disconnect con2; disconnect con7;
--sleep 5 --sleep 5
connection default; connection default;
drop table t1; drop table t1;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
# See mysql-test/std_data/init_file.dat and # See mysql-test/std_data/init_file.dat and
# mysql-test/t/init_file-master.opt for the actual test # mysql-test/t/init_file-master.opt for the actual test
# #
# End of 4.1 tests --echo ok
--echo End of 4.1 tests
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
# server or run mysql-test-run --debug mysql_client_test and check # server or run mysql-test-run --debug mysql_client_test and check
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--disable_result_log --exec echo "$MYSQL_CLIENT_TEST --getopt-ll-test=25600M" > $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1
--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
# End of 4.1 tests # End of 4.1 tests
echo ok;
# This test should work in embedded server after mysqltest is fixed
-- source include/not_embedded.inc -- source include/not_embedded.inc
# ============================================================================ # ============================================================================
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# $mysql_errno contains the return code of the last command # $mysql_errno contains the return code of the last command
# send to the server. # sent to the server.
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# get $mysql_errno before the first statement # get $mysql_errno before the first statement
# $mysql_errno should be -1 # $mysql_errno should be -1
...@@ -49,7 +50,7 @@ select otto from (select 1 as otto) as t1; ...@@ -49,7 +50,7 @@ select otto from (select 1 as otto) as t1;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Negative case(statement): # Negative case(statement):
# The dervied table t1 does not contain a column named 'friedrich' . # The derived table t1 does not contain a column named 'friedrich' .
# --> ERROR 42S22: Unknown column 'friedrich' in 'field list and # --> ERROR 42S22: Unknown column 'friedrich' in 'field list and
# --> 1054: Unknown column 'friedrich' in 'field list' # --> 1054: Unknown column 'friedrich' in 'field list'
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -67,7 +68,7 @@ select friedrich from (select 1 as otto) as t1; ...@@ -67,7 +68,7 @@ select friedrich from (select 1 as otto) as t1;
# The following unmasked unsuccessful statement must give # The following unmasked unsuccessful statement must give
# 1. mysqltest gives a 'failed' # 1. mysqltest gives a 'failed'
# 2. does not produce a r/<test case>.reject file !!! # 2. does not produce a r/<test case>.reject file !!!
# PLEASE uncomment it and check it's effect # PLEASE uncomment it and check its effect
#select friedrich from (select 1 as otto) as t1; #select friedrich from (select 1 as otto) as t1;
...@@ -113,7 +114,7 @@ select friedrich from (select 1 as otto) as t1; ...@@ -113,7 +114,7 @@ select friedrich from (select 1 as otto) as t1;
# test cases for $mysql_errno # test cases for $mysql_errno
# #
# $mysql_errno is a builtin variable of mysqltest and contains the return code # $mysql_errno is a builtin variable of mysqltest and contains the return code
# of the last command send to the server. # of the last command sent to the server.
# #
# The following test cases often initialize $mysql_errno to 1064 by # The following test cases often initialize $mysql_errno to 1064 by
# a command with wrong syntax. # a command with wrong syntax.
...@@ -216,7 +217,7 @@ garbage ; ...@@ -216,7 +217,7 @@ garbage ;
execute stmt; execute stmt;
eval select $mysql_errno as "after_successful_execute" ; eval select $mysql_errno as "after_successful_execute" ;
# failing execute (table dropped) # failing execute (table has been dropped)
drop table t1; drop table t1;
--error 1064 --error 1064
garbage ; garbage ;
...@@ -248,8 +249,8 @@ eval select $mysql_errno as "after_failing_deallocate" ; ...@@ -248,8 +249,8 @@ eval select $mysql_errno as "after_failing_deallocate" ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# test cases for "--disable_abort_on_error" # test cases for "--disable_abort_on_error"
# #
# "--disable_abort_on_error" switches the abort of mysqltest # "--disable_abort_on_error" switches off the abort of mysqltest
# after "unmasked" failing statements off. # after "unmasked" failing statements.
# #
# The default is "--enable_abort_on_error". # The default is "--enable_abort_on_error".
# #
...@@ -257,13 +258,13 @@ eval select $mysql_errno as "after_failing_deallocate" ; ...@@ -257,13 +258,13 @@ eval select $mysql_errno as "after_failing_deallocate" ;
# --error <error number> and --error <error number> # --error <error number> and --error <error number>
# in the line before the failing statement. # in the line before the failing statement.
# #
# There are some additional test case for $mysql_errno # There are some additional test cases for $mysql_errno
# because "--disable_abort_on_error" enables a new situation. # because "--disable_abort_on_error" enables a new situation.
# Example: "unmasked" statement fails + analysis of $mysql_errno # Example: "unmasked" statement fails + analysis of $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Switch the abort on error off and check the effect on $mysql_errno # Switch off the abort on error and check the effect on $mysql_errno
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
--error 1064 --error 1064
garbage ; garbage ;
...@@ -316,7 +317,6 @@ select 3 from t1 ; ...@@ -316,7 +317,6 @@ select 3 from t1 ;
# #
#select 3 from t1 ; #select 3 from t1 ;
# End of 4.1 tests
--error 1 --error 1
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1 --exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
...@@ -344,7 +344,7 @@ select 3 from t1 ; ...@@ -344,7 +344,7 @@ select 3 from t1 ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test detect end of line "junk" # Test detect end of line "junk"
# Most likely causes by a missing delimiter # Most likely caused by a missing delimiter
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Too many parameters to function # Too many parameters to function
...@@ -359,23 +359,95 @@ select 3 from t1 ; ...@@ -359,23 +359,95 @@ select 3 from t1 ;
# Missing delimiter # Missing delimiter
# The comment will be "sucked into" the sleep command since # The comment will be "sucked into" the sleep command since
# delimiter is missing until after "show status" # delimiter is missing until after "show status"
--system echo "sleep 4" > var/log/mysqltest.sql --system echo "sleep 4" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "# A comment" >> var/log/mysqltest.sql --system echo "# A comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "show status;" >> var/log/mysqltest.sql --system echo "show status;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--error 1 --error 1
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until eof
# The comment will be "sucked into" the sleep command since
# delimiter is missing
--system echo "sleep 7" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "# Another comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
# #
# Extra delimiter # Extra delimiter
# #
--error 1 --error 1
--exec echo "--sleep 4;" | $MYSQL_TEST 2>&1 --exec echo "--sleep 4;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--disable_query_log;" | $MYSQL_TEST 2>&1
# Allow trailing # comment # Allow trailing # comment
--sleep 1 # Wait for insert delayed to be executed. --sleep 1 # Wait for insert delayed to be executed.
--sleep 1 # Wait for insert delayed to be executed. --sleep 1 # Wait for insert delayed to be executed.
# ----------------------------------------------------------------------------
# Test error
# ----------------------------------------------------------------------------
# Missing argument
--error 1
--exec echo "error;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--error" | $MYSQL_TEST 2>&1
# First char must be uppercase 'S' or 'E' or [0-9]
--error 1
--exec echo "--error s99999" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--error e99999" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--error 9eeeee" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--error 1sssss" | $MYSQL_TEST 2>&1
# First char 'S' but too long
--error 1
--exec echo "--error S999999" | $MYSQL_TEST 2>&1
# First char 'S' but lowercase char found
--error 1
--exec echo "--error S99a99" | $MYSQL_TEST 2>&1
# First char 'S' but too short
--error 1
--exec echo "--error S9999" | $MYSQL_TEST 2>&1
# First char 'E' but not found in error array
--error 1
--exec echo "--error E9999" | $MYSQL_TEST 2>&1
# First char [0-9] but contains chars
--error 1
--exec echo "--error 999e9" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--error 9b" | $MYSQL_TEST 2>&1
# Multiple errorcodes separated by ','
--error 1,1,1,1
#--error 9,ER_PARSE_ERROR
#--error ER_PARSE_ERROR
#--error 9,ER_PARSE_ERROR,9,ER_PARSE_ERROR
#--error 9, ER_PARSE_ERROR, 9, ER_PARSE_ERROR
#--error 9,S00000,9,ER_PARSE_ERROR
#--error 9,S00000,9,ER_PARSE_ERROR,ER_PARSE_ERROR,ER_PARSE_ERROR,9,10,11,12
--error 9,S00000,9
--error 9,S00000,9,9,10,11,12
--error 9 ,10
--error 9 , 10
--error 9 , 10
--error 9 , 10
# Too many errorcodes specified
--error 1
--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test echo command # Test echo command
...@@ -399,8 +471,8 @@ echo - MySQL: The world''s ...@@ -399,8 +471,8 @@ echo - MySQL: The world''s
- source database; - source database;
echo - MySQL: The world''s echo - MySQL: The world''s
-- most popular open -- most popular
-- source database; -- open source database;
echo # MySQL: The echo # MySQL: The
--world''s --world''s
...@@ -419,7 +491,7 @@ echo ; ...@@ -419,7 +491,7 @@ echo ;
# Illegal use of echo # Illegal use of echo
--error 1 --error 1
--exec echo "echo $;" | $MYSQL_TEST 2>&1 --exec echo "echo \$;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -457,8 +529,8 @@ echo $message; ...@@ -457,8 +529,8 @@ echo $message;
let $message= -- MySQL: The let $message= -- MySQL: The
-- world''s most -- world''s most
-- popular open -- popular
-- source database; -- open source database;
echo $message; echo $message;
let $message= # MySQL: The let $message= # MySQL: The
...@@ -495,9 +567,21 @@ echo $where2; ...@@ -495,9 +567,21 @@ echo $where2;
let $where3=a long $where variable content; let $where3=a long $where variable content;
echo $where3; echo $where3;
let $where3=a long \\\$where variable content;
echo $where3;
let $novar1= $novar2; let $novar1= $novar2;
echo $novar1; echo $novar1;
let $cat=na;
let $cat=ba$cat$cat;
echo banana = $cat;
# ba\$cat\$cat should have been sufficient.
# ba\\\$cat\\\$cat -> ba\$cat\$cat -> ba$cat$cat -> banana
# Magnus' upcoming patch will fix the missing second interpretation.
let $cat=ba\\\$cat\\\$cat;
echo Not a banana: $cat;
# Test illegal uses of let # Test illegal uses of let
...@@ -506,22 +590,19 @@ echo $novar1; ...@@ -506,22 +590,19 @@ echo $novar1;
--exec echo "let ;" | $MYSQL_TEST 2>&1 --exec echo "let ;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $=hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$=hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let hi=hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $1 hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$1 hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $m hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$m hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $ hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$ hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let =hi;" | $MYSQL_TEST 2>&1 --exec echo "let =hi;" | $MYSQL_TEST 2>&1
...@@ -529,6 +610,55 @@ echo $novar1; ...@@ -529,6 +610,55 @@ echo $novar1;
--error 1 --error 1
--exec echo "let hi;" | $MYSQL_TEST 2>&1 --exec echo "let hi;" | $MYSQL_TEST 2>&1
# More advanced test for bug#17280
let $success= 1;
--echo # Execute: --echo # <whatever> success: \$success
--echo # <whatever> success: $success
--echo # Execute: echo # <whatever> success: \$success ;
echo # <whatever> success: $success ;
--echo # The next two variants work fine and expand the content of \$success
--echo # Execute: --echo \$success
--echo $success
--echo # Execute: echo \$success ;
echo $success ;
# ----------------------------------------------------------------------------
# Test to assign let from query
# let $<var_name>=`<query>`;
# ----------------------------------------------------------------------------
--disable_parsing
echo var1;
let $var1= `select "hi" as "Col", 1 as "Column1", "hi there" as Col3`;
echo $var1;
echo $var1_Col;
echo $var1_Column1;
echo $var1_Col3;
echo var2;
let $var2= `select 2 as "Column num 2"`;
echo $var2;
echo $var2_Column num 2;
echo $var2_Column;
echo var2 again;
let $var2= `select 2 as "Column num 2"`;
echo $var2;
echo $var2_Column num 2;
echo $var2_Column_num_2;
echo $var2_Column;
echo var3 two columns with same name;
let $var3= `select 1 as "Col", 2 as "Col", 3 as "var3"`;
echo $var3;
echo $var3_Col;
echo $var3_Col;
echo $var3_var3;
#echo failing query in let;
#--error 1
#--exec echo "let $var2= `failing query;`" | $MYSQL_TEST 2>&1
--enable_parsing
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test source command # Test source command
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -538,29 +668,36 @@ echo $novar1; ...@@ -538,29 +668,36 @@ echo $novar1;
--error 1 --error 1
--exec echo "source ;" | $MYSQL_TEST 2>&1 --exec echo "source ;" | $MYSQL_TEST 2>&1
# Fix win paths
--replace_result \\ /
# Source a nonexisting file
--error 1 --error 1
--exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1 --exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1
# Too many source # Too many source
--exec echo "source var/tmp/recursive.sql;" > var/tmp/recursive.sql --exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" > $MYSQLTEST_VARDIR/tmp/recursive.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1 --error 1
--exec echo "source var/tmp/recursive.sql;" | $MYSQL_TEST 2>&1 --exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" | $MYSQL_TEST 2>&1
# Source a file with error # Source a file with error
--exec echo "garbage ;" > var/tmp/error.sql --exec echo "garbage ;" > $MYSQLTEST_VARDIR/tmp/error.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1 --error 1
--exec echo "source var/tmp/error.sql;" | $MYSQL_TEST 2>&1 --exec echo "source $MYSQLTEST_VARDIR/tmp/error.sql;" | $MYSQL_TEST 2>&1
# Test execution of source in a while loop # Test execution of source in a while loop
--exec echo "echo here is the sourced script;" > var/tmp/sourced.sql --write_file $MYSQLTEST_VARDIR/tmp/sourced.inc
echo here is the sourced script;
EOF
--disable_query_log --disable_query_log
let $outer= 2; # Number of outer loops let $outer= 2; # Number of outer loops
while ($outer) while ($outer)
{ {
eval SELECT '$outer = outer loop variable after while' AS ""; eval SELECT '$outer = outer loop variable after while' AS "";
--source var/tmp/sourced.sql --source $MYSQLTEST_VARDIR/tmp/sourced.inc
eval SELECT '$outer = outer loop variable before dec' AS ""; eval SELECT '$outer = outer loop variable before dec' AS "";
dec $outer; dec $outer;
...@@ -581,7 +718,6 @@ while ($outer) ...@@ -581,7 +718,6 @@ while ($outer)
# Test execution of source in a while loop # Test execution of source in a while loop
--exec echo "--source var/tmp/sourced.sql" > var/tmp/sourced1.sql
--disable_abort_on_error --disable_abort_on_error
# Sourcing of a file within while loop, sourced file will # Sourcing of a file within while loop, sourced file will
# source other file # source other file
...@@ -589,11 +725,12 @@ let $num= 9; ...@@ -589,11 +725,12 @@ let $num= 9;
while ($num) while ($num)
{ {
SELECT 'In loop' AS ""; SELECT 'In loop' AS "";
--source var/tmp/sourced1.sql --source $MYSQLTEST_VARDIR/tmp/sourced.inc
dec $num; dec $num;
} }
--enable_abort_on_error --enable_abort_on_error
--enable_query_log --enable_query_log
--remove_file $MYSQLTEST_VARDIR/tmp/sourced.inc
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test sleep command # Test sleep command
...@@ -683,7 +820,7 @@ system echo "hej" > /dev/null; ...@@ -683,7 +820,7 @@ system echo "hej" > /dev/null;
--exec echo "system false;" | $MYSQL_TEST 2>&1 --exec echo "system false;" | $MYSQL_TEST 2>&1
--disable_abort_on_error --disable_abort_on_error
system NonExistsinfComamdn; system NonExistsinfComamdn 2> /dev/null;
--enable_abort_on_error --enable_abort_on_error
...@@ -700,6 +837,30 @@ echo test3stop ...@@ -700,6 +837,30 @@ echo test3stop
--delimiter ; --delimiter ;
echo test4; echo test4;
# ----------------------------------------------------------------------------
# Test if
# ----------------------------------------------------------------------------
let $counter=10;
if ($counter)
{
echo Counter is greater than 0, (counter=10);
}
if (!$counter)
{
echo Counter is not 0, (counter=10);
}
let $counter=0;
if ($counter)
{
echo Counter is greater than 0, (counter=0);
}
if (!$counter)
{
echo Counter is not 0, (counter=0);
}
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test while, { and } # Test while, { and }
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -713,11 +874,158 @@ while ($i) ...@@ -713,11 +874,158 @@ while ($i)
# One liner # One liner
#let $i=1;while ($i){echo $i;dec $i;} #let $i=1;while ($i){echo $i;dec $i;}
let $i=0;
while (!$i)
{
echo Testing while with not;
inc $i;
}
# Exceed max nesting level # Exceed max nesting level
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest_while.inc
let $1 = 10;
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
echo $1;
dec $1;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
EOF
# Fix win path
--replace_result \\ / $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1 --error 1
--exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1 --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/mysqltest_while.inc
--error 1 --error 1
--exec echo "while \$i;" | $MYSQL_TEST 2>&1 --exec echo "while \$i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
...@@ -731,20 +1039,20 @@ while ($i) ...@@ -731,20 +1039,20 @@ while ($i)
--error 1 --error 1
--exec echo "{;" | $MYSQL_TEST 2>&1 --exec echo "{;" | $MYSQL_TEST 2>&1
--system echo "while (0)" > var/log/mysqltest.sql --system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "echo hej;" >> var/log/mysqltest.sql --system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--error 1 --error 1
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
--system echo "while (0)" > var/log/mysqltest.sql --system echo "while (0)" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "{echo hej;" >> var/log/mysqltest.sql --system echo "{echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--error 1 --error 1
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
--system echo "while (0){" > var/log/mysqltest.sql --system echo "while (0){" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "echo hej;" >> var/log/mysqltest.sql --system echo "echo hej;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--error 1 --error 1
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test error messages returned from comments starting with a command # Test error messages returned from comments starting with a command
...@@ -772,7 +1080,7 @@ select "a" as col1, "c" as col2; ...@@ -772,7 +1080,7 @@ select "a" as col1, "c" as col2;
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1 --exec echo "replace_result a;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1 --exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
--exec echo "replace_result a b;" | $MYSQL_TEST 2>&1 --exec echo "replace_result a b; echo OK;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1 --exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
--error 1 --error 1
...@@ -809,6 +1117,71 @@ select "a" as col1, "c" as col2; ...@@ -809,6 +1117,71 @@ select "a" as col1, "c" as col2;
--error 1 --error 1
--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1 --exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test connect
# ----------------------------------------------------------------------------
--error 1
--exec echo "connect;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect ();" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect (con2);" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect (con2,);" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect (con2,localhost,root,,illegal_db);" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect (con1,localhost,root,,,illegal_port,);" | $MYSQL_TEST 2>&1
--error 1
--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1
# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=100;
while ($i)
{
connect (test_con1,localhost,root,,);
disconnect test_con1;
dec $i;
}
EOF
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
# Repeat connect/disconnect, exceed max number of connections
--system echo "let \$i=200;" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "{" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "}" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
# Select disconnected connection
--system echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "connection test_con1;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
# Connection name already used
--system echo "connect (test_con1,localhost,root,,);" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "connect (test_con1,localhost,root,,);" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
# connect when "disable_abort_on_error" caused "connection not found"
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--disable_abort_on_error
connect (con1,localhost,root,,);
connection default;
connection con1;
--enable_abort_on_error
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test mysqltest arguments # Test mysqltest arguments
...@@ -818,6 +1191,8 @@ select "a" as col1, "c" as col2; ...@@ -818,6 +1191,8 @@ select "a" as col1, "c" as col2;
--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc --exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc
--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc --exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc
--exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc --exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc
# Fix Win paths
--replace_result \\ /
--error 1 --error 1
--exec $MYSQL_TEST -x non_existing_file.inc 2>&1 --exec $MYSQL_TEST -x non_existing_file.inc 2>&1
...@@ -841,3 +1216,275 @@ while ($num) ...@@ -841,3 +1216,275 @@ while ($num)
SELECT 1 as a; SELECT 1 as a;
#
# Bug #10251: Identifiers containing quotes not handled correctly
#
select 1 as `a'b`, 2 as `a"b`;
# Test escaping of quotes
select 'aaa\\','aa''a',"aa""a";
#
# Check of include/show_msg.inc and include/show_msg80.inc
#
# The message contains in most cases a string with the default character set
let $message= Here comes a message;
--source include/show_msg.inc
# The message could also contain a string with character set utf8
let $message= `SELECT USER()`;
--source include/show_msg.inc
# The message contains more then 80 characters on multiple lines
# and is kept between double quotes.
let $message=
"Here comes a very very long message that
- is longer then 80 characters and
- consists of several lines";
--source include/show_msg80.inc
# The message contains more then 80 characters on multiple lines
# and uses the auxiliary character "." at the beginning of the message lines.
let $message= . Here comes a very very long message that
. - is longer then 80 characters and
. - consists of several lines;
--source include/show_msg80.inc
#
# Test --enable_parsing / disable_parsing
#
--disable_query_log
--disable_parsing
# The following will not enable query logging
--enable_query_log
select "this will not be executed";
--enable_parsing
select "this will be executed";
--enable_query_log
#
# Test zero length result file. Should not pass
#
--exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result
--exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql
--error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result 2>&1
#
# Test that a test file that does not generate any output fails.
#
--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql
--error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1
#
# Test that mysqltest fails when there are no queries executed
# but a result file exists
# NOTE! This will never happen as long as it's not allowed to have
# test files that produce no output
#--exec echo "something" > $MYSQLTEST_VARDIR/tmp/result_file.result
#--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql
#--error 1
#--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/result_file.result 2>&1
#
# Bug #11731 mysqltest in multi-statement queries ignores errors in
# non-1st queries
#
echo Failing multi statement query;
# PS does not support multi statement
--exec echo "--disable_ps_protocol" > $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ||||;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "create table t1 (a int primary key);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insert into t1 values (1);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insertz 'error query'||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1
drop table t1;
--error 1
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
# The .out file should be non existent
--exec test ! -s $MYSQLTEST_VARDIR/tmp/bug11731.out
drop table t1;
echo Multi statement using expected error;
# PS does not support multi statement
--exec echo "--disable_ps_protocol" > $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ||||;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "--error 1064" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "create table t1 (a int primary key);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insert into t1 values (1);" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "insertz "error query"||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
--exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
# These two should work since the error is expected
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1
drop table t1;
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
# The .out file should exist
--exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out
drop table t1;
#
# Bug#19890 mysqltest: "query" command is broken
#
# It should be possible to use the command "query" to force mysqltest to
# send the command to the server although it's a builtin mysqltest command.
--error 1064
query sleep;
--error 1064
--query sleep
# Just an empty query command
--error 1065
query ;
# test for replace_regex
--replace_regex /at/b/
select "at" as col1, "c" as col2;
--replace_regex /at/b/i
select "at" as col1, "AT" as col2, "c" as col3;
--replace_regex /a/b/ /ct/d/
select "a" as col1, "ct" as col2;
--replace_regex /(strawberry)/raspberry and \1/ /blueberry/blackberry/ /potato/tomato/;
select "strawberry","blueberry","potato";
--error 1
--exec echo "--replace_regex a" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_regex a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_regex a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_regex a ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_regex a b; echo OK;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_regex /a b c" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_regex /a /b c ;" | $MYSQL_TEST 2>&1
# REQUIREMENT
# replace_regex should replace substitutions from left to right in output
create table t1 (a int, b int);
insert into t1 values (1,3);
insert into t1 values (2,4);
--replace_regex /A/C/ /B/D/i /3/2/ /2/1/
select * from t1;
drop table t1;
# ----------------------------------------------------------------------------
# test for remove_file
# ----------------------------------------------------------------------------
--error 1
--exec echo "remove_file ;" | $MYSQL_TEST 2>&1
--error 1
remove_file non_existing_file;
# ----------------------------------------------------------------------------
# test for write_file
# ----------------------------------------------------------------------------
--error 1
--exec echo "write_file ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "write_file filename ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "write_file filename \";" | $MYSQL_TEST 2>&1
write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Content for test_file1
EOF
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp END_DELIMITER;
Content for test_file1 contains EOF
END_DELIMITER
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
# ----------------------------------------------------------------------------
# test for file_exist
# ----------------------------------------------------------------------------
--error 1
--exec echo "file_exists ;" | $MYSQL_TEST 2>&1
--error 0,1
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
--error 1
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
Content for test_file1
EOF
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
--error 1
file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
# ----------------------------------------------------------------------------
# test for copy_file
# ----------------------------------------------------------------------------
--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
file1
EOF
copy_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/file2.tmp;
--error 1
--exec echo "copy_file ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "copy_file from_file;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# test for perl
# ----------------------------------------------------------------------------
--perl
print "hello\n";
EOF
--perl EOF
print "hello\n";
EOF
--perl DELIMITER
print "hello\n";
DELIMITER
--error 1
--exec echo "perl TOO_LONG_DELIMITER ;" | $MYSQL_TEST 2>&1
perl;
print "hello\n";
EOF
perl;
# Print "hello"
print "hello\n";
EOF
--echo End of tests
...@@ -351,14 +351,14 @@ create table t1 (a int, b int); ...@@ -351,14 +351,14 @@ create table t1 (a int, b int);
insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2); insert into t1 (a, b) values (1,1), (1,2), (2,1), (2,2);
prepare stmt from prepare stmt from
"explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?"; "explain select * from t1 where t1.a=2 and t1.a=t1.b and t1.b > 1 + ?";
--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
set @v=5; set @v=5;
execute stmt using @v;
--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - --replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
set @v=0;
execute stmt using @v; execute stmt using @v;
set @v=0;
--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - --replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
execute stmt using @v;
set @v=5; set @v=5;
--replace_column 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 -
execute stmt using @v; execute stmt using @v;
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
......
...@@ -305,8 +305,8 @@ prepare stmt4 from ' show table status from test like ''t9%'' '; ...@@ -305,8 +305,8 @@ prepare stmt4 from ' show table status from test like ''t9%'' ';
--replace_result 2147483647 4294967295 --replace_result 2147483647 4294967295
# Bug#4288 # Bug#4288
execute stmt4; execute stmt4;
--replace_column 2 #
prepare stmt4 from ' show status like ''Threads_running'' '; prepare stmt4 from ' show status like ''Threads_running'' ';
--replace_column 2 #
execute stmt4; execute stmt4;
prepare stmt4 from ' show variables like ''sql_mode'' '; prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4; execute stmt4;
......
...@@ -35,7 +35,7 @@ use mysqltest; ...@@ -35,7 +35,7 @@ use mysqltest;
--source include/ps_create.inc --source include/ps_create.inc
--source include/ps_renew.inc --source include/ps_renew.inc
--enable_query_log --enable_query_log
eval use $DB; use test;
grant usage on mysqltest.* to second_user@localhost grant usage on mysqltest.* to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
grant select on mysqltest.t9 to second_user@localhost grant select on mysqltest.t9 to second_user@localhost
......
#
# Running test with abort-slave-event-count=1
# This will force slave to reconnect after every event
#
require_manager;
connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock);
connection master;
reset master;
server_stop master;
server_start master;
connection slave;
reset slave;
start slave;
connection master;
show binary logs;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(n int);
insert into t1 values (3351);
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
# This test makes some assumptions about values of thread ids, which should be
# true if the servers have been restarted for this test. So we want to
# stop/restart servers. Note that if assumptions are wrong, the test will not
# fail; it will just fail to test the error-prone scenario.
# Using the manager is the only way to have more than one slave server.
# So you must run this test with --manager.
require_manager;
server_stop master;
server_start master;
server_stop slave;
server_start slave;
# no need for slave_sec (no assumptions on thread ids for this server).
source include/master-slave.inc;
connect (slave_sec,localhost,root,,test,0,slave.sock-1);
connection master;
save_master_pos;
connection slave;
sync_with_master;
reset master;
save_master_pos;
connection slave_sec;
eval change master to master_host='127.0.0.1',master_port=$SLAVE_MYPORT, master_user='root';
start slave;
sync_with_master;
# :P now we have a chain ready-to-test.
connection master;
create temporary table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
connection master1;
create temporary table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
save_master_pos;
# First test:
connection slave_sec;
# Before BUG#1686 ("If 2 master threads with same-name temp table, slave makes
# bad binlog") was fixed, sync_with_master failed
sync_with_master;
show status like 'slave_open_temp_tables';
# 'master' and 'master1' usually have thread id 2-3 or 3-4.
# 'slave' and 'slave1' usually have thread id 2-3.
connection slave;
create temporary table t1 (a int);
connection slave1;
create temporary table t1 (a int);
# So it's likely that in the binlog of slave we get
# server_id=of_master thread_id=3 create temp...
# server_id=of_slave thread_id=3 create temp...
# which would confuse slave-sec unless slave-sec uses server id to distinguish
# between temp tables (here thread id is obviously not enough to distinguish).
save_master_pos;
# Second test:
connection slave_sec;
# If we did not use the server id to distinguish between temp tables,
# sync_with_master would fail
sync_with_master;
show status like 'slave_open_temp_tables';
# Third test (BUG#1240 "slave of slave breaks when STOP SLAVE was issud on
# parent slave and temp tables").
stop slave;
connection slave;
insert into t1 values(1);
create table t2 as select * from t1;
save_master_pos;
connection slave_sec;
start slave;
sync_with_master;
show status like 'slave_open_temp_tables';
select * from t2;
# clean up
connection slave;
drop table t2;
save_master_pos;
connection slave_sec;
sync_with_master;
# On purpose, we don't delete the temporary tables explicitely.
# So temp tables remain on slave (remember they are not deleted when the slave
# SQL thread terminates). If you run this test with
# --valgrind --valgrind-options=--show-reachable=yes
# you will see if they get cleaned up at slave's shutdown (that is, if the
# memory they use is freed (it should) by mysqld before it terminates).
# If they wouldn't be cleaned up, you would see some "still reachable" blocks in
# Valgrind.
# End of 4.1 tests
require_manager;
source include/master-slave.inc;
connect (slave_sec,localhost,root,,test,0,slave.sock-1);
connect (slave_ter,localhost,root,,test,0,slave.sock-2);
connection master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
create table t1(n int);
drop table t1;
sync_slave_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_sec;
start slave;
sync_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_ter;
start slave;
sync_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
# End of 4.1 tests
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
# merge table getting renamed. # merge table getting renamed.
--source include/not_windows.inc --source include/not_windows.inc
let $SERVER_VERSION=`select version()`;
create table t1 (a int); create table t1 (a int);
insert into t1 values (10); insert into t1 values (10);
create table t2 (a int); create table t2 (a int);
......
# You must run this test with --manager.
require_manager;
# Don't know why, but using TCP/IP connections makes this test fail
# with "Lost connection to MySQL server during query" when we
# issue a query after the server restart.
# Maybe this is something awkward in mysqltest or in the manager?
# So we use sockets.
connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock);
connection master;
reset master;
drop table if exists t1;
# we use CREATE SELECT to verify that DELETE does not get into binlog
# before CREATE SELECT
create table t1 type=HEAP select 10 as a;
insert into t1 values(11);
save_master_pos;
show binlog events from 79;
connection slave;
reset slave;
start slave;
sync_with_master;
show create table t1;
select * from t1; # should be one row
server_stop master;
server_start master;
connection master;
select * from t1;
# to check that DELETE is not written twice
# (the LIMIT is to not use the query cache)
select * from t1 limit 10;
save_master_pos;
show binlog events in 'master-bin.002' from 79;
connection slave;
sync_with_master;
select * from t1; # should be empty
# clean up
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
# End of 4.1 tests
...@@ -29,7 +29,4 @@ connection slave; ...@@ -29,7 +29,4 @@ connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
connection master;
# End of 4.1 tests # End of 4.1 tests
...@@ -1721,7 +1721,7 @@ select (select a from t1) = (1,2); ...@@ -1721,7 +1721,7 @@ select (select a from t1) = (1,2);
select (1,2,3) = (select * from t1); select (1,2,3) = (select * from t1);
-- error 1241 -- error 1241
select (select * from t1) = (1,2,3); select (select * from t1) = (1,2,3);
drop table t1 drop table t1;
# #
# Item_int_with_ref check (BUG#10020) # Item_int_with_ref check (BUG#10020)
......
...@@ -23,7 +23,7 @@ CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); ...@@ -23,7 +23,7 @@ CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000));
show columns from t2; show columns from t2;
create table t3 (a long, b long byte); create table t3 (a long, b long byte);
show create TABLE t3; show create TABLE t3;
drop table t1,t2,t3 drop table t1,t2,t3;
# #
# Check errors with blob # Check errors with blob
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment