Derby
  1. Derby
  2. DERBY-1745

System catalog columns of type BIGINT and INT created with incorrect precision of zero.

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal

      Description

      Due to the way system column metadata was handled in the code system columns of these types are always created with precision 0.
      User defined columns of these types will have precision 10 (INT) and 19 (BIGINT)
      DERBY-1734 will fix this for 10.3 and hopefully 10.2 by a merge before the release.
      This bug is here to investigate upgrade issues and fix them if required.
      Not known of any incorrect issues due to this, except for incorrect JDBC metadata for such columns.

        Issue Links

          Activity

          Hide
          Daniel John Debrunner added a comment -

          DERBY-1742 was created for a similar issue, in that case a specific error with a single BOOLEAN column, not all BOOLEAN columns.

          Show
          Daniel John Debrunner added a comment - DERBY-1742 was created for a similar issue, in that case a specific error with a single BOOLEAN column, not all BOOLEAN columns.
          Hide
          Knut Anders Hatlen added a comment -

          Triaged for 10.5.2.

          The bug description says "This bug is here to investigate upgrade issues and fix them if required." Changing issue type from Bug to Task.

          Show
          Knut Anders Hatlen added a comment - Triaged for 10.5.2. The bug description says "This bug is here to investigate upgrade issues and fix them if required." Changing issue type from Bug to Task.
          Hide
          Knut Anders Hatlen added a comment - - edited

          One consequence of this was seen in the first proposed fix for DERBY-5274. When using the CHAR function to convert a BIGINT in SYS.SYSCOLUMNS to a CHAR value in DatabaseMetaData.getColumns(), a truncation error was raised when running on a database upgraded from 10.3.1.4 or earlier.

          For a simple reproduction, create a database with 10.3.1.4 and boot it with 10.8.1.2. Then execute the following statements:

          ij> create table t (x int not null generated always as identity (start with 12));
          0 rows inserted/updated/deleted
          ij> select char(autoincrementstart) from sys.syscolumns where columnname='X';
          1


          ERROR 22001: A truncation error was encountered trying to shrink CHAR '12' to length 1.

          If the database had been created with 10.4.1.3 or later, the select statement would complete successfully.

          Show
          Knut Anders Hatlen added a comment - - edited One consequence of this was seen in the first proposed fix for DERBY-5274 . When using the CHAR function to convert a BIGINT in SYS.SYSCOLUMNS to a CHAR value in DatabaseMetaData.getColumns(), a truncation error was raised when running on a database upgraded from 10.3.1.4 or earlier. For a simple reproduction, create a database with 10.3.1.4 and boot it with 10.8.1.2. Then execute the following statements: ij> create table t (x int not null generated always as identity (start with 12)); 0 rows inserted/updated/deleted ij> select char(autoincrementstart) from sys.syscolumns where columnname='X'; 1 ERROR 22001: A truncation error was encountered trying to shrink CHAR '12' to length 1. If the database had been created with 10.4.1.3 or later, the select statement would complete successfully.

            People

            • Assignee:
              Unassigned
              Reporter:
              Daniel John Debrunner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development