Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractDatabaseMetaData.getSchemas() returns incorrect ResultSet [JDBC142] #184

Closed
firebird-automations opened this issue May 22, 2009 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

Assigned to: Roman Rokytskyy (rrokytskyy)

AbstractDatabaseMetaData.getSchemas() returns only a ResultSet with one column. According to the API docs this should be two

Incorrect code:
public ResultSet getSchemas() throws SQLException {
XSQLVAR[] xsqlvars = new XSQLVAR[1];

    xsqlvars\[0\] = new XSQLVAR\(\);
    xsqlvars\[0\]\.sqltype = ISCConstants\.SQL\_VARYING;
    xsqlvars\[0\]\.sqllen = 31;
    xsqlvars\[0\]\.sqlname = "TABLE\_SCHEM";
    xsqlvars\[0\]\.relname = "TABLESCHEMAS";

    ArrayList rows = new ArrayList\(0\);

    return new FBResultSet\(xsqlvars, rows\);
\}

Corrected code:

public ResultSet getSchemas\(\) throws SQLException \{
    XSQLVAR\[\] xsqlvars = new XSQLVAR\[2\];

    xsqlvars\[0\] = new XSQLVAR\(\);
    xsqlvars\[0\]\.sqltype = ISCConstants\.SQL\_VARYING;
    xsqlvars\[0\]\.sqllen = 31;
    xsqlvars\[0\]\.sqlname = "TABLE\_SCHEM";
    xsqlvars\[0\]\.relname = "TABLESCHEMAS";
    
    xsqlvars\[1\] = new XSQLVAR\(\);
    xsqlvars\[1\]\.sqltype = ISCConstants\.SQL\_VARYING;
    xsqlvars\[1\]\.sqllen = 31;
    xsqlvars\[1\]\.sqlname = "TABLE\_CATALOG";
    xsqlvars\[1\]\.relname = "TABLESCHEMAS";

    ArrayList rows = new ArrayList\(0\);

    return new FBResultSet\(xsqlvars, rows\);
\}

Commits: 3375a1a

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ]

timeestimate: 0 [ 0 ]

timeoriginalestimate: 0 [ 0 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant