PrepareStatement should support is_idempotent
This commit is contained in:
parent
b81cfee027
commit
8e6a1db2f8
@ -1,3 +1,10 @@
|
||||
3.11
|
||||
====
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
* is_idempotent flag is not propagated from PreparedStatement to BoundStatement (PYTHON-736)
|
||||
|
||||
3.10.0
|
||||
======
|
||||
May 24, 2017
|
||||
|
@ -496,7 +496,8 @@ class BoundStatement(Statement):
|
||||
self.keyspace = meta[0].keyspace_name
|
||||
|
||||
Statement.__init__(self, retry_policy, consistency_level, routing_key,
|
||||
serial_consistency_level, fetch_size, keyspace, custom_payload)
|
||||
serial_consistency_level, fetch_size, keyspace, custom_payload,
|
||||
prepared_statement.is_idempotent)
|
||||
|
||||
def bind(self, values):
|
||||
"""
|
||||
|
@ -112,6 +112,16 @@ class SpecExecTest(BasicSharedKeyspaceUnitTestCase):
|
||||
with self.assertRaises(OperationTimedOut):
|
||||
result = self.session.execute(statement, execution_profile='spec_ep_rr', timeout=.5)
|
||||
|
||||
# PYTHON-736 Test speculation policy works with a prepared statement
|
||||
statement = self.session.prepare("SELECT timeout(100) FROM d WHERE k = ?")
|
||||
# non-idempotent
|
||||
result = self.session.execute(statement, (0,), execution_profile='spec_ep_brr')
|
||||
self.assertEqual(1, len(result.response_future.attempted_hosts))
|
||||
# idempotent
|
||||
statement.is_idempotent = True
|
||||
result = self.session.execute(statement, (0,), execution_profile='spec_ep_brr')
|
||||
self.assertLess(1, len(result.response_future.attempted_hosts))
|
||||
|
||||
#TODO redo this tests with Scassandra
|
||||
def test_speculative_and_timeout(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user