wuxin2016 opened a new issue, #23857:
URL: https://github.com/apache/shardingsphere/issues/23857
### Which version of ShardingSphere did you use?
5.3.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
Use Entity frameworkcore paging queries to query the results。
### Actual behavior
first step ,queried the count,it's OK. but queried the data,I got an
exception
~~~C#
var data = source.Where(query).ProjectTo<TDto>();
result.TotalCount = await data.CountAsync(cancellationToken);
if (result.TotalCount > 0)
{
var mapData = data.OrderBy(page, defaultSort);
result.Data = await mapData.Skip(pageSize * (pageIndex -
1))
.Take(pageSize).ToListAsync(cancellationToken);
}
~~~
Exception
~~~C#
An error occurred using the connection to database .....
MySqlConnector.MySqlProtocolException: Packet received out-of-order.
Expected 1; got 2.
at
MySqlConnector.Protocol.Serialization.ProtocolUtility.<DoReadPayloadAsync>g__AddContinuation|5_0(ValueTask`1
readPacketTask, BufferedByteReader bufferedByteReader, IByteHandler
byteHandler, F
unc`1 getNextSequenceNumber, ArraySegmentHolder`1 previousPayloads,
ProtocolErrorBehavior protocolErrorBehavior, IOBehavior ioBehavior) in
/_/src/MySqlConnector/Protocol/Serialization/ProtocolUtility.cs:
line 476
at
MySqlConnector.Core.ServerSession.ReceiveReplyAsyncAwaited(ValueTask`1 task) in
/_/src/MySqlConnector/Core/ServerSession.cs:line 943
at
MySqlConnector.Core.ServerSession.TryResetConnectionAsync(ConnectionSettings
cs, MySqlConnection connection, IOBehavior ioBehavior, CancellationToken
cancellationToken) in /_/src/MySqlConnect
or/Core/ServerSession.cs:line 616
at
MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection,
Int32 startTickCount, IOBehavior ioBehavior, CancellationToken
cancellationToken) in /_/src/MySqlConnector/Core/
ConnectionPool.cs:line 65
at
MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection,
Int32 startTickCount, IOBehavior ioBehavior, CancellationToken
cancellationToken) in /_/src/MySqlConnector/Core/
ConnectionPool.cs:line 124
at MySqlConnector.MySqlConnection.CreateSessionAsync(ConnectionPool
pool, Int32 startTickCount, Nullable`1 ioBehavior, CancellationToken
cancellationToken) in /_/src/MySqlConnector/MySqlConnecti
on.cs:line 915
at MySqlConnector.MySqlConnection.OpenAsync(Nullable`1 ioBehavior,
CancellationToken cancellationToken) in
/_/src/MySqlConnector/MySqlConnection.cs:line 406
at
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean
errorsExpected, CancellationToken cancellationToken)
at
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean
errorsExpected, CancellationToken cancellationToken)
at
Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken
cancellationToken, Boolean errorsExpected)
at
Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlRelationalConnection.OpenAsync(CancellationToken
cancellationToken, Boolean errorsExpected)
at
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject
parameterObject, CancellationToken cancellationToken)
at
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator
enumerator, CancellationToken cancellationToken)
at
Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState
state, Func`4 operation, Func`4 verifySucceeded, CancellationToken
cancellationTok
en)
at
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
dbug: 2023/1/31 10:43:16.083 CoreEventId.ContextDisposed[10407]
(Microsoft.EntityFrameworkCore.Infrastructure)
~~~
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
Asp.Net 6.0 ,MySQL ,Entityframework Core 6.0
### Example codes for reproduce this issue (such as a github link).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]