Opened 9 years ago
Last modified 7 years ago
#12711 new defect
SQL query problem
Reported by: | gbarrelet | Owned by: | Franz |
---|---|---|---|
Priority: | normal | Component: | MailPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description (last modified by )
Hello,
Using Trac 1.1.6 with mailplugin 0.4.3 Plugin has been enabled in trac.ini After several tries, trying to create a new simple report with only field "Reporter" and a where clause for Milestone (tried without any clause and getting the same error):
Illegal Arguments: Illegal value for field 'whereClause'. Further Informations: (u'select id,reporter from ticket where milestone="Unknown"', 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 'interval,active) VALUES ('test','username',1460908800000000,null,'reporter','mi' at line 1"))
Trying the same request in mysql works (select id,reporter from ticket where milestone="Unknown"
). I also tried select id,reporter from ticket where milestone LIKE 'Unknown'
:
Illegal Arguments: Illegal value for field 'whereClause'. Further Informations: (u"select id,reporter from ticket where milestone LIKE 'Unknown'", 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 'interval,active) VALUES ('test','username',1460908800000000,null,'reporter','mi' at line 1"))
The VALUES seems incomplete, I don't know if it is the request or just the debug. "'interval,active" are always in the debug message. Something is different compared to the picture in the wiki, I have an "a" letter near the date. Picture attached to this ticket.
Any idea / tests to do ?
Attachments (1)
Change History (7)
Changed 9 years ago by
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
Are you on MySQL or PostgreSQL? The plugin uses string interpolation to prepare some SQL, which might be causing some problems.
comment:4 Changed 9 years ago by
Hello,
The "a" is still here even after changing to "absolute" format.
I am using MySQL.
comment:5 Changed 9 years ago by
Hello,
In fact, modifying this to "absolute" and reboot fixed the "a". But still unable to set a report.
comment:6 Changed 7 years ago by
I had the same issue. The reason is simple: the column with name interval is a keyword for mySQL. The columnnames should be quoted to get this working.
Replying to gbarrelet:
I think it is different from the wiki because your datetime format is localized. The
a
(as in AM/PM) is probably from the datetime format hint, which has wrapped. If you go to your Date & Time preferences (/prefs/datetime
) and change to absolute format it will probably no longer appear.