Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.2.2
-
None
-
Windows x64, .NET 8.0
Description
When executing the following code:
using System.Data.Odbc;
|
|
string connString = "Driver={MariaDB ODBC 3.2 Driver};Server=localhost;Port=3307;Database=DataFlow;User=root;Password=etlboxpassword;SSL Mode=None;";
|
|
try {
|
var dbConnection = new OdbcConnection(connString);
|
dbConnection.Open();
|
var command = dbConnection.CreateCommand();
|
command.CommandText = $"SELECT * FROM non_existing_table";
|
command.CommandTimeout = 60;
|
var reader = command.ExecuteReader();
|
} catch {
|
Console.WriteLine("Error occured");
|
}
|
a critical `System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'` exception is thrown, and the program execution is aborted (without going into the catch-block).
A "normal" System.Data.Odbc.OdbcException would be expected. The access violation is not thrown when the try/catch is removed.
Sample project is attached.
Attachments
Issue Links
- duplicates
-
ODBC-425 .NET: Updating driver throws System.AccessViolationException instead of System.Data.Odbc.OdbcException.
-
- Closed
-