BoundStmt should inherit fetch_size from PreparedStmt
Fixes PYTHON-80
This commit is contained in:
@@ -6,6 +6,8 @@ Bug Fixes
|
|||||||
---------
|
---------
|
||||||
* Fix references to xrange that do not go through "six" in
|
* Fix references to xrange that do not go through "six" in
|
||||||
libevreactor and geventreactor (github #138)
|
libevreactor and geventreactor (github #138)
|
||||||
|
* Make BoundStatements inherit fetch_size from their parent
|
||||||
|
PreparedStatement (PYTHON-80)
|
||||||
|
|
||||||
2.0.2
|
2.0.2
|
||||||
=====
|
=====
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ class BoundStatement(Statement):
|
|||||||
"""
|
"""
|
||||||
self.consistency_level = prepared_statement.consistency_level
|
self.consistency_level = prepared_statement.consistency_level
|
||||||
self.serial_consistency_level = prepared_statement.serial_consistency_level
|
self.serial_consistency_level = prepared_statement.serial_consistency_level
|
||||||
|
self.fetch_size = prepared_statement.fetch_size
|
||||||
self.prepared_statement = prepared_statement
|
self.prepared_statement = prepared_statement
|
||||||
self.values = []
|
self.values = []
|
||||||
|
|
||||||
|
|||||||
@@ -107,3 +107,21 @@ class BoundStatementTestCase(unittest.TestCase):
|
|||||||
self.assertIn('list', str(e))
|
self.assertIn('list', str(e))
|
||||||
else:
|
else:
|
||||||
self.fail('Passed invalid type but exception was not thrown')
|
self.fail('Passed invalid type but exception was not thrown')
|
||||||
|
|
||||||
|
def test_inherit_fetch_size(self):
|
||||||
|
keyspace = 'keyspace1'
|
||||||
|
column_family = 'cf1'
|
||||||
|
|
||||||
|
column_metadata = [
|
||||||
|
(keyspace, column_family, 'foo1', Int32Type),
|
||||||
|
(keyspace, column_family, 'foo2', Int32Type)
|
||||||
|
]
|
||||||
|
|
||||||
|
prepared_statement = PreparedStatement(column_metadata=column_metadata,
|
||||||
|
query_id=None,
|
||||||
|
routing_key_indexes=[],
|
||||||
|
query=None,
|
||||||
|
keyspace=keyspace,
|
||||||
|
fetch_size=1234)
|
||||||
|
bound_statement = BoundStatement(prepared_statement=prepared_statement)
|
||||||
|
self.assertEqual(1234, bound_statement.fetch_size)
|
||||||
|
|||||||
Reference in New Issue
Block a user