Skip to content

Commit

Permalink
fix test (pingcap#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv authored Oct 23, 2020
1 parent 144bacc commit c11e6bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/_utils/run_services
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ stop_services() {
killall -9 tikv-importer || true
killall -9 tiflash || true

find "$TEST_DIR" -maxdepth 1 -not -path "$TEST_DIR" -not -name "cov.*" -not -name "*.log" | xargs rm -r || true
find "$TEST_DIR" -maxdepth 1 -not -path "$TEST_DIR" -not -name "cov.*" -not -name "*.log" | xargs rm -rf || true
}

start_services() {
Expand Down
9 changes: 8 additions & 1 deletion tests/row-format-v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

set -eux

run_sql 'show variables like "%tidb_row_format_version%";'
row_format=$(grep 'Value: [0-9]' "$TEST_DIR/sql_res.$TEST_NAME.txt" | awk '{print $2}')

if [ "$row_format" -ne "2" ]; then
run_sql 'SET @@global.tidb_row_format_version = 2;' || { echo 'TiDB does not support changing row format version! skipping test'; exit 0; }
fi

run_sql 'DROP DATABASE IF EXISTS rowformatv2;'

Expand All @@ -18,4 +23,6 @@ run_sql 'SELECT DISTINCT col14 FROM rowformatv2.t1;'
check_contains 'col14: NULL'
check_contains 'col14: 39'

run_sql 'SET @@global.tidb_row_format_version = 1;'
if [ "$row_format" -ne "2" ]; then
run_sql "SET @@global.tidb_row_format_version = $row_format;"
fi

0 comments on commit c11e6bd

Please sign in to comment.