From b85ab60a6ced7967b5dc71685e6f59c8a3427676 Mon Sep 17 00:00:00 2001 From: Shweelan Samson Date: Fri, 19 Apr 2019 14:48:00 +0300 Subject: [PATCH] Fix a bug in LIKE filters --- lib/common/expression.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/common/expression.ts b/lib/common/expression.ts index 7e1a48a..5b3d524 100644 --- a/lib/common/expression.ts +++ b/lib/common/expression.ts @@ -87,9 +87,9 @@ function evalExp(e: Expression): Expression { ((e as any[]).length >= 4 && e[3] == null) ) return null; - const r = regExpCache.get(e as any[]); + let r = regExpCache.get(e as any[]); if (!r) { - likePatternToRegExp(e[2], e[3]); + r = likePatternToRegExp(e[2], e[3]); regExpCache.set(e as any[], r); } return r.test(e[1]); @@ -101,9 +101,9 @@ function evalExp(e: Expression): Expression { ((e as any[]).length >= 4 && e[3] == null) ) return null; - const r = regExpCache.get(e as any[]); + let r = regExpCache.get(e as any[]); if (!r) { - likePatternToRegExp(e[2], e[3]); + r = likePatternToRegExp(e[2], e[3]); regExpCache.set(e as any[], r); } return !r.test(e[1]);