Skip to content

Commit

Permalink
Merge #56324
Browse files Browse the repository at this point in the history
56324: importccl: always ignore PGDUMP statements in ignorelist r=dt a=pbardea

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.

Fixes #53958.

Release note: None

Co-authored-by: Paul Bardea <[email protected]>
  • Loading branch information
craig[bot] and pbardea committed Nov 16, 2020
2 parents 14dbd67 + 2d1347d commit 807755c
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 807755c

Please sign in to comment.