summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test2
-rw-r--r--mysql-test/include/not_as_root.inc7
-rw-r--r--mysql-test/lib/mtr_cases.pm27
-rwxr-xr-xmysql-test/mysql-test-run.pl8
-rw-r--r--mysql-test/r/mysqltest.result2
-rw-r--r--mysql-test/r/not_as_root.require2
-rw-r--r--mysql-test/t/execution_constants.test9
-rw-r--r--mysql-test/t/mysqltest.test20
-rw-r--r--mysql-test/t/ps.test2
9 files changed, 62 insertions, 17 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
index 47afcce875b..5a2ab1912b8 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -206,7 +206,7 @@ START TRANSACTION;
-- disable_query_log
-- disable_result_log
let $n=50;
-while ($n>3)
+while ($n)
{
eval call test.p3($n);
dec $n;
diff --git a/mysql-test/include/not_as_root.inc b/mysql-test/include/not_as_root.inc
index e0277ea593e..6c88051d632 100644
--- a/mysql-test/include/not_as_root.inc
+++ b/mysql-test/include/not_as_root.inc
@@ -1,4 +1,3 @@
--- require r/not_as_root.require
-disable_query_log;
-eval select "$MYSQL_TEST_ROOT" as running_as_root;
-enable_query_log;
+if ($MYSQL_TEST_ROOT){
+ skip Not as root;
+}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 904276854ee..93236e483a1 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -120,7 +120,7 @@ sub collect_test_cases ($$) {
}
if ( not $found )
{
- mtr_error("Could not find $tname in any suite");
+ mtr_error("Could not find '$tname' in '$suites' suite(s)");
}
}
}
@@ -537,23 +537,36 @@ sub optimize_cases {
}
}
-
# =======================================================
# Check that engine selected by
# --default-storage-engine=<engine> is supported
# =======================================================
+ my %builtin_engines = ('myisam' => 1, 'memory' => 1);
+
foreach my $opt ( @{$tinfo->{master_opt}} ) {
my $default_engine=
mtr_match_prefix($opt, "--default-storage-engine=");
if (defined $default_engine){
- if ( ! exists $::mysqld_variables{$default_engine} )
- {
- $tinfo->{'skip'}= 1;
- $tinfo->{'comment'}=
- "'$default_engine' not supported";
+ #print " $tinfo->{name}\n";
+ #print " - The test asked to use '$default_engine'\n";
+
+ #my $engine_value= $::mysqld_variables{$default_engine};
+ #print " - The mysqld_variables says '$engine_value'\n";
+
+ if ( ! exists $::mysqld_variables{$default_engine} and
+ ! exists $builtin_engines{$default_engine} )
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}=
+ "'$default_engine' not supported";
}
+
+ $tinfo->{'ndb_test'}= 1
+ if ( $default_engine =~ /^ndb/i );
+ $tinfo->{'innodb_test'}= 1
+ if ( $default_engine =~ /^innodb/i );
}
}
}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 19178bb5482..0e30d045781 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1046,6 +1046,13 @@ sub command_line_setup {
{
mtr_error("Can't use --extern with --embedded-server");
}
+
+ if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd ||
+ $opt_manual_debug || $opt_debugger )
+ {
+ mtr_error("You need to use the client debug options for the",
+ "embedded server. Ex: --client-gdb");
+ }
}
# --------------------------------------------------------------------------
@@ -1878,7 +1885,6 @@ sub check_running_as_root () {
# the file will not return 0000
my $file_mode= (stat($test_file))[2] & 07777;
- $ENV{'MYSQL_TEST_ROOT'}= "NO";
mtr_verbose("result: $result, file_mode: $file_mode");
if ($result eq "MySQL" && $file_mode == 0)
{
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index d8fd01f86ee..26b9044a499 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -726,6 +726,8 @@ mysqltest: At line 1: change user failed: Access denied for user 'root'@'localho
SELECT 'c:\\a.txt' AS col;
col
z
+hej
+mysqltest: At line 1: Found junk ' != 143' after $variable in expression
select 1;
1
1
diff --git a/mysql-test/r/not_as_root.require b/mysql-test/r/not_as_root.require
deleted file mode 100644
index d9ea5244efc..00000000000
--- a/mysql-test/r/not_as_root.require
+++ /dev/null
@@ -1,2 +0,0 @@
-running_as_root
-NO
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
index 4930164d3fa..e61d79f5249 100644
--- a/mysql-test/t/execution_constants.test
+++ b/mysql-test/t/execution_constants.test
@@ -41,12 +41,19 @@ while ($i)
error 0,1436 //
eval $query_head 0 $query_tail//
- if ($mysql_errno != 1436)
+ if ($mysql_errno)
{
# We reached the place where we reported an error about the stack limit,
# and we successfully returned the error. That means that at the stack
# limit, we still have enough space reserved to report an error.
let $i = 1//
+
+ # Check that mysql_errno is 1436
+ if (`select $mysql_errno != 1436`)
+ {
+ die Wrong error triggered, expected 1436 but got $mysql_errno//
+ }
+
}
# Multiplying by three stack frames should be fine enough resolution.
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 5c5b74c968a..0253b5818ee 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -2133,6 +2133,26 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
--replace_result c:\\a.txt z
SELECT 'c:\\a.txt' AS col;
+#
+# Bug #32307 mysqltest - does not detect illegal if syntax
+#
+
+let $test= 1;
+if ($test){
+ echo hej;
+}
+
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+if ($mysql_errno != 1436)
+{
+ echo ^ Should not be allowed!
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
+
# ----------------------------------------------------------------------------
# Test that -- is not allowed as comment, only as mysqltest builtin command
# ----------------------------------------------------------------------------
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 3e1a41d32c8..91cb6eef8ad 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1665,7 +1665,7 @@ DROP PROCEDURE IF EXISTS p1;
let $iterations= 100;
--disable_query_log
--disable_result_log
-while ($iterations > 0)
+while ($iterations)
{
--error ER_PARSE_ERROR
PREPARE stmt FROM "CREATE PROCEDURE p1()";