Skip to content

Commit

Permalink
cql-pytest: Enable test for skipping eq restricted columns in order by
Browse files Browse the repository at this point in the history
This test was marked as xfail, but now the functionality it tests has been implemented.

In my opinion the expected error message makes no sense, the message was:
"Order by currently only supports the ordering of columns following their declared order in the PRIMARY KEY"
In cases where there was missing restriction on one column.

This has been changed to:
"Unsupported order by relation - column {} doesn't have an ordering or EQ relation."

Because of that I had to modify the test to accept messages from both Scylla and Cassandra.
The expected error message pattern is now "rder by", because that's the largest common part.

Signed-off-by: Jan Ciolek <[email protected]>
  • Loading branch information
cvybhu committed Dec 9, 2021
1 parent a548c2d commit 13d367d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ def testInOrderByWithTwoPartitionKeyColumns(cql, test_keyspace):

# Test that ORDER BY columns allow skipping equality-restricted clustering columns, see CASSANDRA-10271.
# Reproduces Scylla issue #2247.
@pytest.mark.xfail(reason="Issue #2247")
def testAllowSkippingEqualityAndSingleValueInRestrictedClusteringColumns(cql, test_keyspace):
with create_table(cql, test_keyspace, "(a int, b int, c int, d int, PRIMARY KEY (a, b, c))") as table:
execute(cql, table, "INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 0, 0, 0)
Expand Down Expand Up @@ -609,7 +608,10 @@ def testAllowSkippingEqualityAndSingleValueInRestrictedClusteringColumns(cql, te
[0, 0, 2, 2],
[0, 0, 1, 1])

errorMsg = "Order by currently only supports the ordering of columns following their declared order in the PRIMARY KEY"
# Minimal error message part that works both with Scylla and Cassandra
# Cassandra says: Order by currently only supports the ordering of columns following their declared order in the PRIMARY KEY
# Scylla says: Unsupported order by relation - column {} doesn't have an ordering or EQ relation.
errorMsg = "rder by"

assert_invalid_message(cql, table, errorMsg, "SELECT * FROM %s WHERE a=? AND b<? ORDER BY c DESC", 0, 1)

Expand Down

0 comments on commit 13d367d

Please sign in to comment.