Skip to content

support unique key for on duplicate key statement - #11632

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ouyuanning:support-unique-col-for-on-dup
Sep 5, 2023
Merged

mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ouyuanning:support-unique-col-for-on-dup

Conversation

@ouyuanning

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #11261

What this PR does / why we need it:

if table have primary key & unique key. we can use on duplicate key statement now.

because if table have primary key & unique key.
on duplicate key statement may get multi dup key (eg: one row for primary key, another row for unique key).
but we only will pick rand one row to do the update action. so we append an agg node before on_duplicate_key node.
see:https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

@mergify mergify Bot added the kind/tech-request New feature or request label Sep 5, 2023
@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Sep 5, 2023
@mergify
mergify Bot merged commit a861194 into matrixorigin:main Sep 5, 2023
sukki37 pushed a commit that referenced this pull request Sep 17, 2023
if table have primary key & unique key.  we can use on duplicate key statement now.

because if table have primary key & unique key.
on duplicate key statement may get multi dup key (eg: one row for primary key, another row for unique key).
but we only will pick rand one row to do the update action.  so we append an agg node before on_duplicate_key node.
see:https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Approved by: @aunjgr, @m-schen, @heni02
sukki37 pushed a commit that referenced this pull request Sep 18, 2023
if table have primary key & unique key.  we can use on duplicate key statement now.

because if table have primary key & unique key.
on duplicate key statement may get multi dup key (eg: one row for primary key, another row for unique key).
but we only will pick rand one row to do the update action.  so we append an agg node before on_duplicate_key node.
see:https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Approved by: @aunjgr, @m-schen, @heni02
@ouyuanning
ouyuanning deleted the support-unique-col-for-on-dup branch November 15, 2023 11:25
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
if table have primary key & unique key.  we can use on duplicate key statement now.

because if table have primary key & unique key.
on duplicate key statement may get multi dup key (eg: one row for primary key, another row for unique key).
but we only will pick rand one row to do the update action.  so we append an agg node before on_duplicate_key node.
see:https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Approved by: @aunjgr, @m-schen, @heni02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/tech-request New feature or request size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants