Changes between Initial Version and Version 7 of Ticket #7496


Ignore:
Timestamp:
Apr 6, 2013, 10:31:53 PM (12 years ago)
Author:
Steffen Hoffmann
Comment:

Replying to dwc:

In case it's helpful, here is a more permanent link to the referenced patch:

Thanks for taking care. But the most "permanent" way to provide the patch, would have been to attach a patch file to this ticket, or just inline the patch into the description, so it is really self-contained and not relying on external resources. I've done so for you now.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7496

    • Property Cc Jun Omae Steffen Hoffmann added; anonymous removed
    • Property Owner changed from Jeff Hammel to Ryan J Ollos
    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
  • Ticket #7496 – Description

    initial v7  
    99A simple fix is to quote the value in the SQL statement.  This works on PostgreSQL and SQLite databases.
    1010
    11 http://github.com/dwc/dwc-overlay/blob/master/dev-python/trac-ticket-mover/files/trac-ticket-mover-sql-quoting.patch
     11{{{
     12#!diff
     13Index: 0.11/ticketmoverplugin/ticketmover.py
     14===================================================================
     15--- 0.11/ticketmoverplugin/ticketmover.py       (revision 8362)
     16+++ 0.11/ticketmoverplugin/ticketmover.py       (working copy)
     17@@ -188,7 +188,7 @@
     18 
     19         # copy the changelog and attachment DBs
     20         for table, _id in tables.items():
     21-            for row in get_all_dict(self.env, "SELECT * FROM %s WHERE %s=%s" % (table, _id, ticket_id)):
     22+            for row in get_all_dict(self.env, "SELECT * FROM %s WHERE %s = '%s'" % (table, _id, ticket_id)):
     23                 row[_id] = new_ticket.id
     24                 insert_row_from_dict(env, table, row)
     25 
     26}}}