-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for new VECTOR type #1609
Conversation
MySQL 9.0.0 added support for the VECTOR type. This adds basic support so it can be handled at the protocol level. Signed-off-by: Dirkjan Bussink <[email protected]>
WalkthroughRecent changes introduce a new contributor, Dirkjan Bussink, and expand the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- AUTHORS (1 hunks)
- const.go (1 hunks)
- fields.go (2 hunks)
- packets.go (1 hunks)
Additional comments not posted (5)
const.go (1)
128-131
: LGTM! But verify the usage of new constants.The new constants
fieldTypeVector
,fieldTypeInvalid
, andfieldTypeBool
are correctly defined.However, ensure that these new constants are correctly used throughout the codebase.
AUTHORS (1)
36-36
: LGTM!The new contributor Dirkjan Bussink is correctly added.
fields.go (2)
203-204
: LGTM! But verify the usage of the method.The new case
fieldTypeVector
is correctly added to returnscanTypeBytes
ifcharSet
isbinaryCollationID
.However, ensure that the
scanType
method is correctly used throughout the codebase.
115-116
: LGTM! But verify the usage of the method.The new case
fieldTypeVector
is correctly added to return "VECTOR".However, ensure that the
typeDatabaseName
method is correctly used throughout the codebase.packets.go (1)
1332-1333
: LGTM! But verify the usage of the method.The new case
fieldTypeVector
is correctly added to handle vector data types.However, ensure that the
readRow
method is correctly used throughout the codebase.Verification successful
LGTM! The new case
fieldTypeVector
is correctly added to handle vector data types.The
readRow
method is properly implemented and used throughout the codebase.
binaryRows.readRow
method includes the new casefieldTypeVector
.readRow
method is used inrows.go
andconnection.go
without issues.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `readRow` method. # Test: Search for the usage of `readRow` method. Expect: Occurrences of the method. rg --type go 'readRow'Length of output: 294
Script:
#!/bin/bash # Description: Gather implementations of `readRow` method and inspect its usage. # Get the implementation of `readRow` method in `binaryRows` struct ast-grep --lang go --pattern $'func (rows *binaryRows) readRow($_) $_ { $$$ }' # Get the implementation of `readRow` method in `textRows` struct ast-grep --lang go --pattern $'func (rows *textRows) readRow($_) $_ { $$$ }' # Get the usage of `readRow` method in `rows.go` rg -A 5 'readRow' rows.go # Get the usage of `readRow` method in `connection.go` rg -A 5 'readRow' connection.goLength of output: 11307
Description
MySQL 9.0.0 added support for the VECTOR type. This adds basic support so it can be handled at the protocol level.
See also https://dev.mysql.com/doc/dev/mysql-server/latest/field__types_8h.html
I have not added tests here specifically, since I also don't see any tests for some of the other types like say
GEOMETRY
and don't know how to add those then in a way that's preferred by the project.Checklist
Summary by CodeRabbit
New Features
VECTOR
in various database operations.Chores