summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2015-06-30 14:30:38 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2015-06-30 14:30:38 +0300
commit4d856e362ec6f740cc4e916218bfc3c1c1eb12e4 (patch)
tree5683a19d19ff44474cc9d794fa37eb87054ea9cc /mysql-test/include
parentd817267ae6469f3cccbe08a55c5d10afd1bdb42f (diff)
downloadmariadb-git-4d856e362ec6f740cc4e916218bfc3c1c1eb12e4.tar.gz
[MDEV-6877] Added tests for binlog_row_image using noblobs switch
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/rpl_row_img_general_loop.inc42
-rw-r--r--mysql-test/include/rpl_row_img_set.inc55
2 files changed, 97 insertions, 0 deletions
diff --git a/mysql-test/include/rpl_row_img_general_loop.inc b/mysql-test/include/rpl_row_img_general_loop.inc
new file mode 100644
index 00000000000..3c7749e5135
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_general_loop.inc
@@ -0,0 +1,42 @@
+#
+# This is a helper script for rpl_row_img.test. It creates
+# all combinations MyISAM / InnoDB in a three server replication
+# chain. Each engine combination is tested against the current
+# seetings for binlog_row_image (on each server).
+#
+# The test script that is executed on every combination is the
+# only argument to this wrapper script. See below.
+#
+# This script takes one parameter:
+# - $row_img_test_script
+# the name of the test script to include in every combination
+#
+# Sample usage:
+# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+# -- source include/rpl_row_img_general_loop.test
+
+
+-- let $engine_type_a= 2
+-- let $server_1_engine= MyISAM
+while($engine_type_a)
+{
+ -- let $engine_type_b= 2
+ -- let $server_2_engine= MyISAM
+ while($engine_type_b)
+ {
+ -- let $engine_type_c= 2
+ -- let $server_3_engine= MyISAM
+ while($engine_type_c)
+ {
+ -- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine
+ -- source $row_img_test_script
+
+ -- let $server_3_engine= InnoDB
+ -- dec $engine_type_c
+ }
+ -- let $server_2_engine= InnoDB
+ -- dec $engine_type_b
+ }
+ -- let $server_1_engine= InnoDB
+ -- dec $engine_type_a
+}
diff --git a/mysql-test/include/rpl_row_img_set.inc b/mysql-test/include/rpl_row_img_set.inc
new file mode 100644
index 00000000000..d998c3f1d6c
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_set.inc
@@ -0,0 +1,55 @@
+#
+# This is an auxiliar script that sets the binlog-row-image
+# on a set of connections. These connections are passed as
+# a parameter to this script. Its format is the following:
+#
+# <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...]
+#
+# In detail:
+#
+# conid -- connection id (eg, master)
+# value -- binlog_row_image value to set (eg, FULL)
+# Y_or_N -- Issue stop and start slave (eg, Y)
+#
+# Sample usage:
+#
+# -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y
+# -- source include/rpl_row_img_set.inc
+#
+# Notes:
+#
+# 1. This script saves and restores the original connection that was
+# in use at the time it was included.
+
+-- let $old_conn= $CURRENT_CONNECTION
+
+while (`SELECT HEX('$row_img_set') != HEX('')`)
+{
+
+ -- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)`
+
+ -- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)`
+ -- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)`
+
+ -- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))`
+
+ -- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart'
+
+ -- connection $conn
+ -- eval SET SESSION binlog_row_image= '$rimg'
+ -- eval SET GLOBAL binlog_row_image= '$rimg'
+
+ if ($is_slave_restart == Y)
+ {
+ -- source include/stop_slave.inc
+ -- source include/start_slave.inc
+ }
+
+ FLUSH TABLES;
+ SHOW VARIABLES LIKE 'binlog_row_image';
+
+ -- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2 ))`
+
+}
+
+-- connection $old_conn