[banshee] SourceWatcher: Fix SQL error caused by incorrect escaping (bgo#667355)
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] SourceWatcher: Fix SQL error caused by incorrect escaping (bgo#667355)
- Date: Sun, 8 Jan 2012 11:56:17 +0000 (UTC)
commit 48f6ac2b9d1127c9a7acc14a0622957d034cc2ae
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sun Jan 8 12:51:47 2012 +0100
SourceWatcher: Fix SQL error caused by incorrect escaping (bgo#667355)
Recent refactoring cause an SQL statement to become incorrect, as the
ESCAPE part was not @-quoted anymore.
Fix this and try to make the query construction a bit clearer by using a
temporary variable.
.../Banshee.LibraryWatcher/SourceWatcher.cs | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
index 1ffbd64..770721e 100644
--- a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
+++ b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/SourceWatcher.cs
@@ -277,9 +277,9 @@ namespace Banshee.LibraryWatcher
"?"), DateTime.Now, track_id, track_id);
} else {
string pattern = StringUtil.EscapeLike (uri) + "/_%";
- delete_command = new HyenaSqliteCommand (String.Format (delete_sql,
- @"SELECT TrackID FROM CoreTracks
- WHERE " + BansheeQuery.UriField.Column + " LIKE ? ESCAPE '\'"),
+ string select_sql = String.Format (@"SELECT TrackID FROM CoreTracks WHERE {0} LIKE ? ESCAPE '\'",
+ BansheeQuery.UriField.Column);
+ delete_command = new HyenaSqliteCommand (String.Format (delete_sql, select_sql),
DateTime.Now, pattern, pattern);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]