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

Optimizing empty tables corrupts the MariaDB connection via ODBC

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.1.17
    • 3.2.0, 3.1.18
    • General
    • None
    • Windows 10 x64

    Description

      I am using the ODBC Connector on Windows with a VBScript like this:

      Option Explicit
       
      Dim oADO
       
      Set oADO = CreateObject("ADODB.Connection")
      Call oADO.Open("Driver={MariaDB ODBC 3.1 Driver};NAMEDPIPE=1;NO_PROMPT=1;SOCKET=myNamedPipe;USER=root;PASSWORD=myPassword")
      On Error Resume Next
        Call oADO.Execute("DROP DATABASE `optimizetest`")
      On Error GoTo 0
      Call oADO.Execute("CREATE DATABASE `optimizetest`")
      Call oADO.Execute("USE `optimizetest`")
      Call AdoExecute("CREATE TABLE `table1` (id BIGINT NOT NULL AUTO_INCREMENT, name varchar(255) not null, PRIMARY KEY (id));")
      Call AdoExecute("CREATE TABLE `table2` (id BIGINT NOT NULL AUTO_INCREMENT, name varchar(255) not null, PRIMARY KEY (id));")
      Call AdoExecute("INSERT INTO `table1` (name) VALUES ('test');")
      Call AdoExecute("OPTIMIZE TABLE `table1`;")
      Call AdoExecute("OPTIMIZE TABLE `table2`;")
      Call WScript.Echo("Finished")
       
      Sub AdoExecute(ByVal sSQL)
        Call WScript.Echo(sSQL)
        Call oADO.Execute(sSQL)
      End Sub
      

      Unfortunately I get errors from the MariaDB driver when I am optimizing an empty table (table2 in the example).
      The error message is:

      Microsoft OLE DB Provider for ODBC Drivers: [ma-3.1.17][10.11.2-MariaDB]Unknown error
      

      If I execute the same statement in HeidiSQL, then it works fine, but I get a notice that nothing has been done and I should recreate the table.
      I guess the driver has problems due to this notice and then throws an error.

      After you got this error, you cannot use the ADO connection anymore. You need to reconnect for further actions.

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            DaGaMx David Gausmann
            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.