[
https://issues.apache.org/jira/browse/DERBY-6216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13686197#comment-13686197
]
Bryan Pendleton commented on DERBY-6216:
----------------------------------------
It's clearly been a while since I worked with this part of the system,
and I'm now working on a new machine, so there may be some build/setup
issues in my environment.
Still, XplainStatisticsTest is exhibiting some very strange behaviors:
1) When, in an empty test directory, I run:
java junit.textui.TestRunner
org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest
I get:
........................
Time: 30.222
OK (23 tests)
The test appears to pass successfully, with no errors.
But I see errors like the following in my system\derby.log:
Mon Jun 17 16:34:07 PDT 2013 Thread[main,5,main] (XID = 450127), (SESSIONID
= 19), (DATABASE = wombat), (DRDAID = null),
Failed Statement is: insert into
"XPLTEST"."SYSXPLAIN_RESULTSETS"(RS_ID,OP_IDENTIFIER,OP_DETAILS,NO_OPENS,
NO_INDEX_UPDATES,LOCK_MODE,LOCK_GRANULARITY,PARENT_RS_ID,EST_ROW_COUNT,EST_COST,AFFECTED_ROWS,DEFERRED_ROWS,
INPUT_ROWS,SEEN_ROWS,SEEN_ROWS_RIGHT,FILTERED_ROWS,RETURNED_ROWS,EMPTY_RIGHT_ROWS,INDEX_KEY_OPT,SCAN_RS_ID,
SORT_RS_ID,STMT_ID,TIMING_ID) values
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
ERROR 42X14: 'RS_ID' is not a column in table or VTI
'XPLTEST.SYSXPLAIN_RESULTSETS'.
at
org.apache.derby.iapi.error.StandardException.newException(StandardException.java:265)
at
org.apache.derby.iapi.error.StandardException.newException(StandardException.java:260)
at
org.apache.derby.impl.sql.compile.ResultColumn.bindResultColumnByName(ResultColumn.java:832)
at
org.apache.derby.impl.sql.compile.ResultColumnList.bindResultColumnsByName(ResultColumnList.java:908)
at
org.apache.derby.impl.sql.compile.InsertNode.bindStatement(InsertNode.java:297)
at
org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:403)
at
org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:100)
at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1107)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:134)
at
org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Driver40.java:101)
at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1734)
at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java:1562)
at
org.apache.derby.catalog.SystemProcedures.createXplainTable(SystemProcedures.java:2148)
at
org.apache.derby.catalog.SystemProcedures.SYSCS_SET_XPLAIN_SCHEMA(SystemProcedures.java:2082)
at
org.apache.derby.exe.acf8e7c29bx013fx547cxa652x00004fd8b4bd3.g0(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
at
org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
at
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:453)
at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:334)
at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1337)
at
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:704)
at
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:631)
at
org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.enableXplainStyle(XplainStatisticsTest.java:501)
at
org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.testTableNotValid(XplainStatisticsTest.java:2546)
Although the stack trace is perfectly reasonable, the presence of
this exception confuses me:
- why is this exception occurring? RS_ID is a perfectly fine column.
- why is this exception not causing the test suite to fail? Is something on
this stack catching and ignoring this exception?
Is it perhaps the dynamically-generated bytecode which is calling
SYSCS_SET_XPLAIN_SCHEMA which is hiding this error?
- if something is hiding the prepareStatement() exception, why isn't that
causing further problems down the road?
2) I tried to diagnose the first problem by running, in an empty directory:
java -Dderby.language.logStatementText=true junit.textui.TestRunner
org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest
(That is, the same test invocation, but with logStatementText=true)
Once again, the test appears to pass fine, with no JUnit-level errors
in the test report.
However, this time, when I look in system/derby.log, all of the above
exceptions are gone! Again, this confuses me:
- why does -Dderby.language.logStatementText=true affect whether or not
the prepareStatement exception is thrown?
I'd be much obliged if somebody could repeat these steps and tell me whether
they can confirm my findings or not.
> XPLAIN feature does not work and gives ERROR XCL16: ResultSet not open
> ----------------------------------------------------------------------
>
> Key: DERBY-6216
> URL: https://issues.apache.org/jira/browse/DERBY-6216
> Project: Derby
> Issue Type: Bug
> Components: Tools
> Affects Versions: 10.6.2.3, 10.7.1.4, 10.8.3.1, 10.9.1.0
> Environment: Solaris 10, MacOS X 10.6, Windows XP
> Reporter: Brett Bergquist
> Assignee: Bryan Pendleton
> Labels: features
>
> I am running Derby 10.9.1.0 and am trying to figure out a performance
> problem with query taking too long. I don’t actually want to run the query
> so from the documentation, I try:
> call syscs_util.syscs_set_runtimestatistics(1);
> call syscs_util.syscs_set_xplain_schema('STATS');
> call syscs_util.syscs_set_xplain_mode(1);
> --- my query here
> call syscs_util.syscs_set_runtimestatistics(0);
> call syscs_util.syscs_set_xplain_schema('');
> call syscs_util.syscs_set_xplain_mode(0);
> When it runs my query, I get:
> ERROR XCL16: ResultSet not open. Operation 'getMetaData' not permitted.
> Verify that autocommit is OFF.
> I try the following with IJ just to see:
> call syscs_util.syscs_set_runtimestatistics(1);
> call syscs_util.syscs_set_xplain_schema('STATS');
> call syscs_util.syscs_set_xplain_mode(1);
> select sql_text from syscs_diag.transaction_table where status != 'IDLE';
> call syscs_util.syscs_set_runtimestatistics(0);
> call syscs_util.syscs_set_xplain_schema('');
> call syscs_util.syscs_set_xplain_mode(0);
> Note I have tried this with real tables as apposed to the
> syscs_diag.transaction_table with the same result. The only reason that I
> posted this with this table is that it is a table that is accessible for any
> database.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira