Boolean columns of dolt system tables (dolt.branches.dirty, dolt.status.staged,
dolt.diff.data_change, etc.) were sent over the wire as MySQL-style '0'/'1' in
text format whenever a filter or sort sat between the projection and the system
table (e.g. SELECT dirty FROM dolt.branches WHERE name = 'main'), while the
field description advertised the boolean OID. Clients that validate text output,
such as psycopg2, fail with "can't parse boolean: '0'".
Two fixes:
- TypeSanitizer's GetField handling only wrapped fields in a GMSCast when the
system table was the node's direct child. It now searches the subtree for the
relation the field names (respecting aliases and stopping at subquery
aliases), so intermediate Filter/Sort/etc. nodes no longer defeat the
GMS-to-Doltgres type translation.
- rowToBytes' text-format path serialized GMS-typed columns with the GMS type's
SQL() even though schemaToFieldDescriptions advertises the equivalent Doltgres
type's OID. It now converts such values through GMSCast and serializes with
the Doltgres type, mirroring what the binary-format path already did.
Adds a ScriptTest and a simple-protocol MessageFlowTest (pgx negotiates binary
results, which took the working code path, so the wire-level test is the one
that reproduces the customer's failure).
Boolean columns of dolt system tables (e.g. dolt.branches.dirty) are now sent over the wire as booleans in text format.
Fixes #3116.