Skip to content

fix(sql): decode MySQL BINARY/VARBINARY columns#3444

Open
rumitvn wants to merge 1 commit into
tauri-apps:v2from
rumitvn:fix/sql-mysql-varbinary
Open

fix(sql): decode MySQL BINARY/VARBINARY columns#3444
rumitvn wants to merge 1 commit into
tauri-apps:v2from
rumitvn:fix/sql-mysql-varbinary

Conversation

@rumitvn

@rumitvn rumitvn commented Jun 10, 2026

Copy link
Copy Markdown

Closes #2274.

MySQL reports VARCHAR columns that use a binary collation (e.g. utf8mb4_bin) as VARBINARY. The MySQL decoder didn't handle BINARY/VARBINARY, so those columns fell through to the catch-all and failed with:

unsupported datatype: VARBINARY

(reported by several users, and the underlying behavior also tracked in launchbadge/sqlx#3387).

Changes

  • Add BINARY and VARBINARY to the binary-decoding match arm in plugins/sql/src/decode/mysql.rs, so they are returned as byte arrays just like BLOB/TINYBLOB/etc. This fixes the error without downgrading sqlx.
  • Fix a pre-existing typo TINIYBLOBTINYBLOB, which meant TINYBLOB columns were never matched and silently fell through too.

cargo check -p tauri-plugin-sql --features mysql passes. Added a covector changefile (sql/sql-js patch).

MySQL reports VARCHAR columns with a binary collation (e.g. utf8mb4_bin)
as VARBINARY, which fell through to the unsupported-datatype error
("unsupported datatype: VARBINARY"). Add BINARY and VARBINARY to the
binary-decoding arm so they are returned as byte arrays like the other
binary types. Also fix a typo (TINIYBLOB) that prevented TINYBLOB
columns from being decoded.

Closes tauri-apps#2274
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.

[bug] MySQL VARCHAR incorrectly interpreted as VARBINARY

1 participant