Skip to content

MDEV-39558 Merge VECTOR into BLOB/MEDIUMBLOB/LONGBLOB in type inferen…#5271

Open
mariadb-YuchenPei wants to merge 1 commit into
11.8from
bb-11.8-mdev-39558
Open

MDEV-39558 Merge VECTOR into BLOB/MEDIUMBLOB/LONGBLOB in type inferen…#5271
mariadb-YuchenPei wants to merge 1 commit into
11.8from
bb-11.8-mdev-39558

Conversation

@mariadb-YuchenPei

Copy link
Copy Markdown
Contributor

…ce aggregation

VECTOR, as a subtype of VARCHAR, has max length 65532, i.e. maximum dimension of 16383. BLOB/MEDIUMBLOB/LONGBLOB (and corresponding TEXT types) each has length exceeding 65532. Therefore, when aggregating VECTOR with one of these BLOB/TEXT types, the aggregated type has length exceeding the max length of VECTOR, so it should be the BLOB/TEXT type rather than VECTOR.

…ce aggregation

VECTOR, as a subtype of VARCHAR, has max length 65532, i.e. maximum
dimension of 16383. BLOB/MEDIUMBLOB/LONGBLOB (and corresponding TEXT
types) each has length exceeding 65532. Therefore, when aggregating
VECTOR with one of these BLOB/TEXT types, the aggregated type has
length exceeding the max length of VECTOR, so it should be the
BLOB/TEXT type rather than VECTOR.
@mariadb-YuchenPei

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request resolves a SIGSEGV and memory corruption issue (MDEV-39558) by correcting type aggregation for comparison between vector types and larger blob/text types. Specifically, Type_collection_vector::aggregate_for_comparison in sql/sql_type_vector.cc is updated to return the blob type instead of the vector type when aggregating with medium_blob, blob, or long_blob. Relevant test cases have been added to mysql-test/main/vector2.test and its result file. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses MDEV-39558 by fixing a SIGSEGV and memory corruption issue during comparison aggregation. In Type_collection_vector::aggregate_for_comparison, when aggregating a vector type with medium, standard, or long BLOB/TEXT types, the method now correctly returns the BLOB type handler instead of the vector type handler. Tiny BLOBs continue to resolve to the vector type. Regression tests covering these intersection cases have been added. I have no feedback to provide as there are no review comments to evaluate.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants