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

Test failures due to clashing temporary table names

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      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.

        Activity

        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/4ec47270 .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.7.0 (2016-03-22).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.7.0 (2016-03-22).

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development