Skip to content

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

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
otan-cockroach:like_fix
Sep 21, 2021
Merged

sql: include ON UPDATE on CREATE TABLE LIKE for INCLUDING DEFAULTS#70472
craig[bot] merged 1 commit intocockroachdb:masterfrom
otan-cockroach:like_fix

Conversation

@otan
Copy link
Copy Markdown
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 a team and rafiss September 21, 2021 04:20
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

h INT8 NULL,
j JSONB NULL,
k INT8 NULL,
t TIMESTAMPTZ NULL ON UPDATE current_timestamp():::TIMESTAMPTZ,
Copy link
Copy Markdown
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
Copy Markdown
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
Release note (sql change): CREATE TABLE ... LIKE ... now copies ON
UPDATE definitions for INCLUDING DEFAULTS.
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

otan commented Sep 21, 2021

bors r=rafiss

@craig
Copy link
Copy Markdown
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