summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-01-17 11:15:53 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-01-17 11:16:58 (GMT)
commitf4c476e7168a8c7224c2ff234c61d00e11870c3a (patch)
tree85cf60e35b7545f5c5d6fbc48fa1650449ceae4e
parent341db07cc25fe3385c48c430bbb04b9b12a3659d (diff)
downloadtabellio.pcfdb-f4c476e7168a8c7224c2ff234c61d00e11870c3a.zip
tabellio.pcfdb-f4c476e7168a8c7224c2ff234c61d00e11870c3a.tar.gz
tabellio.pcfdb-f4c476e7168a8c7224c2ff234c61d00e11870c3a.tar.bz2
also check timestamp from t_histoline, not just t_histo (#1224)
-rw-r--r--tabellio/pcfdb/sync.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index 5a3a606..b05b27d 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -951,9 +951,10 @@ class SyncFromPcfDbView(BrowserView):
where_ts = ''
if timestamp:
- where_ts = cursor.mogrify('''AND EXISTS (SELECT ts FROM t_histoline
+ where_ts = cursor.mogrify('''AND (EXISTS (SELECT ts FROM t_histoline
WHERE idhisto = t_histo.id
- AND ts > %s)''', (timestamp,))
+ AND ts > %s)
+ OR t_histo.ts > %s)''', (timestamp, timestamp))
### Handle t_dossiers
cursor.execute('''SELECT t_histo.id, t_histo.st, t_histo.type,
@@ -1023,9 +1024,10 @@ class SyncFromPcfDbView(BrowserView):
### Handle t_qx
where_ts = ''
if timestamp:
- where_ts = cursor.mogrify('''AND EXISTS (SELECT ts FROM t_histoline
+ where_ts = cursor.mogrify('''AND (EXISTS (SELECT ts FROM t_histoline
WHERE idhisto = t_histo.id
- AND ts > %s)''', (timestamp,))
+ AND ts > %s)
+ OR t_histo.ts > %s)''', (timestamp, timestamp))
cursor.execute('''SELECT t_histo.id, t_histo.st, t_histo.type, t_histo.sess,
t_histo.no, t_histo.intit, t_histo.auteurs,