bridgedb / BridgeDb

The BridgeDb Library source code
https://bridgedb.org/
Apache License 2.0
28 stars 21 forks source link

QC tool should not throw an exception for older Derby files #126

Closed egonw closed 5 years ago

egonw commented 5 years ago

If the master version of the QC tool is run on an older gene ID mapping database (Derby), then it throws this exception:

Exception in thread "main" java.sql.SQLSyntaxErrorException: Column 'ISPRIMARY' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'ISPRIMARY' is not a column in the target table.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
        at org.bridgedb.tools.qc.BridgeQC.summarizeOverallStats(BridgeQC.java:359)
        at org.bridgedb.tools.qc.BridgeQC.run(BridgeQC.java:343)
        at org.bridgedb.tools.qc.BridgeQC.main(BridgeQC.java:407)
Caused by: java.sql.SQLException: Column 'ISPRIMARY' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'ISPRIMARY' is not a column in the target table.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 11 more
Caused by: ERROR 42X04: Column 'ISPRIMARY' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'ISPRIMARY' is not a column in the target table.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(Unknown Source)
        at org.apache.derby.impl.sql.compile.ResultColumn.bindExpression(Unknown Source)
        at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(Unknown Source)
        at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(Unknown Source)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(Unknown Source)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)
        at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
        ... 5 more

But it should only attempt to count the primary and secondary identifiers for the version 4 database schema.

egonw commented 5 years ago

ping @The-Marvex

The-Marvex commented 5 years ago

Started working on this.

egonw commented 5 years ago

@The-Marvex, it's good practice (IMHO :) to indicate why you closed an issue. Is it fixed? Then add a link to the patch (or commit) that fixes is. If the bug is a duplicate, then point to the duplicate. Etc.

The-Marvex commented 5 years ago

fixed: https://github.com/bridgedb/BridgeDb/pull/128