MDEV-39558 Merge VECTOR into BLOB/MEDIUMBLOB/LONGBLOB in type inferen…#5271
MDEV-39558 Merge VECTOR into BLOB/MEDIUMBLOB/LONGBLOB in type inferen…#5271mariadb-YuchenPei wants to merge 1 commit into
Conversation
…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.
|
/gemini review |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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.