Modify

Opened 9 years ago

Closed 9 years ago

#455 closed defect (fixed)

SQL statements not MSSQL compliant

Reported by: bjornswift Owned by: coderanger
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 9 years ago by coderanger

  • Resolution set to fixed
  • Status changed from new to closed

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

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

Add Comment

Modify Ticket

Action
as closed The owner will remain coderanger.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.