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 2010/01/05 16:24:54 UTC
[jira] Created: (DERBY-4504) ASSERT FAILED allTableName (T)
expected to be null
ASSERT FAILED allTableName (T) expected to be null
--------------------------------------------------
Key: DERBY-4504
URL: https://issues.apache.org/jira/browse/DERBY-4504
Project: Derby
Issue Type: Bug
Components: SQL
Affects Versions: 10.5.3.0, 10.6.0.0
Reporter: Knut Anders Hatlen
I see this assert failure in debug builds:
ij> create table t(x int);
0 rows inserted/updated/deleted
ij> select t.* from t join t on 1=1;
ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4504) ASSERT FAILED allTableName (T)
expected to be null
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797768#action_12797768 ]
Knut Anders Hatlen commented on DERBY-4504:
-------------------------------------------
If the repro is changed to a join with a USING clause instead of an ON clause, we get an assert failure at a different point in the code, but with the same message:
ij> select t.* from t join t using(x);
ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
java.sql.SQLException: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
.
.
.
Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED allTableName (T) expected to be null
at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
at org.apache.derby.impl.sql.compile.JoinNode.getAllResultColumns(JoinNode.java:463)
at org.apache.derby.impl.sql.compile.FromList.expandAll(FromList.java:481)
.
.
.
I think we could make both these asserts more liberal. They are detecting an error in the statement, but so does the non-debug code, only at a later stage. For example, it could additionally check whether both legs of the join have the same name, and only raise an assert error if the names differ.
> ASSERT FAILED allTableName (T) expected to be null
> --------------------------------------------------
>
> Key: DERBY-4504
> URL: https://issues.apache.org/jira/browse/DERBY-4504
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.5.3.0, 10.6.0.0
> Reporter: Knut Anders Hatlen
>
> I see this assert failure in debug builds:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> select t.* from t join t on 1=1;
> ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4504) ASSERT FAILED allTableName (T)
expected to be null
Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797744#action_12797744 ]
Mamta A. Satoor commented on DERBY-4504:
----------------------------------------
I tried the test case provided by Knut. Just thought I will include the stack trace for the error.
ij> select t.* from t join t on 1=1;
ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null : org.apache.derby.shared.common.sanity.AssertFailure'.
java.sql.SQLException: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:614)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)
at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)
at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
... 16 more
Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED allTableName (T) expected to be null
at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
at org.apache.derby.impl.sql.compile.JoinNode.getAllResultColumnsNoUsing(JoinNode.java:508)
at org.apache.derby.impl.sql.compile.JoinNode.getAllResultColumns(JoinNode.java:390)
at org.apache.derby.impl.sql.compile.FromList.expandAll(FromList.java:481)
at org.apache.derby.impl.sql.compile.ResultColumnList.expandAllsAndNameColumns(ResultColumnList.java:1599)
at org.apache.derby.impl.sql.compile.ResultColumnList.bindExpressions(ResultColumnList.java:687)
at org.apache.derby.impl.sql.compile.SelectNode.bindExpressions(SelectNode.java:552)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bindExpressions(DMLStatementNode.java:227)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:140)
at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(CursorNode.java:250)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:324)
at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:606)
... 9 more
> ASSERT FAILED allTableName (T) expected to be null
> --------------------------------------------------
>
> Key: DERBY-4504
> URL: https://issues.apache.org/jira/browse/DERBY-4504
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.5.3.0, 10.6.0.0
> Reporter: Knut Anders Hatlen
>
> I see this assert failure in debug builds:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> select t.* from t join t on 1=1;
> ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4504) ASSERT FAILED allTableName (T)
expected to be null
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796701#action_12796701 ]
Knut Anders Hatlen commented on DERBY-4504:
-------------------------------------------
The statement is supposed to fail, but not with an assert failure. Non-debug builds handle this error correctly:
ij> select t.* from t join t on 1=1;
ERROR 42X03: Column name 'T.X' is in more than one table in the FROM list.
> ASSERT FAILED allTableName (T) expected to be null
> --------------------------------------------------
>
> Key: DERBY-4504
> URL: https://issues.apache.org/jira/browse/DERBY-4504
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.5.3.0, 10.6.0.0
> Reporter: Knut Anders Hatlen
>
> I see this assert failure in debug builds:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> select t.* from t join t on 1=1;
> ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4504) ASSERT FAILED allTableName (T)
expected to be null
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797777#action_12797777 ]
Knut Anders Hatlen commented on DERBY-4504:
-------------------------------------------
Actually, the assert also detects an error that the non-debug builds don't detect. This sequence of statements should fail, I think, because T.* is ambiguous (could refer to S1.T or S2.T), but it doesn't fail with insane jars:
ij> create table s1.t(x int);
0 rows inserted/updated/deleted
ij> create table s2.t(x int);
0 rows inserted/updated/deleted
ij> select t.* from s1.t join s2.t on 1=1;
X |X
-----------------------
0 rows selected
The assert is triggered on debug builds, though:
ij> select t.* from s1.t join s2.t on 1=1;
ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
> ASSERT FAILED allTableName (T) expected to be null
> --------------------------------------------------
>
> Key: DERBY-4504
> URL: https://issues.apache.org/jira/browse/DERBY-4504
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.5.3.0, 10.6.0.0
> Reporter: Knut Anders Hatlen
>
> I see this assert failure in debug builds:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> select t.* from t join t on 1=1;
> ERROR XJ001: Java exception: 'ASSERT FAILED allTableName (T) expected to be null: org.apache.derby.shared.common.sanity.AssertFailure'.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.