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


The WikiRenamePlugin has some hard coded SQL statements which are not MSSQL compliant. I made two changes to, 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:

<         '(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.

<     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

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

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

Note: See TracTickets for help on using tickets.