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 , 18 years ago
Keywords: | needinfo added |
---|
follow-up: 3 comment:2 by , 18 years ago
Cc: | 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
145 147 ConnectionWrapper.__init__(self, cnx) 146 148 147 149 def cast(self, column, type): 150 if type == 'int': 151 type = 'signed' 148 152 return 'CAST(%s AS %s)' % (column, type) 149 153 150 154 def like(self):
comment:3 by , 18 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
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 , 18 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ok, patch applied in r3716.
Have you upgraded Trac from the trunk? I believe this may be the same issue as #3669 with the recently introduced use of CAST.