You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added one record to the database and tried to load it and got a memory error. Any idears?
>>> from models import MyModel
>>> MyModel.objects.get(id=1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "lib/python2.7/site-packages/django/db/models/manager.py", line 122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "lib/python2.7/site-packages/django/db/models/query.py", line 381, in get
num = len(clone)
File "lib/python2.7/site-packages/django/db/models/query.py", line 240, in __len__
self._fetch_all()
File "lib/python2.7/site-packages/django/db/models/query.py", line 1074, in _fetch_all
self._result_cache = list(self.iterator())
File "lib/python2.7/site-packages/django/db/models/query.py", line 52, in __iter__
results = compiler.execute_sql()
File "lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 879, in execute_sql
return list(result)
File "lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1239, in cursor_iter
sentinel):
File "lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1238, in <lambda>
for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
File "lib/python2.7/site-packages/django/db/utils.py", line 102, in inner
return func(*args, **kwargs)
File "lib/python2.7/site-packages/sql_server/pyodbc/base.py", line 581, in fetchmany
return self.format_rows(self.cursor.fetchmany(chunk))
MemoryError
The text was updated successfully, but these errors were encountered:
Running the query directly in pyodbc (foregoing django abstraction), I've tracked the problem down to a field defined as [MyField] [numeric](10, 0) NULL. The value in the DB is NULL and this is causing the problem.
I've added one record to the database and tried to load it and got a memory error. Any idears?
The text was updated successfully, but these errors were encountered: