From 08637009a6c6d81f1a78a1a97f429eddfc73963c Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 15 May 2018 13:47:33 +0300 Subject: [PATCH] supporting modified sql_mode --- localtests/datetime-1970/sql_mode | 0 localtests/test.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 localtests/datetime-1970/sql_mode diff --git a/localtests/datetime-1970/sql_mode b/localtests/datetime-1970/sql_mode new file mode 100644 index 0000000..e69de29 diff --git a/localtests/test.sh b/localtests/test.sh index 80bacaa..41c9822 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -87,6 +87,7 @@ start_replication() { test_single() { local test_name test_name="$1" + original_sql_mode="$(gh-ost-test-mysql-master -e "select @@global.sql_mode" -s -s)" if [ -f $tests_path/$test_name/ignore_versions ] ; then ignore_versions=$(cat $tests_path/$test_name/ignore_versions) @@ -102,6 +103,12 @@ test_single() { echo_dot start_replication echo_dot + + if [ -f $tests_path/$test_name/sql_mode ] ; then + gh-ost-test-mysql-master --default-character-set=utf8mb4 test -e "set @@global.sql_mode='$(cat $tests_path/$test_name/sql_mode)'" + gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set @@global.sql_mode='$(cat $tests_path/$test_name/sql_mode)'" + fi + gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql extra_args="" @@ -154,6 +161,11 @@ test_single() { execution_result=$? + if [ -f $tests_path/$test_name/sql_mode ] ; then + gh-ost-test-mysql-master --default-character-set=utf8mb4 test -e "set @@global.sql_mode='${original_sql_mode}'" + gh-ost-test-mysql-replica --default-character-set=utf8mb4 test -e "set @@global.sql_mode='${original_sql_mode}'" + fi + if [ -f $tests_path/$test_name/destroy.sql ] ; then gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/destroy.sql fi