From 509e5135725745f4591a7f76bb86591f19b0fe31 Mon Sep 17 00:00:00 2001 From: eduaard93 Date: Tue, 15 May 2018 10:07:37 +0300 Subject: [PATCH] Persist ((value)) values as a (('value')) to help the optimizer --- Form/JSON/SQL.cls.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Form/JSON/SQL.cls.xml b/Form/JSON/SQL.cls.xml index a041e31..9fdae37 100644 --- a/Form/JSON/SQL.cls.xml +++ b/Form/JSON/SQL.cls.xml @@ -95,7 +95,14 @@ result: out=" WHERE Text='Admin' AND Text='1'"]]> } set value = valTemp _ ")" } else { - set value = $$$sq(value) + // bake ((value)) values as a (('value')) to help the optimizer + if (($e(value,1,2)="((") && ($e(value,*-1,*)="))")) { + set value = $e(value, 3,*-3) + set value = $$$sq(value) + set value = "((" _ value _ "))" + } else { + set value = $$$sq(value) + } set:value="'$$$NULL'" value = "NULL" }