After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599806 - SQLite Error when Importing Library
SQLite Error when Importing Library
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Importing
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 537873 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-10-27 17:00 UTC by Thomas Russell
Modified: 2010-02-19 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ignore '\0' characters in strings returned by TagLib# (933 bytes, patch)
2009-10-28 02:45 UTC, Alexander Kojevnikov
committed Details | Review

Description Thomas Russell 2009-10-27 17:00:57 UTC
A lot of my tracks aren't successfully imported because of an 'Sqlite error unrecognized token: "'" error. 

Here's an example full banshee runtime error that occurs for each failed track: 

[Debug 16:24:52.312] Exception executing command: INSERT INTO CoreTracks (Rating,LastStreamError,PrimarySourceID,ArtistID,AlbumID,TagSetID,MusicBrainzID,MimeType,FileSize,FileModifiedStamp,LastSyncedStamp,Attributes,Title,TitleSort,MetadataHash,TrackNumber,TrackCount,Disc,DiscCount,Duration,Year,Genre,Composer,Conductor,Grouping,Copyright,LicenseUri,Comment,BPM,BitRate,Score,PlayCount,SkipCount,ExternalID,LastPlayedStamp,LastSkippedStamp,DateAddedStamp,DateUpdatedStamp,Uri,TitleSortKey,TitleLowered) VALUES (0,0,1,877,1813,0,NULL,'taglib/mp3',3093396,1219659578,1256660692,5,'Walk Among The Cobras Pt.1',NULL,'7cefc592e93ad553a6ea385bef66edb8',4,0,0,0,193780,2003,'Country Rock','','',NULL,'',NULL,NULL,0,128,0,0,0,0,NULL,NULL,1256660692,1256660692,'file:///home/thomas/Music/My%20Music/d/Dan%20Sartain/Dan%20Sartain%20Vs.%20The%20Serpientes/04%20-%20Wak%20Among%20The%20Cobras%20P.T.1.mp3',X'0EA40E020E480E3607020E020E510E7C0E700E2507020E990E2C0E2107020E0A0E7C0E090E8A0E020E9107020E7E0E9907330C210101010100','walk among the cobras pt1')
[Warn  16:24:52.313] Caught an exception - Sqlite error
unrecognized token: "'" (in `Mono.Data.Sqlite')
  at Mono.Data.Sqlite.Sqlite3.Prepare (System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, System.String& strRemain) [0x00126] in /home/thomas/latest/banshee/src/Libraries/Mono.Data.Sqlite/Mono.Data.Sqlite/SQLite3.cs:267 
  at Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () [0x00019] in /home/thomas/latest/banshee/src/Libraries/Mono.Data.Sqlite/Mono.Data.Sqlite/SQLiteCommand.cs:226 
[Debug 16:24:52.313] type of key value: System.Int32
[Error 16:24:52.318] /home/thomas/Music/My Music/d/Dan Sartain/Dan Sartain Vs. The Serpientes/04 - Wak Among The Cobras P.T.1.mp3 - Sqlite error
unrecognized token: "'"
[Debug 16:24:52.318] Full import exception: Mono.Data.Sqlite.SqliteException: Sqlite error
unrecognized token: "'"
  at Mono.Data.Sqlite.Sqlite3.Prepare (System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, System.String& strRemain) [0x00126] in /home/thomas/latest/banshee/src/Libraries/Mono.Data.Sqlite/Mono.Data.Sqlite/SQLite3.cs:267 
  at Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () [0x00019] in /home/thomas/latest/banshee/src/Libraries/Mono.Data.Sqlite/Mono.Data.Sqlite/SQLiteCommand.cs:226 
[Warn  16:24:52.351] Forcefully breaking out of RCS loop b/c change in total_width less than 1.0
[Debug 16:24:53.158] Importing Media duration: 00:05:12.8335850
[Debug 16:24:53.159] Finished - Importing 20898 of 20907

I can import these files fine in other media players.

I've uploaded a file that fails [Fifteen Minutes Past Three.mp3]- I own full copyright to it.
Comment 1 Thomas Russell 2009-10-27 17:07:57 UTC
File too large for attached. Uploaded here:

http:// crawlbackinbed.com/DragRacer.mp3
Comment 2 Alexander Kojevnikov 2009-10-28 00:35:41 UTC
Confirming
Comment 3 Alexander Kojevnikov 2009-10-28 02:45:55 UTC
Created attachment 146404 [details] [review]
Ignore '\0' characters in strings returned by TagLib#

The patch works around the problem in TagLib# which sometimes returns strings containing only '\0' characters. Mono.Data.Sqlite cannot handle queries containing NULL characters, returning the parsing error.

I filed bug 599873 at TagLib#
Comment 4 Gabriel Burt 2009-11-06 04:36:45 UTC
Comment on attachment 146404 [details] [review]
Ignore '\0' characters in strings returned by TagLib#

Looks fine.  Are there cases where there are actually more than one \0 in the string?  If not, an optimization to check s.Length == 1 before the trim might be good.
Comment 5 Alexander Kojevnikov 2009-11-06 09:38:00 UTC
Thank Gabriel! I committed a slightly modified version of the patch that avoids unnecessary string allocations.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 6 Alexander Kojevnikov 2010-02-19 09:20:43 UTC
*** Bug 537873 has been marked as a duplicate of this bug. ***