[hyena] Fix selecting values from cache



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

    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.Data.Sqlite/SqliteModelCache.cs          |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteModelCache.cs b/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteModelCache.cs
index c877c28..e171362 100644
--- a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteModelCache.cs
+++ b/src/Hyena.Data.Sqlite/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]