Bug 2821 - SVN 5516 & mysql causes crash on scanning
: SVN 5516 & mysql causes crash on scanning
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.5b1
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-15 04:05 UTC by Chris
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 Chris 2006-01-15 04:05:02 UTC
When using MySQL, I get the following crash when I start a scan. The crash occurs on the first track in my library:

2006-01-14 22:21:03.0302 directory entry: file:///L:/Music/Charvie/Alanis%20Mor
issette/Jagged%20Little%20Pill/01%20All%20I%20Really%20Want.mp3
2006-01-14 22:21:03.3345 DBD::mysql::st execute failed: Incorrect integer value:
'' for column 'discc' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/D
ataStores/DBI/DataModel.pm line 956.
Can't update Jagged Little Pill: DBD::mysql::st execute failed: Incorrect intege
r value: '' for column 'discc' at row 1 at C:/Program Files/SlimServer_svn/serve
r/Slim/DataStores/DBI/DataModel.pm line 956.
at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DBIStore.pm line
1951
2006-01-14 22:21:03.6622 ERROR: Slim::Control::Command::clearExecuteCallback() h
as been deprecated!

2006-01-14 22:21:03.6654 ERROR: Please use Slim::Control::Request::unsubscribe()
instead!

2006-01-14 22:21:03.7129 Slim::DataStores::DBI::Album Slim::DataStores::DBI::Alb
um=HASH(0x5142d5c) destroyed without saving changes to discc, replay_peak, title
sort, compilation, titlesearch, replay_gain, musicbrainz_id, disc, year, contrib
utor at slimserver.pl line 0


This crash doesn't occur with svn 5515, but does occur with svn 5516 or later.
Comment 1 Dan Sully 2006-04-10 22:25:57 UTC
Chris - are you still seeing this with the latest nightly?
Comment 2 Chris 2006-04-13 09:49:12 UTC
Hi Dan,

Using svn r6921, I get the following error:

2006-04-13 17:44:05.7036 DBD::mysql::st execute failed: Incorrect integer value: '' for column 'discc' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DataModel.pm line 984. Can't update 10 CC's Greatest Hits 1972-1978: DBD::mysql::st execute failed: Incorrect integer value: '' for column 'discc' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DataModel.pm line 984. at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DBIStore.pm line 1973
2006-04-13 17:44:05.8939 Slim::DataStores::DBI::Album Slim::DataStores::DBI::Album=HASH(0x32b59bc) destroyed without saving changes to discc, replay_peak, title sort, compilation, titlesearch, replay_gain, musicbrainz_id, disc, year, contributor at slimserver.pl line 0

The crash occurs on the first track in the library.

This doesn't seem to affect the split-scanner branch.

Cheers
Chris
Comment 3 Dan Sully 2006-04-13 10:15:02 UTC
Chris - I just checked in change 6922 which will hopefully fix this problem.
Comment 4 Chris 2006-04-13 10:39:18 UTC
That fixes the discc error, but now I get the following:

2006-04-13 18:35:34.3949 DBD::mysql::st execute failed: Data truncated for column 'replay_peak' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DataModel.pm line 984. Can't update Trouble: DBD::mysql::st execute failed: Data truncated for column 'replay_peak' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/
DBI/DataModel.pm line 984. at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DBIStore.pm line 1934
2006-04-13 18:35:34.6730 Slim::DataStores::DBI::Album Slim::DataStores::DBI::Album=HASH(0x32c55f8) destroyed without saving changes to replay_peak, compilation, titlesort, titlesearch, replay_gain, musicbrainz_id, year, contributor at slimserver.pl line 0
Comment 5 Dan Sully 2006-04-13 10:43:29 UTC
Can you run with --d_scan and find out what file is causing this and send it to dan | at | slimdevices.com ?

Thanks.
Comment 6 Chris 2006-04-13 11:12:24 UTC
I've sent you the file via email.
Comment 7 Dan Sully 2006-04-13 11:28:14 UTC
Hmm.. I'm not able to reproduce it. I don't see any RG info in that file.

Can you add the following above the $albumObj->set(%set); line in Slim/DataStores/DBI/DBIStore.pm line 1934:

use Data::Dumper; print Dumper(\%set);

Thanks.
Comment 8 Chris 2006-04-13 12:14:47 UTC
2006-04-13 20:12:59.6618  directory entry: file:///L:/Music/Bob/Akon%20-%20Trouble/01%20-%20Locked%20Up.mp3
$VAR1 = {
          'replay_peak' => undef,
          'compilation' => 0,
          'titlesort' => 'TROUBLE',
          'titlesearch' => 'TROUBLE',
          'replay_gain' => undef,
          'musicbrainz_id' => undef,
          'year' => '2005',
          'contributor' => '2'
        };
2006-04-13 20:12:59.8565 DBD::mysql::st execute failed: Data truncated for column 'replay_peak' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DataModel.pm line 984. Can't update Trouble: DBD::mysql::st execute failed: Data truncated for column 'replay_peak' at row 1 at C:/Program Files/SlimServer_svn/server/Slim/DataStores/
DBI/DataModel.pm line 984. at C:/Program Files/SlimServer_svn/server/Slim/DataStores/DBI/DBIStore.pm line 1934
2006-04-13 20:13:00.0806 Slim::DataStores::DBI::Album Slim::DataStores::DBI::Album=HASH(0x32b4a34) destroyed without saving changes to replay_peak, compilation, titlesort, titlesearch, replay_gain, musicbrainz_id, year, contributor at slimserver.pl line 0
Comment 9 Chris 2006-04-13 14:08:05 UTC
I *think* its falling over on the first track in my library which doesn't contain the replay_peak field. It looks like the scanning process isn't handling undef values correctly...
Comment 10 Dan Sully 2006-04-13 14:11:48 UTC
Subject: Re:  SVN 5516 & mysql causes crash on scanning

* Slim Devices Bugzilla shaped the electrons to say...

>I *think* its falling over on the first track in my library which doesn't
>contain the replay_peak field. It looks like the scanning process isn't
>handling undef values correctly...

Yeah - there's some logic in there - an undef value should mean to delete the value if there is one.

What version of MySQL are you running? Is it in "strict" mode?

-D
--
<iNoah> all your base class are belong to us

Comment 11 Dan Sully 2006-04-13 14:22:55 UTC
Can you try this patch to DataModel.pm ?

--- Slim/DataStores/DBI/DataModel.pm    (revision 6917)
+++ Slim/DataStores/DBI/DataModel.pm    (local)
@@ -977,7 +977,7 @@
 
                } else {
 
-                       push @vals, "$value";
+                       push @vals, (defined $value ? "$value" : undef);
                }
        }


Thanks
Comment 12 Chris 2006-04-13 14:40:02 UTC
I'm using MySQL 5.0.19 on Windows XP. As far as I know strict mode isn't enabled.

However, your patch seems to have solved the problem - my SlimServer is now happily scanning away!!


Comment 13 Dan Sully 2006-04-13 14:51:17 UTC
Ok - fixed in change 6927