From 60bfab24216da489f90f9bed61d3b8d12adff324 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 18 Nov 2025 10:19:04 +0100 Subject: [PATCH] fix(db): Fix Oracle JSON handling Signed-off-by: Joas Schilling --- .../OCIExpressionBuilder.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php index 542e8d62ede..20308b24550 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php @@ -27,6 +27,32 @@ class OCIExpressionBuilder extends ExpressionBuilder { return parent::prepareColumn($column, $type); } + /** + * @inheritdoc + */ + public function eq($x, $y, $type = null): string { + if ($type === IQueryBuilder::PARAM_JSON) { + $x = $this->prepareColumn($x, $type); + $y = $this->prepareColumn($y, $type); + return (string)(new QueryFunction('JSON_EQUAL(' . $x . ',' . $y . ')')); + } + + return parent::eq($x, $y, $type); + } + + /** + * @inheritdoc + */ + public function neq($x, $y, $type = null): string { + if ($type === IQueryBuilder::PARAM_JSON) { + $x = $this->prepareColumn($x, $type); + $y = $this->prepareColumn($y, $type); + return (string)(new QueryFunction('NOT JSON_EQUAL(' . $x . ',' . $y . ')')); + } + + return parent::neq($x, $y, $type); + } + /** * @inheritdoc */