Skip to content

Commit

Permalink
importccl: always ignore PGDUMP statements in ignorelist
Browse files Browse the repository at this point in the history
Previously, we would only ignore statements that were in our ignorelist
if we could not parse them. However, as we add the ability to parse new
statements, that does not mean that IMPORT supports them just yet.

Release note: None
  • Loading branch information
pbardea committed Nov 5, 2020
1 parent af2fc41 commit 2d1347d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 2d1347d

Please sign in to comment.