Class | Name | Status | Type | Time(s) |
8_cythonno_x86_64_10_64 | test_conditional_delete | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f87c1c9bb20>
def test_conditional_delete(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
v1 int,
)
""")
# static columns
cursor.execute("""
CREATE TABLE test2 (
k text,
s text static,
i int,
v text,
PRIMARY KEY (k, i)
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("TRUNCATE test2")
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [False])
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (1, 2) IF NOT EXISTS", [True])
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [True])
assert_none(cursor, "SELECT * FROM test WHERE k=1", cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [False])
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (2, 2) IF NOT EXISTS USING TTL 1", [True])
time.sleep(1.5)
assert_one(cursor, "DELETE FROM test WHERE k=2 IF EXISTS", [False])
assert_none(cursor, "SELECT * FROM test WHERE k=2", cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (3, 2) IF NOT EXISTS", [True])
assert_one(cursor, "DELETE v1 FROM test WHERE k=3 IF EXISTS", [True])
assert_one(cursor, "SELECT * FROM test WHERE k=3", [3, None], cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE v1 FROM test WHERE k=3 IF EXISTS", [True])
assert_one(cursor, "DELETE FROM test WHERE k=3 IF EXISTS", [True])
cursor.execute("INSERT INTO test2 (k, s, i, v) VALUES ('k', 's', 0, 'v') IF NOT EXISTS")
assert_one(cursor, "DELETE v FROM test2 WHERE k='k' AND i=0 IF EXISTS", [True])
assert_one(cursor, "DELETE FROM test2 WHERE k='k' AND i=0 IF EXISTS", [True])
assert_one(cursor, "DELETE v FROM test2 WHERE k='k' AND i=0 IF EXISTS", [False])
assert_one(cursor, "DELETE FROM test2 WHERE k='k' AND i=0 IF EXISTS", [False])
# CASSANDRA-6430
> v = self.get_node_version(is_upgraded)
upgrade_tests/cql_tests.py:3215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 61.041 |
8_cythonno_x86_64_11_64 | test_select_with_alias | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fa8f14048e0>
def test_select_with_alias(self):
cursor = self.prepare()
cursor.execute('CREATE TABLE users (id int PRIMARY KEY, name text)')
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE users")
for id in range(0, 5):
cursor.execute("INSERT INTO users (id, name) VALUES ({}, 'name{}') USING TTL 10 AND TIMESTAMP 0".format(id, id))
# test aliasing count(*)
res = cursor.execute('SELECT count(*) AS user_count FROM users')
assert 'user_count' == res[0]._fields[0]
assert 5 == res[0].user_count
# test aliasing regular value
res = cursor.execute('SELECT name AS user_name FROM users WHERE id = 0')
assert 'user_name' == res[0]._fields[0]
assert 'name0' == res[0].user_name
# test aliasing writetime
res = cursor.execute('SELECT writeTime(name) AS name_writetime FROM users WHERE id = 0')
assert 'name_writetime' == res[0]._fields[0]
assert 0 == res[0].name_writetime
# test aliasing ttl
res = cursor.execute('SELECT ttl(name) AS name_ttl FROM users WHERE id = 0')
assert 'name_ttl' == res[0]._fields[0]
assert res[0].name_ttl, (9 in 10)
# test aliasing a regular function
res = cursor.execute('SELECT intAsBlob(id) AS id_blob FROM users WHERE id = 0')
assert 'id_blob' == res[0]._fields[0]
assert '\x00\x00\x00\x00' == res[0].id_blob.decode()
> logger.debug("Current node version is {}".format(self.get_node_version(is_upgraded)))
upgrade_tests/cql_tests.py:3276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 56.459 |
8_cythonno_x86_64_12_64 | test_function_with_null | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fae3e8c9fa0>
def test_function_with_null(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
t timeuuid
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("INSERT INTO test(k) VALUES (0)")
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:3458:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 53.270 |
8_cythonno_x86_64_16_64 | test_function_with_null | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7efc2c2eec40>
def test_function_with_null(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
t timeuuid
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("INSERT INTO test(k) VALUES (0)")
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:3458:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 62.492 |
8_cythonno_x86_64_17_64 | test_static_columns_paging | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestPagingDataNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fc190974280>
@since('2.0.6')
def test_static_columns_paging(self):
"""
Exercises paging with static columns to detect bugs
@jira_ticket CASSANDRA-8502.
"""
cursor = self.prepare(row_factory=named_tuple_factory)
cursor.execute("CREATE TABLE test (a int, b int, c int, s1 int static, s2 int static, PRIMARY KEY (a, b))")
for is_upgraded, cursor in self.do_upgrade(cursor, row_factory=named_tuple_factory):
> min_version = min(self.get_node_versions())
upgrade_tests/paging_test.py:660:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/distutils/version.py:52: in __lt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 48.214 |
8_cythonno_x86_64_1_64 | test_limit_multiget | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f875937c670>
def test_limit_multiget(self):
""" Validate LIMIT option for 'multiget' in SELECT statements """
cursor = self.prepare()
cursor.execute("""
CREATE TABLE clicks (
userid int,
url text,
time bigint,
PRIMARY KEY (userid, url)
) WITH COMPACT STORAGE;
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE clicks")
# Inserts
for id in range(0, 100):
for tld in ['com', 'org', 'net']:
cursor.execute("INSERT INTO clicks (userid, url, time) VALUES ({}, 'http://foo.{}', 42)".format(id, tld))
# Check that we do limit the output to 1 *and* that we respect query
# order of keys (even though 48 is after 2) prior to 2.1.17
> if self.get_node_version(is_upgraded) >= '2.1.17':
upgrade_tests/cql_tests.py:359:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 64.775 |
8_cythonno_x86_64_26_64 | test_static_columns_cas | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fa4ae718550>
@since('2.1')
def test_static_columns_cas(self):
""""
@jira_ticket CASSANDRA-6839
@jira_ticket CASSANDRA-6561
"""
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
id int,
k text,
version int static,
v text,
PRIMARY KEY (id, k)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
# Test that INSERT IF NOT EXISTS concerns only the static column if no clustering nor regular columns
# is provided, but concerns the CQL3 row targetted by the clustering columns otherwise
assert_one(cursor, "INSERT INTO test(id, k, v) VALUES (1, 'foo', 'foo') IF NOT EXISTS", [True])
assert_one(cursor, "INSERT INTO test(id, k, version) VALUES (1, 'foo', 1) IF NOT EXISTS", [False, 1, 'foo', None, 'foo'])
assert_one(cursor, "INSERT INTO test(id, version) VALUES (1, 1) IF NOT EXISTS", [True])
assert_one(cursor, "SELECT * FROM test", [1, 'foo', 1, 'foo'], ConsistencyLevel.SERIAL)
# Dodgy as its not conditional, but this is not allowed with a condition and that's probably fine in practice so go with it
cursor.execute("DELETE FROM test WHERE id = 1")
assert_one(cursor, "INSERT INTO test(id, version) VALUES (0, 0) IF NOT EXISTS", [True])
assert_one(cursor, "UPDATE test SET v='foo', version=1 WHERE id=0 AND k='k1' IF version = 0", [True])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 1, 'foo']], ConsistencyLevel.SERIAL)
assert_one(cursor, "UPDATE test SET v='bar', version=1 WHERE id=0 AND k='k2' IF version = 0", [False, 1])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 1, 'foo']], ConsistencyLevel.SERIAL)
assert_one(cursor, "UPDATE test SET v='bar', version=2 WHERE id=0 AND k='k2' IF version = 1", [True])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 2, 'foo'], [0, 'k2', 2, 'bar']], ConsistencyLevel.SERIAL)
# CASSANDRA-12694 (committed in 3.0.11 and 3.10) changes the behavior below slightly.
> version = self.get_node_version(is_upgraded)
upgrade_tests/cql_tests.py:3954:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.259 |
8_cythonno_x86_64_27_64 | test_composite_row_key | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fc371d6a940>
def test_composite_row_key(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k1 int,
k2 int,
c int,
v int,
PRIMARY KEY ((k1, k2), c)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
req = "INSERT INTO test (k1, k2, c, v) VALUES ({}, {}, {}, {})"
for i in range(0, 4):
cursor.execute(req.format(0, i, i, i))
assert_all(cursor, "SELECT * FROM test", [[0, 2, 2, 2], [0, 3, 3, 3], [0, 0, 0, 0], [0, 1, 1, 1]])
assert_all(cursor, "SELECT * FROM test WHERE k1 = 0 and k2 IN (1, 3)", [[0, 1, 1, 1], [0, 3, 3, 3]])
assert_invalid(cursor, "SELECT * FROM test WHERE k2 = 3")
> if self.get_node_version(is_upgraded) < '2.2':
upgrade_tests/cql_tests.py:1496:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 51.532 |
8_cythonno_x86_64_29_64 | test_select_count_paging | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f2d57442a60>
def test_select_count_paging(self):
"""
Test for the #6579 'select count' paging bug
@jira_ticket CASSANDRA-6579
"""
cursor = self.prepare()
cursor.execute("create table test(field1 text, field2 timeuuid, field3 boolean, primary key(field1, field2));")
cursor.execute("create index test_index on test(field3);")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("insert into test(field1, field2, field3) values ('hola', now(), false);")
cursor.execute("insert into test(field1, field2, field3) values ('hola', now(), false);")
# the result depends on which node we're connected to, see CASSANDRA-8216
> if self.get_node_version(is_upgraded) >= '2.2':
upgrade_tests/cql_tests.py:4197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 48.654 |
8_cythonno_x86_64_30_64 | test_static_columns_cas | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7efcb0598280>
@since('2.1')
def test_static_columns_cas(self):
""""
@jira_ticket CASSANDRA-6839
@jira_ticket CASSANDRA-6561
"""
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
id int,
k text,
version int static,
v text,
PRIMARY KEY (id, k)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
# Test that INSERT IF NOT EXISTS concerns only the static column if no clustering nor regular columns
# is provided, but concerns the CQL3 row targetted by the clustering columns otherwise
assert_one(cursor, "INSERT INTO test(id, k, v) VALUES (1, 'foo', 'foo') IF NOT EXISTS", [True])
assert_one(cursor, "INSERT INTO test(id, k, version) VALUES (1, 'foo', 1) IF NOT EXISTS", [False, 1, 'foo', None, 'foo'])
assert_one(cursor, "INSERT INTO test(id, version) VALUES (1, 1) IF NOT EXISTS", [True])
assert_one(cursor, "SELECT * FROM test", [1, 'foo', 1, 'foo'], ConsistencyLevel.SERIAL)
# Dodgy as its not conditional, but this is not allowed with a condition and that's probably fine in practice so go with it
cursor.execute("DELETE FROM test WHERE id = 1")
assert_one(cursor, "INSERT INTO test(id, version) VALUES (0, 0) IF NOT EXISTS", [True])
assert_one(cursor, "UPDATE test SET v='foo', version=1 WHERE id=0 AND k='k1' IF version = 0", [True])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 1, 'foo']], ConsistencyLevel.SERIAL)
assert_one(cursor, "UPDATE test SET v='bar', version=1 WHERE id=0 AND k='k2' IF version = 0", [False, 1])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 1, 'foo']], ConsistencyLevel.SERIAL)
assert_one(cursor, "UPDATE test SET v='bar', version=2 WHERE id=0 AND k='k2' IF version = 1", [True])
assert_all(cursor, "SELECT * FROM test", [[0, 'k1', 2, 'foo'], [0, 'k2', 2, 'bar']], ConsistencyLevel.SERIAL)
# CASSANDRA-12694 (committed in 3.0.11 and 3.10) changes the behavior below slightly.
> version = self.get_node_version(is_upgraded)
upgrade_tests/cql_tests.py:3954:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 60.987 |
8_cythonno_x86_64_31_64 | test_composite_row_key | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fa5d5f2a3d0>
def test_composite_row_key(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k1 int,
k2 int,
c int,
v int,
PRIMARY KEY ((k1, k2), c)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
req = "INSERT INTO test (k1, k2, c, v) VALUES ({}, {}, {}, {})"
for i in range(0, 4):
cursor.execute(req.format(0, i, i, i))
assert_all(cursor, "SELECT * FROM test", [[0, 2, 2, 2], [0, 3, 3, 3], [0, 0, 0, 0], [0, 1, 1, 1]])
assert_all(cursor, "SELECT * FROM test WHERE k1 = 0 and k2 IN (1, 3)", [[0, 1, 1, 1], [0, 3, 3, 3]])
assert_invalid(cursor, "SELECT * FROM test WHERE k2 = 3")
> if self.get_node_version(is_upgraded) < '2.2':
upgrade_tests/cql_tests.py:1496:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 69.742 |
8_cythonno_x86_64_33_64 | test_select_count_paging | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fe956b11e20>
def test_select_count_paging(self):
"""
Test for the #6579 'select count' paging bug
@jira_ticket CASSANDRA-6579
"""
cursor = self.prepare()
cursor.execute("create table test(field1 text, field2 timeuuid, field3 boolean, primary key(field1, field2));")
cursor.execute("create index test_index on test(field3);")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("insert into test(field1, field2, field3) values ('hola', now(), false);")
cursor.execute("insert into test(field1, field2, field3) values ('hola', now(), false);")
# the result depends on which node we're connected to, see CASSANDRA-8216
> if self.get_node_version(is_upgraded) >= '2.2':
upgrade_tests/cql_tests.py:4197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 63.392 |
8_cythonno_x86_64_34_64 | test_in_order_by_without_selecting | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f4234f47f10>
@since('2.1')
def test_in_order_by_without_selecting(self):
"""
Test that columns don't need to be selected for ORDER BY when there is a IN
@jira_ticket CASSANDRA-4911
"""
cursor = self.prepare()
cursor.execute("CREATE TABLE test (k int, c1 int, c2 int, v int, PRIMARY KEY (k, c1, c2))")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.default_fetch_size = None
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 0, 0)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 1, 1)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 2, 2)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 0, 3)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 1, 4)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 2, 5)")
assert_all(cursor, "SELECT * FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0)", [[0, 0, 0, 0], [0, 0, 2, 2]])
assert_all(cursor, "SELECT * FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 ASC, c2 ASC", [[0, 0, 0, 0], [0, 0, 2, 2]])
# check that we don't need to select the column on which we order
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0)", [[0], [2]])
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 ASC", [[0], [2]])
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 DESC", [[2], [0]])
> if self.get_node_version(is_upgraded) >= '2.1.17':
upgrade_tests/cql_tests.py:4323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.929 |
8_cythonno_x86_64_36_64 | test_whole_list_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f08668fd6a0>
@since('2.1.1')
def test_whole_list_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tlist (
k int PRIMARY KEY,
l list<text>
)""")
cursor.execute("""
CREATE TABLE frozentlist (
k int PRIMARY KEY,
l frozen<list<text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tlist")
cursor.execute("TRUNCATE frozentlist")
for frozen in (False, True):
table = "frozentlist" if frozen else "tlist"
cursor.execute("INSERT INTO {}(k, l) VALUES (0, ['foo', 'bar', 'foobar'])".format(table))
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition), [True], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True], cl=self.CL)
assert_none(cursor, "SELECT * FROM {}".format(table)) # read back at default cl.one
cursor.execute("INSERT INTO {}(k, l) VALUES (0, ['foo', 'bar', 'foobar'])".format(table))
check_applies("l = ['foo', 'bar', 'foobar']")
check_applies("l != ['baz']")
check_applies("l > ['a']")
check_applies("l >= ['a']")
check_applies("l < ['z']")
check_applies("l <= ['z']")
check_applies("l IN (null, ['foo', 'bar', 'foobar'], ['a'])")
# multiple conditions
check_applies("l > ['aaa', 'bbb'] AND l > ['aaa']")
check_applies("l != null AND l IN (['foo', 'bar', 'foobar'])")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition),
[False, ['foo', 'bar', 'foobar']], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition),
[False, ['foo', 'bar', 'foobar']], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# should not apply
check_does_not_apply("l = ['baz']")
check_does_not_apply("l != ['foo', 'bar', 'foobar']")
check_does_not_apply("l > ['z']")
check_does_not_apply("l >= ['z']")
check_does_not_apply("l < ['a']")
check_does_not_apply("l <= ['a']")
check_does_not_apply("l IN (['a'], null)")
check_does_not_apply("l IN ()")
# multiple conditions
check_does_not_apply("l IN () AND l IN (['foo', 'bar', 'foobar'])")
check_does_not_apply("l > ['zzz'] AND l < ['zzz']")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']], cl=self.CL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']], cl=self.CL)
check_invalid("l = [null]")
check_invalid("l < null")
check_invalid("l <= null")
check_invalid("l > null")
check_invalid("l >= null")
check_invalid("l IN null", expected=SyntaxException)
check_invalid("l IN 367", expected=SyntaxException)
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4452:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 50.505 |
8_cythonno_x86_64_38_64 | test_in_order_by_without_selecting | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f8dd1adf3a0>
@since('2.1')
def test_in_order_by_without_selecting(self):
"""
Test that columns don't need to be selected for ORDER BY when there is a IN
@jira_ticket CASSANDRA-4911
"""
cursor = self.prepare()
cursor.execute("CREATE TABLE test (k int, c1 int, c2 int, v int, PRIMARY KEY (k, c1, c2))")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.default_fetch_size = None
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 0, 0)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 1, 1)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (0, 0, 2, 2)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 0, 3)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 1, 4)")
cursor.execute("INSERT INTO test(k, c1, c2, v) VALUES (1, 1, 2, 5)")
assert_all(cursor, "SELECT * FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0)", [[0, 0, 0, 0], [0, 0, 2, 2]])
assert_all(cursor, "SELECT * FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 ASC, c2 ASC", [[0, 0, 0, 0], [0, 0, 2, 2]])
# check that we don't need to select the column on which we order
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0)", [[0], [2]])
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 ASC", [[0], [2]])
assert_all(cursor, "SELECT v FROM test WHERE k=0 AND c1 = 0 AND c2 IN (2, 0) ORDER BY c1 DESC", [[2], [0]])
> if self.get_node_version(is_upgraded) >= '2.1.17':
upgrade_tests/cql_tests.py:4323:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 60.983 |
8_cythonno_x86_64_39_64 | test_whole_set_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f9c316ddd30>
@since('2.1.1')
def test_whole_set_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tset (
k int PRIMARY KEY,
s set<text>
)""")
cursor.execute("""
CREATE TABLE frozentset (
k int PRIMARY KEY,
s frozen<set<text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tset")
cursor.execute("TRUNCATE frozentset")
for frozen in (False, True):
table = "frozentset" if frozen else "tset"
assert_one(cursor, "INSERT INTO {}(k, s) VALUES (0, {{'bar', 'foo'}}) IF NOT EXISTS".format(table), [True])
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition), [True])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True])
assert_none(cursor, "SELECT * FROM {}".format(table), cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "INSERT INTO {}(k, s) VALUES (0, {{'bar', 'foo'}}) IF NOT EXISTS".format(table), [True])
check_applies("s = {'bar', 'foo'}")
check_applies("s = {'foo', 'bar'}")
check_applies("s != {'baz'}")
check_applies("s > {'a'}")
check_applies("s >= {'a'}")
check_applies("s < {'z'}")
check_applies("s <= {'z'}")
check_applies("s IN (null, {'bar', 'foo'}, {'a'})")
# multiple conditions
check_applies("s > {'a'} AND s < {'z'}")
check_applies("s IN (null, {'bar', 'foo'}, {'a'}) AND s IN ({'a'}, {'bar', 'foo'}, null)")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition),
[False, {'bar', 'foo'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition),
[False, {'bar', 'foo'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# should not apply
check_does_not_apply("s = {'baz'}")
check_does_not_apply("s != {'bar', 'foo'}")
check_does_not_apply("s > {'z'}")
check_does_not_apply("s >= {'z'}")
check_does_not_apply("s < {'a'}")
check_does_not_apply("s <= {'a'}")
check_does_not_apply("s IN ({'a'}, null)")
check_does_not_apply("s IN ()")
check_does_not_apply("s != null AND s IN ()")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
check_invalid("s = {null}")
check_invalid("s < null")
check_invalid("s <= null")
check_invalid("s > null")
check_invalid("s >= null")
check_invalid("s IN null", expected=SyntaxException)
check_invalid("s IN 367", expected=SyntaxException)
# element access is not allow for sets
check_invalid("s['foo'] = 'foobar'")
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4683:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 49.936 |
8_cythonno_x86_64_39_64 | test_static_columns_paging | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestPagingDataNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f9c3153c2e0>
@since('2.0.6')
def test_static_columns_paging(self):
"""
Exercises paging with static columns to detect bugs
@jira_ticket CASSANDRA-8502.
"""
cursor = self.prepare(row_factory=named_tuple_factory)
cursor.execute("CREATE TABLE test (a int, b int, c int, s1 int static, s2 int static, PRIMARY KEY (a, b))")
for is_upgraded, cursor in self.do_upgrade(cursor, row_factory=named_tuple_factory):
> min_version = min(self.get_node_versions())
upgrade_tests/paging_test.py:660:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/distutils/version.py:52: in __lt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 56.358 |
8_cythonno_x86_64_3_64 | test_clustering_order_and_functions | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fec220e0280>
def test_clustering_order_and_functions(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int,
t timeuuid,
PRIMARY KEY (k, t)
) WITH CLUSTERING ORDER BY (t DESC)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
for i in range(0, 5):
cursor.execute("INSERT INTO test (k, t) VALUES (%d, now())" % i)
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:3056:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.541 |
8_cythonno_x86_64_40_64 | test_whole_list_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fd6c6aad490>
@since('2.1.1')
def test_whole_list_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tlist (
k int PRIMARY KEY,
l list<text>
)""")
cursor.execute("""
CREATE TABLE frozentlist (
k int PRIMARY KEY,
l frozen<list<text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tlist")
cursor.execute("TRUNCATE frozentlist")
for frozen in (False, True):
table = "frozentlist" if frozen else "tlist"
cursor.execute("INSERT INTO {}(k, l) VALUES (0, ['foo', 'bar', 'foobar'])".format(table))
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition), [True], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True], cl=self.CL)
assert_none(cursor, "SELECT * FROM {}".format(table)) # read back at default cl.one
cursor.execute("INSERT INTO {}(k, l) VALUES (0, ['foo', 'bar', 'foobar'])".format(table))
check_applies("l = ['foo', 'bar', 'foobar']")
check_applies("l != ['baz']")
check_applies("l > ['a']")
check_applies("l >= ['a']")
check_applies("l < ['z']")
check_applies("l <= ['z']")
check_applies("l IN (null, ['foo', 'bar', 'foobar'], ['a'])")
# multiple conditions
check_applies("l > ['aaa', 'bbb'] AND l > ['aaa']")
check_applies("l != null AND l IN (['foo', 'bar', 'foobar'])")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition),
[False, ['foo', 'bar', 'foobar']], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition),
[False, ['foo', 'bar', 'foobar']], cl=self.CL)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']]) # read back at default cl.one
# should not apply
check_does_not_apply("l = ['baz']")
check_does_not_apply("l != ['foo', 'bar', 'foobar']")
check_does_not_apply("l > ['z']")
check_does_not_apply("l >= ['z']")
check_does_not_apply("l < ['a']")
check_does_not_apply("l <= ['a']")
check_does_not_apply("l IN (['a'], null)")
check_does_not_apply("l IN ()")
# multiple conditions
check_does_not_apply("l IN () AND l IN (['foo', 'bar', 'foobar'])")
check_does_not_apply("l > ['zzz'] AND l < ['zzz']")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET l = ['foo', 'bar', 'foobar'] WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']], cl=self.CL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, ['foo', 'bar', 'foobar']], cl=self.CL)
check_invalid("l = [null]")
check_invalid("l < null")
check_invalid("l <= null")
check_invalid("l > null")
check_invalid("l >= null")
check_invalid("l IN null", expected=SyntaxException)
check_invalid("l IN 367", expected=SyntaxException)
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4452:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 57.726 |
8_cythonno_x86_64_40_64 | test_whole_map_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fd6c67862b0>
@since('2.1.1')
def test_whole_map_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tmap (
k int PRIMARY KEY,
m map<text, text>
)""")
cursor.execute("""
CREATE TABLE frozentmap (
k int PRIMARY KEY,
m frozen<map<text, text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tmap")
cursor.execute("TRUNCATE frozentmap")
for frozen in (False, True):
logger.debug("Testing {} maps".format("frozen" if frozen else "normal"))
table = "frozentmap" if frozen else "tmap"
cursor.execute("INSERT INTO %s(k, m) VALUES (0, {'foo' : 'bar'})" % (table,))
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), [True])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True])
assert_none(cursor, "SELECT * FROM {}".format(table), cl=ConsistencyLevel.SERIAL)
cursor.execute("INSERT INTO {}(k, m) VALUES (0, {{'foo' : 'bar'}})".format(table))
check_applies("m = {'foo': 'bar'}")
check_applies("m > {'a': 'a'}")
check_applies("m >= {'a': 'a'}")
check_applies("m < {'z': 'z'}")
check_applies("m <= {'z': 'z'}")
check_applies("m != {'a': 'a'}")
check_applies("m IN (null, {'a': 'a'}, {'foo': 'bar'})")
# multiple conditions
check_applies("m > {'a': 'a'} AND m < {'z': 'z'}")
check_applies("m != null AND m IN (null, {'a': 'a'}, {'foo': 'bar'})")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# should not apply
check_does_not_apply("m = {'a': 'a'}")
check_does_not_apply("m > {'z': 'z'}")
check_does_not_apply("m >= {'z': 'z'}")
check_does_not_apply("m < {'a': 'a'}")
check_does_not_apply("m <= {'a': 'a'}")
check_does_not_apply("m != {'foo': 'bar'}")
check_does_not_apply("m IN ({'a': 'a'}, null)")
check_does_not_apply("m IN ()")
check_does_not_apply("m = null AND m != null")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
check_invalid("m = {null: null}")
check_invalid("m = {'a': null}")
check_invalid("m = {null: 'a'}")
check_invalid("m < null")
check_invalid("m IN null", expected=SyntaxException)
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4775:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.369 |
8_cythonno_x86_64_41_64 | test_map_item_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7ffb8f587e20>
@since('2.1')
def test_map_item_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tmap (
k int PRIMARY KEY,
m map<text, text>
)""")
cursor.execute("""
CREATE TABLE frozentmap (
k int PRIMARY KEY,
m frozen<map<text, text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tmap")
cursor.execute("TRUNCATE frozentmap")
for frozen in (False, True):
table = "frozentmap" if frozen else "tmap"
assert_one(cursor, "INSERT INTO %s(k, m) VALUES (0, {'foo' : 'bar'}) IF NOT EXISTS" % (table,), [True])
assert_invalid(cursor, "DELETE FROM %s WHERE k=0 IF m[null] = 'foo'" % (table,))
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = 'foo'" % (table,), [False, {'foo': 'bar'}])
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = null" % (table,), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM %s" % (table,), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = 'bar'" % (table,), [True])
assert_none(cursor, "SELECT * FROM %s" % (table,), cl=ConsistencyLevel.SERIAL)
> if self.get_node_version(is_upgraded) > "2.1.1":
upgrade_tests/cql_tests.py:4822:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.755 |
8_cythonno_x86_64_43_64 | test_whole_set_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f07c7624d00>
@since('2.1.1')
def test_whole_set_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tset (
k int PRIMARY KEY,
s set<text>
)""")
cursor.execute("""
CREATE TABLE frozentset (
k int PRIMARY KEY,
s frozen<set<text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tset")
cursor.execute("TRUNCATE frozentset")
for frozen in (False, True):
table = "frozentset" if frozen else "tset"
assert_one(cursor, "INSERT INTO {}(k, s) VALUES (0, {{'bar', 'foo'}}) IF NOT EXISTS".format(table), [True])
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition), [True])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True])
assert_none(cursor, "SELECT * FROM {}".format(table), cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "INSERT INTO {}(k, s) VALUES (0, {{'bar', 'foo'}}) IF NOT EXISTS".format(table), [True])
check_applies("s = {'bar', 'foo'}")
check_applies("s = {'foo', 'bar'}")
check_applies("s != {'baz'}")
check_applies("s > {'a'}")
check_applies("s >= {'a'}")
check_applies("s < {'z'}")
check_applies("s <= {'z'}")
check_applies("s IN (null, {'bar', 'foo'}, {'a'})")
# multiple conditions
check_applies("s > {'a'} AND s < {'z'}")
check_applies("s IN (null, {'bar', 'foo'}, {'a'}) AND s IN ({'a'}, {'bar', 'foo'}, null)")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition),
[False, {'bar', 'foo'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition),
[False, {'bar', 'foo'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# should not apply
check_does_not_apply("s = {'baz'}")
check_does_not_apply("s != {'bar', 'foo'}")
check_does_not_apply("s > {'z'}")
check_does_not_apply("s >= {'z'}")
check_does_not_apply("s < {'a'}")
check_does_not_apply("s <= {'a'}")
check_does_not_apply("s IN ({'a'}, null)")
check_does_not_apply("s IN ()")
check_does_not_apply("s != null AND s IN ()")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET s = {{'bar', 'foo'}} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'bar', 'foo'}], cl=ConsistencyLevel.SERIAL)
check_invalid("s = {null}")
check_invalid("s < null")
check_invalid("s <= null")
check_invalid("s > null")
check_invalid("s >= null")
check_invalid("s IN null", expected=SyntaxException)
check_invalid("s IN 367", expected=SyntaxException)
# element access is not allow for sets
check_invalid("s['foo'] = 'foobar'")
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4683:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 59.608 |
8_cythonno_x86_64_44_64 | test_whole_map_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7ff61e87f700>
@since('2.1.1')
def test_whole_map_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tmap (
k int PRIMARY KEY,
m map<text, text>
)""")
cursor.execute("""
CREATE TABLE frozentmap (
k int PRIMARY KEY,
m frozen<map<text, text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tmap")
cursor.execute("TRUNCATE frozentmap")
for frozen in (False, True):
logger.debug("Testing {} maps".format("frozen" if frozen else "normal"))
table = "frozentmap" if frozen else "tmap"
cursor.execute("INSERT INTO %s(k, m) VALUES (0, {'foo' : 'bar'})" % (table,))
def check_applies(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), [True])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [True])
assert_none(cursor, "SELECT * FROM {}".format(table), cl=ConsistencyLevel.SERIAL)
cursor.execute("INSERT INTO {}(k, m) VALUES (0, {{'foo' : 'bar'}})".format(table))
check_applies("m = {'foo': 'bar'}")
check_applies("m > {'a': 'a'}")
check_applies("m >= {'a': 'a'}")
check_applies("m < {'z': 'z'}")
check_applies("m <= {'z': 'z'}")
check_applies("m != {'a': 'a'}")
check_applies("m IN (null, {'a': 'a'}, {'foo': 'bar'})")
# multiple conditions
check_applies("m > {'a': 'a'} AND m < {'z': 'z'}")
check_applies("m != null AND m IN (null, {'a': 'a'}, {'foo': 'bar'})")
def check_does_not_apply(condition):
# UPDATE statement
assert_one(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_one(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# should not apply
check_does_not_apply("m = {'a': 'a'}")
check_does_not_apply("m > {'z': 'z'}")
check_does_not_apply("m >= {'z': 'z'}")
check_does_not_apply("m < {'a': 'a'}")
check_does_not_apply("m <= {'a': 'a'}")
check_does_not_apply("m != {'foo': 'bar'}")
check_does_not_apply("m IN ({'a': 'a'}, null)")
check_does_not_apply("m IN ()")
check_does_not_apply("m = null AND m != null")
def check_invalid(condition, expected=InvalidRequest):
# UPDATE statement
assert_invalid(cursor, "UPDATE {} SET m = {{'foo': 'bar'}} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
# DELETE statement
assert_invalid(cursor, "DELETE FROM {} WHERE k=0 IF {}".format(table, condition), expected=expected)
assert_one(cursor, "SELECT * FROM {}".format(table), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
check_invalid("m = {null: null}")
check_invalid("m = {'a': null}")
check_invalid("m = {null: 'a'}")
check_invalid("m < null")
check_invalid("m IN null", expected=SyntaxException)
# @jira_ticket CASSANDRA-10537
> if self.get_node_version(is_upgraded) >= LooseVersion(CASSANDRA_4_1):
upgrade_tests/cql_tests.py:4775:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 61.349 |
8_cythonno_x86_64_45_64 | test_map_item_conditional | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7fd5e48a0a60>
@since('2.1')
def test_map_item_conditional(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE tmap (
k int PRIMARY KEY,
m map<text, text>
)""")
cursor.execute("""
CREATE TABLE frozentmap (
k int PRIMARY KEY,
m frozen<map<text, text>>
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE tmap")
cursor.execute("TRUNCATE frozentmap")
for frozen in (False, True):
table = "frozentmap" if frozen else "tmap"
assert_one(cursor, "INSERT INTO %s(k, m) VALUES (0, {'foo' : 'bar'}) IF NOT EXISTS" % (table,), [True])
assert_invalid(cursor, "DELETE FROM %s WHERE k=0 IF m[null] = 'foo'" % (table,))
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = 'foo'" % (table,), [False, {'foo': 'bar'}])
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = null" % (table,), [False, {'foo': 'bar'}])
assert_one(cursor, "SELECT * FROM %s" % (table,), [0, {'foo': 'bar'}], cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE FROM %s WHERE k=0 IF m['foo'] = 'bar'" % (table,), [True])
assert_none(cursor, "SELECT * FROM %s" % (table,), cl=ConsistencyLevel.SERIAL)
> if self.get_node_version(is_upgraded) > "2.1.1":
upgrade_tests/cql_tests.py:4822:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 58.271 |
8_cythonno_x86_64_4_64 | test_in_clause_wide_rows | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f33aa657850>
def test_in_clause_wide_rows(self):
""" Check IN support for 'wide rows' in SELECT statement """
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test1 (
k int,
c int,
v int,
PRIMARY KEY (k, c)
) WITH COMPACT STORAGE;
""")
# composites
cursor.execute("""
CREATE TABLE test2 (
k int,
c1 int,
c2 int,
v int,
PRIMARY KEY (k, c1, c2)
) WITH COMPACT STORAGE;
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test1")
cursor.execute("TRUNCATE test2")
# Inserts
for x in range(0, 10):
cursor.execute("INSERT INTO test1 (k, c, v) VALUES (0, %i, %i)" % (x, x))
assert_all(cursor, "SELECT v FROM test1 WHERE k = 0 AND c IN (5, 2, 8)", [[2], [5], [8]])
# Inserts
for x in range(0, 10):
cursor.execute("INSERT INTO test2 (k, c1, c2, v) VALUES (0, 0, {}, {})".format(x, x))
# Check first we don't allow IN everywhere
> if self.get_node_version(is_upgraded) >= '2.2':
upgrade_tests/cql_tests.py:598:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.373 |
8_cythonno_x86_64_4_64 | test_conditional_update | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f33aa615490>
def test_conditional_update(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
v1 int,
v2 text,
v3 int
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
# Shouldn't apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF v1 = 4", [False])
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF EXISTS", [False])
# Should apply
assert_one(cursor, "INSERT INTO test (k, v1, v2) VALUES (0, 2, 'foo') IF NOT EXISTS", [True])
# Shouldn't apply
assert_one(cursor, "INSERT INTO test (k, v1, v2) VALUES (0, 5, 'bar') IF NOT EXISTS", [False, 0, 2, 'foo', None])
assert_one(cursor, "SELECT * FROM test", [0, 2, 'foo', None], cl=ConsistencyLevel.SERIAL)
# Should not apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF v1 = 4", [False, 2])
assert_one(cursor, "SELECT * FROM test", [0, 2, 'foo', None], cl=ConsistencyLevel.SERIAL)
# Should apply (note: we want v2 before v1 in the statement order to exercise #5786)
assert_one(cursor, "UPDATE test SET v2 = 'bar', v1 = 3 WHERE k = 0 IF v1 = 2", [True])
assert_one(cursor, "UPDATE test SET v2 = 'bar', v1 = 3 WHERE k = 0 IF EXISTS", [True])
assert_one(cursor, "SELECT * FROM test", [0, 3, 'bar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply, only one condition is ok
assert_one(cursor, "UPDATE test SET v1 = 5, v2 = 'foobar' WHERE k = 0 IF v1 = 3 AND v2 = 'foo'", [False, 3, 'bar'])
assert_one(cursor, "SELECT * FROM test", [0, 3, 'bar', None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "UPDATE test SET v1 = 5, v2 = 'foobar' WHERE k = 0 IF v1 = 3 AND v2 = 'bar'", [True])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = 3", [False, 5])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = null", [False, 5])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = 5", [True])
assert_one(cursor, "SELECT * FROM test", [0, 5, None, None], cl=ConsistencyLevel.SERIAL)
# Shouln't apply
assert_one(cursor, "DELETE v1 FROM test WHERE k = 0 IF v3 = 4", [False, None])
# Should apply
assert_one(cursor, "DELETE v1 FROM test WHERE k = 0 IF v3 = null", [True])
assert_one(cursor, "SELECT * FROM test", [0, None, None, None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "DELETE FROM test WHERE k = 0 IF v1 = null", [True])
assert_none(cursor, "SELECT * FROM test", cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF EXISTS", [False])
> if self.get_node_version(is_upgraded) > "2.1.1":
upgrade_tests/cql_tests.py:3132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 49.129 |
8_cythonno_x86_64_53_64 | test_timeuuid | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f1db3047fd0>
def test_timeuuid(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int,
t timeuuid,
PRIMARY KEY (k, t)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
assert_invalid(cursor, "INSERT INTO test (k, t) VALUES (0, 2012-11-07 18:18:22-0800)", expected=SyntaxException)
for i in range(4):
cursor.execute("INSERT INTO test (k, t) VALUES (0, now())")
time.sleep(1)
assert_row_count(cursor, 'test', 4)
res = list(cursor.execute("SELECT * FROM test"))
dates = [d[1] for d in res]
assert_row_count(cursor, 'test', 4, where="k = 0 AND t >= {}".format(dates[0]))
assert_row_count(cursor, 'test', 0, where="k = 0 AND t < {}".format(dates[0]))
assert_row_count(cursor, 'test', 2, where="k = 0 AND t > {} AND t <= {}".format(dates[0], dates[2]))
assert_row_count(cursor, 'test', 1, where="k = 0 AND t = {}".format(dates[0]))
# test function with deprecated pre-5.0 names
# not sure what to check exactly so just checking the query returns
assert_invalid(cursor, "SELECT minTimeuuid(k) FROM test WHERE k = 0 AND t = %s" % dates[0])
cursor.execute("SELECT t FROM test WHERE k = 0"
" AND t > maxTimeuuid(1234567)"
" AND t < minTimeuuid('2012-11-07 18:18:22-0800')")
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:2670:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 56.705 |
8_cythonno_x86_64_57_64 | test_timeuuid | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f5008f07130>
def test_timeuuid(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int,
t timeuuid,
PRIMARY KEY (k, t)
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
assert_invalid(cursor, "INSERT INTO test (k, t) VALUES (0, 2012-11-07 18:18:22-0800)", expected=SyntaxException)
for i in range(4):
cursor.execute("INSERT INTO test (k, t) VALUES (0, now())")
time.sleep(1)
assert_row_count(cursor, 'test', 4)
res = list(cursor.execute("SELECT * FROM test"))
dates = [d[1] for d in res]
assert_row_count(cursor, 'test', 4, where="k = 0 AND t >= {}".format(dates[0]))
assert_row_count(cursor, 'test', 0, where="k = 0 AND t < {}".format(dates[0]))
assert_row_count(cursor, 'test', 2, where="k = 0 AND t > {} AND t <= {}".format(dates[0], dates[2]))
assert_row_count(cursor, 'test', 1, where="k = 0 AND t = {}".format(dates[0]))
# test function with deprecated pre-5.0 names
# not sure what to check exactly so just checking the query returns
assert_invalid(cursor, "SELECT minTimeuuid(k) FROM test WHERE k = 0 AND t = %s" % dates[0])
cursor.execute("SELECT t FROM test WHERE k = 0"
" AND t > maxTimeuuid(1234567)"
" AND t < minTimeuuid('2012-11-07 18:18:22-0800')")
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:2670:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 62.991 |
8_cythonno_x86_64_61_64 | test_limit_multiget | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f4679b9eb80>
def test_limit_multiget(self):
""" Validate LIMIT option for 'multiget' in SELECT statements """
cursor = self.prepare()
cursor.execute("""
CREATE TABLE clicks (
userid int,
url text,
time bigint,
PRIMARY KEY (userid, url)
) WITH COMPACT STORAGE;
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE clicks")
# Inserts
for id in range(0, 100):
for tld in ['com', 'org', 'net']:
cursor.execute("INSERT INTO clicks (userid, url, time) VALUES ({}, 'http://foo.{}', 42)".format(id, tld))
# Check that we do limit the output to 1 *and* that we respect query
# order of keys (even though 48 is after 2) prior to 2.1.17
> if self.get_node_version(is_upgraded) >= '2.1.17':
upgrade_tests/cql_tests.py:359:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 52.384 |
8_cythonno_x86_64_6_64 | test_conditional_delete | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f50cc7b9430>
def test_conditional_delete(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
v1 int,
)
""")
# static columns
cursor.execute("""
CREATE TABLE test2 (
k text,
s text static,
i int,
v text,
PRIMARY KEY (k, i)
)""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
cursor.execute("TRUNCATE test2")
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [False])
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (1, 2) IF NOT EXISTS", [True])
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [True])
assert_none(cursor, "SELECT * FROM test WHERE k=1", cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE FROM test WHERE k=1 IF EXISTS", [False])
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (2, 2) IF NOT EXISTS USING TTL 1", [True])
time.sleep(1.5)
assert_one(cursor, "DELETE FROM test WHERE k=2 IF EXISTS", [False])
assert_none(cursor, "SELECT * FROM test WHERE k=2", cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "INSERT INTO test (k, v1) VALUES (3, 2) IF NOT EXISTS", [True])
assert_one(cursor, "DELETE v1 FROM test WHERE k=3 IF EXISTS", [True])
assert_one(cursor, "SELECT * FROM test WHERE k=3", [3, None], cl=ConsistencyLevel.SERIAL)
assert_one(cursor, "DELETE v1 FROM test WHERE k=3 IF EXISTS", [True])
assert_one(cursor, "DELETE FROM test WHERE k=3 IF EXISTS", [True])
cursor.execute("INSERT INTO test2 (k, s, i, v) VALUES ('k', 's', 0, 'v') IF NOT EXISTS")
assert_one(cursor, "DELETE v FROM test2 WHERE k='k' AND i=0 IF EXISTS", [True])
assert_one(cursor, "DELETE FROM test2 WHERE k='k' AND i=0 IF EXISTS", [True])
assert_one(cursor, "DELETE v FROM test2 WHERE k='k' AND i=0 IF EXISTS", [False])
assert_one(cursor, "DELETE FROM test2 WHERE k='k' AND i=0 IF EXISTS", [False])
# CASSANDRA-6430
> v = self.get_node_version(is_upgraded)
upgrade_tests/cql_tests.py:3215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 51.927 |
8_cythonno_x86_64_7_64 | test_clustering_order_and_functions | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f5571eb5a00>
def test_clustering_order_and_functions(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int,
t timeuuid,
PRIMARY KEY (k, t)
) WITH CLUSTERING ORDER BY (t DESC)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
for i in range(0, 5):
cursor.execute("INSERT INTO test (k, t) VALUES (%d, now())" % i)
> if self.get_node_version(is_upgraded) >= LooseVersion('2.2'):
upgrade_tests/cql_tests.py:3056:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 60.455 |
8_cythonno_x86_64_7_64 | test_select_with_alias | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes2RF1_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f5571c0dc70>
def test_select_with_alias(self):
cursor = self.prepare()
cursor.execute('CREATE TABLE users (id int PRIMARY KEY, name text)')
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE users")
for id in range(0, 5):
cursor.execute("INSERT INTO users (id, name) VALUES ({}, 'name{}') USING TTL 10 AND TIMESTAMP 0".format(id, id))
# test aliasing count(*)
res = cursor.execute('SELECT count(*) AS user_count FROM users')
assert 'user_count' == res[0]._fields[0]
assert 5 == res[0].user_count
# test aliasing regular value
res = cursor.execute('SELECT name AS user_name FROM users WHERE id = 0')
assert 'user_name' == res[0]._fields[0]
assert 'name0' == res[0].user_name
# test aliasing writetime
res = cursor.execute('SELECT writeTime(name) AS name_writetime FROM users WHERE id = 0')
assert 'name_writetime' == res[0]._fields[0]
assert 0 == res[0].name_writetime
# test aliasing ttl
res = cursor.execute('SELECT ttl(name) AS name_ttl FROM users WHERE id = 0')
assert 'name_ttl' == res[0]._fields[0]
assert res[0].name_ttl, (9 in 10)
# test aliasing a regular function
res = cursor.execute('SELECT intAsBlob(id) AS id_blob FROM users WHERE id = 0')
assert 'id_blob' == res[0]._fields[0]
assert '\x00\x00\x00\x00' == res[0].id_blob.decode()
> logger.debug("Current node version is {}".format(self.get_node_version(is_upgraded)))
upgrade_tests/cql_tests.py:3276:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 55.953 |
8_cythonno_x86_64_8_64 | test_in_clause_wide_rows | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f3792601b80>
def test_in_clause_wide_rows(self):
""" Check IN support for 'wide rows' in SELECT statement """
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test1 (
k int,
c int,
v int,
PRIMARY KEY (k, c)
) WITH COMPACT STORAGE;
""")
# composites
cursor.execute("""
CREATE TABLE test2 (
k int,
c1 int,
c2 int,
v int,
PRIMARY KEY (k, c1, c2)
) WITH COMPACT STORAGE;
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test1")
cursor.execute("TRUNCATE test2")
# Inserts
for x in range(0, 10):
cursor.execute("INSERT INTO test1 (k, c, v) VALUES (0, %i, %i)" % (x, x))
assert_all(cursor, "SELECT v FROM test1 WHERE k = 0 AND c IN (5, 2, 8)", [[2], [5], [8]])
# Inserts
for x in range(0, 10):
cursor.execute("INSERT INTO test2 (k, c1, c2, v) VALUES (0, 0, {}, {})".format(x, x))
# Check first we don't allow IN everywhere
> if self.get_node_version(is_upgraded) >= '2.2':
upgrade_tests/cql_tests.py:598:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 59.488 |
8_cythonno_x86_64_8_64 | test_conditional_update | Failure | TypeError: '<' not supported between instances of 'str' and 'int'
self = <abc.TestCQLNodes3RF3_Upgrade_current_5_0_x_To_indev_5_0_x object at 0x7f37925b7c40>
def test_conditional_update(self):
cursor = self.prepare()
cursor.execute("""
CREATE TABLE test (
k int PRIMARY KEY,
v1 int,
v2 text,
v3 int
)
""")
for is_upgraded, cursor in self.do_upgrade(cursor):
logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
cursor.execute("TRUNCATE test")
# Shouldn't apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF v1 = 4", [False])
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF EXISTS", [False])
# Should apply
assert_one(cursor, "INSERT INTO test (k, v1, v2) VALUES (0, 2, 'foo') IF NOT EXISTS", [True])
# Shouldn't apply
assert_one(cursor, "INSERT INTO test (k, v1, v2) VALUES (0, 5, 'bar') IF NOT EXISTS", [False, 0, 2, 'foo', None])
assert_one(cursor, "SELECT * FROM test", [0, 2, 'foo', None], cl=ConsistencyLevel.SERIAL)
# Should not apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF v1 = 4", [False, 2])
assert_one(cursor, "SELECT * FROM test", [0, 2, 'foo', None], cl=ConsistencyLevel.SERIAL)
# Should apply (note: we want v2 before v1 in the statement order to exercise #5786)
assert_one(cursor, "UPDATE test SET v2 = 'bar', v1 = 3 WHERE k = 0 IF v1 = 2", [True])
assert_one(cursor, "UPDATE test SET v2 = 'bar', v1 = 3 WHERE k = 0 IF EXISTS", [True])
assert_one(cursor, "SELECT * FROM test", [0, 3, 'bar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply, only one condition is ok
assert_one(cursor, "UPDATE test SET v1 = 5, v2 = 'foobar' WHERE k = 0 IF v1 = 3 AND v2 = 'foo'", [False, 3, 'bar'])
assert_one(cursor, "SELECT * FROM test", [0, 3, 'bar', None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "UPDATE test SET v1 = 5, v2 = 'foobar' WHERE k = 0 IF v1 = 3 AND v2 = 'bar'", [True])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = 3", [False, 5])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = null", [False, 5])
assert_one(cursor, "SELECT * FROM test", [0, 5, 'foobar', None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "DELETE v2 FROM test WHERE k = 0 IF v1 = 5", [True])
assert_one(cursor, "SELECT * FROM test", [0, 5, None, None], cl=ConsistencyLevel.SERIAL)
# Shouln't apply
assert_one(cursor, "DELETE v1 FROM test WHERE k = 0 IF v3 = 4", [False, None])
# Should apply
assert_one(cursor, "DELETE v1 FROM test WHERE k = 0 IF v3 = null", [True])
assert_one(cursor, "SELECT * FROM test", [0, None, None, None], cl=ConsistencyLevel.SERIAL)
# Should apply
assert_one(cursor, "DELETE FROM test WHERE k = 0 IF v1 = null", [True])
assert_none(cursor, "SELECT * FROM test", cl=ConsistencyLevel.SERIAL)
# Shouldn't apply
assert_one(cursor, "UPDATE test SET v1 = 3, v2 = 'bar' WHERE k = 0 IF EXISTS", [False])
> if self.get_node_version(is_upgraded) > "2.1.1":
upgrade_tests/cql_tests.py:3132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
upgrade_tests/upgrade_base.py:227: in get_node_version
return max(node_versions) if is_upgraded else min(node_versions)
/usr/lib/python3.8/distutils/version.py:64: in __gt__
c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = LooseVersion ('5.0-rc1'), other = LooseVersion ('5.0.1')
def _cmp (self, other):
if isinstance(other, str):
other = LooseVersion(other)
if self.version == other.version:
return 0
> if self.version < other.version:
E TypeError: '<' not supported between instances of 'str' and 'int'
/usr/lib/python3.8/distutils/version.py:337: TypeError | 55.915 |