Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Done
-
3.1.20
-
None
-
Windows .net 4.8
Description
When I try to execute from .NET via ODBC multistatement with PREPARE and EXECUTE, it ends with exception like:
System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
|
at System.Data.Common.UnsafeNativeMethods.SQLMoreResults(OdbcStatementHandle StatementHandle)
|
at System.Data.Odbc.OdbcStatementHandle.MoreResults()
|
at System.Data.Odbc.OdbcDataReader.NextResult(Boolean disposing, Boolean allresults)
|
at System.Data.Odbc.OdbcDataReader.Close(Boolean disposing)
|
at System.Data.Odbc.OdbcDataReader.Dispose(Boolean disposing)
|
at System.Data.Common.DbDataReader.Dispose()
|
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
|
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
|
at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
|
at System.Data.Odbc.OdbcCommand.ExecuteReader()
|
Example of query we executed:
SELECT COUNT(*) FROM information_schema.tables |
WHERE TABLE_SCHEMA='information_schema' AND TABLE_NAME='TABLESPACES' |
INTO @tableExists; |
|
SELECT |
IF(@tableExists>0 |
,'SELECT tablespace_name, engine, tablespace_type, logfile_group_name, extent_size FROM information_schema.tablespaces ORDER BY tablespace_name , engine' |
,'SELECT NULL LIMIT 0') |
INTO @query; |
|
PREPARE s FROM @query; |
EXECUTE s; |
|
DEALLOCATE PREPARE s; |
Is supported to use EXECUTE statment via ODBC connector?
Could you please try version 3.2.2? The 3.2 series substitutes 3.1, and it's already GA. I believe your problem has been solved in 3.2. 3.1 uses prepared statements aka binary protocol in almost all cases, in particular for batch statements. It splits it to individual statement, and prepare+execute them one by one. And here we probably have problem with preparing PREPARE statement, it's not supported by the server.
I think this ticket can be closed, but I'll wait till your confirmation.