Skip to content

Allow ALTER TABLE ADD COLUMN to specify an inline FK constraint#1299

Merged
fulghum merged 1 commit intomainfrom
fulghum/alter_table
Mar 18, 2025
Merged

Allow ALTER TABLE ADD COLUMN to specify an inline FK constraint#1299
fulghum merged 1 commit intomainfrom
fulghum/alter_table

Conversation

@fulghum
Copy link
Copy Markdown
Contributor

@fulghum fulghum commented Mar 18, 2025

The regressions listed below are caused by us now honoring the inline check constraint definition, instead of ignoring them. GMS doesn't update the scope with the new column, so check constraints that use the column at the same time as adding it don't work properly. MySQL also supports this behavior, but we don't support it in GMS yet, so the fix for these regressions will be in GMS.

@github-actions
Copy link
Copy Markdown
Contributor

Main PR
covering_index_scan_postgres 383.75/s 386.54/s +0.7%
index_join_postgres 153.60/s 153.92/s +0.2%
index_join_scan_postgres 180.60/s 185.94/s +2.9%
index_scan_postgres 12.21/s 12.58/s +3.0%
oltp_point_select 2731.51/s 2810.52/s +2.8%
oltp_read_only 1822.71/s 1870.75/s +2.6%
select_random_points 107.85/s 109.91/s +1.9%
select_random_ranges 132.54/s 132.91/s +0.2%
table_scan_postgres 10.08/s 10.20/s +1.1%
types_table_scan_postgres 5.31/s 5.38/s +1.3%

@github-actions
Copy link
Copy Markdown
Contributor

Main PR
Total 42090 42090
Successful 15732 15728
Failures 26358 26362
Partial Successes1 5190 5191
Main PR
Successful 37.3770% 37.3675%
Failures 62.6230% 62.6325%

${\color{red}Regressions (5)}$

alter_table

QUERY:          alter table atacc1 add column value int check (value < 10);
RECEIVED ERROR: column "value" could not be found in any table in scope (errno 1105) (sqlstate HY000)
QUERY:          alter table p1 add column a1 int check (a1 > 0);
RECEIVED ERROR: column "a1" could not be found in any table in scope (errno 1105) (sqlstate HY000)
QUERY:          update p1 set a1 = a1 + 1, f2 = upper(f2);
RECEIVED ERROR: column "a1" could not be found in any table in scope (errno 1105) (sqlstate HY000)

inherit

QUERY:          alter table pp1 add column a1 int check (a1 > 0);
RECEIVED ERROR: column "a1" could not be found in any table in scope (errno 1105) (sqlstate HY000)
QUERY:          alter table pp1 add column a2 int check (a2 > 0);
RECEIVED ERROR: column "a2" could not be found in any table in scope (errno 1105) (sqlstate HY000)

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@fulghum fulghum requested a review from zachmu March 18, 2025 23:07
Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM!

@fulghum fulghum merged commit d8f83bc into main Mar 18, 2025
18 checks passed
@fulghum fulghum deleted the fulghum/alter_table branch March 18, 2025 23:26
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.

2 participants