[mythtv] Database upgrade failure

John Pilkington johnpilk222 at gmail.com
Sun Jan 30 10:01:06 UTC 2022


On 24/01/2022 17:56, David Hampton via mythtv-dev wrote:
> On Mon, 2022-01-24 at 17:38 +0000, Gary Buhrmaster wrote:
>> On Mon, Jan 24, 2022 at 5:22 PM Gary Buhrmaster
>> <gary.buhrmaster at gmail.com> wrote:
>> I just noticed another issue.  The sportslisting
>> table uses a foreign key.  And MYISAM does
>> not support foreign keys.
>>
>> TTBOMK, the MythTV project as historically
>> avoided using foreign keys (preferring to
>> implement the business logic in the code,
>> and any cleanups, including inconsistencies,
>> to be in the housekeeping codes) in order
>> to be database independent.
> 
> I think I can just drop the FOREIGN_KEY statement, as the code already
> contains the following constraint in the select statement(1):
> 
>      "INNER JOIN sportsapi api ON sl.api = api.id"
> 
> I only have a passing familiarity with sql, so I'd love to hear from
> anyone with more experience if this is a correct solution.
> 
> Thanks.
> 
> David
> 
> 1) From programs/mythbackend/recordingextender.cpp:1153.

I just tried again, but no luck:
{{{
2022-01-30 09:53:18.551453 C  mythtv-setup version: HEAD 
[v32-Pre-fd4b8e3487] www.mythtv.org
2022-01-30 09:53:18.551459 C  Qt version: compile: 5.9.7, runtime: 5.9.7
2022-01-30 09:53:18.562244 I  Scientific Linux 7.9 (Nitrogen) (x86_64)


2022-01-30 09:54:20.094519 C  Upgrading to MythTV schema version 1371
2022-01-30 09:54:20.095828 E  DB Error (Performing MythtTV database 
upgrade):
Query was: CREATE TABLE sportsapi (
               id INT UNSIGNED PRIMARY KEY,
               provider TINYINT UNSIGNED DEFAULT 0,
               name VARCHAR(128) NOT NULL,
               key1 VARCHAR(256) NOT NULL,
               key2 VARCHAR(256) NOT NULL,
               UNIQUE(provider,key1,key2)
               ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Error was: Driver error was [2/1071]:
QMYSQL: Unable to execute query
Database error was:
Specified key was too long; max key length is 1000 bytes
}}}

John


More information about the mythtv-dev mailing list