* fix(ai): resolve Codex CLI from shell PATH on macOS
* fix(ai): hide Codex CLI subprocess windows on Windows
* feat(ai): allow to set environment variable for Codex CLI
* fix(ai): parse Codex MCP tool events
* fix(mcp): honor Postgres TLS settings in direct queries
Problem: When exporting DISTINCT/GROUP BY query results from distributed
databases like Doris 2.1, LIMIT/OFFSET pagination without ORDER BY causes
duplicate rows across pages because tablet scan order varies between
independent query executions.
Fix: Detect dedup queries (DISTINCT, GROUP BY, HAVING) that lack an
ORDER BY clause and automatically inject a positional ORDER BY (1, 2, ..., N)
before applying LIMIT/OFFSET. Positional references work correctly with
aliases, expressions, CASE WHEN, subqueries, and aggregate functions.
Changes:
- Add dedup_projection_count_without_order_by() using sqlparser to detect
dedup queries and count projection columns
- Add ormat_positional_order_by() to generate ORDER BY 1, 2, ..., N
- Modify dd_standard_limit() to accept dedup_projection_count and inject
ORDER BY; wrap in subquery when original query already has LIMIT
- Update dd_outer_standard_limit() to accept an order_sql parameter
- Add 20 unit tests covering Doris, MySQL, PostgreSQL, aliases, expressions,
subqueries, GROUP BY, UNION, and existing ORDER BY scenarios
All 1203 tests pass (61 in query_result_sql, 11 in query_result_export).
StarRocks/Doris expose external storage through a catalog. dbx had no
catalog concept, so connecting to e.g. `paimon_catalog.clip` failed: the
URL path's database was sent as the MySQL handshake schema and rejected
before any `SET catalog` could run, and table listing/preview ran against
the default catalog.
Add an opt-in `catalog=<name>` URL parameter for mysql-family connections:
- `mysql_connection_catalog`: reads the `catalog` param (percent-decoded).
- `mysql_setup_queries`: emits `SET catalog = <name>` when present. Pushed
last so mysql_async's back-to-front setup execution (Vec::pop) runs it
before `USE <database>`, which would otherwise fail (the database lives
in the external catalog). The pool re-runs setup after each reset, so the
catalog stays current.
- `mysql_async_url`: when a catalog is configured, strip the database path
from the URL handed to mysql_async so the handshake does not send the
external-catalog database as the schema. The original URL (with path) is
still used for setup, so `USE <database>` is emitted correctly.
- Add `catalog` to `is_dbx_handled_mysql_url_param` so mysql_async ignores
the unknown param.
This is opt-in: only connections that set `catalog=` are affected; all
existing mysql/StarRocks/Doris connections behave unchanged. Configure a
Paimon connection as `database=clip`, `url_params=catalog=paimon_catalog`.
Verified against a StarRocks + Paimon catalog via the dbx MCP bridge:
SHOW DATABASES, SHOW TABLES, DESCRIBE, and unqualified `SELECT * FROM <t>`
all resolve in the selected catalog.