Skip to content

Commit

Permalink
Merge pull request praeclarum#618 from kicsiede/master
Browse files Browse the repository at this point in the history
allow comparison with nullable parameter
  • Loading branch information
praeclarum authored Aug 24, 2017
2 parents de7afe9 + 405faf1 commit 5603ee0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/SQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3574,8 +3574,13 @@ private string CompileNullBinaryExpression (BinaryExpression expression, Compile
if (expression.NodeType == ExpressionType.Equal)
return "(" + parameter.CommandText + " is ?)";
else if (expression.NodeType == ExpressionType.NotEqual)
return "(" + parameter.CommandText + " is not ?)";
else
return "(" + parameter.CommandText + " is not ?)";
else if (expression.NodeType == ExpressionType.GreaterThan
|| expression.NodeType == ExpressionType.GreaterThanOrEqual
|| expression.NodeType == ExpressionType.LessThan
|| expression.NodeType == ExpressionType.LessThanOrEqual)
return "(" + parameter.CommandText + " < ?)"; // always false
else
throw new NotSupportedException ("Cannot compile Null-BinaryExpression with type " + expression.NodeType.ToString ());
}

Expand Down

0 comments on commit 5603ee0

Please sign in to comment.