Commit 4cf01f2d authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

SQLCatalog: keep the order when building query from AST

When searching for something like for example "A AND B", make sure that
the AND complex query contains query for ["A", "B"], not ["B", "A"].
This is probably always equivalent in generated SQL, but this makes
testing easier.

Revealed by testSQLCatalog.TestSQLCatalog with PYTHONHASHSEED 279 on py2
parent ec0b7bb3
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
############################################################################## ##############################################################################
from __future__ import absolute_import from __future__ import absolute_import
from collections import OrderedDict
import six import six
from six import string_types as basestring from six import string_types as basestring
from six.moves import xrange from six.moves import xrange
...@@ -1931,7 +1932,7 @@ class Catalog(Folder, ...@@ -1931,7 +1932,7 @@ class Catalog(Folder,
) )
else: else:
query_list = [] query_list = []
value_dict = {} value_dict = OrderedDict()
append = query_list.append append = query_list.append
for subnode in node.getNodeList(): for subnode in node.getNodeList():
if subnode.isLeaf(): if subnode.isLeaf():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment