#9833 closed (fixed)
create_test_db doesn't respect caching parameters for db backend
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.0 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
line 318 in django.db.backends.creation.py (create_test_db) just takes everything after 'db://' as the cache table name.
if settings.CACHE_BACKEND.startswith('db://'):
cache_name = settings.CACHE_BACKEND[len('db://'):]
call_command('createcachetable', cache_name)
This results a table name of cache?timeout=15&max_entries=100 if CACHE_BACKEND is 'db://cache?timeout=15&max_entries=100'
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/var/lib/python-support/python2.5/django/core/management/__init__.py", line 340, in execute_manager
utility.execute()
File "/var/lib/python-support/python2.5/django/core/management/__init__.py", line 295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/lib/python-support/python2.5/django/core/management/base.py", line 192, in run_from_argv
self.execute(*args, **options.__dict__)
File "/var/lib/python-support/python2.5/django/core/management/base.py", line 219, in execute
output = self.handle(*args, **options)
File "/var/lib/python-support/python2.5/django/core/management/commands/test.py", line 33, in handle
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
File "/var/lib/python-support/python2.5/django/test/simple.py", line 142, in run_tests
connection.creation.create_test_db(verbosity, autoclobber=not interactive)
File "/var/lib/python-support/python2.5/django/db/backends/creation.py", line 319, in create_test_db
call_command('createcachetable', cache_name)
File "/var/lib/python-support/python2.5/django/core/management/__init__.py", line 158, in call_command
return klass.execute(*args, **options)
File "/var/lib/python-support/python2.5/django/core/management/base.py", line 219, in execute
output = self.handle(*args, **options)
File "/var/lib/python-support/python2.5/django/core/management/base.py", line 319, in handle
label_output = self.handle_label(label, **options)
File "/var/lib/python-support/python2.5/django/core/management/commands/createcachetable.py", line 41, in handle_label
curs.execute(statement)
File "/var/lib/python-support/python2.5/django/db/backends/mysql/base.py", line 83, in execute
return self.cursor.execute(query, args)
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "/var/lib/python-support/python2.5/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (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 '?timeout=15&max_entries=100_expires ON `cache?timeout=15&max_entries=100` (`expi' at line 1")
Change History (4)
comment:1 by , 17 years ago
| milestone: | → 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 17 years ago
Note:
See TracTickets
for help on using tickets.
(In [9936]) Changed the way cache specifiers are parsed.
Allows us to reuse the same code in multiple places, avoiding new and
interesting bugs (the testing framework had a DIY version that was slightly
wrong, for example). Fixed #9833.