Explorar el Código

Fix to SQL string operators to use IFNULL to prevent dumb bugs.

Kenric Nugteren hace 4 meses
padre
commit
612df6be38
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      inabox.database.sqlite/SQLiteProvider.cs

+ 3 - 3
inabox.database.sqlite/SQLiteProvider.cs

@@ -1730,9 +1730,9 @@ public class SQLiteProvider : IProvider
         { Operator.IsGreaterThanOrEqualTo, "{0} >= {1}" },
         { Operator.IsLessThan, "{0} < {1}" },
         { Operator.IsLessThanOrEqualTo, "{0} <= {1}" },
-        { Operator.BeginsWith, "{0} LIKE {1} || '%'" },
-        { Operator.Contains, "{0} LIKE '%' || {1} || '%'" },
-        { Operator.EndsWith, "{0} LIKE '%' || {1}" },
+        { Operator.BeginsWith, "IFNULL({0},'') LIKE {1} || '%'" },
+        { Operator.Contains, "IFNULL({0},'') LIKE '%' || {1} || '%'" },
+        { Operator.EndsWith, "IFNULL({0},'') LIKE '%' || {1}" },
         { Operator.InList, "{0} IN ({1})" },
         { Operator.NotInList, "{0} NOT IN ({1})" },
         { Operator.InQuery, "{0} IN ({1})" },