Incorrect SQL

73 views
Skip to first unread message

Egon.F...@gmx.de

unread,
Mar 22, 2014, 6:48:43 PM3/22/14
to django...@googlegroups.com
With django 1.6.2, python3 and MySQL manage.py inspectdb brings this error:

django.db.utils.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 '%s AND table_schema = DATABASE()\n                AND character_maximum_length IS' at line 2")

I put some print statements in
- django/db/backends/mysql/introspection.py line 43
- django/db/utils.py line 111, 125, 151, 154, 165, 202
- django/db/backends/util.py line 47

The output with traceback shows in line 22 (from line 43 introspections.py) the table_name auth_group
and then from util line 47 the sql statement in which the table_name  should be inserted.

But that doesn't happened. The executed sql statement contains still %s and not the table name.

Any idea?

Egon

OutputIntrospection.txt

Ramiro Morales

unread,
Mar 22, 2014, 9:06:39 PM3/22/14
to django...@googlegroups.com
It's weird.

Can you modify the execute() method in
django/db/backends/mysql/base.py to verify the args argument actually
contains your 'auth_user' table name?

Also, what's the origin of the python-MySQLdb driver you are using?
AFAIK there isn't a 1.2.3 version compatible with Python 3.x. See
https://docs.djangoproject.com/en/1.6/ref/databases/#python-3

--
Ramiro Morales
@ramiromorales
Reply all
Reply to author
Forward
0 new messages