Fix compare expression - md5() was in wrong place
authorMarko Kreen <markokr@gmail.com>
Thu, 18 Oct 2012 08:13:40 +0000 (11:13 +0300)
committerMarko Kreen <markokr@gmail.com>
Thu, 18 Oct 2012 08:13:40 +0000 (11:13 +0300)
python/londiste/compare.py

index f2d253abf075164488e2a470e0afdd44b1f2f91f..067a6b49dbece689a80ee6d32b8a311e76c567e0 100644 (file)
@@ -36,7 +36,7 @@ class Comparator(Syncer):
         v1 = src_db.server_version
         v2 = dst_db.server_version
         if (v1 < 80400 or v2 < 80400) and v1 != v2:
-            q = "select count(1) as cnt, sum(md5('x'||substr(md5(_COLS_::text),1,16))::bit(64)::bigint) as chksum from only _TABLE_"
+            q = "select count(1) as cnt, sum(('x'||substr(md5(_COLS_::text),1,16))::bit(64)::bigint) as chksum from only _TABLE_"
         else:
             q = "select count(1) as cnt, sum(hashtext(_COLS_::text)::bigint) as chksum from only _TABLE_"