Modify ↓
Opened 9 years ago
Closed 9 years ago
#12399 closed defect (fixed)
Not unique table/alias: 'priority' when priority enums are removed and priority custom field is added
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.11 |
Component: | query system | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix database exceptions in query system when no defined milestones/versions/enums and the same name as custom field is added. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
All of priority enums are removed and priority
as custom field is added, query system raises an OperationalError
on MySQL.
2016-03-14 12:03:35,208 Trac[util] DEBUG: SQL: SELECT COUNT(*) FROM (SELECT t.id AS id,t.summary AS summary,t.status AS status,t.type AS type,t.milestone AS milestone,t.component AS component,t.time AS time,t.changetime AS changetime,t.owner AS owner,priority.value AS priority_value,`priority`.value AS `priority` FROM ticket AS t LEFT OUTER JOIN ticket_custom AS `priority` ON (`priority`.ticket=t.id AND `priority`.name='priority') LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND priority.name=priority) WHERE ((COALESCE(t.status,'')!=%s) AND (COALESCE(t.owner,'')=%s)) ORDER BY COALESCE(priority.value,'')='',CAST(priority.value AS signed),t.id) AS x 2016-03-14 12:03:35,208 Trac[util] DEBUG: args: [u'closed', u'admin'] 2016-03-14 12:03:35,208 Trac[util] DEBUG: execute exception: OperationalError(1066, "Not unique table/alias: 'priority'")
The issue doesn't raise on Trac 0.12.7 and MySQL.
Attachments (0)
Change History (4)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Proposed changes in log:jomae.git@t12399, which fixes this issue and the similar issues when no defined milestones/versions.
comment:4 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
The same issue raises with all datatbase backends.
SQLite:
PostgreSQL: