Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1067

Test failures due to clashing temporary table names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • None

    Description

      Some tests have been failing because they use the same name for their temporary tables in hsqldb. For example,

      Error Message
      
      Error -1 (00000) : Error while executing SQL "insert into TEST_TABLE2 values ('1735556312', '95d82c2e-49d0-4478-acb9-a7763a6234c4')": Remote driver error: RuntimeException: java.sql.SQLDataException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> SQLDataException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> HsqlException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> HsqlException: data exception: string data, right truncation
      
      Stacktrace
      
      org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL "insert into TEST_TABLE2 values ('1735556312', '95d82c2e-49d0-4478-acb9-a7763a6234c4')": Remote driver error: RuntimeException: java.sql.SQLDataException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> SQLDataException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> HsqlException: data exception: string data, right truncation;  table: TEST_TABLE2 column: MSG -> HsqlException: data exception: string data, right truncation
      	at org.apache.calcite.avatica.Helper.createException(Helper.java:53)
      	at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
      	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:143)
      	at org.apache.calcite.avatica.AvaticaStatement.executeLargeUpdate(AvaticaStatement.java:204)
      	at org.apache.calcite.avatica.AvaticaStatement.executeUpdate(AvaticaStatement.java:199)
      	at org.apache.calcite.avatica.remote.RemoteMetaTest.testRemoteStatementInsert(RemoteMetaTest.java:274)
      
      Standard Output
      
      jdbc:avatica:remote:url=http://localhost:55369;serialization=JSON
      

      This occurs because RemoteMetaTest.testRemoteStatementInsert and RemoteMetaTest.testRemoteStatementInsert both use a table called TEST_TABLE2.

      The solution is to generate unique temporary table names; add a method String AvaticaUtils.unique(String s) and have tests call it to make their table names unique. They could use it for any other resources they want to be unique, such as file names.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: