Refs #34060 -- Fixed JSONField __exact lookup for primitivies on Oracle 21c+.

Regression in c991602ce5.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
Albert Defler 2024-02-17 12:22:53 +00:00 committed by Mariusz Felisiak
parent f25d84f61a
commit 26aae56144
1 changed files with 4 additions and 1 deletions

View File

@ -313,7 +313,10 @@ class JSONExact(lookups.Exact):
def as_oracle(self, compiler, connection):
lhs, lhs_params = self.process_lhs(compiler, connection)
rhs, rhs_params = self.process_rhs(compiler, connection)
return f"JSON_EQUAL({lhs}, {rhs})", (*lhs_params, *rhs_params)
if connection.features.supports_primitives_in_json_field:
lhs = f"JSON({lhs})"
rhs = f"JSON({rhs})"
return f"JSON_EQUAL({lhs}, {rhs} ERROR ON ERROR)", (*lhs_params, *rhs_params)
class JSONIContains(CaseInsensitiveMixin, lookups.IContains):