sql: error on result type changes in prepared statements#16335
Merged
madelynnblue merged 1 commit intocockroachdb:release-1.0from Jun 5, 2017
madelynnblue:cherrypick-16089
Merged
sql: error on result type changes in prepared statements#16335madelynnblue merged 1 commit intocockroachdb:release-1.0from madelynnblue:cherrypick-16089
madelynnblue merged 1 commit intocockroachdb:release-1.0from
madelynnblue:cherrypick-16089
Conversation
Fix a panic when the number of results change in a pgwire prepared statement. This is not the full fix for this bug, but it is the most we have decided to do for the 1.0 branch. This adds a few known bugs, all of which are fixed in the master branch: 1. Prepared statements of the form `INSERT ... RETURNING *` where a schema change is done after the prepare act inconsistently. They will succeed to write the data, but also return an error if the number of columns has increased. If the number of columns is the same but the types have changed, they will write the data and not return an error. 2. PREPARE/EXECUTE statements (that is, statements where PREPARE and EXECUTE appear in the text of the statement) incorrectly allow changes in result types due to schema changes between executions. Fixes #16062 See #16089 for the full fix
Member
bdarnell
approved these changes
Jun 5, 2017
jordanlewis
approved these changes
Jun 5, 2017
Contributor
|
The text of the known limitation must be very clear that even if an error is reported by CockroachDB due to a schema change between prepare and execute, the data is still inserted/upserted into the database. |
Contributor
|
LGTM otherwise Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a panic when the number of results change in a pgwire prepared
statement. This is not the full fix for this bug, but it is the most
we have decided to do for the 1.0 branch. This adds a few known bugs,
all of which are fixed in the master branch:
INSERT ... RETURNING *where aschema change is done after the prepare act inconsistently. They will
succeed to write the data, but also return an error if the number of
columns has increased. If the number of columns is the same but the
types have changed, they will write the data and not return an error.
and EXECUTE appear in the text of the statement) incorrectly allow
changes in result types due to schema changes between executions.
Fixes #16062
See #16089 for the full fix
cc @cockroachdb/release
@jseldess I think this needs to be documented in the 1.0 known limitations?