Skip to content

Commit

Permalink
Add vector type added in MySQL 9.0
Browse files Browse the repository at this point in the history
This type was added in MySQL 9.0, so ensure we can parse it here. See
also:

https://dev.mysql.com/doc/dev/mysql-server/latest/field__types_8h.html

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
  • Loading branch information
dbussink committed Jul 18, 2024
1 parent b2b6d7b commit c31c81d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/mysql2/result.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ static rb_encoding *binaryEncoding;
*/
#define MYSQL2_BINARY_CHARSET 63

#ifndef MYSQL_TYPE_VECTOR
#define MYSQL_TYPE_VECTOR 242
#endif

#ifndef MYSQL_TYPE_JSON
#define MYSQL_TYPE_JSON 245
#endif
Expand Down Expand Up @@ -382,6 +386,9 @@ static VALUE rb_mysql_result_fetch_field_type(VALUE self, unsigned int idx) {
case MYSQL_TYPE_JSON: // json
rb_field_type = rb_str_new_cstr("json");
break;
case MYSQL_TYPE_VECTOR: // vector
rb_field_type = rb_str_new_cstr("vector");
break;
default:
rb_field_type = rb_str_new_cstr("unknown");
break;
Expand Down

0 comments on commit c31c81d

Please sign in to comment.