diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2011-08-30 23:04:39 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2011-08-30 23:04:39 +0200 |
commit | 79a47c61e348ad678e981a4f386757398a59f12b (patch) | |
tree | f7a1a15d73c5c86ebc4854411c55449e93cf8964 | |
parent | c09cbe74390015806e09604c2c446abe2ff6ac22 (diff) | |
parent | 56294f4d3101471d668e017f9f3d00cba1cf5f3c (diff) | |
download | mariadb-git-79a47c61e348ad678e981a4f386757398a59f12b.tar.gz |
merge from 5.5-mtr
-rw-r--r-- | client/mysqltest.cc | 32 | ||||
-rw-r--r-- | mysql-test/include/mtr_check.sql | 10 | ||||
-rw-r--r-- | mysql-test/include/mysqld--help.inc | 2 | ||||
-rw-r--r-- | mysql-test/lib/mtr_cases.pm | 46 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 8 | ||||
-rw-r--r-- | mysql-test/r/execution_constants.result | 2 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 23 | ||||
-rw-r--r-- | mysql-test/std_data/bug57108.cnf | 95 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/plugin_dir_basic.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/plugin_dir_basic.test | 14 | ||||
-rw-r--r-- | mysql-test/t/execution_constants.test | 10 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 38 |
13 files changed, 139 insertions, 152 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index cc5dd1f377c..903f6a024f7 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -494,6 +494,7 @@ void str_to_file(const char *fname, char *str, int size); void str_to_file2(const char *fname, char *str, int size, my_bool append); void fix_win_paths(const char *val, int len); +const char *get_errname_from_code (uint error_code); #ifdef __WIN__ void free_tmp_sh_file(); @@ -2263,6 +2264,7 @@ void var_set_int(const char* name, int value) void var_set_errno(int sql_errno) { var_set_int("$mysql_errno", sql_errno); + var_set_string("$mysql_errname", get_errname_from_code(sql_errno)); } @@ -4670,8 +4672,7 @@ void do_shutdown_server(struct st_command *command) } -#if MYSQL_VERSION_ID >= 50000 -/* List of error names to error codes, available from 5.0 */ +/* List of error names to error codes */ typedef struct { const char *name; @@ -4681,6 +4682,7 @@ typedef struct static st_error global_error_names[] = { + { "<No error>", -1, "" }, #include <mysqld_ername.h> { 0, 0, 0 } }; @@ -4711,16 +4713,28 @@ uint get_errcode_from_name(char *error_name, char *error_end) die("Unknown SQL error name '%s'", error_name); DBUG_RETURN(0); } -#else -uint get_errcode_from_name(char *error_name __attribute__((unused)), - char *error_end __attribute__((unused))) + +const char *get_errname_from_code (uint error_code) { - abort_not_in_this_version(); - return 0; /* Never reached */ -} -#endif + st_error *e= global_error_names; + DBUG_ENTER("get_errname_from_code"); + DBUG_PRINT("enter", ("error_code: %d", error_code)); + if (! error_code) + { + DBUG_RETURN(""); + } + for (; e->name; e++) + { + if (e->code == error_code) + { + DBUG_RETURN(e->name); + } + } + /* Apparently, errors without known names may occur */ + DBUG_RETURN("<Unknown>"); +} void do_get_errcodes(struct st_command *command) { diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 55e346c2007..699a35a1831 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -72,3 +72,13 @@ BEGIN mysql.user; END|| + +-- +-- Procedure used by test case used to force all +-- servers to restart after testcase and thus skipping +-- check test case after test +-- +CREATE DEFINER=root@localhost PROCEDURE force_restart() +BEGIN + SELECT 1 INTO OUTFILE 'force_restart'; +END|| diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index 5d20cff2c13..380a7f6c8cf 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -26,7 +26,7 @@ perl; # And substitute the content some environment variables with their # names: - @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/; + @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/; $re1=join('|', @skipvars, @plugins); $re2=join('|', @plugins); diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 044ebb1f176..c8381e16061 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -337,17 +337,41 @@ sub collect_one_suite($) for my $skip (@disabled_collection) { if ( open(DISABLED, $skip ) ) - { - while ( <DISABLED> ) - { - chomp; - if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) - { - $disabled{$1}= $2 if not exists $disabled{$1}; - } - } - close DISABLED; - } + { + # $^O on Windows considered not generic enough + my $plat= (IS_WINDOWS) ? 'windows' : $^O; + + while ( <DISABLED> ) + { + chomp; + #diasble the test case if platform matches + if ( /\@/ ) + { + if ( /\@$plat/ ) + { + /^\s*(\S+)\s*\@$plat.*:\s*(.*?)\s*$/ ; + $disabled{$1}= $2 if not exists $disabled{$1}; + } + elsif ( /\@!(\S*)/ ) + { + if ( $1 ne $plat) + { + /^\s*(\S+)\s*\@!.*:\s*(.*?)\s*$/ ; + $disabled{$1}= $2 if not exists $disabled{$1}; + } + } + } + elsif ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) + { + chomp; + if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) + { + $disabled{$1}= $2 if not exists $disabled{$1}; + } + } + } + close DISABLED; + } } # Read suite.opt file diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ec0ca74b1d1..451b877f9a8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2132,8 +2132,10 @@ sub find_plugin($$) my $lib_plugin= mtr_file_exists(vs_config_dirs($location,$plugin_filename), "$basedir/lib/plugin/".$plugin_filename, + "$basedir/lib64/plugin/".$plugin_filename, "$basedir/$location/.libs/".$plugin_filename, "$basedir/lib/mysql/plugin/".$plugin_filename, + "$basedir/lib64/mysql/plugin/".$plugin_filename, ); return $lib_plugin; } @@ -2295,12 +2297,6 @@ sub environment_setup { $ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'}; $ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir; $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir; - # Used for guessing default plugin dir, we can't really know for sure - $ENV{'MYSQL_LIBDIR'}= "$basedir/lib"; - # Override if this does not exist, but lib64 does (best effort) - if (! -d "$basedir/lib" && -d "$basedir/lib64") { - $ENV{'MYSQL_LIBDIR'}= "$basedir/lib64"; - } $ENV{'MYSQL_BINDIR'}= "$bindir"; $ENV{'MYSQL_SHAREDIR'}= $path_language; $ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir; diff --git a/mysql-test/r/execution_constants.result b/mysql-test/r/execution_constants.result index 293c88dc506..86eed447b83 100644 --- a/mysql-test/r/execution_constants.result +++ b/mysql-test/r/execution_constants.result @@ -7,6 +7,6 @@ PRIMARY KEY (`ID_MEMBER`,`ID_BOARD`), KEY `logTime` (`logTime`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_bulgarian_ci; INSERT INTO `t_bug21476` VALUES (2,2,1154870939,0),(1,2,1154870957,0),(2,183,1154941362,0),(2,84,1154904301,0),(1,84,1154905867,0),(2,13,1154947484,10271),(3,84,1154880549,0),(1,6,1154892183,0),(2,25,1154947581,10271),(3,25,1154904760,0),(1,25,1154947373,10271),(1,179,1154899992,0),(2,179,1154899410,0),(5,25,1154901666,0),(2,329,1154902026,0),(3,329,1154902040,0),(1,329,1154902058,0),(1,13,1154930841,0),(3,85,1154904987,0),(1,183,1154929665,0),(3,13,1154931268,0),(1,85,1154936888,0),(1,169,1154937959,0),(2,169,1154941717,0),(3,183,1154939810,0),(3,169,1154941734,0); -Assertion: mysql_errno 1436 == 1436 +Assertion: mysql_errname ER_STACK_OVERRUN_NEED_MORE == ER_STACK_OVERRUN_NEED_MORE DROP TABLE `t_bug21476`; End of 5.0 tests. diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 9c8f49c333b..9d000e6f782 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -1,6 +1,5 @@ -select 0 as "before_use_test" ; -before_use_test -0 +-1 before test +<No error> before test select otto from (select 1 as otto) as t1; otto 1 @@ -21,27 +20,32 @@ mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' fai select otto from (select 1 as otto) as t1; otto 1 + select 0 as "after_successful_stmt_errno" ; after_successful_stmt_errno 0 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 +ER_PARSE_ERROR select 1064 as "after_wrong_syntax_errno" ; after_wrong_syntax_errno 1064 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 +ER_PARSE_ERROR select 1064 as "after_let_var_equal_value" ; after_let_var_equal_value 1064 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 set @my_var= 'abc' ; + select 0 as "after_set_var_equal_value" ; after_set_var_equal_value 0 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 +ER_PARSE_ERROR select 1064 as "after_disable_warnings_command" ; after_disable_warnings_command 1064 @@ -49,6 +53,7 @@ drop table if exists t1 ; 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 drop table if exists t1 ; + select 0 as "after_disable_warnings" ; after_disable_warnings 0 @@ -56,6 +61,7 @@ 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 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist +ER_NO_SUCH_TABLE select 1146 as "after_minus_masked" ; after_minus_masked 1146 @@ -63,6 +69,7 @@ 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 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist +ER_NO_SUCH_TABLE select 1146 as "after_!_masked" ; after_!_masked 1146 @@ -75,6 +82,7 @@ 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 prepare stmt from "select 3 from t1" ; ERROR 42S02: Table 'test.t1' doesn't exist +ER_NO_SUCH_TABLE select 1146 as "after_failing_prepare" ; after_failing_prepare 1146 @@ -82,6 +90,7 @@ create table t1 ( f1 char(10)); 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 prepare stmt from "select 3 from t1" ; + select 0 as "after_successful_prepare" ; after_successful_prepare 0 @@ -89,6 +98,7 @@ 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 execute stmt; 3 + select 0 as "after_successful_execute" ; after_successful_execute 0 @@ -97,6 +107,7 @@ 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 execute stmt; ERROR 42S02: Table 'test.t1' doesn't exist +ER_NO_SUCH_TABLE select 1146 as "after_failing_execute" ; after_failing_execute 1146 @@ -104,12 +115,14 @@ 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 execute __stmt_; ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE +ER_UNKNOWN_STMT_HANDLER select 1243 as "after_failing_execute" ; after_failing_execute 1243 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 deallocate prepare stmt; + select 0 as "after_successful_deallocate" ; after_successful_deallocate 0 @@ -117,11 +130,13 @@ 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 deallocate prepare __stmt_; ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE +ER_UNKNOWN_STMT_HANDLER select 1243 as "after_failing_deallocate" ; after_failing_deallocate 1243 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 +ER_PARSE_ERROR select 1064 as "after_--disable_abort_on_error" ; after_--disable_abort_on_error 1064 @@ -131,12 +146,14 @@ select 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist select 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist +ER_NO_SUCH_TABLE 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: 'Table 'test.t1' doesn't exist', 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 +ER_PARSE_ERROR select 1064 as "after_--enable_abort_on_error" ; after_--enable_abort_on_error 1064 diff --git a/mysql-test/std_data/bug57108.cnf b/mysql-test/std_data/bug57108.cnf deleted file mode 100644 index 5fd8c485cf0..00000000000 --- a/mysql-test/std_data/bug57108.cnf +++ /dev/null @@ -1,95 +0,0 @@ -[mysqld] -open-files-limit=1024 -character-set-server=latin1 -connect-timeout=4711 -log-bin-trust-function-creators=1 -key_buffer_size=1M -sort_buffer=256K -max_heap_table_size=1M -loose-innodb_data_file_path=ibdata1:10M:autoextend -loose-innodb_buffer_pool_size=8M -loose-innodb_write_io_threads=2 -loose-innodb_read_io_threads=2 -loose-innodb_log_buffer_size=1M -loose-innodb_log_file_size=5M -loose-innodb_additional_mem_pool_size=1M -loose-innodb_log_files_in_group=2 -slave-net-timeout=120 -log-bin=mysqld-bin -loose-enable-performance-schema -loose-performance-schema-max-mutex-instances=10000 -loose-performance-schema-max-rwlock-instances=10000 -loose-performance-schema-max-table-instances=500 -loose-performance-schema-max-table-handles=1000 -binlog-direct-non-transactional-updates - -[mysql] -default-character-set=latin1 - -[mysqlshow] -default-character-set=latin1 - -[mysqlimport] -default-character-set=latin1 - -[mysqlcheck] -default-character-set=latin1 - -[mysql_upgrade] -default-character-set=latin1 -tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp - -[mysqld.1] -#!run-master-sh -log-bin=master-bin -loose-enable-performance-schema -basedir=/home/bzr/bugs/b57108-5.5-bugteam -tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1 -character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets -lc-messages-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/ -datadir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/data -pid-file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/run/mysqld.1.pid -#host=localhost -port=13000 -socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock -#log-error=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/log/mysqld.1.err -general_log=1 -general_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld.log -slow_query_log=1 -slow_query_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log -#user=root -#password= -server-id=1 -secure-file-priv=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var -ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem -ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-cert.pem -ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-key.pem - -[mysqlbinlog] -disable-force-if-open -character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets - -[ENV] -MASTER_MYPORT=13000 -MASTER_MYSOCK=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock - -[client] -password= -user=root -port=13000 -host=localhost -socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock - -[mysqltest] -ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem -ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-cert.pem -ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-key.pem -skip-ssl=1 - -[client.1] -password= -user=root -port=13000 -host=localhost -socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock - diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result index f81cae24dda..a5f36de73fa 100644 --- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result @@ -1,20 +1,20 @@ select @@global.plugin_dir; @@global.plugin_dir -MYSQL_LIBDIR/plugin +MYSQL_TMP_DIR select @@session.plugin_dir; ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable show global variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_LIBDIR/plugin +plugin_dir MYSQL_TMP_DIR show session variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_LIBDIR/plugin +plugin_dir MYSQL_TMP_DIR select * from information_schema.global_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_LIBDIR/plugin +PLUGIN_DIR MYSQL_TMP_DIR select * from information_schema.session_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_LIBDIR/plugin +PLUGIN_DIR MYSQL_TMP_DIR set global plugin_dir=1; ERROR HY000: Variable 'plugin_dir' is a read only variable set session plugin_dir=1; diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt new file mode 100644 index 00000000000..69a9f0def2a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic-master.opt @@ -0,0 +1 @@ +--plugin-dir=$MYSQL_TMP_DIR diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test index d714950c807..59889f7ecb2 100644 --- a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test +++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test @@ -3,20 +3,20 @@ # # -# on windows it's <basedir>/lib/plugin -# on unix it's <basedir>/lib/mysql/plugin +# Don't rely on being able to guess the correct default. +# -master.opt file for this test sets plugin_dir to a known directory # ---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ / select @@global.plugin_dir; --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.plugin_dir; ---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ / show global variables like 'plugin_dir'; ---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ / show session variables like 'plugin_dir'; ---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ / select * from information_schema.global_variables where variable_name='plugin_dir'; ---replace_result $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR /mysql/ / select * from information_schema.session_variables where variable_name='plugin_dir'; # diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test index 92b1deb9921..285197cd1f4 100644 --- a/mysql-test/t/execution_constants.test +++ b/mysql-test/t/execution_constants.test @@ -38,7 +38,7 @@ while ($i) { # If we SEGV because the min stack size is exceeded, this would return error # 2013 . - error 0,1436 // + error 0,ER_STACK_OVERRUN_NEED_MORE // eval $query_head 0 $query_tail// if ($mysql_errno) @@ -48,10 +48,10 @@ while ($i) # limit, we still have enough space reserved to report an error. let $i = 1// - # Check that mysql_errno is 1436 - if ($mysql_errno != 1436) + # Check that mysql_errname is ER_STACK_OVERRUN_NEED_MORE + if ($mysql_errname != ER_STACK_OVERRUN_NEED_MORE) { - die Wrong error triggered, expected 1436 but got $mysql_errno// + die Wrong error triggered, expected ER_STACK_OVERRUN_NEED_MORE but got $mysql_errname// } } @@ -76,7 +76,7 @@ while ($i) enable_result_log// enable_query_log// -echo Assertion: mysql_errno 1436 == $mysql_errno// +echo Assertion: mysql_errname ER_STACK_OVERRUN_NEED_MORE == $mysql_errname// delimiter ;// DROP TABLE `t_bug21476`; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9ff92496653..9fa41b9eb51 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1,3 +1,14 @@ +# ---------------------------------------------------------------------------- +# $mysql_errno contains the return code of the last command +# sent to the server. +# ---------------------------------------------------------------------------- +# get $mysql_errno before the first statement +# $mysql_errno should be -1 +# get $mysql_errname as well + +echo $mysql_errno before test; +echo $mysql_errname before test; + -- source include/have_log_bin.inc # This test should work in embedded server after mysqltest is fixed @@ -34,15 +45,6 @@ # ============================================================================ # ---------------------------------------------------------------------------- -# $mysql_errno contains the return code of the last command -# sent to the server. -# ---------------------------------------------------------------------------- -# get $mysql_errno before the first statement -# $mysql_errno should be -1 -eval select $mysql_errno as "before_use_test" ; - - -# ---------------------------------------------------------------------------- # Positive case(statement) # ---------------------------------------------------------------------------- @@ -134,6 +136,7 @@ select friedrich from (select 1 as otto) as t1; # check mysql_errno = 0 after successful statement # ---------------------------------------------------------------------------- select otto from (select 1 as otto) as t1; +echo $mysql_errname; eval select $mysql_errno as "after_successful_stmt_errno" ; #---------------------------------------------------------------------------- @@ -142,6 +145,7 @@ eval select $mysql_errno as "after_successful_stmt_errno" ; --error ER_PARSE_ERROR garbage ; +echo $mysql_errname; eval select $mysql_errno as "after_wrong_syntax_errno" ; # ---------------------------------------------------------------------------- @@ -151,6 +155,7 @@ eval select $mysql_errno as "after_wrong_syntax_errno" ; garbage ; let $my_var= 'abc' ; +echo $mysql_errname; eval select $mysql_errno as "after_let_var_equal_value" ; # ---------------------------------------------------------------------------- @@ -160,6 +165,7 @@ eval select $mysql_errno as "after_let_var_equal_value" ; garbage ; set @my_var= 'abc' ; +echo $mysql_errname; eval select $mysql_errno as "after_set_var_equal_value" ; # ---------------------------------------------------------------------------- @@ -170,6 +176,7 @@ eval select $mysql_errno as "after_set_var_equal_value" ; garbage ; --disable_warnings +echo $mysql_errname; eval select $mysql_errno as "after_disable_warnings_command" ; # ---------------------------------------------------------------------------- @@ -182,6 +189,7 @@ drop table if exists t1 ; garbage ; drop table if exists t1 ; +echo $mysql_errname; eval select $mysql_errno as "after_disable_warnings" ; --enable_warnings @@ -194,6 +202,7 @@ garbage ; --error ER_NO_SUCH_TABLE select 3 from t1 ; +echo $mysql_errname; eval select $mysql_errno as "after_minus_masked" ; --error ER_PARSE_ERROR @@ -201,6 +210,7 @@ garbage ; --error ER_NO_SUCH_TABLE select 3 from t1 ; +echo $mysql_errname; eval select $mysql_errno as "after_!_masked" ; # ---------------------------------------------------------------------------- @@ -222,6 +232,7 @@ garbage ; --error ER_NO_SUCH_TABLE prepare stmt from "select 3 from t1" ; +echo $mysql_errname; eval select $mysql_errno as "after_failing_prepare" ; create table t1 ( f1 char(10)); @@ -230,6 +241,7 @@ create table t1 ( f1 char(10)); garbage ; prepare stmt from "select 3 from t1" ; +echo $mysql_errname; eval select $mysql_errno as "after_successful_prepare" ; # successful execute @@ -237,6 +249,7 @@ eval select $mysql_errno as "after_successful_prepare" ; garbage ; execute stmt; +echo $mysql_errname; eval select $mysql_errno as "after_successful_execute" ; # failing execute (table has been dropped) @@ -247,6 +260,7 @@ garbage ; --error ER_NO_SUCH_TABLE execute stmt; +echo $mysql_errname; eval select $mysql_errno as "after_failing_execute" ; # failing execute (unknown statement) @@ -256,6 +270,7 @@ garbage ; --error ER_UNKNOWN_STMT_HANDLER execute __stmt_; +echo $mysql_errname; eval select $mysql_errno as "after_failing_execute" ; # successful deallocate @@ -263,6 +278,7 @@ eval select $mysql_errno as "after_failing_execute" ; garbage ; deallocate prepare stmt; +echo $mysql_errname; eval select $mysql_errno as "after_successful_deallocate" ; # failing deallocate ( statement handle does not exist ) @@ -272,6 +288,7 @@ garbage ; --error ER_UNKNOWN_STMT_HANDLER deallocate prepare __stmt_; +echo $mysql_errname; eval select $mysql_errno as "after_failing_deallocate" ; @@ -299,6 +316,7 @@ eval select $mysql_errno as "after_failing_deallocate" ; garbage ; --disable_abort_on_error +echo $mysql_errname; eval select $mysql_errno as "after_--disable_abort_on_error" ; # ---------------------------------------------------------------------------- @@ -316,6 +334,7 @@ select 3 from t1 ; --error ER_NO_SUCH_TABLE select 3 from t1 ; +echo $mysql_errname; eval select $mysql_errno as "after_!errno_masked_error" ; # expected error <> response # --error 1000 @@ -341,6 +360,7 @@ EOF garbage ; --enable_abort_on_error +echo $mysql_errname; eval select $mysql_errno as "after_--enable_abort_on_error" ; # ---------------------------------------------------------------------------- |