Bugzilla – Bug 2610
More schema issues - upsets mySQL with alphanumeric blank years ("") and probable incorrect field def
Last modified: 2008-09-15 14:39:24 UTC
1) Related to bug 2600 - but the simple issues I fixed in that have been commited and bug closed - so best to open another I think. I have been scanning some old MP3's noticed an additional problem with the YEAR. Some MP3's have the year set as nothing (actually ""), which Slim is reading back as the string "". The DB then errors when it tries to write the string "" to the integer field Year. There should obviously be a null conversion if the string is "" or indeed if should be nulled and errorlogged in the strange case it's screwed up with < 4 digits or has alphabetic characters. Simple fix would be to change the Year to char(4), but then we are making alphanumeric what is essentially a number - plus in the future this date field might want to be changed to a real date, to allow for more accurate dating. My suggestion would be to fix this after tag-reading and before DB writing. 2) In addition (see http://forums.slimdevices.com/showthread.php?t=18358) I noticed in the albums table that the reference to contributor is defined as varchar (255) --EDIT now it's been changed to TEXT--. This is actually holding a numeric reference to the contributor tables id so I assume it should be defined as: contributor int(10) unsigned NOT NULL
Thanks - fixed in change 5292.
Dan, Thanks for adding the change. Unfortunately it looks like the "contributor" change doesn't quite work properly. I get the following error message: 2005-11-23 09:09:04.2785 DBD::mysql::st execute failed: Field 'contributor' does n't have a default value at C:\Program Files\SlimServer_svn\server\CPAN/DBIx/Con textualFetch.pm line 52. Can't insert new Slim::DataStores::DBI::Album: DBD::mysql::st execute failed: Fi eld 'contributor' doesn't have a default value at C:\Program Files\SlimServer_sv n\server\CPAN/DBIx/ContextualFetch.pm line 52. at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DBIStore.pm line 1795
Just to clarify the above comment, the server actually crashes with the above error message as soon as you start a scan.