[Solved] Schema version 1370 upgrade failure

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

[Solved] Schema version 1370 upgrade failure

Post by ZedThou »

I sent this message to the mythtv-dev mailing list, but will also ask here...

I'm using the launchpad Ubuntu repository for v32.0.

After upgrading today to the deb version

32.0~master.202105172043.c8c226c9b4~ubuntu20.04.1

I get the error pasted below, upgrading from schema 1369 to 1370. I wish I could simply downgrade to a previous version of the mythtv packages, but there are no earlier 20.04 debs in that repository. Please let me know if there is any other information I can provide.

Code: Select all

C CoreContext dbcheckcommon.cpp:119 (performActualUpdate) Upgrading to MythTV schema version 1370
May 18 15:46:51 mythtv mythbackend: mythbackend[159722]: E CoreContext dbcheckcommon.cpp:95 (performUpdateSeries) DB Error (Performing MythTV database upgrade): #012Query was: ALTER TABLE programrating MODIFY COLUMN system     varchar(128); #012Error was: Driver error was [2/1064]:#012QMYSQL: Unable to execute query#012Database error was:#012You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system     varchar(128)' at line 1
May 18 15:46:51 mythtv mythbackend: mythbackend[159722]: E CoreContext dbcheck.cpp:425 (UpgradeTVDatabaseSchema) Database schema upgrade failed.
May 18 15:46:51 mythtv mythbackend: mythbackend[159722]: E CoreContext main_helpers.cpp:588 (run_backend) Couldn't upgrade database to new schema on master backend
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: schema version 1370 upgrade failure

Post by bill6502 »

I see the reason for the error. Testing the fix now. Didn't see the post on the dev list.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: schema version 1370 upgrade failure

Post by kmdewaal »

I did actually test this on Fedora 34 with MariaDB before committing but that was apparently not enough. Thanks for looking into this.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: schema version 1370 upgrade failure

Post by bill6502 »

Pushed [034eb86a3]. MySQL v10 back tick issue.
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: schema version 1370 upgrade failure

Post by ZedThou »

Thanks very much for the quick fix.

I'm trying to figure out how to manually make the database changes, rather than compiling from source or waiting for the updated debs to show up in the repository. I don't know enough about SQL databases to understand why the attempt below is failing.

Code: Select all

mysql> show columns from programrating;
+-----------+--------------+------+-----+---------------------+-------+
| Field     | Type         | Null | Key | Default             | Extra |
+-----------+--------------+------+-----+---------------------+-------+
| chanid    | int unsigned | NO   | MUL | 0                   |       |
| starttime | datetime     | NO   | MUL | 0000-00-00 00:00:00 |       |
| system    | varchar(8)   | YES  |     | NULL                |       |
| rating    | varchar(16)  | YES  |     | NULL                |       |
+-----------+--------------+------+-----+---------------------+-------+
4 rows in set (0.01 sec)

mysql> ALTER TABLE programrating MODIFY COLUMN `system` varchar(128);
ERROR 1067 (42000): Invalid default value for 'starttime'
ZedThou
Junior
Posts: 25
Joined: Tue May 18, 2021 8:11 pm
United States of America

Re: schema version 1370 upgrade failure

Post by ZedThou »

Okay, I compiled from source and was able to get back up and running. All is well again.
Post Reply