Modify

Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#7383 closed defect (fixed)

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

Reported by: Dennis McRitchie <dmcr@…> Owned by: Mikael Relbe
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 14 years ago by William D Hill

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

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

% (oldvalue, ticket, time))

comment:2 Changed 14 years ago by William D 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 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 14 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 14 years ago by Jiri Hoogeveen

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

comment:5 Changed 14 years ago by Mikael Relbe

Resolution: fixed
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Mikael Relbe.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.