diff --git a/cql_test.py b/cql_test.py index 99d3088ced..30c5507d02 100644 --- a/cql_test.py +++ b/cql_test.py @@ -1219,14 +1219,23 @@ def _assert_logs_slow_queries_with_skinny_table(node, session): TestCQLSlowQuery._assert_logs(node, session, table, query="SELECT * FROM {} WHERE k >= 0 AND k < 100 ALLOW FILTERING", logged_query="SELECT \* FROM ks.{} WHERE k >= 0 AND k < 100") - TestCQLSlowQuery._assert_logs(node, session, table, - query="SELECT * FROM {} WHERE k <= 100 AND k > 0 ALLOW FILTERING", - logged_query="SELECT \* FROM ks.{} WHERE k > 0 AND k <= 100") - TestCQLSlowQuery._assert_logs(node, session, table, - query="SELECT * FROM {} WHERE k < 100 AND k >= 0 ALLOW FILTERING", - logged_query="SELECT \* FROM ks.{} WHERE k >= 0 AND k < 100") - # test logging of slow queries with restriciton on regular column + if node.cluster.version() >= '5.1': + TestCQLSlowQuery._assert_logs(node, session, table, + query="SELECT * FROM {} WHERE k <= 100 AND k > 0 ALLOW FILTERING", + logged_query="SELECT \* FROM ks.{} WHERE k <= 100 AND k > 0") + TestCQLSlowQuery._assert_logs(node, session, table, + query="SELECT * FROM {} WHERE k < 100 AND k >= 0 ALLOW FILTERING", + logged_query="SELECT \* FROM ks.{} WHERE k < 100 AND k >= 0") + else: + TestCQLSlowQuery._assert_logs(node, session, table, + query="SELECT * FROM {} WHERE k <= 100 AND k > 0 ALLOW FILTERING", + logged_query="SELECT \* FROM ks.{} WHERE k > 0 AND k <= 100") + TestCQLSlowQuery._assert_logs(node, session, table, + query="SELECT * FROM {} WHERE k < 100 AND k >= 0 ALLOW FILTERING", + logged_query="SELECT \* FROM ks.{} WHERE k >= 0 AND k < 100") + + # test logging of slow queries with restriction on regular column TestCQLSlowQuery._assert_logs(node, session, table, query="SELECT * FROM {} WHERE v = 1 ALLOW FILTERING", logged_query="SELECT \* FROM ks.{} WHERE v = 1") diff --git a/json_test.py b/json_test.py index 4f2e32b5dd..94c09f55c1 100644 --- a/json_test.py +++ b/json_test.py @@ -1238,10 +1238,10 @@ def test_simple_schema(self): """ run_func_docstring(tester=self, test_func=self.test_simple_schema) + @since("2.0", max_version="5.0") def test_pkey_requirement(self): """ Create schema: - >>> cqlsh(''' ... CREATE TABLE primitive_type_test ( ... key1 text PRIMARY KEY, @@ -1261,9 +1261,7 @@ def test_pkey_requirement(self): ... col14 varint, ... col15 boolean) ... ''') - Try to create a JSON row with the pkey omitted from the column list, and omitted from the JSON data: - >>> cqlsh_err_print('''INSERT INTO primitive_type_test JSON '{"col1": "bar"}' ''') :2:InvalidRequest: Error from server: code=2200 [Invalid query] message="Invalid null value in condition for column key1"