#17158: django.db.backends.BaseDatabaseOperations.last_executed_query issue
----------------------------------------------+--------------------
     Reporter:  a.gerchenov@…                 |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.2
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 Method "last_executed_query" should not always return "smart_unicode(sql)
 % u_params". If params variable is empty it should return just
 "smart_unicode(sql)". The problem is when we try to execute query with
 MySQL DATA_FORMAT function it says error.

 Example:

 {{{
 from django.db import connection
 c = connection.cursor()
 c.execute("SELECT * FROM VAR_current GROUP BY DATE_FORMAT(closing_month,
 '%Y-%m');")
 print c.fetchall()
 }}}

 Error:

 {{{
 django/db/backends/__init__.py", line 216, in last_executed_query
     return smart_unicode(sql) % u_params
 TypeError: not enough arguments for format string
 }}}

 This issue is closely related to #9055.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17158>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to