[banshee] [Hyena.Data.Sqlite] Fix selecting values from cache



commit e8315c65229f9bcd90880759d90c336212d877d1
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Feb 22 14:21:46 2010 -0800

    [Hyena.Data.Sqlite] Fix selecting values from cache
    
    A recent change to SqliteModelCache I made for ShuffleBySimilar caused
    Genres in Radio to show up as numbers (bgo#610651).

 .../Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs    |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
index c877c28..e171362 100644
--- a/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
+++ b/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
@@ -127,8 +127,11 @@ namespace Hyena.Data.Sqlite
                     CacheTableName, uid, model.JoinPrimaryKey
                 );
             } else if (model.CachesValues) {
+                // The duplication of OrderID/ItemID in the select below is intentional!
+                // The first is used construct the QueryFilterInfo value, the last internally
+                // to this class
                 select_str = String.Format (
-                    @"SELECT 1 {2}, OrderID, ItemID FROM {0} {3} WHERE {0}.ModelID = {1}",
+                    @"SELECT OrderID, ItemID {2}, OrderID, ItemID FROM {0} {3} WHERE {0}.ModelID = {1}",
                     CacheTableName, uid, "{0}", "{1}"
                 );
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]