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)

Change History (1)

comment:1 Changed 18 years ago by Noah Kantrowitz

Resolution: fixed
Status: newclosed

(In [938]) * Fixing auto redirect when using ctxtnav links.

  • Make the SQL work with MSSQL (Closes #455).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.