-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: INSERT ON CONFLICT can insert NULLs into NOT NULL columns #35040
Comments
Great find. Thank you, we'll fix this. |
cc @vivekmenezes - this is not just a schema change problem. We should remove this panic. |
I filed #35083 to address the "over-eager panic" here. This issue represents a fix for the on conflict smuggling that you found. |
Minimized repro:
|
Here's a similar problem:
|
I think this is a regression. It used to work fine. |
So the logic to check nullability is properly shared between INSERT and UPSERT, because it's performed in However there's something funky going on in |
Found the bug: |
#34323 can be caused by this issue. |
35091: sql: rearchitecture ALTER TABLE RENAME, add support for renaming constraints r=knz a=knz Fixes #32555. For TypeORM compat, see discussion on #22298. Release note (sql change): This patch changes RENAME COLUMN to become a "table command", which can be used alongside other table commands in a single ALTER TABLE statement. This makes it possible to e.g. atomically add a computed column based on an existing column, and rename the columns so that the computed column "replaces" the original column. Release note (sql change): CockroachDB now supports ALTER TABLE RENAME CONSTRAINT for compatibility with PostgreSQL. This feature is limited to *named* constraints, where the name of the constraints is preserved in the table metadata. This currently includes CHECK, UNIQUE and FOREIGN KEY constraints, and does not include other constraints (DEFAULT, NULL etc) otherwise supported by PostgreSQL. For UNIQUE constraint, only supporting indexes that are not depended on by views can be renamed. 35121: sql: add support for pg_catalog.{current_setting,set_config} r=knz a=knz Fixes #35108. Needed for Flowable compatibility. Release note (sql change): The SQL built-in functions `pg_catalog.current_setting()` and `pg_catalog.set_config()` are now supported for compatibility with PostgreSQL. Note that only session-scoped configuration changes remain supported (`set_config(_, _, false)`). 35359: roachtest: backup: use AOST time slightly in the past r=mjibson a=mjibson Avoids problems where it's sometimes in the future according to the AOST logic. Fixes #34817 Release note: None 35371: sql: ensure column constraints are validated after SET for UPSERT r=knz a=knz Fixes #35040. Release note (bug fix): CockroachDB now properly applies column width and nullability constraints on the result of conflict resolution in UPSERT and INSERT ON CONFLICT. Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Matt Jibson <[email protected]>
amazing!
…On Thu, Mar 7, 2019 at 2:44 PM craig[bot] ***@***.***> wrote:
Closed #35040 <#35040> via
#35371 <#35371>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35040 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALOpBFj9DnhcPitI-QKNS_tGUbcai80pks5vUWwbgaJpZM4bBl7d>
.
--
"I've never found understanding CockroachDB to be a problem. Understanding
the architecture is easy, the difficulty comes when I immerse myself in it.
It's not the understanding that's hard, getting inside it and finding
myself rocking in the deep is when I find myself circling around something
that I want to wrestle with. It is often swimming back from such a
challenge when I feel fulfilled--the pleasure in reacquainting myself with
bors r+"
|
Describe the problem
The following sequence crashes CockroachDB:
Backtrace:
Please describe the issue you observed, and any steps we can take to reproduce it:
To Reproduce
What did you do? Describe in your own words.
Run the set of statements posted above.
Expected behavior
A clear and concise description of what you expected to happen.
Second
EXECUTE X
should fail to insert NULL value into a NON-NULL column.Environment:
cocroach sql
The text was updated successfully, but these errors were encountered: