Fix pgsql build failures (#783)#786
Merged
Merged
Conversation
The pgsql test suite (recording mode against postgres:14) failed on 4 assertions while every mysql job stayed green. PostgreSQL's strict typing rejects simulated SQL that MySQL silently casts, exposing three issues: - Positional '?' parameters were substituted in the wrong order. Bind calls are discovered in reverse source order by ExpressionFinder, so `WHERE a = ? and b = ?` became `a = '<b-value>' and b = '<a-value>'`. MySQL tolerated the mismatched literal, pgsql could not cast it. Sort the parameters by placeholder key before substitution. - The `number` type (int|float) was simulated as '1.0', which pgsql refuses to cast to an integer column. Prefer an integer representative for unions, which is accepted by both integer and float/decimal columns. - The CTE tests added in staabm#776 were mysql-only: `gesperrt int<-128,127>` assumes mysql TINYINT (pgsql schema uses INT) and `CAST(... AS SIGNED)` is invalid pgsql syntax. Keep the cross-db cases shared and split the aggregation/recursive cases into engine-specific data files.
b60a74f to
c75ff8e
Compare
This reverts commit 313a86b.
Owner
|
thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@staabm Hi, I've got a message regarding the failing test case, I'm not up to speed with the latest development of this repo, so the changes are vibe coded but it looks sensible to me.
The pgsql test suite (recording mode against postgres:14) failed on 4 assertions while every mysql job stayed green. PostgreSQL's strict typing rejects simulated SQL that MySQL silently casts, exposing three issues:
Positional '?' parameters were substituted in the wrong order. Bind calls are discovered in reverse source order by ExpressionFinder, so
WHERE a = ? and b = ?becamea = '<b-value>' and b = '<a-value>'. MySQL tolerated the mismatched literal, pgsql could not cast it. Sort the parameters by placeholder key before substitution.The
numbertype (int|float) was simulated as '1.0', which pgsql refuses to cast to an integer column. Prefer an integer representative for unions, which is accepted by both integer and float/decimal columns.The CTE tests added in Fix mixed row inference for CTE (WITH ...) queries #776 were mysql-only:
gesperrt int<-128,127>assumes mysql TINYINT (pgsql schema uses INT) andCAST(... AS SIGNED)is invalid pgsql syntax. Keep the cross-db cases shared and split the aggregation/recursive cases into engine-specific data files.