Opened 18 years ago

Last modified 18 years ago

#2945 closed defect

DB Api - "count" being inserted — at Initial Version

Reported by: dcramer@… 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

  1. response = callback(request, *callback_args, callback_kwargs)

File "/home/www/cursedjango/cursesite/../cursesite/files/views.py" in detail

  1. 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

  1. return HttpResponse(loader.render_to_string(*args, kwargs))

File "/usr/lib/python2.4/site-packages/django/template/loader.py" in render_to_string

  1. return t.render(context_instance)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. return self.nodelist.render(context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. bits.append(self.render_node(node, context))

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node

  1. return(node.render(context))

File "/usr/lib/python2.4/site-packages/django/template/loader_tags.py" in render

  1. return compiled_parent.render(context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. return self.nodelist.render(context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. bits.append(self.render_node(node, context))

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node

  1. return(node.render(context))

File "/usr/lib/python2.4/site-packages/django/template/loader_tags.py" in render

  1. result = self.nodelist.render(context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. bits.append(self.render_node(node, context))

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render_node

  1. return(node.render(context))

File "/usr/lib/python2.4/site-packages/django/template/init.py" in render

  1. output = self.filter_expression.resolve(context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in resolve

  1. obj = resolve_variable(self.var, context)

File "/usr/lib/python2.4/site-packages/django/template/init.py" in resolve_variable

  1. current = current[bits[0]]

File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in getitem

  1. return list(self._clone(_offset=k, _limit=1))[0]

File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in iter

  1. return iter(self._get_data())

File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in _get_data

  1. self._result_cache = list(self.iterator())

File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in iterator

  1. 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

  1. return self.cursor.execute(sql, params)

File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/base.py" in execute

  1. return self.cursor.execute(sql, params)

File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py" in execute

  1. self.errorhandler(self, exc, value)

File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py" in defaulterrorhandler

  1. 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")

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top