Skip to content

Commit 28ddc07

Browse files
tests: reduce nested type/UDT depth to 12 for new CQL nesting limit
Scylla now caps the nesting depth of CQL expressions in the parser, rejecting deeply nested literals with: SyntaxException code=2000 'expression nested too deeply' Cap the deepest case at 12, the maximum depth the server now allows. Caused by scylladb/scylladb commit e35c388 ('cql3: limit nesting depth of function calls and CASTs in CQL parser') scylladb/scylladb@c27e322.
1 parent c08913b commit 28ddc07

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

tests/integration/standard/test_types.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,18 +663,20 @@ def test_can_insert_nested_tuples(self):
663663
s.encoder.mapping[tuple] = s.encoder.cql_encode_tuple
664664

665665
# create a table with multiple sizes of nested tuples
666+
# Note: Scylla limits CQL expression nesting depth to 12, so the
667+
# deepest tuple tested here is 12 levels deep.
666668
s.execute("CREATE TABLE nested_tuples ("
667669
"k int PRIMARY KEY, "
668670
"v_1 frozen<%s>,"
669671
"v_2 frozen<%s>,"
670672
"v_3 frozen<%s>,"
671-
"v_32 frozen<%s>"
673+
"v_12 frozen<%s>"
672674
")" % (self.nested_tuples_schema_helper(1),
673675
self.nested_tuples_schema_helper(2),
674676
self.nested_tuples_schema_helper(3),
675-
self.nested_tuples_schema_helper(32)))
677+
self.nested_tuples_schema_helper(12)))
676678

677-
for i in (1, 2, 3, 32):
679+
for i in (1, 2, 3, 12):
678680
# create tuple
679681
created_tuple = self.nested_tuples_creator_helper(i)
680682

tests/integration/standard/test_udts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def test_can_insert_nested_registered_udts(self):
389389
with self._cluster_default_dict_factory() as c:
390390
s = c.connect(self.keyspace_name, wait_for_all_pools=True)
391391

392-
max_nesting_depth = 16
392+
max_nesting_depth = 12
393393

394394
# create the schema
395395
self.nested_udt_schema_helper(s, max_nesting_depth)
@@ -417,7 +417,7 @@ def test_can_insert_nested_unregistered_udts(self):
417417
with self._cluster_default_dict_factory() as c:
418418
s = c.connect(self.keyspace_name, wait_for_all_pools=True)
419419

420-
max_nesting_depth = 16
420+
max_nesting_depth = 12
421421

422422
# create the schema
423423
self.nested_udt_schema_helper(s, max_nesting_depth)
@@ -454,7 +454,7 @@ def test_can_insert_nested_registered_udts_with_different_namedtuples(self):
454454
with self._cluster_default_dict_factory() as c:
455455
s = c.connect(self.keyspace_name, wait_for_all_pools=True)
456456

457-
max_nesting_depth = 16
457+
max_nesting_depth = 12
458458

459459
# create the schema
460460
self.nested_udt_schema_helper(s, max_nesting_depth)

0 commit comments

Comments
 (0)