Skip to content

Add support for UPDATE ... RETURNING#1432

Merged
fulghum merged 5 commits intomainfrom
fulghum/update_returning
Apr 29, 2025
Merged

Add support for UPDATE ... RETURNING#1432
fulghum merged 5 commits intomainfrom
fulghum/update_returning

Conversation

@fulghum
Copy link
Contributor

@fulghum fulghum commented Apr 25, 2025

Adds support for basic usage of UPDATE with a RETURNING clause.

Limitations:

  • Does not support * as an expression yet – an additional analyzer change is needed to expand * into column names.

Fixes: #1421

Depends on: dolthub/go-mysql-server#2955

@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2025

Main PR
covering_index_scan_postgres 334.84/s 334.64/s -0.1%
index_join_postgres 153.28/s 153.68/s +0.2%
index_join_scan_postgres 185.05/s 183.58/s -0.8%
index_scan_postgres 12.58/s 12.48/s -0.8%
oltp_point_select 2504.40/s 2505.28/s 0.0%
oltp_read_only 1811.36/s 1794.90/s -1.0%
select_random_points 117.42/s 115.51/s -1.7%
select_random_ranges 133.32/s 131.08/s -1.7%
table_scan_postgres 11.88/s 11.76/s -1.1%
types_table_scan_postgres 5.50/s 5.48/s -0.4%

@github-actions
Copy link
Contributor

Main PR
Total 42090 42090
Successful 16378 16381
Failures 25712 25709
Partial Successes1 5540 5540
Main PR
Successful 38.9119% 38.9190%
Failures 61.0881% 61.0810%

${\color{lightgreen}Progressions (3)}$

inherit

QUERY: update some_tab set a = a + 1 where false returning b, a;

triggers

QUERY: update stmt_trig_on_empty_upd set a = a where false returning a+1 as aa;
QUERY: update stmt_trig_on_empty_upd1 set a = a where false returning a+1 as aa;

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 force-pushed the fulghum/update_returning branch from f3d3f0e to 0ebab66 Compare April 25, 2025 20:01
@fulghum fulghum force-pushed the fulghum/update_returning branch from 0ebab66 to a20d77e Compare April 25, 2025 20:09
@fulghum fulghum requested a review from zachmu April 28, 2025 17:13
Copy link
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 43b2a93 into main Apr 29, 2025
14 checks passed
@fulghum fulghum deleted the fulghum/update_returning branch April 29, 2025 19:11
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.

UPDATE...RETURNING not yet supported

2 participants