Modify

Opened 8 years ago

Last modified 6 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 Ryan J Ollos)

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)

typo.png (5.6 KB) - added by gbarrelet 8 years ago.

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by gbarrelet

Attachment: typo.png added

comment:1 Changed 8 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 in reply to:  description Changed 8 years ago by Ryan J Ollos

Replying to gbarrelet:

Something is different compared to the picture in the wiki, I have an "a" letter near the date. Picture attached to this ticket.

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.

comment:3 Changed 8 years ago by Ryan J Ollos

Are you on MySQL or PostgreSQL? The plugin uses string interpolation to prepare some SQL, which might be causing some problems.

comment:4 Changed 8 years ago by anonymous

Hello,

The "a" is still here even after changing to "absolute" format.

I am using MySQL.

comment:5 Changed 8 years ago by gbarrelet

Hello,

In fact, modifying this to "absolute" and reboot fixed the "a". But still unable to set a report.

comment:6 Changed 6 years ago by dries.decock@…

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Franz.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.