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

sql: include ON UPDATE on CREATE TABLE LIKE for INCLUDING DEFAULTS #70472

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

otan
Copy link
Contributor

@otan otan commented Sep 21, 2021

Resolves #69258

Release note (sql change): CREATE TABLE ... LIKE ... now copies ON
UPDATE definitions for INCLUDING DEFAULTS.

@otan otan requested review from rafiss and a team September 21, 2021 04:20
@cockroach-teamcity
Copy link
Member

This change is Reviewable

pkg/sql/logictest/testdata/logic_test/create_table Outdated Show resolved Hide resolved
pkg/sql/logictest/testdata/logic_test/create_table Outdated Show resolved Hide resolved
pkg/sql/logictest/testdata/logic_test/create_table Outdated Show resolved Hide resolved
@@ -230,9 +235,10 @@ like_defaults CREATE TABLE public.like_defaults (
h INT8 NULL,
j JSONB NULL,
k INT8 NULL,
t TIMESTAMPTZ NULL ON UPDATE current_timestamp():::TIMESTAMPTZ,
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd be fine keeping this one. i vote we just decide now that INCLUDING DEFAULTS will also copy ON UPDATE. but then one thing to check is that a column with both DEFAULT and ON UPDATE is copied correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i've changed this to be for DEFAULTS because ALL is a bitmask meaning including it on every option. i'm a bad proofreader.

@otan otan changed the title sql: include ON UPDATE on CREATE TBLE LIKE for INCLUDING ALL sql: include ON UPDATE on CREATE TBLE LIKE for INCLUDING DEFAULTS Sep 21, 2021
@otan otan changed the title sql: include ON UPDATE on CREATE TBLE LIKE for INCLUDING DEFAULTS sql: include ON UPDATE on CREATE TABLE LIKE for INCLUDING DEFAULTS Sep 21, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Release note (sql change): CREATE TABLE ... LIKE ... now copies ON
UPDATE definitions for INCLUDING DEFAULTS.
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm!

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan and @rafiss)

@otan
Copy link
Contributor Author

otan commented Sep 21, 2021

bors r=rafiss

@craig
Copy link
Contributor

craig bot commented Sep 21, 2021

Build succeeded:

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.

sql: decide how ON UPDATE expressions should be copied when using CREATE TABLE LIKE
3 participants