mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 18:10:39 +00:00
When writing to an integer column, Cassandra's fromJson() function allows not just JSON number constants, it also allows a string containing a number. Strings which do not hold a number fail with a FunctionFailure. In particular, the empty string "" is an invalid number, and should fail. The tests in this patch check this for two integer types: int and varint. Curiously, Cassandra and Scylla have opposite bugs here: Scylla fails to recognize the error for varint, while Cassandra fails to recognize the error for int. The tests in this patch reproduce these bugs. The tests demonstrating Scylla's bug are marked xfail, and the tests demonstrating Cassandra's bug is marked "cassandra_bug" (which means it is marked xfail only when running against Cassandra, but expected to succeed on Scylla. Refs #7944. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210121133833.66075-1-nyh@scylladb.com>