Opened 10 years ago
Last modified 10 years ago
#23889 closed Bug
mysql warning: Calling a SQLCompiler directly is deprecated. Call compiler.quote_name_unless_alias instead. — at Version 2
Reported by: | Collin Anderson | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I'm using queryset.prefetch(Prefetch('etc'))
on mysql
on master
.
Traceback: File "/home/collin/pop/django/core/handlers/base.py" in get_response 125. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/collin/pop/django/contrib/auth/decorators.py" in _wrapped_view 22. return view_func(request, *args, **kwargs) File "/home/collin/pop/resources/views.py" in home 79. cd = {c.id: c for c in collections} File "/home/collin/pop/django/db/models/query.py" in __iter__ 161. self._fetch_all() File "/home/collin/pop/django/db/models/query.py" in _fetch_all 989. self._result_cache = list(self.iterator()) File "/home/collin/pop/django/db/models/query.py" in iterator 289. for row in compiler.results_iter(): File "/home/collin/pop/django/db/models/sql/compiler.py" in results_iter 725. for rows in self.execute_sql(MULTI): File "/home/collin/pop/django/db/models/sql/compiler.py" in execute_sql 811. sql, params = self.as_sql() File "/home/collin/pop/django/db/models/sql/compiler.py" in as_sql 112. where, w_params = self.compile(self.query.where) File "/home/collin/pop/django/db/models/sql/compiler.py" in compile 83. return node.as_sql(self, self.connection) File "/home/collin/pop/django/db/models/sql/where.py" in as_sql 105. sql, params = compiler.compile(child) File "/home/collin/pop/django/db/models/sql/compiler.py" in compile 83. return node.as_sql(self, self.connection) File "/home/collin/pop/django/db/models/sql/where.py" in as_sql 423. return query_compiler.as_subquery_condition(self.alias, self.columns, compiler) File "/home/collin/pop/django/db/backends/mysql/compiler.py" in as_subquery_condition 8. return '(%s) IN (%s)' % (', '.join('%s.%s' % (qn(alias), qn2(column)) for column in columns), sql), params File "/home/collin/pop/django/db/backends/mysql/compiler.py" in <genexpr> 8. return '(%s) IN (%s)' % (', '.join('%s.%s' % (qn(alias), qn2(column)) for column in columns), sql), params File "/home/collin/pop/django/db/models/sql/compiler.py" in __call__ 58. RemovedInDjango20Warning, stacklevel=2) File "/home/collin/pop/settings_local.py" in new_warn 11. raise Exception(repr(args)) Exception Type: Exception at /file-library/ Exception Value: ('Calling a SQLCompiler directly is deprecated. Call compiler.quote_name_unless_alias instead.', <class 'django.utils.deprecation.RemovedInDjango20Warning'>)
Change History (2)
comment:1 by , 10 years ago
Has patch: | set |
---|
comment:2 by , 10 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
https://github.com/django/django/pull/3595