Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-429

AccessViolationException when executing a SELECT on a non existing table

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.2.2
    • 3.2.3
    • General
    • 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

          Activity

            People

              Lawrin Lawrin Novitsky
              andreas.lennartz Andreas Lennartz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.