-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dumpling: support dumping sequences #32570
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f36cc91
dumpling: support dumping sequences
docsir 5ee7743
dumpling: support dumping sequences
docsir 45e26d7
Merge branch 'fix_32538' of https://github.com/docsir/tidb into fix_3…
docsir e86856b
fix codes with suggestions
docsir 7e44fec
add unit test
docsir d15ed89
fix unit test
docsir f81353e
Merge branch 'master' into fix_32538
lance6716 d25db58
fix codes with review suggestions
docsir ea79eab
Merge branch 'fix_32538' of https://github.com/docsir/tidb into fix_3…
docsir d703ab4
add integration test
docsir 2108dc3
first fix it
docsir 1d79a00
fix icodes and integration test
docsir a7fc01f
fix ut
docsir 9f60673
Merge branch 'master' into fix_32538
docsir 905f290
Merge branch 'master' into fix_32538
lichunzhu 6987b40
add IT for no-schemas and no-sequences
docsir 4fa3826
Merge branch 'fix_32538' of https://github.com/docsir/tidb into fix_3…
docsir e85f74a
add newline
docsir eaa32c0
add annotate
docsir 613ddc4
fix codes
docsir b890a65
support dump sequences for MariaDB
docsir cea334b
fix codes(use 'select setval' instead 'do setval')
docsir bf086cf
Merge branch 'master' into fix_32538
lichunzhu 1dcc007
Merge branch 'master' into fix_32538
ti-chi-bot b5e4193
Merge branch 'master' into fix_32538
ti-chi-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
3 changes: 3 additions & 0 deletions
3
dumpling/tests/sequences/data/sequences.s-schema-sequence-expect.sql
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,3 @@ | ||
/*!40101 SET NAMES binary*/; | ||
CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; | ||
SELECT SETVAL(`s`,1001); |
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,30 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0. | ||
|
||
set -eu | ||
|
||
export DUMPLING_TEST_PORT=4000 | ||
|
||
run_sql "drop database if exists sequences;" | ||
run_sql "create database sequences DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" | ||
export DUMPLING_TEST_DATABASE="sequences" | ||
|
||
run_sql "create sequence s start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB;" | ||
run_sql "select nextval(s);" | ||
|
||
# test --no-sequences | ||
run_dumpling --no-sequences | ||
file_not_exist "$DUMPLING_OUTPUT_DIR/sequences.s-schema-sequence.sql" | ||
|
||
rm -rf $DUMPLING_OUTPUT_DIR | ||
run_dumpling --no-sequences=false | ||
lichunzhu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
diff "$DUMPLING_BASE_NAME/data/sequences.s-schema-sequence-expect.sql" "$DUMPLING_OUTPUT_DIR/sequences.s-schema-sequence.sql" | ||
file_not_exist "$DUMPLING_OUTPUT_DIR/sequences.s.000000000.sql" | ||
|
||
# test --no-schemas | ||
rm -rf $DUMPLING_OUTPUT_DIR | ||
run_dumpling --no-schemas | ||
file_not_exist "$DUMPLING_OUTPUT_DIR/sequences-schema-create.sql" | ||
file_not_exist "$DUMPLING_OUTPUT_DIR/sequences.s-schema-sequence.sql" | ||
file_not_exist "$DUMPLING_OUTPUT_DIR/sequences.s.000000000.sql" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this structure created?