Ticket #6807: iterator_sentinel.patch
File iterator_sentinel.patch, 2.1 KB (added by , 17 years ago) |
---|
-
django/db/models/sql/query.py
1330 1330 if result_type == SINGLE: 1331 1331 return cursor.fetchone() 1332 1332 # The MULTI case. 1333 if self.connection.features.uses_tuple_iterator_sentinel: 1334 return iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)), ()) 1333 1335 return iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)), []) 1334 1336 1335 1337 def get_order_dir(field, default='ASC'): -
django/db/backends/mysql/base.py
61 61 class DatabaseFeatures(BaseDatabaseFeatures): 62 62 autoindexes_primary_keys = False 63 63 inline_fk_references = False 64 uses_tuple_iterator_sentinel = True 64 65 65 66 class DatabaseOperations(BaseDatabaseOperations): 66 67 def date_extract_sql(self, lookup_type, field_name): … … 127 128 return sql 128 129 else: 129 130 return [] 130 131 131 132 class DatabaseWrapper(BaseDatabaseWrapper): 132 133 features = DatabaseFeatures() 133 134 ops = DatabaseOperations() -
django/db/backends/__init__.py
50 50 supports_tablespaces = False 51 51 uses_case_insensitive_names = False 52 52 uses_custom_queryset = False 53 uses_tuple_iterator_sentinel = False 53 54 54 55 class BaseDatabaseOperations(object): 55 56 """ … … 126 127 contain a '%s' placeholder for the value being searched against. 127 128 """ 128 129 raise NotImplementedError('Full-text search is not implemented for this database backend') 129 130 130 131 def last_executed_query(self, cursor, sql, params): 131 132 """ 132 133 Returns a string of the query last executed by the given cursor, with