mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 06:05:53 +00:00
The SELECT JSON statement, just like SELECT, allows the user to rename selected columns using an "AS" specification. E.g., "SELECT JSON v AS foo". This specification was not honored: We simply forgot to look at the alias in SELECT JSON's implementation (we did it correctly in regular SELECT). So this patch fixes this bug. We had two tests in cassandra_tests/validation/entities/json_test.py that reproduced this bug. The checks in those tests now pass, but these two tests still continue to fail after this patch because of two other unrelated bugs that were discovered by the same tests. So in this patch I also add a new test just for this specific issue - to serve as a regression test. Fixes #8078 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Closes #12123
All tests in this directory and its subdirectories were translated from Apache Cassandra's unit tests - the test/unit/org/apache/cassandra/cql3 directory in the Apache Cassandra source code repository. The organization of this directory mirrors that of the Cassandra directory, with test files renamed from SomeThingTest.java to some_thing_test.py. Individual files were translated in their entirety, and each individual file includes a comment on which version of the file was translated (Cassandra's tests continue to evolve, so we may later want to catch up with the differences). Please avoid adding new tests, not translated from Cassandra, in this directory. Instead, place new tests written from scratch for Scylla, or improved tests, in the directory above.