cql-rb 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/cql/protocol/cql_byte_buffer.rb +7 -2
- data/lib/cql/version.rb +1 -1
- data/spec/cql/protocol/cql_byte_buffer_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de475cb52182f982ae799799efa2666839c515eb
|
4
|
+
data.tar.gz: 6d736d939d31b342a732c7e47708b39329cce374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 087c4fb13f332dd30744a2b7e11a180a23043383b637221895723a9e5cbc9ccf12e56d7fbe30ec95f09d54ce5092338670b46bf1130b815c864b672c13f6b37b
|
7
|
+
data.tar.gz: 066cb8bb0af5e671443acc12b68b0c6975fcd22da11ec4236299f19ea34d41558bae878f64ebddcb7b1801075df3cfa0b1815de15a728614ed11d3b3313ec49a
|
data/README.md
CHANGED
@@ -364,6 +364,8 @@ after_fork do |server, worker|
|
|
364
364
|
end
|
365
365
|
```
|
366
366
|
|
367
|
+
Since prepared statements are tied to a particular connection, you'll need to recreate those after forking as well.
|
368
|
+
|
367
369
|
If your process does not fork and you still encounter deadlock errors, it might also be a bug. All IO is done is a dedicated thread, and if something happens that makes that thread shut down, Ruby will detect that the locks that the client code is waiting on can't be unlocked.
|
368
370
|
|
369
371
|
## I get "Bad file descriptor"
|
@@ -264,9 +264,12 @@ module Cql
|
|
264
264
|
end
|
265
265
|
|
266
266
|
def append_decimal(n)
|
267
|
-
|
267
|
+
str = n.to_s(FLOAT_STRING_FORMAT)
|
268
|
+
size = str.index(DECIMAL_POINT)
|
269
|
+
number_string = str.gsub(DECIMAL_POINT, NO_CHAR)
|
270
|
+
|
268
271
|
num = number_string.to_i
|
269
|
-
raw = self.class.new.append_varint(
|
272
|
+
raw = self.class.new.append_varint(num)
|
270
273
|
append_int(number_string.length - size)
|
271
274
|
append(raw)
|
272
275
|
end
|
@@ -284,6 +287,8 @@ module Cql
|
|
284
287
|
MINUS = '-'.freeze
|
285
288
|
ZERO = '0'.freeze
|
286
289
|
DECIMAL_POINT = '.'.freeze
|
290
|
+
FLOAT_STRING_FORMAT = 'F'.freeze
|
291
|
+
NO_CHAR = ''.freeze
|
287
292
|
end
|
288
293
|
end
|
289
294
|
end
|
data/lib/cql/version.rb
CHANGED
@@ -853,6 +853,16 @@ module Cql
|
|
853
853
|
buffer.should eql_bytes("\x00\x00\x00\x01\x00")
|
854
854
|
end
|
855
855
|
|
856
|
+
it 'encodes a BigDecimal ending in .0' do
|
857
|
+
buffer.append_decimal(BigDecimal.new('1042342234234.0'))
|
858
|
+
buffer.should eql_bytes("\x00\x00\x00\x01\tz\xE4b\xD4\xC4")
|
859
|
+
end
|
860
|
+
|
861
|
+
it 'encodes a BigDecimal ending with 00.0' do
|
862
|
+
buffer.append_decimal(BigDecimal.new('12000.0'))
|
863
|
+
buffer.should eql_bytes("\x00\x00\x00\x01\x01\xD4\xC0")
|
864
|
+
end
|
865
|
+
|
856
866
|
it 'appends to the buffer' do
|
857
867
|
buffer << "\x99"
|
858
868
|
buffer.append_decimal(BigDecimal.new('1042342234234.123423435647768234'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Hultberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ione
|