Bug 2610 - More schema issues - upsets mySQL with alphanumeric blank years ("") and probable incorrect field def
: More schema issues - upsets mySQL with alphanumeric blank years ("") and prob...
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: unspecified
: All All
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-21 13:54 UTC by Jim
Modified: 2008-09-15 14:39 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim 2005-11-21 13:54:03 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
Comment 1 Dan Sully 2005-11-22 15:57:47 UTC
Thanks - fixed in change 5292.
Comment 2 Chris 2005-11-23 01:14:48 UTC
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
Comment 3 Chris 2005-11-23 01:17:00 UTC
Just to clarify the above comment, the server actually crashes with the above error message as soon as you start a scan.