Opened 18 years ago
Last modified 18 years ago
#2945 closed defect
DB Api - "count" being inserted — at Initial Version
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This seems to happen once, refreshing the view and its gone. It's throwing "count" where the limit (of some sorts) should be.
The query its executing is:
'SELECT files_version
.id
,files_version
.file_id
,files_version
.md5
,files_version
.name
,files_version
.post_date
,files_version
.archive
,files_version
.change_log
,files_version
.author_id
,files_version
.downloads
,files_version
.type_id
FROM files_version
WHERE (files_version
.file_id
= %s) ORDER BY files_version
.post_date
DESC LIMIT count,1'
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "/home/www/cursedjango/cursesite/../cursesite/files/views.py" in detail
- return render_to_response('files/detail.html', context_instance=context)
File "/usr/lib/python2.4/site-packages/django/shortcuts/init.py" in render_to_response
- return HttpResponse(loader.render_to_string(*args, kwargs))
File "/usr/lib/python2.4/site-packages/django/template/loader.py" in render_to_string
- return t.render(context_instance)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- return self.nodelist.render(context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- bits.append(self.render_node(node, context))
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node
- return(node.render(context))
File "/usr/lib/python2.4/site-packages/django/template/loader_tags.py" in render
- return compiled_parent.render(context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- return self.nodelist.render(context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- bits.append(self.render_node(node, context))
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node
- return(node.render(context))
File "/usr/lib/python2.4/site-packages/django/template/loader_tags.py" in render
- result = self.nodelist.render(context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- bits.append(self.render_node(node, context))
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node
- return(node.render(context))
File "/usr/lib/python2.4/site-packages/django/template/init.py" in render
- output = self.filter_expression.resolve(context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in resolve
- obj = resolve_variable(self.var, context)
File "/usr/lib/python2.4/site-packages/django/template/init.py" in resolve_variable
- current = current[bits[0]]
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in getitem
- return list(self._clone(_offset=k, _limit=1))[0]
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in iter
- return iter(self._get_data())
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in _get_data
- self._result_cache = list(self.iterator())
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in iterator
- cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params)
File "/usr/lib/python2.4/site-packages/django/db/backends/util.py" in execute
- return self.cursor.execute(sql, params)
File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/base.py" in execute
- return self.cursor.execute(sql, params)
File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py" in execute
- self.errorhandler(self, exc, value)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py" in defaulterrorhandler
- raise errorclass, errorvalue
ProgrammingError at /en/files/details/4647/blackuweather-fishing/
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'count,1' at line 1")