Skip to content
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

importccl: always ignore PGDUMP statements in ignorelist #56324

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/ccl/importccl/import_stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,8 @@ END;
`,
query: map[string][][]string{
`SELECT nextval('i_seq')`: {{"11"}},
`SHOW CREATE SEQUENCE i_seq`: {{"i_seq", "CREATE SEQUENCE i_seq MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1"}},
`SHOW CREATE SEQUENCE i_seq`: {{"i_seq", "CREATE SEQUENCE public.i_seq MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1"}},
},
skipIssue: 53958,
},
{
name: "INSERT without specifying all column values",
Expand Down
11 changes: 6 additions & 5 deletions pkg/ccl/importccl/read_import_pgdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ func (p *postgreStream) Next() (interface{}, error) {

for p.s.Scan() {
t := p.s.Text()
// Regardless if we can parse the statement, check that it's not something
// we want to ignore.
if isIgnoredStatement(t) {
continue
}

stmts, err := parser.Parse(t)
if err != nil {
// Something non-parseable may be something we don't yet parse but still
// want to ignore.
if isIgnoredStatement(t) {
continue
}
return nil, err
}
switch len(stmts) {
Expand Down