test(prepared_statements): avoid corrupting PS after setting number of PS to 0 - #1340
test(prepared_statements): avoid corrupting PS after setting number of PS to 0#1340meskill wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
|
||
| /// Run a named statement the way a client would, leaving it to the | ||
| /// connection to prepare it first if it isn't already. | ||
| pub(crate) async fn execute_prepared(server: &mut Server, name: &str) -> Vec<i64> { |
There was a problem hiding this comment.
Why is this not taking self? And if we're only using this in tests, let's mark it with cfg(test) as well, especially since this is using hardcoded values. Alternatively, give the caller the ability to pass in params - that will make this method usable by callers for real.
There was a problem hiding this comment.
that is also inside the mod test, no self to not mess with the usual impl, and I added the single param to the function so it could be used in more context if needed.
overall, this function is to run the existing prepared when the actual prepared was managed outside, so it's possible to mess around with actual caches etc.
bd156b4 to
5f1a2a3
Compare
5f1a2a3 to
e48b1aa
Compare
… PS to 0 - prevent counter reset to avoid newly created prepared statement treated like old one without shape check - do not clear global hashmap for keys since that could lead to attempt to reuse statement name wiped from global cache
e48b1aa to
6806997
Compare
it was fixed already by #1331 but anyway at-least here is integration-like test for this with the helpers to reuse later