fix(prepared_statements): make the old PREPARE unused and allow memory reclaim - #1342
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
levkk
approved these changes
Aug 11, 2026
levkk
reviewed
Aug 11, 2026
| /// | ||
| /// SQL `PREPARE` gets a key of its own, so it is never handed to | ||
| /// a second client. It is tracked and evicted like any other statement. | ||
| pub fn insert_anyway(&mut self, parse: &Parse) -> String { |
Collaborator
There was a problem hiding this comment.
You may want to rename this method accordingly. insert_anyway implies bypassing the cache, it does not imply handling prepared statements sent over the simple protocol only.
Contributor
Author
There was a problem hiding this comment.
renamed to insert_prepared
levkk
reviewed
Aug 11, 2026
| /// | ||
| /// 1. Mapping between unique prepared statement identifiers (query and result data types), | ||
| /// and the global unique prepared statement name used in all server connections. | ||
| /// Statements created by SQL `PREPARE` carry a key of their own, so they are |
Collaborator
There was a problem hiding this comment.
This is not a great implementation on our part. We should make those re-usable between clients.
meskill
force-pushed
the
meskill-2026-08-10-fix-prepared_statements---nspk
branch
from
August 11, 2026 18:21
18a3c97 to
bea37e8
Compare
meskill
force-pushed
the
meskill-2026-08-10-fix-prepared_statements---nspk
branch
2 times, most recently
from
August 11, 2026 18:55
eb2b53d to
6d4743b
Compare
Base automatically changed from
meskill-2026-08-08-fix-prepared_statements---wsp
to
main
August 12, 2026 10:53
meskill
force-pushed
the
meskill-2026-08-10-fix-prepared_statements---nspk
branch
2 times, most recently
from
August 12, 2026 10:55
c8ba50f to
76aef9b
Compare
meskill
force-pushed
the
meskill-2026-08-10-fix-prepared_statements---nspk
branch
from
August 13, 2026 05:35
76aef9b to
20be5ee
Compare
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.
Make sure the overwrite the PREPARED doesn't leak the statement in global cache.
And other refactors of global_cache to make it more explicit how it works for simple queries