-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spanner: Properly handle multi-row mutations with heterogeneous columns #2426
Conversation
Prior to this change, attempting to insert multiple rows at once with Table#insert or Transaction#insert where some rows lack a value for nullable columns would result in data attempting to be inserted into the incorrect column, due to a flawed assumption in transaction-request.js that every single row contains exact same set of columns, and that the order of keys returned by Object.keys would be identical for each and every row. This fixes googleapis#2411.
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
BoolValue: true, | ||
IntValue: 10 | ||
} | ||
], done); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
What would happen if the two rows have different number of columns? I think you should error out in that case. |
var missingColumns = columns.filter(column => keys.indexOf(column) === -1); | ||
|
||
if (missingColumns.length > 0) { | ||
throw new Error([ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #2411
This adds a commit with tests on top of the work done by @jscinoz in #2417.