mirror of https://github.com/sysown/proxysql
PR #5755 (commit e6bef5c58) fixed `process_pg_typecast()` in
`lib/pgsql_tokenizer.cpp` so that the trailing space after a PG
typecast is preserved unless the next non-space character is a
modifier `(` or array bracket `[`. The commit message documented
this as an intentional behaviour change:
"The new lookahead-conditional skip preserves the trailing
space unless the very next non-space character is a modifier
`(` or array bracket `[`."
Three test cases in `tokenizer_payloads/pgsql_regular_tokenizer_digests.hjson`
hardcoded expected digests against the OLD (buggy) tokenizer output,
where the space-eating bug glued the preceding literal to the
following operator. With the fix in place those expectations
mismatch, making `pgsql-query_digests_stages_test-t` fail
deterministically in the legacy-g4 TAP group on v3.0 HEAD:
* `::json -> 'key'` STAGE 1: actual `select ? -> ?` vs old expected `select ?-> ?`
* `::jsonb @> ...` STAGE 1-4: actual `select ? @> ?` vs old expected `select ?@> ?`
* `::money + ...` STAGE 1: actual `select ? + ?` vs old expected `select ?+ ?`
For `->` and `+`, only STAGE 1 changes — STAGE 2-4's existing
whitespace-collapse step still glues `?->` and `?+` for those
operators, so `s2`/`s3`/`s4` expectations stay as-is. For `@>`,
none of the stages collapse the space, so all four expectations
move.
The new actual digest output is the more correct one — it mirrors
the existing MySQL tokenizer's behaviour for the same shape, where
`'literal' + 'literal'` already produces `? + ?` at STAGE 1. This
commit only updates the fixture; no tokenizer or test source
changes.
Verified locally against the existing test binary (built from
v3.0 HEAD, includes the new tokenizer behaviour):
./pgsql-query_digests_stages_test-t → 734/734 ok, RC=0
The 9 previously-failing assertions (#381, #385, #389-#392, #592,
#596, #600) all flip to ok with the updated fixture.
fix/parsersql-1.0.3-pg-set-fixes
parent
5a48004af5
commit
e668a9ddac
Loading…
Reference in new issue