mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-04 14:03:06 +00:00
This patch adds several additional tests o test/cql-pytest/test_json.py to reproduce additional bugs or clarify some non-bugs. First, it adds a reproducer for issue #8087, where SELECT JSON may create invalid JSON - because it doesn't quote a string which is part of a map's key. As usual for these reproducers, the test passes on Cassandra, and fails on Scylla (so marked xfail). We have a bigger test translated from Cassandra's unit tests, cassandra_tests/validation/entities/json_test.py::testInsertJsonSyntaxWithNonNativeMapKeys which demonstrates the same problem, but the test added in this patch is much shorter and focuses on demonstrating exactly where the problem is. Second, this patch adds a test test verifies that SELECT JSON works correctly for UDTs or tuples where one of their components was never set - in such a case the SELECT JSON should also output this component, with a "null" value. And this test works (i.e., produces the same result in Cassandra and Scylla). This test is interesting because it shows that issue #8092 is specific to the case of an altered UDT, and doesn't happen for every case of null component in a UDT. Refs #8087 Refs #8092 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20210216150329.1167335-1-nyh@scylladb.com>