Opened 18 years ago

Closed 17 years ago

#2534 closed patch (fixed)

Modify MythVideo DB update for MySQL 3.x compatibility

Reported by: sphery <mtdean@…> Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: mythvideo Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Modifies the MythVideo DB update I posted in #2040 and that was committed in [10852] to be compatible with MySQL 3.x. The use of multi-table UPDATEs or DELETEs (i.e. through LEFT JOIN) is only supported in MySQL 4.0+.

The initial value of categoryIDs handles the case of an empty videocategory table and ensures we don't modify categories that are already at 0. The patch was tested against a database with an empty videocategories table, with some invalid categories in videometadata, and with no invalid categories in videometadata.

If the initial query fails, a do-nothing statement is used for the update, rather than possibly destroying valid data while cleaning up invalid data. The invalid data could be manually fixed by the user through the MythVideo UI later, so it's not a critical update. Therefore, I chose to ignore the changes if we fail to get a valid list of categories, and let the schema update (try to) succeed. If performActualUpdate() also fails, we'll have another chance to fix the bad categories at next startup (after the user has fixed the database).

Attachments (2)

mythplugins-mythvideo-dbcheck_mysql3_compat.patch (1.2 KB) - added by sphery <mtdean@…> 18 years ago.
mythplugins-mythvideo-dbcheck_mysql3_compat-1.patch (1.2 KB) - added by sphery <mtdean@…> 18 years ago.
Oops. This is the current patch (moves categoryIDs declaration to the appropriate block after adding the else)

Download all attachments as: .zip

Change History (4)

Changed 18 years ago by sphery <mtdean@…>

Changed 18 years ago by sphery <mtdean@…>

Oops. This is the current patch (moves categoryIDs declaration to the appropriate block after adding the else)

comment:1 Changed 18 years ago by Anduin Withers

(In [11436]) References #2534

MySQL 3.x compatibility fix, thanks to Michael T. Dean

comment:2 Changed 17 years ago by Anduin Withers

Resolution: fixed
Status: newclosed

(In [11627]) Closes #2534

Merge in [11436] MySQL 3.x compatibility fix, thanks to Michael T. Dean

Note: See TracTickets for help on using tickets.