#10070: Named parameters not working on raw sql queries with sqlite
-------------------------------------+-------------------------------------
Reporter: Matias Surdi | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tobias Kunze):
* version: 1.0 => master
Comment:
This still breaks on SQLite (3.27.2), although with a less helpful error
message:
{{{
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/rixx/.local/share/virtualenvs/demo/lib/python3.7/site-
packages/django/db/backends/sqlite3/base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: near "%": syntax error
}}}
This syntax isn't documented (as far as I can see, at least not in
`topics/db/sql`) – do we want to add documentation for this, and exclude
SQLite?
--
Ticket URL: <https://code.djangoproject.com/ticket/10070#comment:16>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.458a1b2bf526bb1a84832a377c651244%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.