Skip to content

Commit

Permalink
add integration case for skip __TiDB_BR_Temporary_mysql when backup
Browse files Browse the repository at this point in the history
Signed-off-by: joccau <zak.zhao@pingcap.com>
  • Loading branch information
joccau authored and ti-chi-bot committed Feb 9, 2023
1 parent dfbc0d5 commit 31cb972
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions br/tests/br_backup_empty/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ run_sql "CREATE TABLE ${DB}1.usertable1 ( \
PRIMARY KEY (YCSB_KEY) \
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;"

# backup empty table
echo "backup empty table start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/empty_table"

Expand All @@ -75,6 +76,7 @@ while [ $i -le $DB_COUNT ]; do
i=$(($i+1))
done

# restore empty table.
echo "restore empty table start..."
run_br --pd $PD_ADDR restore full -s "local://$TEST_DIR/empty_table"

Expand All @@ -85,3 +87,15 @@ while [ $i -le $DB_COUNT ]; do
run_sql "DROP DATABASE $DB$i;"
i=$(($i+1))
done


# backup, skip temporary system database(__TiDB_BR_Temporary_mysql) when backup
run_sql "CREATE DATABASE __TiDB_BR_Temporary_mysql";
run_sql "CREATE TABLE __TiDB_BR_Temporary_mysql.tables_priv(id int);";
echo "backup and skip __TiDB_BR_Temporary_mysql start..."
run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/skip_temporary_mysql"

# restore successfully without panic.
run_sql "DROP DATABASE __TiDB_BR_Temporary_mysql";
echo "restore the data start..."
run_br restore full -s "local://$TEST_DIR/skip_temporary_mysql" --pd $PD_ADDR --ratelimit 1024

0 comments on commit 31cb972

Please sign in to comment.