775 if ' ORDERBY ' in rql: |
775 if ' ORDERBY ' in rql: |
776 rql = '%s WHERE %s' % (rql.split(' ORDERBY ', 1)[0], |
776 rql = '%s WHERE %s' % (rql.split(' ORDERBY ', 1)[0], |
777 rql.split(' WHERE ', 1)[1]) |
777 rql.split(' WHERE ', 1)[1]) |
778 elif not ' ORDERBY ' in rql: |
778 elif not ' ORDERBY ' in rql: |
779 args = rql.split(' WHERE ', 1) |
779 args = rql.split(' WHERE ', 1) |
780 # if modification_date already retreived, we should use it instead |
780 # if modification_date already retrieved, we should use it instead |
781 # of adding another variable for sort. This should be be problematic |
781 # of adding another variable for sort. This should be be problematic |
782 # but it's actually with sqlserver, see ticket #694445 |
782 # but it's actually with sqlserver, see ticket #694445 |
783 if 'X modification_date ' in args[1]: |
783 if 'X modification_date ' in args[1]: |
784 var = args[1].split('X modification_date ', 1)[1].split(',', 1)[0] |
784 var = args[1].split('X modification_date ', 1)[1].split(',', 1)[0] |
785 args.insert(1, var.strip()) |
785 args.insert(1, var.strip()) |