Bug 212676 - collection scanner fails on SQL INSERT if LANG is not English
Summary: collection scanner fails on SQL INSERT if LANG is not English
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.3-GIT
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-01 23:47 UTC by Benedikt Waldvogel
Modified: 2009-11-12 05:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benedikt Waldvogel 2009-11-01 23:47:05 UTC
Version:           git (using KDE 4.3.2)
Compiler:          gcc 4.1.2 
OS:                Linux
Installed from:    Gentoo Packages

The collection scanners fails to update the collection (i.e. incremental or full rescan).
LANG is set to de_DE.utf8.

Running amarok --debug --nofork reveals the problem:

amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match value count at row 13  on "INSERT INTO tracks_temp VALUES
(5248,4866,545,643,41,1,2,'Like a Book','',3,NULL,190,215000,44100,5142970,NULL,NULL,1249858959,1248132709,NULL,NULL,NULL,NULL),
(5249,4867,545,643,41,1,2,'Same Ground Again','',4,NULL,210,280000,44100,7376364,NULL,NULL,1249858960,1248132710,NULL,NULL,NULL,NULL),
(5250,4868,545,643,41,1,2,'Guilty','',5,NULL,215,210000,44100,5674330,NULL,NULL,1249858961,1248132710,NULL,NULL,NULL,NULL),
(5251,4869,545,643,41,1,2,'Chances','',6,NULL,206,215000,44100,5550118,NULL,NULL,1249858961,1248132710,NULL,NULL,NULL,NULL),
(5252,4870,545,643,41,1,2,'Out of This World','',7,NULL,207,291000,44100,7563245,NULL,NULL,1249858961,1248132711,NULL,NULL,NULL,NULL),
(5253,4871,545,643,41,1,2,'Wish You Were Here','',8,NULL,172,297000,44100,6441457,NULL,NULL,1249858960,1248132711,NULL,NULL,NULL,NULL),
(5254,4872,545,643,41,1,2,'Thief','',9,NULL,188,276000,44100,6519614,NULL,NULL,1249858962,1248132711,NULL,NULL,NULL,NULL),
(5255,4873,545,643,41,1,2,'Under Fire','',10,NULL,209,238000,44100,6254946,NULL,NULL,1249858961,1248132712,NULL,NULL,NULL,NULL),
(5256,4874,545,643,41,1,2,'Not Enough Love','',11,NULL,189,317000,44100,7530109,NULL,NULL,1249858962,1248132712,NULL,NULL,NULL,NULL),
(5257,4875,545,643,41,1,2,'Cruel Heart','',12,NULL,177,254000,44100,5627743,NULL,NULL,1249858962,1248132712,NULL,NULL,NULL,NULL),
(5258,4876,545,643,41,1,2,'Marching Orders','',13,NULL,204,301000,44100,7701392,NULL,NULL,1249858962,1248132713,NULL,NULL,NULL,NULL),
(5259,4877,545,643,41,1,2,'Your Life','',14,NULL,185,243000,44100,5654949,NULL,NULL,1249858963,1248132713,NULL,NULL,NULL,NULL),
(5260,4878,730,644,56,1,32,'Jerk of Life','',1,NULL,1010,309000,44100,39029834,NULL,NULL,1249859017,1248132742,-7,3,-0,00981166,-6,91,-0,0103424),
(5261,4879,730,644,56,1,32,'Nam Nam','',2,NULL,942,909000,44100,107092424,NULL,NULL,1249859021,1248132752,-7,3,-0,00981166,-7,26,-0,00981166),


The floating point numbers have incorrect formatting (i.e. -0,0098.. instead of -0.0098).

A quickfix for me was changing LANG to en_GB.utf8.
Though, the amarok collection was totally broken and I had to recover it from a backup :/
Comment 1 Benedikt Waldvogel 2009-11-01 23:49:19 UTC
After all, why aren't prepared statements used?
Creating the SQL statement by hand is a very bad idea IMO.
Comment 2 Mark Kretschmann 2009-11-02 07:19:07 UTC
CC'ing Jeff Mitchell, who knows the scanner code best. Jeff, any ideas? :)
Comment 3 Jeff Mitchell 2009-11-02 13:45:19 UTC
Prepared statements aren't used because they won't provide any sort of a significant speedup and are a total and complete pain in the ass in the C API.
Comment 4 Jeff Mitchell 2009-11-02 14:14:38 UTC
Also I don't see how prepared statements are even related to this bug, considering the problem is bad data being passed in, not the query itself.

Regardless, it should be fixed in 6685d27. Please let me know.
Comment 5 Benedikt Waldvogel 2009-11-03 22:06:34 UTC
Thanks for your work Jeff, but I still get the very same ERROR. More debugging needed?
Comment 6 Jeff Mitchell 2009-11-04 02:14:03 UTC
Don't know what to say. I just tested it and it's fixed for me. You sure you're using a new enough version from git?

What is the exact ERROR you get in the debug output? It might be something new; please repaste from debug output. Also please tell me what git version you're using.

It's entirely possible that you built a version from Git but aren't actually using it (or it's using the wrong libraries), due to your PATH or LDPATH.
Comment 7 Benedikt Waldvogel 2009-11-12 05:03:35 UTC
The problem seems to be fixed for me since e38986b54701. Thanks Jeff!