Skip to content

fix(plugins): MySQL numeric column rendering and Query cancelled alert race#1209

Merged
datlechin merged 1 commit into
mainfrom
fix/mysql-cells-and-cancel-alert
May 11, 2026
Merged

fix(plugins): MySQL numeric column rendering and Query cancelled alert race#1209
datlechin merged 1 commit into
mainfrom
fix/mysql-cells-and-cancel-alert

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Two regressions from #1190 (refactor(plugins)!: typed PluginCellValue for binary cells):

1. MySQL numeric / date columns render as hex bytes

INT 1 displayed as 0x31, DECIMAL 12.50 as 0x31322E3530, dates as raw byte sequences. The new binary-routing predicate was field.charsetnr == 63, but MariaDB reports charset 63 for every non-character type, not just BLOB/VARBINARY.

Fix: MariaDBFieldClassifier.isBinary(typeRaw:charset:) now requires both charset 63 AND a BLOB / VARBINARY / BIT field type. Numerics, decimals, dates, JSON, ENUM, SET, GEOMETRY all route to .text as they should.

Audited every plugin touched by #1190; MySQL is the only one with this bug. PostgreSQL (OID 17), DuckDB (DUCKDB_TYPE_BLOB), MSSQL (SYBBINARY|SYBVARBINARY|SYBIMAGE), Oracle (.raw|.longRAW|.blob), Cassandra (CASS_VALUE_TYPE_BLOB), BigQuery (schema type "BYTES"), MongoDB (as? Data), DynamoDB (.binary enum) all use sound predicates. ClickHouse, Redis, CloudflareD1, Etcd, LibSQL never emit .bytes on result rows.

2. "Query Execution Failed: Query cancelled" alert race

When opening a table tab, the in-flight query is sometimes cancelled by supersession (refresh, preview-tab promotion, teardown). The plugin threw a custom error with message "Query cancelled", which the catch path in MainContentCoordinator / QueryExecutionCoordinator+Parameters / +MultiStatement surfaced as a user alert because there was no Task.isCancelled / cancellation-error filter.

Fix:

  • MySQL, MSSQL, and MongoDB drivers now throw the standard CancellationError() instead of a custom *Error("Query cancelled"). This aligns with what the streaming paths already do (Oracle, DuckDB, the streaming branches of those same drivers).
  • All three catch sites (MainContentCoordinator:1107-1119, +Parameters:156-168, +MultiStatement:140-156) now short-circuit when error is CancellationError || Task.isCancelled. Cleanup state mutations still run; only the alert is suppressed.

Test plan

  • Build and open MySQL connection. Click order_items (1M rows seeded). INT and DECIMAL render as 1, 12.50 etc. — no 0x... hex.
  • Click between tables rapidly to trigger query supersession. No "Query cancelled" alert should appear.
  • Hit Refresh while a query is loading. No alert.
  • Close a connection mid-query. No alert.
  • MariaDBFieldClassifierTests — 7 new tests covering BIT, BLOB family, VAR_STRING/STRING charset 63, numerics, temporals, JSON/ENUM/SET/GEOMETRY. Verified via xcodebuild test -only-testing:TableProTests/MariaDBFieldClassifierTests** TEST SUCCEEDED **.

@datlechin datlechin merged commit 0f2f965 into main May 11, 2026
2 checks passed
@datlechin datlechin deleted the fix/mysql-cells-and-cancel-alert branch May 11, 2026 06:27
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.

1 participant