Skip to content

fix(ios): read MySQL and MariaDB column defaults the way the Mac app does - #3091

Merged
datlechin merged 1 commit into
mainfrom
fix/ios-mysql-column-defaults
Sep 23, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/ios-mysql-column-defaults

Conversation

@datlechin

@datlechin datlechin commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Problem

The iOS MySQL driver passed SHOW FULL COLUMNS' Default value through unread. The Mac decoder from #3067 was not shared with the app. So on iPhone and iPad:

Fix

  • The iOS app now compiles the Mac decoder instead of a fork of it:
    • MySQLCatalogDefault.swift, MySQLGeneratedColumnClassification.swift, MySQLServerVersion.swift and OceanBaseColumnDefaults.swift are shared.
    • Every top-level declaration in them states nonisolated, and check-ios-shared-isolation.py passes.
  • The literal helpers the decoder needs moved from MySQLColumnDefinitionSQL.swift into a Foundation-only MySQLLiteralSQL.swift. The DDL writers stay on the Mac.
  • accountSyntax moved into the plugin-only account file, so MySQLServerVersion shares without dragging it in.
  • mysqlShowColumnsDefault is the one function the Mac per-table read and the iOS driver both call.
  • MySQLColumnListing picks the source by flavor:
    • MySQL and TiDB: SHOW FULL COLUMNS in its bare form
    • MariaDB 10.2.7 and later: the quoted INFORMATION_SCHEMA.COLUMNS default, the only read there that tells an expression from a string. A refused catalog falls back to the bare value, as on the Mac.
    • OceanBase: the shared OceanBaseColumnDefaults.columnDefault
    • Databend: as reported
  • The structure view now shows the SQL form ('abc', NULL, CURRENT_TIMESTAMP), the same as the Mac Structure tab.

The iOS app does not read SHOW CREATE TABLE. On MariaDB before 10.2.7, and for a MySQL expression default holding non-ASCII text, a default reads as the catalog states it.

Tests

  • MySQLColumnListingTests (9) use SHOW FULL COLUMNS and catalog rows captured verbatim from MySQL 8.4.11 and MariaDB 13.0.2.
  • iOS simulator: 777 Swift Testing tests in 105 suites pass, and 53 XCTests with 0 failures (30 are the existing skips).
  • SwiftLint is clean on every changed file.
  • The Mac suites that cover the moved helpers (MySQLColumnDefinitionSQLTests, OceanBaseColumnDefaultsTests, ColumnDefaultRoundTripTests, MySQLCreateTableTests) did not run locally. The shared build was stuck behind a stalled package download, so CI is their first run.

@datlechin
datlechin force-pushed the fix/mysql-no-backslash-escapes branch from 3abeac4 to 765d484 Compare September 23, 2026 15:35
@datlechin
datlechin force-pushed the fix/ios-mysql-column-defaults branch from 9cec39d to 15247d0 Compare September 23, 2026 15:35
@datlechin
datlechin force-pushed the fix/mysql-no-backslash-escapes branch from 765d484 to 4a30d97 Compare September 23, 2026 15:37
@datlechin
datlechin force-pushed the fix/ios-mysql-column-defaults branch from 15247d0 to e6e21d5 Compare September 23, 2026 15:38
@datlechin
datlechin changed the base branch from fix/mysql-no-backslash-escapes to main September 23, 2026 15:38
@datlechin
datlechin merged commit 731bd96 into main Sep 23, 2026
@datlechin
datlechin deleted the fix/ios-mysql-column-defaults branch September 23, 2026 19:19
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