I've posted your question to the django tracker https://code.djangoproject.com/ticket/18886
Yes, there is a difference, see #14091.
I hope this helps.
On Thu, Aug 30, 2012 at 11:25 PM, Ken Ashcraft <kash@google.com> wrote:
Using a protected field in the mysql driver seems like the wrong thing for django to do. Is there a substantial difference between the default implementation of last_executed_query() and the one returned by the mysql version?def last_executed_query(self, cursor, sql, params):"""Returns a string of the query last executed by the given cursor, withplaceholders replaced with actual values.`sql` is the raw query containing placeholders, and `params` is thesequence of parameters. These are used by default, but this methodexists for database backends to provide a better implementationaccording to their own quoting schemes."""from django.utils.encoding import smart_unicode, force_unicode# Convert params to contain Unicode values.to_unicode = lambda s: force_unicode(s, strings_only=True, errors='replace')if isinstance(params, (list, tuple)):u_params = tuple([to_unicode(val) for val in params])else:u_params = dict([(to_unicode(k), to_unicode(v)) for k, v in params.items()])return smart_unicode(sql) % u_paramsOn Wed, Aug 29, 2012 at 5:11 PM, bika <akasha.bika@gmail.com> wrote:
sorry, my mail was a bit misleading, it was meant to draw your attention to the fact that your dbapi driver does not have this property despite claiming to be 100% mysql compatibleplease, consider my mail either as a bug reportthanks, VOn Wed, Aug 29, 2012 at 7:50 PM, Rob Clevenger <rcleveng@google.com> wrote:
Hi,Our dbapi driver doesn't have this field.RobOn Tue, Aug 28, 2012 at 7:27 AM, Bika <akasha.bika@gmail.com> wrote:
from the django/db/backends/mysql/base.py# With MySQLdb, cursor objects have an (undocumented) "_last_executed"# attribute where the exact query sent to the database is saved.# See MySQLdb/cursors.py in the source distribution.Is there a way to access the last executed query string using cloud sql?
No comments:
Post a Comment