summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-01 00:54:03 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-01 00:54:03 +0100
commit59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5 (patch)
tree3e4a302ccf3912d4d8a40aa271414003bfe7c9b6 /mysql-test/include
parentce02738d7f2f2688eeec7004dd6a30293d36044f (diff)
parent6b6d40fa6ca1fe36f2a51c2723c58dfb3fc025bb (diff)
downloadmariadb-git-59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5.tar.gz
5.5 merge
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/mtr_check.sql5
-rw-r--r--mysql-test/include/search_pattern_in_file.inc66
2 files changed, 71 insertions, 0 deletions
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index 46c2d59aa59..4edac056376 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -81,5 +81,10 @@ BEGIN
-- verify that no plugin changed its disabled/enabled state
SELECT * FROM INFORMATION_SCHEMA.PLUGINS;
+ select * from information_schema.session_variables
+ where variable_name = 'debug_sync';
+
+ show status like 'slave_open_temp_tables';
+
END||
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
new file mode 100644
index 00000000000..c047b5bc499
--- /dev/null
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -0,0 +1,66 @@
+# Purpose:
+# Simple search with Perl for a pattern in some file.
+#
+# The advantages compared to thinkable auxiliary constructs using the
+# mysqltest language and SQL are:
+# 1. We do not need a running MySQL server.
+# 2. SQL causes "noise" during debugging and increases the size of logs.
+# Perl code does not disturb at all.
+#
+# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
+# before sourcing this routine.
+#
+# In case of
+# - SEARCH_FILE and/or SEARCH_PATTERN is not set
+# - SEARCH_FILE cannot be opened
+# - SEARCH_FILE does not contain SEARCH_PATTERN
+# the test will abort immediate.
+# MTR will report something like
+# ....
+# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
+# main.1st [ pass ] 3
+# innodb.innodb_page_size [ fail ]
+# Test ended at 2011-11-11 18:15:58
+#
+# CURRENT_TEST: innodb.innodb_page_size
+# # ERROR: The file '<name>' does not contain the expected pattern <pattern>
+# mysqltest: In included file "./include/search_pattern_in_file.inc":
+# included from ./include/search_pattern_in_file.inc at line 36:
+# At line 25: command "perl" failed with error 255. my_errno=175
+#
+# The result from queries just before the failure was:
+# ...
+# - saving '<some path>' to '<some path>'
+# main.1st [ pass ] 2
+#
+# Typical use case (check invalid server startup options):
+# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
+# --error 0,1
+# --remove_file $error_log
+# let SEARCH_FILE= $error_log;
+# # Stop the server
+# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+# --exec echo "wait" > $restart_file
+# --shutdown_server 10
+# --source include/wait_until_disconnected.inc
+#
+# --error 1
+# --exec $MYSQLD_CMD <whatever wrong setting> > $error_log 2>&1
+# # The server restart aborts
+# let SEARCH_PATTERN= \[ERROR\] Aborting;
+# --source include/search_pattern_in_file.inc
+#
+# Created: 2011-11-11 mleich
+#
+
+perl;
+ use strict;
+ my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
+ my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
+ open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
+ read(FILE, my $file_content, 50000, 0);
+ close(FILE);
+ if ( not $file_content =~ m{$search_pattern} ) {
+ die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
+ }
+EOF