From 2d1347de6c1aca33e5827fa5d927f2c7abfa1916 Mon Sep 17 00:00:00 2001 From: Paul Bardea Date: Thu, 5 Nov 2020 10:23:10 -0500 Subject: [PATCH] importccl: always ignore PGDUMP statements in ignorelist 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 --- pkg/ccl/importccl/import_stmt_test.go | 3 +-- pkg/ccl/importccl/read_import_pgdump.go | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/ccl/importccl/import_stmt_test.go b/pkg/ccl/importccl/import_stmt_test.go index a1ba02b0d853..ccbf6b90a105 100644 --- a/pkg/ccl/importccl/import_stmt_test.go +++ b/pkg/ccl/importccl/import_stmt_test.go @@ -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", diff --git a/pkg/ccl/importccl/read_import_pgdump.go b/pkg/ccl/importccl/read_import_pgdump.go index 881ea9473fd9..851eb573a105 100644 --- a/pkg/ccl/importccl/read_import_pgdump.go +++ b/pkg/ccl/importccl/read_import_pgdump.go @@ -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) {