Repository navigation
sql(postgres): re-prepare cached statements invalidated by 26000/0A000 #35120
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
Closed
+1,146
−49
Closed
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
bc025ae
sql(postgres): re-prepare cached statements invalidated by 26000/0A000
robobun fe73e7d
Merge remote-tracking branch 'origin/main' into farm/0d098c84/postgre…
robobun fb3fd16
sql(postgres): shorten the evict_statement doc comment
robobun b2a7790
Merge remote-tracking branch 'origin/main' into farm/0d098c84/postgre…
robobun c261ec4
sql(postgres): re-prepare only for an error that answers the Bind
robobun 4db5c8d
sql(postgres): re-run every pipelined query that hits a prepared-stat…
robobun 4550360
[autofix.ci] apply automated fixes
autofix-ci[bot] 92b5cb2
sql(postgres): shorten the re-prepare comments
robobun 1613087
Merge remote-tracking branch 'origin/main' into farm/0d098c84/postgre…
robobun 02d5348
sql(postgres): do not re-run a retried query inside a transaction blo…
robobun 2134b4d
sql(postgres): shorten two retry comments
robobun f9a42a6
sql(postgres): mark the connection not ready on ErrorResponse until i…
robobun aaa9eb6
sql(postgres): give a re-prepare its own statement object
robobun f0c2d58
sql(postgres): shorten the replace_statement doc comment
robobun 214866d
test(sql): fail fast when the re-prepare Describe never comes
robobun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,28 @@ | ||
| use super::new_reader::NewReader; | ||
| use super::transaction_status_indicator::TransactionStatusIndicator; | ||
| use crate::postgres::AnyPostgresError; | ||
|
|
||
| #[derive(Default)] | ||
| pub struct ReadyForQuery {} | ||
| pub struct ReadyForQuery { | ||
| pub status: TransactionStatusIndicator, | ||
| } | ||
|
|
||
| impl Default for ReadyForQuery { | ||
| fn default() -> Self { | ||
| Self { | ||
| status: TransactionStatusIndicator::I, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl ReadyForQuery { | ||
| pub fn decode_internal<Container: super::new_reader::ReaderContext>( | ||
| mut reader: NewReader<Container>, | ||
| ) -> Result<Self, AnyPostgresError> { | ||
| reader.length()?; | ||
|
|
||
| // transaction status indicator | ||
| reader.int::<u8>()?; | ||
| Ok(Self {}) | ||
| let status = reader.int::<u8>()?; | ||
| Ok(Self { | ||
| status: TransactionStatusIndicator(status), | ||
| }) | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Any u8 value is valid storage (the wire can carry bytes outside {I, T, E}). | ||
| // A Rust `#[repr(u8)] enum` would be UB for such values, so this is a | ||
| // transparent u8 newtype with associated consts instead. | ||
|
robobun marked this conversation as resolved.
Resolved
|
||
| #[repr(transparent)] | ||
| #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] | ||
| pub struct TransactionStatusIndicator(pub u8); | ||
|
|
||
| impl TransactionStatusIndicator { | ||
| /// if idle (not in a transaction block) | ||
| pub const I: Self = Self(b'I'); | ||
| } | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.