GNOME Bugzilla – Bug 474142
crash when Updating database from version 7 to 8
Last modified: 2007-09-06 08:58:22 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:
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...)
fixed in 3339