Skip to content
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

fix: DDL batch errors halfway were not propagated #444

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

olavloite
Copy link
Collaborator

A DDL batch that executed at least one statement successfully and then failed for a later statement would be reported as successful. This was caused by an invalid extraction of the returned update counts from the SpannerBatchUpdateException. The exception contains a full list of update counts for all statements in the batch. The value is 1 for a statement that was (successfully) executed and 0 for all other statements. The extraction of the update counts assumed that the list would only contain an entry for the statements that were actually executed.

Fixes #443

A DDL batch that executed at least one statement successfully and then
failed for a later statement would be reported as successful. This was
caused by an invalid extraction of the returned update counts from the
SpannerBatchUpdateException. The exception contains a full list of
update counts for all statements in the batch. The value is 1 for a
statement that was (successfully) executed and 0 for all other
statements. The extraction of the update counts assumed that the list
would only contain an entry for the statements that were actually
executed.

Fixes #443
@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Merging #444 (bf91662) into postgresql-dialect (170dc7c) will increase coverage by 0.03%.
The diff coverage is n/a.

@@                   Coverage Diff                    @@
##             postgresql-dialect     #444      +/-   ##
========================================================
+ Coverage                 87.29%   87.32%   +0.03%     
- Complexity                 2020     2022       +2     
========================================================
  Files                       122      122              
  Lines                      6651     6651              
  Branches                    957      957              
========================================================
+ Hits                       5806     5808       +2     
+ Misses                      595      594       -1     
+ Partials                    250      249       -1     
Flag Coverage Δ
all_tests 87.32% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...panner/pgadapter/statements/BackendConnection.java 90.99% <ø> (+0.46%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@olavloite olavloite merged commit fc6efa4 into postgresql-dialect Nov 2, 2022
@olavloite olavloite deleted the issue-443 branch November 2, 2022 12:42
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.

Errors are not propagated correctly in a DDL batch
1 participant