iconara / cql-rb

Cassandra CQL 3 binary protocol driver for Ruby
106 stars 31 forks source link

Fixing bug with appending varint of 0. #112

Closed ndrwdn closed 10 years ago

ndrwdn commented 10 years ago

Our team discovered an issue with saving a BigDecimal value of "0.0". We found that the append_varint method in cql_byte_buffer.rb doesn't encode the number 0. This commit fixes append_varint, fixing the usage of BigDecimal "0.0".

iconara commented 10 years ago

Great, thanks. Feels like I should have had a test for zero, seems obvious in hindsight. I'll merge shortly. Do you need a new version released soon?

ndrwdn commented 10 years ago

You're welcome!

Soon would be ideal, but we are not in a huge rush either.

iconara commented 10 years ago

I changed the fix around a bit and added a separate test for BigDecimal.new('0.0') to make sure we don't regress in the future (see 63271fbb15a8).

I'll release v2.0.1 shortly.

iconara commented 10 years ago

I've pushed v2.0.1 to RubyGems now.

ndrwdn commented 10 years ago

Great! Thank you for the quick response!