You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2014/02/20 14:36:19 UTC

[jira] [Updated] (DERBY-4753) "ERROR 42X01: Syntax error: FALSE." during call to java.sql.DatabaseMetaData.getIndexInfo

     [ https://issues.apache.org/jira/browse/DERBY-4753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4753:
--------------------------------------

    Attachment: d4753-1a.diff

The repro no longer seems to reproduce the bug. Apparently, creating a single table with 1000 columns is not enough to make the query plan stale with the current code on trunk. Creating more tables seems to make it fail still, though.

The attached patch (d4753-1a.diff) has turned the repro into a test case in the upgrade test suite. The patch also contains a fix for the bug. The fix is simply to pass down the forMetaData flag from EmbedStatement to the code that recompiles the meta-data query. When given this flag, the compiler knows that internal syntax should be allowed, and the syntax error goes away.

I'm running the full regression test suite on the patch now.

> "ERROR 42X01: Syntax error: FALSE." during call to java.sql.DatabaseMetaData.getIndexInfo
> -----------------------------------------------------------------------------------------
>
>                 Key: DERBY-4753
>                 URL: https://issues.apache.org/jira/browse/DERBY-4753
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0
>         Environment: Linux
>            Reporter: Craig Chaney
>              Labels: derby_triage10_8
>         Attachments: Derby4753.java, d4753-1a.diff
>
>
> We are seeing the failure below occasionally.  It does not happen every time ... with the exact same database and call sequence it will happen about 1 out of 3 times.
> The parameters on the getIndexInfo call are
> connection.getMetaData().getIndexInfo(null, schemaName, tableName, false, false);
> schemaName and tableName are valid and definitely not null.
> Caused by: 
> java.sql.SQLException: Syntax error: FALSE.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.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.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.doGetIndexInfo(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getIndexInfo(Unknown Source)
> 	at com.ibm.team.repository.service.db.provider.AbstractDbProvider.getIndexMetadata(AbstractDbProvider.java:381)
> 	at com.ibm.team.repository.service.db.provider.AbstractDbProvider.doesIndexExist(AbstractDbProvider.java:343)
> 	... 61 more
> Caused by: 
> ERROR 42X01: Syntax error: FALSE.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.checkInternalFeature(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.literal(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.valueSpecification(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.valueExpressionPrimary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpressionXX(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.unaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.multiplicativeExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.additiveExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.thenElseExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.whenThenExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.valueSpecification(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.valueExpressionPrimary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpressionXX(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.unaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.multiplicativeExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.additiveExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.valueExpressionPrimary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpressionXX(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.primaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.unaryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.multiplicativeExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.additiveExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.derivedColumn(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.selectSublist(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.selectColumnList(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.selectList(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.querySpecification(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.simpleTable(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.nonJoinQueryPrimary(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.nonJoinQueryTerm(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.queryExpression(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.preparableSelectStatement(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.preparableSQLDataStatement(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.StatementPart(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.SQLParser.Statement(Unknown Source)
> 	at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(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.GenericPreparedStatement.rePrepare(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	... 68 more



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)