Modify

Opened 4 years ago

Closed 4 years ago

Last modified 11 months ago

#7383 closed defect (fixed)

trac-admin $ENV ticket_changesets commands fail w/ Trac 0.12

Reported by: Dennis McRitchie <dmcr@…> Owned by: mrelbe
Priority: normal Component: TracTicketChangesetsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

When running any of the trac-admin $ENV ticket_changesets commands, the results are always:

trac-admin $ENV ticket_changesets diff
diff ticket commit messages to be reformatted
OperationalError: (1054, "Unknown column 'rowid' in 'field list'")

The column 'rowid' is no longer present in the ticket_change table. The patch below is a suggested fix:

diff admin.py.orig admin.py
195c195
<             cursor.execute('SELECT rowid,ticket,oldvalue,newvalue '
---
>             cursor.execute('SELECT ticket,time,oldvalue,newvalue '
198c198
<                 rowid, ticket, oldvalue, oldmessage = row
---
>                 ticket, time, oldvalue, oldmessage = row
210,211c210,211
<                                            'SET newvalue=%s WHERE rowid=%s',
<                                            [newmessage, rowid])
---
>                                            'SET newvalue=%s WHERE ticket=%d AND time=%d',
>                                            [newmessage, ticket, time])
213c213
<                             printout('@@ comment:%s:ticket:%s (db rowid %s) @@'
---
>                             printout('@@ comment:%s:ticket:%d (db time %d) @@'

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by daul.hill@…

The patch listed is missing an extra change for line 214.

214c214 < % (oldvalue, ticket, rowid)) ---

% (oldvalue, ticket, time))

comment:2 Changed 4 years ago by daul.hill@…

This patch is a better one to use. The previous one made some incorrect assumptions in line 210, and wouldn't work. This one includes the amendment I added, and has been tested.

Cheers.

195c195
<             cursor.execute('SELECT rowid,ticket,oldvalue,newvalue '
---
>             cursor.execute('SELECT ticket,time,oldvalue,newvalue '
198c198
<                 rowid, ticket, oldvalue, oldmessage = row
---
>                 ticket, time, oldvalue, oldmessage = row
210,211c210,211
<                                            'SET newvalue=%s WHERE rowid=%s',
<                                            [newmessage, rowid])
---
>                                            'SET newvalue=%s WHERE ticket=%s and time=%s',
>                                            [newmessage, ticket, time])
213,214c213,214
<                             printout('@@ comment:%s:ticket:%s (db rowid %s) @@'
<                                      % (oldvalue, ticket, rowid))
---
>                             printout('@@ comment:%s:ticket:%d (db time %d) @@'
>                                      % (oldvalue, ticket, time))

Last edited 11 months ago by rjollos (previous) (diff)

comment:3 Changed 4 years ago by Jiri

Hi,

I just got the code from subversion, still with this bug.

http://trac-hacks.org/svn/tracticketchangesetsplugin/trunk/

When will this patch get in the code?

comment:4 Changed 4 years ago by wica

And I can confirm that this patch works. Testen with trac 0.12.2

comment:5 Changed 4 years ago by mrelbe

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

(In [9996]) Fixes #7383 (trac-admin $ENV ticket_changesets commands fail w/ Trac 0.12)

Patch provided by Dennis McRitchie <dmcr@…> and daul.hill@….

Thanks!

(I beg your pardon for the ridiculous long delay of getting this into the repo.)

Add Comment

Modify Ticket

Action
as closed The owner will remain mrelbe.
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.