Opened 12 years ago

Closed 12 years ago

#4029 closed defect (invalid)

[fix] Cannot update schedules after an upgrade

Reported by: anonymous Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: 0.20.2
Severity: medium Keywords: recordid schedule fails
Cc: Ticket locked: no

Description

After an upgrade from an earlier version of MythTV to 0.20.2, any attempt to update the recording schedules fails, whether it is attempted from within mythfrontend or through mythweb. The problem is that in the database upgrade statements, record.recordid is created WITHOUT the AUTO_INCREMENT attribute, whereas if the table is created by libmythtv/dbcheck.cpp, it is created WITH the AUTO_INCREMENT attribute.

Fix is fairly simply, just increment the database schema version and add a MySQL statement for that version upgrade to ADD the AUTO_INCREMENT attribute to record.recordid.

Attachments (1)

20070928__recordid.diff (1.0 KB) - added by tilghman@… 12 years ago.
Patch file

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by tilghman@…

Attachment: 20070928__recordid.diff added

Patch file

comment:1 Changed 12 years ago by danielk

Owner: changed from Isaac Richards to danielk
Priority: blockerminor
Severity: highmedium

tilghman, I can't find the DB update you speak of.

The patch is incorrect as it would break the upgrade path to 0.21, but if I find the source of the problem I'm sure I can fix it.

comment:2 Changed 12 years ago by tilghman@…

In the branch 0.20-fixes (svn), in libs/libmythtv/dbcheck.cpp (revision 14557), see line number 2935. You'll see that the recordid is specified as auto_increment. Now look at the upgrade path from previous dbschemas. You'll find that the recordid field never gets changed to have that attribute. That attribute is absolutely critical, as the recordid field is inserted in multiple places with the value 0, which triggers mysql to use the next auto-incremented value in its place.

That is why you cannot change the schedule on an upgraded mythtv box and why this needs to be fixed.

comment:3 Changed 12 years ago by danielk

I see where recordid is added with the attribute, but where is recordid added without the auto increment attribute?

I don't want to apply a general fix if only your database is affected.

comment:4 Changed 12 years ago by tilghman@…

Okay, I don't see anywhere where it didn't have it, so chalk this up to mysql (maybe a recovery after a crash somewhere) silently dropping the auto_increment attribute.

I have to wonder now how many of my other tables are missing a necessary auto_increment attribute.

Close this out.

comment:5 Changed 12 years ago by danielk

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.