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
fix(pgwire): fix spurious error when executing "create table" SQL from Rust #2385
Conversation
The real issue is that create table statement is executed in parse phase instead of execute .
|
Thank you @bziobrowski Your test is a lot better and reproduces the very same issue found by Rust. Regarding bind variables in |
CTAS executed as prepared statements fail even when there are no actual bind variables so this fix works only for CREATE TABLE x (spec) statements . |
All the issues Bolek mentioned are fixed. After merging master, which brought copy unification PR new “fuzz” PG tests began to fail specifically for “copy” sql. I asked @puzpuzpuz to take a look asap |
The COPY issue is now fixed as well as the CTAS/DDL not being executed on multiple statement runs. |
[PR Coverage check]😍 pass : 85 / 87 (97.70%) file detail
|
When executing any
CREATE TABLE
statement via Rust table would be created but Rust client will receive spurious "table already exists" error. This PR fixes that by not re-executingCREATE TABLE
despite Rust treating it as a prepared statement.Fixes the following:
S
format, which removes leading zeroes. This causes incorrect data values to be returned and inconsistent behaviour between "simple" and "extended" protocolsCREATE TABLE
,CREATE AS SELECT
andCOPY
BIND
message would leavesyncActions
array dirty. Subsequent SQL execution crashes JDBC driver due to duplicate response from the serverCLOSE
message on non-existing statement. This behaviour is removed. SomePARSE
errors could end up never registering named statement, which would subsequently fail to close.Adds tests, most PG wire tests, which require simple connection, are now run by a wrapper. This wrapper executes the same "lambda" against 12 different protocol combinations. This ensures consistent behaviour wherever possible.
Gotcha
testBatchInsertWithTransaction
excludessimple
protocol due to a bug. With simple protocol enabled, test hangs the connection on "cannot insert records out of order" error. We are sending invalid error response to the driver. This requires wireshark investigation as the behaviour is specific to batch execution over simple protocol. @bziobrowski would you mind having a look please?