supporting modified sql_mode

This commit is contained in:
Shlomi Noach 2018-05-15 13:47:33 +03:00
parent 80387d9160
commit 08637009a6
2 changed files with 12 additions and 0 deletions

View File

View File

@ -87,6 +87,7 @@ start_replication() {
test_single() { test_single() {
local test_name local test_name
test_name="$1" 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 if [ -f $tests_path/$test_name/ignore_versions ] ; then
ignore_versions=$(cat $tests_path/$test_name/ignore_versions) ignore_versions=$(cat $tests_path/$test_name/ignore_versions)
@ -102,6 +103,12 @@ test_single() {
echo_dot echo_dot
start_replication start_replication
echo_dot 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 gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/create.sql
extra_args="" extra_args=""
@ -154,6 +161,11 @@ test_single() {
execution_result=$? 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 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 gh-ost-test-mysql-master --default-character-set=utf8mb4 test < $tests_path/$test_name/destroy.sql
fi fi