Fix size & type of copied objects (sqlite)
authorSofia Papagiannaki <papagian@gmail.com>
Thu, 28 Jun 2012 16:52:45 +0000 (19:52 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Thu, 28 Jun 2012 16:52:45 +0000 (19:52 +0300)
Refs: #2611

snf-pithos-backend/pithos/backends/lib/sqlite/node.py

index ce73d48..d3649b1 100644 (file)
@@ -530,12 +530,12 @@ class Node(DBWorker):
              "where serial in (select max(serial) "
                              "from versions "
                              "where node in (%s) and mtime < ? group by node) "
-             "and cluster = ?")
+             "and cluster = ? %s")
         placeholders = ','.join('?' for node in nodes)
         if not all_props:
-            q = q % ("serial",  placeholders)
+            q = q % ("serial",  placeholders, '')
         else:
-            q = q % ("serial, node, hash, size, type, source, mtime, muser, uuid, checksum, cluster",  placeholders)
+            q = q % ("serial, node, hash, size, type, source, mtime, muser, uuid, checksum, cluster",  placeholders, 'order by node')
         
         args = nodes
         args.extend((before, cluster))