forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dumpling: check table-list types before dumping (pingcap#53683)
close pingcap#53682
- Loading branch information
1 parent
b32b212
commit a5f2b0a
Showing
3 changed files
with
160 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2024 PingCAP, Inc. Licensed under Apache-2.0. | ||
|
||
set -eu | ||
cur=$(cd `dirname $0`; pwd) | ||
|
||
DB_NAME="specified_table_view" | ||
TABLE_NAME="t" | ||
VIEW_NAME="v" | ||
|
||
run_sql "drop database if exists \`$DB_NAME\`;" | ||
run_sql "create database \`$DB_NAME\`;" | ||
run_sql "create table \`$DB_NAME\`.\`$TABLE_NAME\` (a int);" | ||
run_sql "create view \`$DB_NAME\`.\`$VIEW_NAME\` as select * from \`$DB_NAME\`.\`$TABLE_NAME\`;" | ||
|
||
set +e | ||
rm -rf "$DUMPLING_OUTPUT_DIR" | ||
run_dumpling --consistency=lock -T="$DB_NAME.$TABLE_NAME,$DB_NAME.$VIEW_NAME" -L ${DUMPLING_OUTPUT_DIR}/dumpling.log | ||
set -e | ||
|
||
file_should_exist "$DUMPLING_OUTPUT_DIR/$DB_NAME.$TABLE_NAME-schema.sql" | ||
file_should_exist "$DUMPLING_OUTPUT_DIR/$DB_NAME.$VIEW_NAME-schema-view.sql" | ||
|
||
set +e | ||
rm -rf "$DUMPLING_OUTPUT_DIR" | ||
run_dumpling --consistency=lock -T="$DB_NAME.$TABLE_NAME,$DB_NAME.$VIEW_NAME" -L ${DUMPLING_OUTPUT_DIR}/dumpling.log | ||
set -e | ||
|
||
file_should_exist "$DUMPLING_OUTPUT_DIR/$DB_NAME.$TABLE_NAME-schema.sql" | ||
file_should_exist "$DUMPLING_OUTPUT_DIR/$DB_NAME.$VIEW_NAME-schema-view.sql" |