Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3675 closed defect (fixed)

When adding a severity, I get an SQL syntax error

Reported by: anonymous Owned by: Matthew Good
Priority: normal Milestone: 0.10
Component: admin/console Version: 0.10b1
Severity: normal Keywords: needinfo
Cc: trac@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The command and error looks like:

trac-admin /path/to/project/ severity add annoying Command failed: (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 'int)),0),'severity','annoying' FROM enum WHERE type='severity at line 1")

Attachments (0)

Change History (4)

comment:1 by Matthew Good, 18 years ago

Keywords: needinfo added

Have you upgraded Trac from the trunk? I believe this may be the same issue as #3669 with the recently introduced use of CAST.

comment:2 by trac@…, 18 years ago

Cc: trac@… added

After updating past r3690, trac doesn't work with mysql anymore. The problem is that

select cast(1 as int);

doesn't work in mysql.

The following patch works for me

  • trac/db/mysql_backend.py

     
    145147        ConnectionWrapper.__init__(self, cnx)
    146148
    147149    def cast(self, column, type):
     150       if type == 'int':
     151           type = 'signed'
    148152        return 'CAST(%s AS %s)' % (column, type)
    149153
    150154    def like(self):

in reply to:  2 comment:3 by Matthew Good, 18 years ago

Milestone: 0.10
Owner: changed from daniel to Matthew Good
Status: newassigned

Replying to trac@erre.user.lysator.liu.se:

After updating past r3690, trac doesn't work with mysql anymore. The problem is that

select cast(1 as int);

doesn't work in mysql.

Hmm, there was an existing cast before r3690, so I don't know why this just popped up, but the patch looks ok.

comment:4 by Matthew Good, 18 years ago

Resolution: fixed
Status: assignedclosed

Ok, patch applied in r3716.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matthew Good.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Matthew Good to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.