Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2371

DatabaseMetadata.getColumns() returns bad COLUMN_SIZE for varchar and varbinary columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.5.0
    • None
    • None
    • Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

    Description

      DatabaseMetadata.getColumns() returns bad COLUMN_SIZE value for varchar and varbinary columns. Specifically, for the following table:
      CREATE TABLE SERGIO (I INTEGER, V10 VARCHAR(10),
      VHUGE VARCHAR(2147483647), V VARCHAR, VB10 VARBINARY(10), VBHUGE VARBINARY(2147483647), VB VARBINARY) ;

      1. COLUMN_SIZE is NULL for all varbinary columns, no matter the defined size. This should return the max possible size of the column, so:
      COLUMN_SIZE should return 10 for column VB10,
      COLUMN_SIZE should return 2147483647 for column VBHUGE,
      COLUMN_SIZE should return 2147483647 for column VB, assuming that a column defined with no size should default to the maximum size.

      2. COLUMN_SIZE returns NULL for all varchar columns that are not defined with a size, like in column V in the above CREATE TABLE. I would think that a VARCHAR column defined with no size parameter should default to the maximum size possible (2147483647) for COLUMN_SIZE, not to NULL.

      Attachments

        Issue Links

          Activity

            People

              kliew Kevin Liew
              sergiolob Sergio Lob
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: