-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Labels
Milestone
Description
Steps to reproduce
What steps can we follow to reproduce the issue?
We ❤ code! Include a complete code listing or attach a simplified project
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task OrderBy_StartsWith_with_null_parameter_as_argument(bool async)
{
var prm = (string)null;
return AssertQuery(
async,
ss => ss.Set<Gear>().OrderBy(g => g.FullName.StartsWith(prm)).ThenBy(g => g.Nickname),
ss => ss.Set<Gear>().OrderBy(g => false).ThenBy(g => g.Nickname),
assertOrder: true);
}Got Exceptions? Include both the message and the stack trace
Message:
Microsoft.Data.SqlClient.SqlException : A constant expression was encountered in the ORDER BY list, position 1.
Stack Trace:
SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
SqlDataReader.TryConsumeMetaData()
SqlDataReader.get_MetaData()
SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
SqlCommand.ExecuteReader(CommandBehavior behavior)
SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
DbCommand.ExecuteReader()
RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) line 404
Enumerator.InitializeReader(DbContext _, Boolean result) line 176
ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state) line 173
ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) line 159
Enumerator.MoveNext() line 125
LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
EnumerableHelpers.ToArray[T](IEnumerable`1 source)
Enumerable.ToArray[TSource](IEnumerable`1 source)
QueryAsserter`1.AssertQuery[TResult](Func`2 actualQuery, Func`2 expectedQuery, Func`2 elementSorter, Action`2 elementAsserter, Boolean assertOrder, Int32 entryCount, Boolean async, String testMethodName) line 87
GearsOfWarQuerySqlServerTest.OrderBy_StartsWith_with_null_parameter_as_argument(Boolean async) line 7095
--- End of stack trace from previous location ---
Further technical details
EF Core version: master
Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (e.g. .NET Core 3.0)
Operating system:
IDE: (e.g. Visual Studio 2019 16.3)
Reactions are currently unavailable