Opened 7 years ago

Closed 7 years ago

#27619 closed Bug (duplicate)

Queries where column name includes a '%' character break when using MySQL

Reported by: Zach Zundel Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Sorry about this nonsense, but...

I have a table in MySQL with a column name '%exp'. I know this is a poor choice for a column name.

When calling the objects.all(), I was getting a rather frustrating error message from pyMySQL, "not enough arguments for format string." I couldn't figure out what was causing it until I printed result of calling QuerySet.Query.sql_with_params() on the resulting QuerySet. I saw that there were no params, but the string contained %e, which python interpreted as trying to format the string.

Change History (2)

comment:1 by Zach Zundel, 7 years ago

Easy pickings: set

comment:2 by Tim Graham, 7 years ago

Component: UncategorizedDatabase layer (models, ORM)
Resolution: duplicate
Status: newclosed
Type: UncategorizedBug

Duplicate of #6343

Note: See TracTickets for help on using tickets.
Back to Top