From 3c6936c288b5b759cbe1c20c629fa5a506b7ed24 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Apr 2007 22:58:25 +0200 Subject: Look for "testname.warnings" file produced by mysqltest, could find problems like misspelled -- commands --- mysql-test/lib/mtr_report.pl | 9 +++++++++ mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test (limited to 'mysql-test') diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 2a90344c110..d47f9051763 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -295,6 +295,15 @@ sub mtr_report_stats ($) { } } } + + # Look for warnings produced by mysqltest in testname.warnings + foreach my $test_warning_file + ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + { + $found_problems= 1; + print WARN "Check myqltest warnings in $test_warning_file\n"; + } + if ( $found_problems ) { mtr_warning("Got errors/warnings while running tests, please examine", diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests -- cgit v1.2.1 From 9ff5060ebfa1fcdddfd04a9ca510fc9281ac96d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 10:59:00 +0200 Subject: Only check for warnings produced by mysqltest if --check-testcases --- mysql-test/lib/mtr_report.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index d47f9051763..a2f22ef8870 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -296,12 +296,15 @@ sub mtr_report_stats ($) { } } - # Look for warnings produced by mysqltest in testname.warnings - foreach my $test_warning_file - ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + if ( $::opt_check_testcases ) { - $found_problems= 1; - print WARN "Check myqltest warnings in $test_warning_file\n"; + # Look for warnings produced by mysqltest in testname.warnings + foreach my $test_warning_file + ( glob("$::glob_mysql_test_dir/r/*.warnings") ) + { + $found_problems= 1; + print WARN "Check myqltest warnings in $test_warning_file\n"; + } } if ( $found_problems ) -- cgit v1.2.1 From 075d69548b0badb1a45b831d4c0b4df8253e8472 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:09:12 +0200 Subject: Add expansion of $variables in "let from query", "if with query" and "while with query" --- mysql-test/r/mysqltest.result | 3 +++ mysql-test/t/mysqltest.test | 15 +++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 71f1c7de4ed..ba37284e597 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -268,6 +268,9 @@ mysqltest: At line 1: Missing assignment operator in let 1 # Execute: echo $success ; 1 +var2: content of variable 1 +var3: content of variable 1 content of variable 1 +length of var3 is longer than 0 mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 221ad5d5c6e..9a7139187b5 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -685,6 +685,21 @@ echo # success: $success ; --echo # Execute: echo \$success ; echo $success ; +# ---------------------------------------------------------------------------- +# Test let from query with $variable +# let $=``; +# ---------------------------------------------------------------------------- + +let $var1=content of variable 1; +let $var2= `select "$var1"`; +let $var3= `select concat("$var1", " ", "$var2")`; +echo var2: $var2; +echo var3: $var3; +if (`select length("$var3") > 0`) +{ + echo length of var3 is longer than 0; +} + # ---------------------------------------------------------------------------- # Test to assign let from query # let $=``; -- cgit v1.2.1 From 2bc3f1fd7e59dc15d0a271f3e6fdb0f8563ab2d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 15:40:40 +0200 Subject: Skip test cases if the script or binary they need can't be found mysql-test/mysql-test-run.pl: Move some opt_extern hacks to same place. Remove duplicate opt_skip_im=1 if opt_extern mysql-test/t/fix_priv_tables.test: Skip test if $MYSQL_FIX_PRIVILEGE_TABLES is not set mysql-test/t/system_mysql_db_fix30020.test: Skip test if $MYSQL_FIX_SYSTEM_TABLES is not set mysql-test/t/system_mysql_db_fix40123.test: Skip test if $MYSQL_FIX_PRIVILEGE_TABLES is not set --- mysql-test/mysql-test-run.pl | 8 ++------ mysql-test/t/fix_priv_tables.test | 7 +++++++ mysql-test/t/system_mysql_db_fix30020.test | 8 ++++++-- mysql-test/t/system_mysql_db_fix40123.test | 7 +++++++ 4 files changed, 22 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b48ac6c5abc..6bd9122f07f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -724,8 +724,6 @@ sub command_line_setup () { { $mysqld_variables{'port'}= 3306; $mysqld_variables{'master-port'}= 3306; - $opt_skip_ndbcluster= 1; - $opt_skip_im= 1; } if ( $opt_comment ) @@ -1235,6 +1233,7 @@ sub command_line_setup () { { # Turn off features not supported when running with extern server $opt_skip_rpl= 1; + $opt_skip_ndbcluster= 1; # Setup master->[0] with the settings for the extern server $master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock"; @@ -2011,10 +2010,7 @@ sub environment_setup () { $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; } - if (!$opt_extern) - { - $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; - } + $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables; # ---------------------------------------------------- # Setup env so childs can execute my_print_defaults diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test index 3a91f41dfcc..3051fd88076 100644 --- a/mysql-test/t/fix_priv_tables.test +++ b/mysql-test/t/fix_priv_tables.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 4.1.23 diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test index b71ae6c2204..23562807c14 100644 --- a/mysql-test/t/system_mysql_db_fix30020.test +++ b/mysql-test/t/system_mysql_db_fix30020.test @@ -1,8 +1,12 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc -# Windows doesn't support execution of shell scripts (to fix!!) ---source include/not_windows.inc +# Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_SYSTEM_TABLES; +} # # This is the test for mysql_fix_privilege_tables diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test index 471598625d4..012d05af3b8 100644 --- a/mysql-test/t/system_mysql_db_fix40123.test +++ b/mysql-test/t/system_mysql_db_fix40123.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test need MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 4.1.23 -- cgit v1.2.1