Repository navigation
fix(mysql): decode MySQL 9 VECTOR columns (type 0xf2) - #4441
Merged
Merged
Conversation
This was referenced Oct 2, 2026
anderson-andres-dev
pushed a commit
to anderson-andres-dev/rowly-db
that referenced
this pull request
Oct 3, 2026
Rowly deja de depender de anderson-andres-dev/sqlx (rev df7b880): se quita [patch.crates-io] y los 6 crates de sqlx vuelven a la 0.8.6 de crates.io. La 0.8.6 publicada no lee el tipo 0xf2 (transact-rs/sqlx#4441 a煤n no est谩 en una release), as铆 que las lecturas de VECTOR de MySQL 9 llevan "-- gap:" y version_lines exige que sigan fallando con ese error. D8 pasa a parcial y SQL_ENGINE 搂9 suma el P2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds MySQL 9's
VECTORcolumn type (0xf2) tosqlx-mysql, so result sets with a vector column can be read.Does your PR solve an issue?
fixes #4440
Is this a breaking change?
No.
ColumnTypeispub(crate). Queries that failed with "unknown column type 0xf2" now return rows; nothing that worked before changes.What changes
ColumnType::Vector = 0xf2, decoded intry_from_u16and namedVECTOR.float32values, little-endian).[u8]/Vec<u8>are compatible withVECTOR, so a vector can be decoded as its raw bytes; throughany.rsthat also makes it anAnyTypeInfoKind::Blob.There is no Rust type for vectors here: decoding them into something like
Vec<f32>could be a follow-up if wanted.Tests
decodes_a_mysql_9_vector_columninprotocol/text/column.rs: it decodes a column definition of type0xf2. It fails before this change withunknown column type 0xf2and passes after it.tests/mysql: CI runs MySQL 8, which has noVECTORtype. I checked by hand against MySQL 9.0.1 and 9.7.2, with both protocols:SELECT *on a table with aVECTOR(3)column,SELECT STRING_TO_VECTOR('[1,2,3]'), and a prepared statement with a parameter. In the last one, the vector arrives as its 12 bytes and the column after it is read correctly.