-
Notifications
You must be signed in to change notification settings - Fork 860
Fix explicit prepare/unprepare after error 0A000 #5869
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
Conversation
@@ -61,7 +61,8 @@ internal PreparedStatementManager(NpgsqlConnector connector) | |||
if (BySql.TryGetValue(sql, out var pStatement)) | |||
{ | |||
Debug.Assert(pStatement.State != PreparedState.Unprepared); | |||
if (pStatement.IsExplicit) | |||
// If statement is invalidated, fall through below where we replace it with another | |||
if (pStatement.IsExplicit && pStatement.State != PreparedState.Invalidated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, changes in this file aren't required for the fix. But they do allow to just call Prepare
again after error 0A000 instead of calling both Unprepare
and Prepare
together. All in all I'm ok with removing this part (or for example just not backporting this particular change).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me
Fixes #5864