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

parser: Add IMPORT INTO prototype syntax #37450

Merged
merged 2 commits into from
May 10, 2019

Conversation

dt
Copy link
Member

@dt dt commented May 10, 2019

Breaking this out of the implementation PR.
Release note: None

@dt dt requested review from knz, thoszhang and a team May 10, 2019 15:00
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but please do something about the split in two commits, see comment below.

Reviewed 1 of 1 files at r1, 6 of 7 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt, @knz, and @lucy-zhang)


pkg/sql/parser/sql.y, line 1788 at r1 (raw file):

    $$.val = &tree.Import{Table: &name, CreateDefs: $5.tblDefs(), FileFormat: $7, Files: $10.exprs(), Options: $12.kvOptions()}
  }
| IMPORT INTO table_name import_format DATA '(' string_or_placeholder_list ')' opt_with_options

This change in the 1st commit should be migrated to the 2nd, OR you can move the change to parse_test.go back to the first, OR you can squash the two things.

dt added 2 commits May 10, 2019 17:45
Expand a couple contractions and fix missing quotes.
This has the nice side effect of making the file highlight correctly even for
syntax highlighers that don't respect comments for quote-matching.

Release note: none.
@dt
Copy link
Member Author

dt commented May 10, 2019

whoops, nice catch!

@dt
Copy link
Member Author

dt commented May 10, 2019

bors r+

craig bot pushed a commit that referenced this pull request May 10, 2019
37366: sql: don't exclude unvalidated check constraints r=lucy-zhang a=lucy-zhang

Previously, as of 19.1, AllActiveAndInactiveChecks(), which gets check
constraints for ALTER TABLE as well as SHOW CONSTRAINT, etc., excluded
unvalidated checks on the table descriptor, under the assumption that all
checks would be validated once they'd been added to the table descriptor. This
was to avoid double-counting constraints that were both on the table descriptor
and in the list of mutations. This caused unvalidated checks added in earlier
versions to disappear (though they are still on the table descriptor itself,
and are still enforced for writes). This PR fixes the issue by only excluding
`Validating` checks on the table descriptor to avoid double-counting.

Fixes #37285.

Release note (bug fix): Fixes bug where unvalidated check constraints disappear
from the output of SHOW CONSTRAINT and cannot be referenced in ALTER TABLE
after upgrading to 19.1.

37450: parser: Add IMPORT INTO prototype syntax r=dt a=dt

Breaking this out of the implementation PR.
Release note: None

Co-authored-by: Lucy Zhang <lucy-zhang@users.noreply.github.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@craig craig bot merged commit fec8650 into cockroachdb:master May 10, 2019
@dt dt deleted the import-into-syntax branch May 11, 2019 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants