1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #29692 -- Fixed removing ordering parts for multiline RawSQL expressions.

This commit is contained in:
can
2019-05-02 20:11:26 +03:00
committed by Mariusz Felisiak
parent ef082ebb84
commit 567b9928a3
2 changed files with 25 additions and 1 deletions

View File

@@ -32,7 +32,8 @@ class SQLCompiler:
self.select = None
self.annotation_col_map = None
self.klass_info = None
self.ordering_parts = re.compile(r'(.*)\s(ASC|DESC)(.*)')
# Multiline ordering SQL clause may appear from RawSQL.
self.ordering_parts = re.compile(r'^(.*)\s(ASC|DESC)(.*)', re.MULTILINE | re.DOTALL)
self._meta_ordering = None
def setup_query(self):