Selaa lähdekoodia

Merge commit 'd01204420cf839d54ee9f9fb4eec0dc6cf7f246d' into frank

frogsoftware 9 kuukautta sitten
vanhempi
commit
c70cfff32f
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      inabox.database.sqlite/SQLiteProvider.cs

+ 7 - 1
inabox.database.sqlite/SQLiteProvider.cs

@@ -1537,7 +1537,13 @@ public class SQLiteProvider : IProvider
                     // 1000-parameter limit by using building the string ourselves
                     if (filter.Value is Guid[] list)
                     {
-                        result = string.Format("(" + operators[filter.Operator] + ")", prop, string.Format("\"{0}\"", string.Join("\",\"", list)));
+                        result = string.Format("(" + operators[filter.Operator] + ")",
+                            prop,
+                            string.Join(',', list.Where(x => x != Guid.Empty).Select(x => $"'{x}'")));
+                        if (list.Contains(Guid.Empty))
+                        {
+                            result = $"({result} or ({prop} IS NULL))";
+                        }
                     }
                     else if (filter.Value is IEnumerable enumerable)
                     {