Skip to content

Fix UPDATE with multiple identical values#9295

Merged
losipiuk merged 1 commit intotrinodb:masterfrom
djsagain:david.stryker/fix-update-duplicates
Sep 24, 2021
Merged

Fix UPDATE with multiple identical values#9295
losipiuk merged 1 commit intotrinodb:masterfrom
djsagain:david.stryker/fix-update-duplicates

Conversation

@djsagain
Copy link
Copy Markdown
Member

UPDATE failed when more than one column was updated
to the same value. The root cause was confusion in
LocalExecutionPlanner.createColumnValueAndRowIdChannels().

This commit fixes that confusion and removes an comment
declaring incorrectly that the code depended on order of
columns in the page - - instead, the code is looking up
the channel by Symbol.

This commit adds the test contained in the original bug
report, as well as a test for identical update values
for multiple columns.

@cla-bot cla-bot Bot added the cla-signed label Sep 19, 2021
@djsagain djsagain requested review from findepi and hashhar September 19, 2021 00:30
@djsagain djsagain force-pushed the david.stryker/fix-update-duplicates branch from 50d47e1 to ee2c3ea Compare September 19, 2021 00:47
losipiuk
losipiuk previously approved these changes Sep 20, 2021
Copy link
Copy Markdown
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This check is a noop now. We are iterating over columnValueAndRowIdSymbols incrementing symbolCounter in every iteration. It will always be true no matter what

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed; removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It feels to me that we should have verify(index >= 0) here. Is that valid case that there exists a symbol in columnValueAndRowIdSymbols which is not part of outputSymbols?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point - - added
verify(index >= 0, "Could not find symbol %s in the outputSymbols %s", symbol, outputSymbols);

Copy link
Copy Markdown
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

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

Well - not relly LGTM. Some comments :)

@losipiuk losipiuk self-requested a review September 20, 2021 07:37
@findepi findepi requested a review from electrum September 20, 2021 07:56
@djsagain djsagain force-pushed the david.stryker/fix-update-duplicates branch from ee2c3ea to 584ed00 Compare September 20, 2021 14:20
@djsagain
Copy link
Copy Markdown
Member Author

Thanks for the review, @losipiuk! I acted on your comments, and also fixed one of the added tests whose results depended on CURRENT_DATE.

Copy link
Copy Markdown
Member

@martint martint left a comment

Choose a reason for hiding this comment

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

Just a minor comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These log messages are not particularly useful and will just clutter the test output. Please remove them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I removed them and force-pushed.

UPDATE failed when more than one column was updated
to the same value.  The root cause was confusion in
LocalExecutionPlanner.createColumnValueAndRowIdChannels().

This commit fixes that confusion and removes an comment
declaring incorrectly that the code depended on order of
columns in the page - - instead, the code is looking up
the channel by Symbol.

This commit adds the test contained in the original bug
report, as well as a test for identical update values
for multiple columns.
@djsagain djsagain force-pushed the david.stryker/fix-update-duplicates branch from 584ed00 to 4e1cc58 Compare September 24, 2021 15:04
@losipiuk losipiuk merged commit eb9b5ef into trinodb:master Sep 24, 2021
@losipiuk
Copy link
Copy Markdown
Member

Thanks. Merged

@github-actions github-actions Bot added this to the 363 milestone Sep 24, 2021
@losipiuk losipiuk mentioned this pull request Oct 5, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants