diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2023-12-12 16:07:31 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-01 10:59:16 +0100 |
| commit | c72001644fa794b82fa88a7d2ecc20197b01b6f2 (patch) | |
| tree | ff5c2d03ef4f791bfb210c2eb0e4a3cbf913cc8c /django/db/models/functions/text.py | |
| parent | a816efe238eaeb88fd0a53b124c6337bfa60b5a6 (diff) | |
Updated DatabaseFeatures.bare_select_suffix on Oracle 23c.
https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/application-development.html#GUID-4EB70EB9-4EE3-4FE2-99C4-86F7AAC60F12
Diffstat (limited to 'django/db/models/functions/text.py')
| -rw-r--r-- | django/db/models/functions/text.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/models/functions/text.py b/django/db/models/functions/text.py index 500fbea194..392061880c 100644 --- a/django/db/models/functions/text.py +++ b/django/db/models/functions/text.py @@ -261,13 +261,14 @@ class Reverse(Transform): def as_oracle(self, compiler, connection, **extra_context): # REVERSE in Oracle is undocumented and doesn't support multi-byte # strings. Use a special subquery instead. + suffix = connection.features.bare_select_suffix sql, params = super().as_sql( compiler, connection, template=( "(SELECT LISTAGG(s) WITHIN GROUP (ORDER BY n DESC) FROM " - "(SELECT LEVEL n, SUBSTR(%(expressions)s, LEVEL, 1) s " - "FROM DUAL CONNECT BY LEVEL <= LENGTH(%(expressions)s)) " + f"(SELECT LEVEL n, SUBSTR(%(expressions)s, LEVEL, 1) s{suffix} " + "CONNECT BY LEVEL <= LENGTH(%(expressions)s)) " "GROUP BY %(expressions)s)" ), **extra_context, |
