You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
If you try to use null as the value for a string comparison in a Where() predicate (and presumably other predicates too), the query provider will throw a NullReferenceException. It looks like this is because it is trying to get the type of the null value.
Here's the stack trace you get when you do it:
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
at System.Object.GetType()
at FSharp.MySqlQueryProvider.QueryTranslator.defaultGetMySqlDBType(TypeSource morP)
at FSharp.MySqlQueryProvider.QueryTranslator.result$cont@323-4(FSharpFunc`2 getDBType, FSharpFunc`2 getColumnName, FSharpRef`1 columnNameUnique, Context context, Expression e, Unit unitVar)
at [email protected](Expression e)
at [email protected](Expression e)
at FSharp.MySqlQueryProvider.Expression.Visitor.Visit(Expression expression)
at FSharp.MySqlQueryProvider.Expression.map[t](FSharpFunc`2 mapping, Expression expression)
at FSharp.MySqlQueryProvider.QueryTranslator.bin@314(QueryType queryType, FSharpFunc`2 getDBType, FSharpFunc`2 getColumnName, FSharpFunc`2 getTableName, FSharpRef`1 columnNameUnique, FSharpRef`1 tableAliasIndex, Context context, BinaryExpression e, String text)
at [email protected](Expression e)
at [email protected](Expression e)
at FSharp.MySqlQueryProvider.Expression.Visitor.Visit(Expression expression)
at FSharp.MySqlQueryProvider.Expression.map[t](FSharpFunc`2 mapping, Expression expression)
at [email protected](MethodCallExpression w)
at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x)
at [email protected](Expression e)
at [email protected](Expression e)
at FSharp.MySqlQueryProvider.Expression.Visitor.Visit(Expression expression)
at FSharp.MySqlQueryProvider.Expression.map[t](FSharpFunc`2 mapping, Expression expression)
at FSharp.MySqlQueryProvider.QueryTranslator.translate(QueryDialect _queryDialect, QueryType queryType, FSharpOption`1 getDBType, FSharpOption`1 getTableName, FSharpOption`1 getColumnName, Expression expression)
at FSharp.MySqlQueryProvider.QueryTranslator.translateToCommand(QueryDialect queryDialect, QueryType queryType, FSharpOption`1 getDBType, FSharpOption`1 getTableName, FSharpOption`1 getColumnName, MySqlConnection connection, Expression expression)
at FSharp.MySqlQueryProvider.MySqlQueryProvider.translate(MySqlConnection con, Expression expression)
at FSharp.MySqlQueryProvider.MySqlQueryProvider.Execute(Expression expression)
at FSharp.MySqlQueryProvider.Queryable.QueryProvider.System-Linq-IQueryProvider-Execute[S](Expression expression)
at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
Here's an example of how to get the exception to occur.
If you try to use
null
as the value for a string comparison in aWhere()
predicate (and presumably other predicates too), the query provider will throw aNullReferenceException
. It looks like this is because it is trying to get the type of the null value.Here's the stack trace you get when you do it:
Here's an example of how to get the exception to occur.
The text was updated successfully, but these errors were encountered: