Skip to content

Commit 8f60fea

Browse files
committed
RUBY-220 - Plumbing to support custom types: serializing and deserializing custom domain objects defined by the client.
* Fix bug in prepared-statement processing to enable insertion into tables with a custom-type partition-key.
1 parent 468d634 commit 8f60fea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/cassandra/statements/prepared.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def create_partition_key(values)
185185
'the partition key and must be present.'
186186
end
187187

188-
if @connection_options.protocol_version >= 3
188+
if @connection_options.protocol_version >= 4
189+
Protocol::Coder.write_value_v4(buffer, value, type)
190+
elsif @connection_options.protocol_version >= 3
189191
Protocol::Coder.write_value_v3(buffer, value, type)
190192
else
191193
Protocol::Coder.write_value_v1(buffer, value, type)
@@ -205,7 +207,9 @@ def create_partition_key(values)
205207
'the partition key and must be present.'
206208
end
207209

208-
if @connection_options.protocol_version >= 3
210+
if @connection_options.protocol_version >= 4
211+
Protocol::Coder.write_value_v4(buffer, value, type)
212+
elsif @connection_options.protocol_version >= 3
209213
Protocol::Coder.write_value_v3(buf, value, type)
210214
else
211215
Protocol::Coder.write_value_v1(buf, value, type)

0 commit comments

Comments
 (0)