Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#13473 closed Patch - Feature (Fixed)

Handle databases that have auto increments other than 1

Reported by: mdabbs Owned by: Peter Bennett
Priority: minor Milestone: 31.0
Component: MythTV - General Version: v30-fixes
Severity: medium Keywords: RecGroupID
Cc: Ticket locked: no

Description

This patch adds a method to retrieve the RecGroupID from the database instead of assuming that the enumerated values match the auto-increments from the DB.

For DBs that have auto-increments of something other than 1, this will provide the correct ID as it was assigned by the DB.

Attachments (1)

mythtv-fixes-30-recording-groups.patch (6.4 KB) - added by mdabbs 5 years ago.
Patch to provide ability to get RecGroupIDs form the DB instead of the enumeration

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by mdabbs

Patch to provide ability to get RecGroupIDs form the DB instead of the enumeration

comment:1 Changed 5 years ago by Peter Bennett

Owner: set to Peter Bennett
Status: newassigned

comment:2 Changed 5 years ago by Peter Bennett

Before I can do anything about implementing this I need the name and email address of author of the code change to use in the github commit. I have the email address, but I do not know your name.

comment:3 Changed 5 years ago by mdabbs

Author name: Mike Dabbs

comment:4 Changed 5 years ago by Peter Bennett

My feelings on this

  • It likely affects very few users.
  • The proposed change adds database accesses.
  • It is possible that some users have decided to update the database and change the name of their default group to something else. The proposed change would clobber them.

I recommend a simple change rather in dbcheck.cpp to insert the special groups with the correct ids in the first place, regardless to the auto increment value. This should have been done at the start and this problem would never have happened.

For those who already have the wrong values, run this:

update recgroups set recgroupid = 1 where recgroup = 'Default';
update recorded set recgroupid = 1 where recgroup = 'Default';

Repeat for the other two special group names.

comment:5 Changed 5 years ago by Peter Bennett <pbennett@…>

In da558ca5f/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

comment:6 Changed 5 years ago by Peter Bennett <pbennett@…>

In 5cde0578d8/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

comment:7 Changed 5 years ago by Peter Bennett <pbennett@…>

In 7668cc59ab/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

comment:8 Changed 5 years ago by Peter Bennett <pbennett@…>

In bf8956a98/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

comment:9 Changed 4 years ago by Peter Bennett

Resolution: Fixed
Status: assignedclosed
Summary: Get RecGroupIDs from the DB instead of hard-coding them in an enumHandle databases that have auto increments other than 1

I have updated the title of the bug to reflect the problem that it being fixed. Closing the bug because it has been fixed, in a different way from the original description.

comment:10 Changed 4 years ago by Stuart Auchterlonie

Milestone: needs_triage31.0
Note: See TracTickets for help on using tickets.