ElvishArtisan / rivendell

A full-featured radio automation system targeted for use in professional broadcast and media environments
209 stars 64 forks source link

RDLogManager Fails to update grids when using MySQL version 5.5 #47

Closed FireByTrial closed 9 years ago

FireByTrial commented 9 years ago

After a clean install on Ubuntu14.04 experienced problem with not being able to set grids between Thursday 12:00 - end of week.

after look up of issue (http://dev.mysql.com/doc/refman/5.0/en/column-count-limit.html) appears to be a limit of row size capacity in newer MySQL. I changed my local DB from CHAR(60) to VARCAHR(60) for grid# and appears to have resolved the issue.

waynemerricks commented 9 years ago

This is a common problem. In MySQL < 5.5 the default database engine was MyISAM unless otherwise specified. After 5.5 InnoDB is now the default which introduced the lower row limit.

VARCHAR fixed the problem because MySQL stores varchars, blobs and probably some others outside of the rows themselves. This has a small performance impact on row retrieval but for most people/work loads apart from very high numbers of users you'd never really notice.

I suppose a better fix would be to specify MyISAM but then that may interfere with RD's use on different databases. The longer term fix would probably be a restructure on SERVICES where the days are split into rows e.g.

Date, Clock No, Slot, Service_ID

Then you could do slot 0 - 23 per day (or even a clock 0 - 23 per day so each row was a single day), have the date and clock number look up. At the moment each row is an entire weeks worth of clocks including all the other service info in the SERVICES table.

In theory you could do some table joins to present back to Riv the same format of data it expects from the single row per week scenario. I might have a play with that as code wise it is trivial to swap out a single SQL statement vs a whole bunch of extra lookups and code rewrites.

ElvishArtisan commented 9 years ago

On Dec 4, 2014, at 14:49 15, waynemerricks notifications@github.com wrote:

I suppose a better fix would be to specify MyISAM but then that may interfere with RD's use on different databases. The longer term fix would probably be a restructure on SERVICES where the days are split into rows e.g.

Yes, renormalizing SERVICES is definitely the correct solution. It will require a fairly involved procedure to refactor existing data correctly when doing the in-place update, as well as changes in the log generation code. All pretty intricate code!

Cheers!

---------------------------------------------------------------------- Frederick F. Gleason, Jr. Chief Developer Paravel Systems
A room without books is like a body without a soul.
-- Cicero
----------------------------------------------------------------------
albanpeignier commented 9 years ago

Yes, renormalizing SERVICES is definitely the correct solution.

:+1:

ElvishArtisan commented 9 years ago

Fixed. The SERVICES table has now been normalized, with all of the per-clock values moved into a 'SVC_CLOCKS' table, so this should now play nice with InnoDB tables.

dthertel commented 8 years ago

Hello all. I know this is a very old thread, but I am just starting to learn linux and Rivendell.

I have installed everything and have everything that I want working but the grid in the scheduler.

Does anybody have some directions for beginners on how to normalize the database?

waynemerricks commented 8 years ago

I'm not sure what version of OS/Rivendell you're using but you will have issues with MyISAM and InnoDB which causes the grid problem (MyISAM has a higher row limit than InnoDB does so you get an overflow and the row doesn't update all of the clocks in the grid).

In MySQL itself you need to force the table to MyISAM. The easiest way to do this is dump the Rivendell SERVICES table (mysqldump). Open up the file in a text editor and change InnoDB to MyISAM. Then reimport the SERVICES table.

dthertel commented 8 years ago

Wayne,

Thanks for the details..

I found an even easier way... love google!....

I just logged into the Rivendell database and then ran the following line

ALTER TABLE SERVICES ENGINE=MyISAM;

took care of it!

Thanks for the help!

Dave

On Mon, Oct 31, 2016 at 9:50 AM, Wayne Merricks notifications@github.com wrote:

I'm not sure what version of OS/Rivendell you're using but you will have issues with MyISAM and InnoDB which causes the grid problem (MyISAM has a higher row limit than InnoDB does so you get an overflow and the row doesn't update all of the clocks in the grid).

In MySQL itself you need to force the table to MyISAM. The easiest way to do this is dump the Rivendell SERVICES table (mysqldump). Open up the file in a text editor and change InnoDB to MyISAM. Then reimport the SERVICES table.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ElvishArtisan/rivendell/issues/47#issuecomment-257298308, or mute the thread https://github.com/notifications/unsubscribe-auth/AWGKPO5MgXBmI6zg-jFIQ-wqs1wrE0Agks5q5fIqgaJpZM4DCdKH .

David Hertel Newman-Kees Engineering Evansville, In Cell 812-760-9071