From d57a0e52ac8c1c1a717f64f7520a156c3180b57c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jul 2005 17:51:43 +0200 Subject: BUG#11316 mysqltest, problems when assigning value with '#' to $variable - Fixed problem, only detect comment if the # is on start of line AND starting line of the current command. - Wrote tests for most of the mysqltest commands, added stricter checking of correct syntax. client/mysqltest.c: Updated mysql test to do stricter checking of syntax. For example when the number of arguments to a command is known, everything else is "junk" => die. Better checking of argument types. Added better debug printouts. Added improved printouts when wrong syntax is detected. Fix two bugs where mysqltest could not detect end of comamnd properly, as described in bug#11316 Fix segfault when performing too many source commands. Fix segfault when doing too many while loop levels. Add printout of line number in die Remove lineno and \n in all strings passed to die function. Decrese BLOCK_STACK_DEPTH from 32 to 16, does any test use more than 1 level? mysql-test/mysql-test-run.pl: export MYSQL_TEST environment variable, used from msyqltest.test mysql-test/mysql-test-run.sh: export MYSQL_TEST environment variable, used from msyqltest.test mysql-test/r/mysqltest.result: Updated test results mysql-test/r/rpl_flush_log_loop.result: Updated test result. Approved by lars mysql-test/t/innodb-deadlock.test: Correct wrong syntax Superfluos ; mysql-test/t/innodb-lock.test: Correct wrong syntax Superfluos ; mysql-test/t/mysqltest.test: Add several new tests for mysqltest. Foxus on detecting wrong syntax in test files. Use exec with expected error to execute test scripts that will kill mysqltest Change some negative test that were previously commented out to use the above method. mysql-test/t/ndb_autodiscover2.test: Correct wrong syntax Superfluos ; mysql-test/t/rpl_change_master.test: Correct wrong syntax Superfluos ; mysql-test/t/rpl_deadlock.test: Correct wrong syntax Superfluos ; mysql-test/t/rpl_drop_temp.test: Correct wrong syntax Superfluos ; mysql-test/t/rpl_flush_log_loop.test: Fix after detecting wrong syntax, missing ; Discussed with lars. mysql-test/t/rpl_insert_id.test: Missing ; mysql-test/t/rpl_rotate_logs.test: Correct wrong syntax Superfluos ; mysql-test/t/rpl_until.test: Missing delimiter mysql-test/include/mysqltest_while.inc: New file to test too many while levels --- mysql-test/r/mysqltest.result | 121 +++++++++++++++++++++++++++++++++ mysql-test/r/rpl_flush_log_loop.result | 2 +- 2 files changed, 122 insertions(+), 1 deletion(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index d75dbd5d00c..3b2828c3c6c 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -7,6 +7,7 @@ otto select otto from (select 1 as otto) as t1; otto 1 +mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: 1054: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' select otto from (select 1 as otto) as t1; @@ -15,10 +16,12 @@ otto select otto from (select 1 as otto) as t1; otto 1 +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; ERROR 42S22: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' +mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000... select otto from (select 1 as otto) as t1; otto 1 @@ -135,6 +138,8 @@ ERROR 42S02: Table 'test.t1' doesn't exist select 1146 as "after_!errno_masked_error" ; after_!errno_masked_error 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 instead of 1000... 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 select 1064 as "after_--enable_abort_on_error" ; @@ -142,3 +147,119 @@ after_--enable_abort_on_error 1064 select 3 from t1 ; 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: 1146: Table 'test.t1' doesn't exist +hello +hello +;;;;;;;; +# MySQL: -- The +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: Extra delimiter ";" found +MySQL +"MySQL" +MySQL: The world''s most popular open source database +"MySQL: The world's most popular open source database" +MySQL: The world''s +most popular open +source database +# MySQL: The world''s +# most popular open +# source database +- MySQL: The world''s +- most popular open +- source database +- MySQL: The world''s +-- most popular open +-- source database +# MySQL: The +--world''s +# most popular +-- open +- source database +"MySQL: The world's most popular; open source database" +"MySQL: The world's most popular ; open source database" +"MySQL: The world's most popular ;open source database" +echo message echo message + +mysqltest: At line 1: Empty variable +sh: -c: line 0: syntax error near unexpected token `;' +sh: -c: line 0: `;' +mysqltest: At line 1: command ";" failed +mysqltest: At line 1: Missing argument in exec +MySQL +"MySQL" +MySQL: The +world''s most +popular open +source database +# MySQL: The +# world''s most +# popular open +# source database +-- MySQL: The +-- world''s most +-- popular open +-- source database +# MySQL: The +- world''s most +-- popular open +# source database +'$message' +"$message" +hej +hej +hej +mysqltest: At line 1: Missing arguments to 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 arguments to 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 file name in source +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 "./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: At line 1: Missing argument to sleep +mysqltest: At line 1: Invalid argument to sleep "abc" +1 +2 +101 +hej +1 +mysqltest: At line 1: Missing arguments to inc +mysqltest: At line 1: First argument to inc must be a variable (start with $) +mysqltest: At line 1: End of line junk detected: "1000" +4 +4 +-1 +-2 +99 +hej +-1 +mysqltest: At line 1: Missing arguments to dec +mysqltest: At line 1: First argument to dec must be a variable (start with $) +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! +sh: NonExistsinfComamdn: command not found +mysqltest: At line 1: system command 'NonExistsinfComamdn' failed +test +test2 +test3 +test4 +1 +mysqltest: In included file "./include/mysqltest_while.inc": At line 32: 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: 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 '{' diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result index 25177a6bca3..0a2d7e5e72a 100644 --- a/mysql-test/r/rpl_flush_log_loop.result +++ b/mysql-test/r/rpl_flush_log_loop.result @@ -4,10 +4,10 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +stop slave; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=MASTER_PORT; start slave; -stop slave; change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=SLAVE_PORT; start slave; -- cgit v1.2.1 From 9b5b5d6f97df6d45fcd605ff7b8f889a6ee03b02 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Aug 2005 17:10:52 +0200 Subject: BUG#10267 mysqltest, wrong number of loops when a script is sourced within a loop client/mysqltest.c: Don't open a sourced file more than once as it will already have been read into the q_lines cache mysql-test/r/mysqltest.result: Added tests for source command inside of while loop mysql-test/t/mysqltest.test: Added tests for source command inside of while loop --- mysql-test/r/mysqltest.result | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 3b2828c3c6c..21c73f2c7bf 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -224,6 +224,61 @@ mysqltest: At line 1: Missing file name in source 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 "./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 + +2 = outer loop variable after while +here is the sourced script + +2 = outer loop variable before dec + +1 = outer loop variable after dec + +1 = outer loop variable after while +here is the sourced script + +1 = outer loop variable before dec + +0 = outer loop variable after dec + +2 = outer loop variable after while +here is the sourced script + +2 = outer loop variable before dec + +1 = outer loop variable after dec + +1 = outer loop variable after while +here is the sourced script + +1 = outer loop variable before dec + +0 = outer loop variable after dec + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script + +In loop +here is the sourced script mysqltest: At line 1: Missing argument to sleep mysqltest: At line 1: Invalid argument to sleep "abc" 1 -- cgit v1.2.1 From 76c1bcf986bcdf54d114ca0eb7c83512c1841787 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 Aug 2005 17:16:05 +0200 Subject: 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 ; --- mysql-test/r/mysqltest.result | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 21c73f2c7bf..a5ebb08458a 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -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" -- cgit v1.2.1 From 43422eceb516932603110a7b8665496d4132de35 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 Aug 2005 18:10:26 +0200 Subject: Remove syntax !$ to set an expected error code Use ! instead client/mysqltest.c: Remove syntax !$ to set an expected error code mysql-test/r/mysqltest.result: Update test result mysql-test/t/mysqltest.test: Uncomment tests for the deprecated syntax --- mysql-test/r/mysqltest.result | 5 ----- 1 file changed, 5 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index a5ebb08458a..668cf6beb57 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -13,14 +13,9 @@ ERROR 42S22: Unknown column 'friedrich' in 'field list' select otto from (select 1 as otto) as t1; otto 1 -select otto from (select 1 as otto) as t1; -otto -1 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; ERROR 42S22: Unknown column 'friedrich' in 'field list' -select friedrich from (select 1 as otto) as t1; -ERROR 42S22: Unknown column 'friedrich' in 'field list' mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000... select otto from (select 1 as otto) as t1; otto -- cgit v1.2.1 From 50cc21ea3e5f4ebcd3f9185c5f64746d5b0b7a98 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Sep 2005 09:34:40 +0200 Subject: Bug #12471 mysqltest, --error within loop affects wrong statement - Move clearing of expected errors client/mysqltest.c: Move clear of expected errors to the query loop so that the expected error is reset even when the query is retrieved from the q_lines cache. mysql-test/r/mysqltest.result: Update test results mysql-test/t/mysqltest.test: Add test for bug#12471 --- mysql-test/r/mysqltest.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 668cf6beb57..36dc09b9e24 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -341,3 +341,10 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: Invalid integer argument "a" +failing_statement; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1 +failing_statement; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1 +SELECT 1 as a; +a +1 -- cgit v1.2.1 From 772843ba41a7a10aaaed6d37a7544907be38d443 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Sep 2005 10:53:33 +0200 Subject: Bug #3131 mysqltest fails on $2=$1 assignment in test client/mysqltest.c: Fix function var_copy to make it possible to assign one variable to another. ex: let $1=$2 mysql-test/r/mysqltest.result: Update test result mysql-test/t/mysqltest.test: Add test cases for variable to variable assignment --- mysql-test/r/mysqltest.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 36dc09b9e24..80c54f589da 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -206,6 +206,13 @@ source database hej hej hej +1 + + +a long variable content +a long variable content +a long $where variable content + mysqltest: At line 1: Missing arguments to let mysqltest: At line 1: Missing variable name in let mysqltest: At line 1: Variable name in hi=hi does not start with '$' -- cgit v1.2.1