Skip to content

Can't obtain results from stored procedure with version 2.3.0+ and Mysql 5.1.73 #1445

Closed
@hclander

Description

@hclander

Software versions
MySqlConnector version: 2.3.0+ with Mysql 5.1.73

.NET version: 7

Describe the bug
From version 2.3.0+ we can't get results from stored procedures from Mysql 5.1.73 database servers.
With version 2.2.7 all works fine and with version 2.3.0+ and Mysql 8.0.33 also works fine.

Exception

Unhandled exception. MySqlConnector.MySqlException (0x80004005): **_PROCEDURE DbGis.FindGis can't return a result set in the given context_**
   at MySqlConnector.Core.ServerSession.ReceiveReplyAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 950
   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 37
   at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 130
   at MySqlConnector.MySqlDataReader.InitAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 483
   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 56
   at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 357
   at MySqlConnector.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in /_/src/MySqlConnector/MySqlCommand.cs:line 290
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior) in /_/Dapper/SqlMapper.cs:line 1156
   at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in /_/Dapper/SqlMapper.cs:line 1184
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType) in /_/Dapper/SqlMapper.cs:line 815
   at Program.<<Main>$>g__BuscaLugarOpt|0_26(MySqlConnection cnx, Double lat, Double lon, Int32 range) in ~/RiderProjects/test_db_gis/test_db_gis/Program.cs:line 1731
   at Program.<<Main>$>g__TestBenchmark|0_2(MySqlConnection cnx, BuscarLugar buscar, Int32 limit, Int32 progress, Int32 rounds) in ~/RiderProjects/test_db_gis/test_db_gis/Program.cs:line 331
   at Program.<>c__DisplayClass0_0.<<Main>$>g__BenchMarks|0() in ~/RiderProjects/test_db_gis/test_db_gis/Program.cs:line 192
   at Program.<Main>$(String[] args) in ~/RiderProjects/test_db_gis/test_db_gis/Program.cs:line 119

Code sample

  var sql = "call FindGis(38.741283,-6.391783,25)";

    var rx = cnx5.Query<(int Id, double lat, double lon, string Zone1, string Zone2)>(sql);

    foreach (var r in rx)
    {
        Console.WriteLine(r);
    }

Expected behavior
We expected to obtain a few rows with POIs stored in the database within a 25 m. range from a latitude and latitude parameters

Additional context
No special context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions