Skip to content

Fix getGeneratedKeys when no insert during batch upsert#4136

Merged
sougou merged 4 commits intovitessio:masterfrom
HubSpot:fix-batch-upsert-noinsert
Sep 1, 2018
Merged

Fix getGeneratedKeys when no insert during batch upsert#4136
sougou merged 4 commits intovitessio:masterfrom
HubSpot:fix-batch-upsert-noinsert

Conversation

@leoxlin
Copy link
Copy Markdown

@leoxlin leoxlin commented Aug 15, 2018

@acharis @harshit-gangal

Leo Xuzhang Lin added 3 commits August 14, 2018 22:08
Signed-off-by: Leo Xuzhang Lin <llin@hubspot.com>
Signed-off-by: Leo Xuzhang Lin <llin@hubspot.com>
Signed-off-by: Leo Xuzhang Lin <llin@hubspot.com>
@harshit-gangal harshit-gangal self-requested a review August 20, 2018 10:03
@harshit-gangal
Copy link
Copy Markdown
Member

I will look into this week.

Copy link
Copy Markdown
Member

@harshit-gangal harshit-gangal left a comment

Choose a reason for hiding this comment

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

Changes looks good overall.

if (this.retrieveGeneratedKeys) {
generatedKeys[i] = new long[]{cursorWithError.getCursor().getInsertId(), truncatedUpdateCount};
long insertId = cursorWithError.getCursor().getInsertId();
if (this.retrieveGeneratedKeys && !queryBatchUpsert || insertId > 0) {
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.

nit: good to put brackets for clarity . a && (b || c)

Signed-off-by: Leo Xuzhang Lin <llin@hubspot.com>
@sougou sougou merged commit e55032e into vitessio:master Sep 1, 2018
@leoxlin leoxlin deleted the fix-batch-upsert-noinsert branch October 30, 2018 03:06
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.

3 participants