Commit 76c1bcf9 authored by unknown's avatar unknown

BUG#11316: mysqltest, problems when assigning value with '#' to $variable

 - Add stricter checking of syntax in mysqltest


client/mysqltest.c:
  Stricter checking of syntax in mysqltest.
mysql-test/r/mysqltest.result:
  Update test results
mysql-test/t/create.test:
  Remove extra ;
mysql-test/t/create_select_tmp.test:
  Remove extra ;
mysql-test/t/drop.test:
  Remove extra ;
mysql-test/t/flush.test:
  Remove extra ;
mysql-test/t/handler.test:
  Remove extra ;
mysql-test/t/innodb.test:
  Remove extra ;
mysql-test/t/mysqltest.test:
  Add more tests for replace, replace_columns, comments with commands and sync_with_master
mysql-test/t/rpl000001.test:
  Remove extra ;
mysql-test/t/rpl_EE_error.test:
  Remove extra ;
mysql-test/t/rpl_drop.test:
  Remove extra ;
mysql-test/t/rpl_error_ignored_table.test:
  Remove extra ;
mysql-test/t/rpl_loaddata.test:
  Remove extra ;
parent 9b5b5d6f
This diff is collapsed.
......@@ -308,13 +308,41 @@ test2
test3
test4
1
mysqltest: In included file "./include/mysqltest_while.inc": At line 32: Nesting too deeply
mysqltest: In included file "./include/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 '{' 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: query '' failed: 1065: Query was empty
mysqltest: At line 1: Missing '{' after while. Found "echo hej"
mysqltest: At line 3: Missing end of block
mysqltest: At line 1: Missing newline between while and '{'
mysqltest: At line 1: missing '(' in if
mysqltest: At line 1: Stray 'end' command - end of block before beginning
select "b" bs col1, "c" bs col2;
col1 col2
b c
seledt "b" bs dol1, "d" bs dol2;
dol1 dol2
b d
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 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;
col1 col2
b c
select "a" as col1, "c" as col2;
col1 col2
b d
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a'
mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_column 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a"
......@@ -238,7 +238,7 @@ drop table t1;
create table `t1 `(a int);
--error 1102
create database `db1 `;
--error 1166;
--error 1166
create table t1(`a ` int);
#
......
......@@ -11,19 +11,19 @@ drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
--error 1062;
--error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146;
--error 1146
select * from t2;
--error 1062;
--error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146;
--error 1146
select * from t2;
--error 1062;
--error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146;
--error 1146
select * from t2;
--error 1062;
--error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146;
--error 1146
select * from t2;
......@@ -6,13 +6,13 @@ drop database if exists mysqltest;
drop database if exists client_test_db;
--enable_warnings
--error 1051;
--error 1051
drop table t1;
create table t1(n int);
insert into t1 values(1);
create temporary table t1( n int);
insert into t1 values(2);
--error 1050;
--error 1050
create table t1(n int);
drop table t1;
select * from t1;
......@@ -56,13 +56,13 @@ drop database mysqltest;
# test drop/create database and FLUSH TABLES WITH READ LOCK
flush tables with read lock;
--error 1209,1223;
--error 1209,1223
create database mysqltest;
unlock tables;
create database mysqltest;
show databases;
flush tables with read lock;
--error 1208,1223;
--error 1208,1223
drop database mysqltest;
unlock tables;
drop database mysqltest;
......@@ -73,7 +73,7 @@ drop database mysqltest;
# test create table and FLUSH TABLES WITH READ LOCK
drop table t1;
flush tables with read lock;
--error 1223;
--error 1223
create table t1(n int);
unlock tables;
create table t1(n int);
......
......@@ -37,7 +37,7 @@ connection con1;
select * from t1;
connection con2;
flush tables with read lock;
--error 1099;
--error 1099
drop table t2;
connection con1;
send drop table t2;
......
......@@ -300,7 +300,7 @@ handler t5 open as h5;
handler h5 read first limit 9;
# close first
alter table t1 engine=MyISAM;
--error 1109;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
handler h3 read first limit 9;
......@@ -308,22 +308,22 @@ handler h4 read first limit 9;
handler h5 read first limit 9;
# close last
alter table t5 engine=MyISAM;
--error 1109;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
handler h3 read first limit 9;
handler h4 read first limit 9;
--error 1109;
--error 1109
handler h5 read first limit 9;
# close middle
alter table t3 engine=MyISAM;
--error 1109;
--error 1109
handler h1 read first limit 9;
handler h2 read first limit 9;
--error 1109;
--error 1109
handler h3 read first limit 9;
handler h4 read first limit 9;
--error 1109;
--error 1109
handler h5 read first limit 9;
handler h2 close;
handler h4 close;
......@@ -335,11 +335,11 @@ handler h1_1 read first limit 9;
handler h1_2 read first limit 9;
handler h1_3 read first limit 9;
alter table t1 engine=MyISAM;
--error 1109;
--error 1109
handler h1_1 read first limit 9;
--error 1109;
--error 1109
handler h1_2 read first limit 9;
--error 1109;
--error 1109
handler h1_3 read first limit 9;
drop table t1;
drop table t2;
......
......@@ -1183,7 +1183,7 @@ drop table t1;
#
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
--error 1214;
--error 1214
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
DROP TABLE t1;
......
......@@ -705,6 +705,69 @@ while ($i)
--error 1
--exec echo -e "while (0){\n echo hej;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test error messages returned from comments starting with a command
# ----------------------------------------------------------------------------
--error 1
--exec echo "--if the other server is down" | $MYSQL_TEST 2>&1
--error 1
--exec echo "-- end when ..." | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test replace
# ----------------------------------------------------------------------------
--replace_result a b
select "a" as col1, "c" as col2;
--replace_result a b c d
select "a" as col1, "c" as col2;
--error 1
--exec echo "--replace_result a" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
--exec echo "replace_result a b;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a b c ;" | $MYSQL_TEST 2>&1
--replace_column 1 b
select "a" as col1, "c" as col2;
--replace_column 1 b 2 d
select "a" as col1, "c" as col2;
--error 1
--exec echo "--replace_column a" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column 1" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column a b" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column a 1" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column 1 b c " | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test sync_with_master
# ----------------------------------------------------------------------------
--error 1
--exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# TODO Test queries, especially their errormessages... so it's easy to debug
# new scripts and diagnose errors
......
......@@ -89,7 +89,7 @@ kill @id;
# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
--error 1053;
--error 1053
reap;
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
......
......@@ -22,7 +22,7 @@ set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
save_master_pos;
--error 1062;
--error 1062
insert into t1 values(1),(2);
drop table t1;
save_master_pos;
......
......@@ -5,7 +5,7 @@ source include/master-slave.inc;
drop table if exists t1, t2;
--enable_warnings
create table t1 (a int);
--error 1051;
--error 1051
drop table t1, t2;
save_master_pos;
connection slave;
......
......@@ -6,7 +6,7 @@ source include/master-slave.inc;
connection master;
create table t1 (a int primary key);
# generate an error that goes to the binlog
--error 1062;
--error 1062
insert into t1 values (1),(1);
save_master_pos;
connection slave;
......@@ -45,7 +45,7 @@ select (@id := id) - id from t3;
kill @id;
drop table t2,t3;
connection master;
--error 0,1053;
--error 0,1053
reap;
connection master1;
show binlog events from 79;
......
......@@ -123,7 +123,7 @@ connection master;
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day));
--error 1062;
--error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
......
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