Skip to content

Fix pgsql build failures (#783)#786

Merged
staabm merged 4 commits into
staabm:mainfrom
p4veI:fix/pgsql-build-783
Jun 8, 2026
Merged

Fix pgsql build failures (#783)#786
staabm merged 4 commits into
staabm:mainfrom
p4veI:fix/pgsql-build-783

Conversation

@p4veI

@p4veI p4veI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@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 = ? 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 Fix mixed row inference for CTE (WITH ...) queries #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.

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.
@p4veI p4veI force-pushed the fix/pgsql-build-783 branch from b60a74f to c75ff8e Compare June 8, 2026 08:08
@staabm staabm enabled auto-merge (squash) June 8, 2026 15:29
@staabm

staabm commented Jun 8, 2026

Copy link
Copy Markdown
Owner

thank you!

@staabm staabm merged commit 74e4a11 into staabm:main Jun 8, 2026
28 checks passed
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.

2 participants