Bug in postgresql7.1 jdbc2 DatabaseMetaData class - Mailing list pgsql-bugs

From Robert Weiler
Subject Bug in postgresql7.1 jdbc2 DatabaseMetaData class
Date
Msg-id 3B15BD88.3080709@perfectsense.com
Whole thread Raw
Responses Re: Bug in postgresql7.1 jdbc2 DatabaseMetaData class
List pgsql-bugs
On line 1707 there is a dereference of 'relKind' which may very likely
be set to null. This can cause a null pointer exception. I've include
dthe workaround I am using, though there is almost certainly somethig
better.

Bob Weiler

String relKind;
    switch (r.getBytes(3)[0]) {
    case 'r':
        relKind = "TABLE";
        break;
    case 'i':
        relKind = "INDEX";
        break;
    case 'S':
        relKind = "SEQUENCE";
        break;
    default:
        relKind = null;
    }

    tuple[0] = null;        // Catalog name
    tuple[1] = null;        // Schema name
    tuple[2] = r.getBytes(1);    // Table name
    tuple[3] = relKind != null ? relKind.getBytes() : null;    // Table type
    tuple[4] = remarks;        // Remarks
    v.addElement(tuple);
      }

pgsql-bugs by date:

Previous
From: Arcady Genkin
Date:
Subject: Re: Compilation --with-python fails on Solaris 8
Next
From: Vlad Seryakov
Date:
Subject: TRigger crashes PG