Modify ↓
Opened 18 years ago
Closed 18 years ago
#455 closed defect (fixed)
SQL statements not MSSQL compliant
Reported by: | Björn Swift | Owned by: | Noah Kantrowitz |
---|---|---|---|
Priority: | normal | Component: | WikiRenamePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
The WikiRenamePlugin has some hard coded SQL statements which are not MSSQL compliant. I made two changes to util.py, which seems to make things right. I haven't tested this against sqlite (or mysql/postgres), but I assume this works for those as well.
The first change was made since MSSQL's column names are case sensitive when the database's collation is binary sort:
17c17 < '(SELECT name, MAX(version) AS VERSION FROM WIKI GROUP BY NAME) w2 ' + \ --- > '(SELECT name, MAX(version) AS version FROM wiki GROUP BY name) w2 ' + \
The second change was made since assignment strings need to be single quoted in MSSQL, but not double quoted.
41c41 < cursor.execute('UPDATE attachment SET id=%s WHERE type="wiki" AND id=%s', (newname,oldname)) --- > cursor.execute('UPDATE attachment SET id=%s WHERE type=\'wiki\' AND id=%s', (newname,oldname))
Hope this get submitted.
Attachments (0)
Note: See
TracTickets for help on using
tickets.
(In [938]) * Fixing auto redirect when using ctxtnav links.