trilogy 2.8.1 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 314d8fc7b424ff0f7cb1a7b432fdf64d51d4a1c3bb0eb20dcf8ea67fb2445bd5
4
- data.tar.gz: 66b842ec3cf4017226fcc43e4b0bb931701b1299ea1cb025d8764ad7705dd96e
3
+ metadata.gz: 998b06e77dcb78b2f30307834490a7c9c7d61422dea586f646cead7b74467058
4
+ data.tar.gz: e5bf1ecf9e8b2b675db0d3c3ee7531db4ab022aa725c4ed0c16db088884c6075
5
5
  SHA512:
6
- metadata.gz: 5cf6f57d91e14972b5fc61576c1b5be98644c03a4a6185dd6fe80aa2c4c22f629c792abb1572e37dbe6b53aec2208cbb344a5575d8877094d3072a16d011bcbe
7
- data.tar.gz: e967b694945e7c2506240d20e2cb45fa67e0aca7f80ca4961cca7556d7fec8e27f1ab790a8459fc57de425a9144cdc808cc19547a607f35713640e59b752552f
6
+ metadata.gz: bd2acff1c38bbed9bea64f3fbb9ad474e4d42198dccbcdca0aa1b8ba3b52e35711f1c9e2e1a6859c15a71c38ed08ba06b5adcb5fbb5054b1b4264fd51ae0933f
7
+ data.tar.gz: e032a04cfb901d48a4e1e711cd576c380562f2b7f871724d06568dff8bd3b599fd3ea86360b3bcbe2f8f9471f986d6b1cc8f8d8e69309877778d1ce442dd65f3
@@ -133,7 +133,8 @@ static void handle_trilogy_error(struct trilogy_ctx *ctx, int rc, const char *ms
133
133
  rb_raise(Trilogy_TimeoutError, "%" PRIsVALUE, rbmsg);
134
134
 
135
135
  case TRILOGY_ERR: {
136
- VALUE message = rb_str_new(ctx->conn.error_message, ctx->conn.error_message_len);
136
+ VALUE conn_message = rb_str_new(ctx->conn.error_message, ctx->conn.error_message_len);
137
+ VALUE message = rb_sprintf("%" PRIsVALUE " (%" PRIsVALUE ")", conn_message, rbmsg);
137
138
  VALUE exc = rb_funcall(Trilogy_ProtocolError, id_from_code, 2, message, INT2NUM(ctx->conn.error_code));
138
139
  rb_exc_raise(exc);
139
140
  }
@@ -1133,6 +1134,10 @@ static VALUE rb_trilogy_server_version(VALUE self) { return rb_str_new_cstr(get_
1133
1134
 
1134
1135
  RUBY_FUNC_EXPORTED void Init_cext(void)
1135
1136
  {
1137
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
1138
+ rb_ext_ractor_safe(true);
1139
+ #endif
1140
+
1136
1141
  VALUE Trilogy = rb_const_get(rb_cObject, rb_intern("Trilogy"));
1137
1142
  rb_define_alloc_func(Trilogy, allocate_trilogy);
1138
1143
 
@@ -289,6 +289,7 @@ typedef enum {
289
289
  XX(TRILOGY_TYPE_YEAR, 0x0d) \
290
290
  XX(TRILOGY_TYPE_VARCHAR, 0x0f) \
291
291
  XX(TRILOGY_TYPE_BIT, 0x10) \
292
+ XX(TRILOGY_TYPE_VECTOR, 0xf2) \
292
293
  XX(TRILOGY_TYPE_JSON, 0xf5) \
293
294
  XX(TRILOGY_TYPE_NEWDECIMAL, 0xf6) \
294
295
  XX(TRILOGY_TYPE_ENUM, 0xf7) \
@@ -182,7 +182,7 @@ int trilogy_builder_write_buffer(trilogy_builder_t *builder, const void *data, s
182
182
 
183
183
  size_t fragment_remaining = TRILOGY_MAX_PACKET_LEN - builder->fragment_length;
184
184
 
185
- if (builder->packet_length >= builder->packet_max_length - len) {
185
+ if (builder->packet_length + len >= builder->packet_max_length) {
186
186
  return TRILOGY_MAX_PACKET_EXCEEDED;
187
187
  }
188
188
 
@@ -926,6 +926,8 @@ int trilogy_build_stmt_execute_packet(trilogy_builder_t *builder, uint32_t stmt_
926
926
  case TRILOGY_TYPE_VAR_STRING:
927
927
  case TRILOGY_TYPE_STRING:
928
928
  case TRILOGY_TYPE_GEOMETRY:
929
+ case TRILOGY_TYPE_JSON:
930
+ case TRILOGY_TYPE_VECTOR:
929
931
  CHECKED(trilogy_builder_write_lenenc_buffer(builder, val.as.str.data, val.as.str.len));
930
932
 
931
933
  break;
@@ -1059,6 +1061,7 @@ int trilogy_parse_stmt_row_packet(const uint8_t *buff, size_t len, trilogy_colum
1059
1061
  case TRILOGY_TYPE_DECIMAL:
1060
1062
  case TRILOGY_TYPE_NEWDECIMAL:
1061
1063
  case TRILOGY_TYPE_JSON:
1064
+ case TRILOGY_TYPE_VECTOR:
1062
1065
  CHECKED(trilogy_reader_get_lenenc_buffer(&reader, &out_values[i].as.str.len,
1063
1066
  (const void **)&out_values[i].as.str.data));
1064
1067
 
@@ -1,3 +1,3 @@
1
1
  class Trilogy
2
- VERSION = "2.8.1"
2
+ VERSION = "2.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trilogy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-13 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.5.3
105
+ rubygems_version: 3.5.11
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: A friendly MySQL-compatible library for Ruby, binding to libtrilogy