Skip to content

Conversation

vonzshik
Copy link
Contributor

@vonzshik vonzshik commented Oct 5, 2024

Fixes #5864

@vonzshik vonzshik requested a review from roji as a code owner October 5, 2024 20:59
@@ -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)
Copy link
Contributor Author

@vonzshik vonzshik Oct 5, 2024

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

@vonzshik vonzshik merged commit 39e38fd into main Oct 7, 2024
15 checks passed
@vonzshik vonzshik deleted the 5864-explicit-prepare-after-0A000-error-fix branch October 7, 2024 18:55
vonzshik added a commit that referenced this pull request Oct 7, 2024
vonzshik added a commit that referenced this pull request Oct 7, 2024
@vonzshik
Copy link
Contributor Author

vonzshik commented Oct 7, 2024

Backported to 8.0.5 via 30e8144, 7.0.9 via aaed546 (reverted due to not being stable on 7.0.9)

vonzshik added a commit that referenced this pull request Oct 7, 2024
vonzshik added a commit that referenced this pull request Oct 8, 2024
vonzshik added a commit that referenced this pull request Oct 8, 2024
@vonzshik
Copy link
Contributor Author

vonzshik commented Oct 8, 2024

Reapplied to 7.0.9 via 6b376a2 after a fix in #5874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading from 6.0.4 to 8.x: trick (Unprepare and Prepare again) to recover from '0A000: cached plan must not change result type' no longer works
2 participants