Prepared statement support has bugs that Npgsql tests expose
JelteF opened this issue · 3 comments
Describe the bug
When prepared statement support is enabled some prepared statements are still not recognized.
To Reproduce
git clone https://github.com/npgsql/Npgsql
cd Npgsql
git checkout v7.0.4
dotnet test ./test/Npgsql.Tests --filter QueryNonQuery
Expected behavior
No error.
Actual behaviour
The test fails with this error:
Failed QueryNonQuery [332 ms]
Error Message:
Npgsql.PostgresException : 26000: prepared statement "P_25136" does not exist
Desktop (please complete the following information):
- OS: Linux, Ubuntu 22.04 (using WSL2 on Windows 11)
Additional context
I won't have a lot of time to help debug this issue.
We don't fully support all features of the prepared protocol, e.g. if the library is using PREPARE
instead of Parse
, we don't detect the prepared statement.
I'm 99% sure that this test uses protocol level Parse packets
Sorry I didn't see this earlier.
This was such a rabbit hole but I managed to reproduce the failures and got the tests to pass. I encountered some interesting edge cases there. This test suite is awesome! Thank Jelte!
PR incoming!