Changes between Initial Version and Version 1 of Ticket #11253


Ignore:
Timestamp:
Jan 8, 2014, 6:06:49 AM (10 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11253

    • Property Status changed from new to accepted
  • Ticket #11253 – Description

    initial v1  
    1 from model.py:
     1from `model.py`:
    22
    3 {{{
     3{{{#!py
    44cursor.execute('UPDATE ticket_custom SET value=%s WHERE ticket=%s AND name=%s',
    55                                   (new_value, n, field))
     
    1212}}}
    1313
    14 Since there is "UPDATE ticket" between "UPDATE ticket_custom" and "if not cursor.rowcount", "INSERT INTO ticket_custom" is actually never called, because "UPDATE ticket" is always OK, no matter if "UPDATE ticket_custom" completed successfully or there is no such record.
     14Since there is `UPDATE ticket" between "UPDATE ticket_custom` and `if not cursor.rowcount`, `INSERT INTO ticket_custom` is actually never called, because `UPDATE ticket` is always OK, no matter if `UPDATE ticket_custom` completed successfully or there is no such record.
    1515
    16 Got this issue on a legacy database where tickets do not have corresponding ticket_custom values for blockedby and blocked.
     16Got this issue on a legacy database where tickets do not have corresponding ticket_custom values for `blockedby` and `blocked`.
    1717
    18 I did a patch for this issue, you just have to move "UPDATE ticket" below "if not cursor.rowcount - INSERT INTO ticket custom" block.
     18I did a patch for this issue, you just have to move `UPDATE ticket` below `if not cursor.rowcount - INSERT INTO ticket custom` block.