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 474142 - crash when Updating database from version 7 to 8
crash when Updating database from version 7 to 8
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
SVN
Other All
: Normal critical
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2007-09-06 07:30 UTC by xbx
Modified: 2007-09-06 08:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix for the issue (1.45 KB, patch)
2007-09-06 08:10 UTC, xbx
none Details | Review

Description xbx 2007-09-06 07:30:16 UTC
Steps to reproduce:
run f-spot..
(with photos in the database with version_id containing "'")

Stack trace:
I'm having a crash with latest svn, when Updating database from version 7 to 8:

Unhandled Exception: Mono.Data.SqliteClient.SqliteSyntaxException: near "image": syntax error

at Mono.Data.SqliteClient.SqliteCommand.GetNextStatement (IntPtr pzStart, System.IntPtr& pzTail, System.IntPtr& pStmt) [0x00000]

at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000]   

at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery () [0x00000]   

at Banshee.Database.QueuedSqliteCommand.Execute () [0x00000] 



I tracked it back to this statement:

string statement = String.Format ("INSERT INTO photo_versions (photo_id, version_id, name, uri) " +         "VALUES ({0}, {1}, '{2}', '{3}')",
         Convert.ToUInt32 (reader [0]),
         Convert.ToUInt32 (reader [1]),
         (string)(reader [2]),
         uri);


with version_id = "Modifié dans Éditeur d'image GIMP" (notice the "'")...


Other information:
Comment 1 xbx 2007-09-06 08:10:59 UTC
Created attachment 95038 [details] [review]
fix for the issue

fix the issue using Banshee helper functions.
works for me... (tm)

There don't seem to be other similar issues in Updater.cs

(But I just don't have a clue if this is the correct fix, the Banshee stuff having a queuing/threading model that seem to do more than just building the correct querry...)
Comment 2 Stephane Delcroix 2007-09-06 08:58:22 UTC
fixed in 3339