Modify ↓
#13461 closed defect (fixed)
ticketlog sync :: DataError: (1264, "Out of range value for column 'ticket' at row 1")
Reported by: | Rochi | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | TracTicketChangelogPlugin |
Severity: | normal | Keywords: | patch |
Cc: | Trac Release: | 1.2 |
Description
There is a bug if I run:
trac-admin $env ticketlog sync
DataError: (1264, "Out of range value for column 'ticket' at row 1")
This is because the ticket number sometimes matches invalid numbers.
I fixed it with:
-
web_ui.py
27 27 from trac.util.text import shorten_line 28 28 from trac.util.translation import domain_functions 29 29 from tracopt.ticket.commit_updater import CommitTicketUpdater 30 from trac.util.text import exception_to_unicode 30 31 31 32 gettext, _, tag_, N_, add_domain = \ 32 33 domain_functions('ticketlog', 'gettext', '_', 'tag_', 'N_', 'add_domain') … … 154 155 155 156 def _insert_revision(self, rid, rev, message): 156 157 tickets = self._parse_message(message) 157 with self.env.db_transaction as db: 158 for tid in tickets: 159 db(""" 160 INSERT INTO ticket_revision (ticket,repos,rev) 161 VALUES (%s,%s,%s) 162 """, (tid, rid, rev)) 158 try: 159 with self.env.db_transaction as db: 160 for tid in tickets: 161 if tid <= 2147483647: 162 db(""" 163 INSERT INTO ticket_revision (ticket,repos,rev) 164 VALUES (%s,%s,%s) 165 """, (tid, rid, rev)) 166 else: 167 self.log.error("ticketlog::sync:Ticket #%s is not a valid ticket number!", tid) 168 except Exception as e: 169 self.log.error("Unexpected error while processing ticket " 170 "#%s: %s", tid, exception_to_unicode(e)) 163 171 164 172 def _get_ticket_revisions(self, req, ticket_id): 165 173 revisions = []
Attachments (1)
Change History (5)
Changed 6 years ago by
Attachment: | web_ui.py.diff added |
---|
comment:1 Changed 6 years ago by
Keywords: | patch added |
---|
comment:2 Changed 6 years ago by
Status: | new → accepted |
---|
Note: See
TracTickets for help on using
tickets.
Patch