Mercurial > libervia-pubsub
changeset 378:22832c1d2827
storage (pgsql): don't specify table name in ORDER BY clause as it can cause troubles in some requests.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 12 Jan 2019 16:41:45 +0100 |
parents | ded7657b03fa |
children | 66fbf026ed49 |
files | src/pgsql_storage.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pgsql_storage.py Thu Jan 10 08:42:49 2019 +0100 +++ b/src/pgsql_storage.py Sat Jan 12 16:41:45 2019 +0100 @@ -843,16 +843,16 @@ """ keys = ext_data.get('order_by') if not keys: - return u'ORDER BY items.updated ' + direction + return u'ORDER BY updated ' + direction cols_statmnt = [] for key in keys: if key == 'creation': - column = 'items.item_id' # could work with items.created too + column = 'item_id' # could work with items.created too elif key == 'modification': - column = 'items.updated' + column = 'updated' else: log.msg(u"WARNING: Unknown order by key: {key}".format(key=key)) - column = 'items.updated' + column = 'updated' cols_statmnt.append(column + u' ' + direction) return u"ORDER BY " + u",".join([col for col in cols_statmnt])