Modify ↓
Opened 17 years ago
Closed 17 years ago
#7113 closed defect (fixed)
TicketQuery limit argument inserts LIMIT as unicode
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | ticket system | Version: | 0.11b2 |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Using Trac 0.11b2 on Fedora 7, python 2.4.
Using the following macro on the WikiStart page
[[TicketQuery(resolution=invalid&limit=1)]]
produces an SQL error from unicode in the SQL:
# Error Error: Macro TicketQuery(resolution=invalid&limit=1) failed 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 6 # SQL ... WHERE COALESCE(t.resolution,”)=u'invalid' ORDER BY COALESCE(t.priority,”)=”,priority.value,t.id LIMIT u'1'
Attachments (0)
Change History (3)
comment:1 by , 17 years ago
Milestone: | → 0.11 |
---|---|
Priority: | low → normal |
Version: | → 0.11b2 |
comment:2 by , 17 years ago
Status: | new → assigned |
---|
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in r6831. Better handle limit as an int from the start. Otherwise we risk to have surprises, like in the above code, possibly ending up with a LIMIT 0 in the SQL.
Note:
See TracTickets
for help on using tickets.
This is an issue with mysqldb 1.2.2, but not pysqlite 2.4.1. The reporter is correct in that the following does not trigger the error:
A quick glance doesn't show any other numeric parameters in the TicketQuery macro