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

Creation of temporary tables with multiple statements in one query fails.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.0.6
    • Component/s: General
    • Labels:
      None
    • Environment:
      MariaDB 10.2.13 on FreeBSD 11.1, Client Windows 10 with ODBC Connector 3.0.5

      Description

      We are having issues with the creation of temporary tables through the MariaDB ODBC Connector.

      The statements we are issuing:

      DROP TABLE IF EXISTS _temp_statistics;
      CREATE TEMPORARY TABLE _temp_statistics AS (SELECT * FROM INFORMATION_SCHEMA.STATISTICS);
      SELECT * FROM _temp_statistics;
      

      We execute these statements in a single query like so:

      using (var connection = new OdbcConnection(connectionString))
      {
         connection.Open();
         using (var command = connection.CreateCommand())
         {
            command.CommandText = Resource.CreateAndSelectTempTable;
            int result = command.ExecuteNonQuery();
         }
      }
      

      The error we get is:
      " ERROR [42S02] [ma-3.0.5][10.2.13-MariaDB-log]Table 'DB._temp_statistics' doesn't exist"

      However if we execute this in multiple queries it does work. Like so:

      using (var connection = new OdbcConnection(connectionString))
      {
         int result;
         connection.Open();
         using (var command = connection.CreateCommand())
         {
            command.CommandText = Resource.DropTempTable;
            result = command.ExecuteNonQuery();
         }
         using (var command = connection.CreateCommand())
         {
            command.CommandText = Resource.CreateTempTable;
            result = command.ExecuteNonQuery();
         }
         using (var command = connection.CreateCommand())
         {
            command.CommandText = Resource.SelectTempTable;
            result = command.ExecuteNonQuery();
         }
      }
      

      Is there a bug concering multiple statements in a single query and temporary tables?

      Both versions do work with the mysql connector. I have also attached the general logfile for the case when the command fails.

      Like always i am happy to provide more information on this as needed.

        Attachments

          Activity

            People

            Assignee:
            Lawrin Lawrin Novitsky
            Reporter:
            Patrick Dudziak Patrick Dudziak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: