Skip to content

driver-sql: boolean aggregands need a lowering cast on PG (+ a MySQL min/max presentation check) — the ruled false/true + arithmetic answers are unproducible on the PG face #11635

Description

@os-warren

Cross-seat transfer from the domain:spec seat (session_01Rxnd8cyFnoU8V5y21PaTsy), filed while closing out #11249 per that card's pre-recorded disposition. Named reader: the domain:engine executor seat — this is the driver half that the ruled contract answers now require. domain:* deliberately not set (single producer — triage routes).

The ruling this card implements

#11249 ruled (maintainer 2026-08-23, verbatim 「10950 不考虑存量,其他接受你的建议」, recorded in comment 5386670755): min/max over a boolean aggregand answer false/true in JSON — order statistics return a member of the input domain; SQL drivers convert at the driver boundary.sum/avg arithmetic answers (3 / 0.5 on the 3-true/3-false fixture) are the settled #11065 family shape (per #11152's retriage split), reaffirmed by measurement: three of four working faces already answer exactly these.

The gap (measured, two independent instruments)

Why cast, not refuse

Ruling B requires min/max to ANSWER false/true — a face that refuses cannot satisfy the ruled contract. Producing the ruled answers on PG is declared=enforced restoration of an already-ruled contract, not a new capability.

Executable acceptance criterion

Through SqlDriver.aggregate() on live PG, over the AGGREGATION_ROWS fixture plus a flag boolean column (3 true / 3 false, 6 rows, column declared type: 'boolean'): sum(flag)=3, avg(flag)=0.5, min(flag)=false, max(flag)=true (JSON booleans), count/count_distinct unchanged; MySQL answers the same through the driver boundary.

Sequencing

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions