diff OrthancServer/Search/ISqlLookupFormatter.cpp @ 3079:65e2bfa953ef db-changes

ISqlLookupFormatter::FormatWildcardEscape()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 03 Jan 2019 14:03:39 +0100
parents 147497152ce3
children f6de9d25b20d
line wrap: on
line diff
--- a/OrthancServer/Search/ISqlLookupFormatter.cpp	Thu Jan 03 12:47:17 2019 +0100
+++ b/OrthancServer/Search/ISqlLookupFormatter.cpp	Thu Jan 03 14:03:39 2019 +0100
@@ -190,11 +190,13 @@
 
           if (constraint.IsCaseSensitive())
           {
-            comparison = tag + ".value LIKE " + parameter + " ESCAPE '\\'";
+            comparison = (tag + ".value LIKE " + parameter + " " +
+                          formatter.FormatWildcardEscape());
           }
           else
           {
-            comparison = "lower(" + tag + ".value) LIKE lower(" + parameter + ") ESCAPE '\\'";
+            comparison = ("lower(" + tag + ".value) LIKE lower(" +
+                          parameter + ") " + formatter.FormatWildcardEscape());
           }
         }