also check timestamp from t_histoline, not just t_histo (#1224)

This commit is contained in:
Frédéric Péters 2012-01-17 12:15:53 +01:00
parent 341db07cc2
commit f4c476e716
1 changed files with 6 additions and 4 deletions

View File

@ -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,