From c31c81db12ee00ed3ab271aac2c4b4ed5691321c Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 18 Jul 2024 15:06:18 +0200 Subject: [PATCH] Add vector type added in MySQL 9.0 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 --- ext/mysql2/result.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/mysql2/result.c b/ext/mysql2/result.c index 23ec611ee..3e94f341a 100644 --- a/ext/mysql2/result.c +++ b/ext/mysql2/result.c @@ -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 @@ -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;