simplereach/helenus — pull request #81 by pieterbos (2012-10-16 12:16:20+00:00)
Title: Add support for negative integers to CQL (at least version 3)

According to the CQL datatypes documentation, the types int, bigint and varint refer to signed integers.

Helenus incorrectly interprets them as unsigned integers, at least from CQL.

The first commit contains tests to test number parsing in CQL3. This test fails on negative integers.

The second commit fixes the test.

This works for positive integers up to 53 bits (which is the 64-bit float javascript limit). For negative integers, with this patch the maximum negative value is the most negative 32 bit signed integer. There is room for improvement here, possibly by introducing a big integer library for the long values, or by trying to parse 53-bit negative numbers instead of 32. These limits apply both to bigint/long and varint above 32 bits.