To reproduce:
1. Connect to Sybase ASE 15.5 database and open a query window
2. Paste the below query which selects from a view and click on the Execute Explain icon
SELECT uid, gid, hashkey, id, sequence, exec_min, exec_max, exec_avg, elap_min, elap_max, elap_avg, lio_min, lio_max, lio_avg, pio_min, pio_max, pio_avg, cnt, abort_cnt, qtext
FROM dbo.sysquerymetrics
java.lang.StringIndexOutOfBoundsException: String index out of range: 4230
at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:879)
at java.lang.StringBuilder.substring(StringBuilder.java:55)
at \\...\\ .\\हिñçêČάй語简??한\\.cꃴꑯꇹ⠒ package.k(Unknown Source)
at \\...\\ .\\हिñçêČάй語简??한\\.Eꋊ⢷ꌦꊆ.a(Unknown Source)
at \\...\\ .\\हिñçêČάй語简??한\\.Eꋊ⢷ꌦꊆ.valueChanged(Unknown Source)
at javax.swing.JTree.fireValueChanged(JTree.java:2820)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3191)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
at javax.swing.JTree.setSelectionPath(JTree.java:1598)
at \\...\\ .\\हिñçêČάй語简??한\\.Eꋊ⢷ꌦꊆ.e(Unknown Source)
at \\...\\ .\\हिñçêČάй語简??한\\.Eꋊ⢷ꌦꊆ.actionPerformed(Unknown Source)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1240)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:567)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
at \\...\\ .\\हिñçêČάй語简??한\\.yᚸꅛꂦꋨ.run(Unknown Source)
|
81 KB
![]() |
4 KB
![]() |
4 KB
|
132 KB
|
99 KB
The AFExplainPlanUtil returns XML execution plan which has text embedded at the beginning. This is causing the display engine to not able to parse the XML. The XML attached to this issue was from the Sybase ASE tool which does not have the leading text.
idgiduidgiduididgiduidgiduidgiduididtypeidtypetypeidgiduidtypeid<?xml version="1.0" encoding="UTF-8"?><query>....</query>
I tried executing the following queries (which I believe are what AFExplainPlanUtil use to retreive the XML execution plan) in a query analyzer:
set plan for show_execio_xml to message on
SELECT uid, gid, hashkey, id, sequence, exec_min, exec_max, exec_avg, elap_min, elap_max, elap_avg, lio_min, lio_max, lio_avg, pio_min, pio_max, pio_avg, cnt, abort_cnt, qtext FROM dbo.sysquerymetrics
select showplan_in_xml(0)
set plan for show_execio_xml off
And the result of "select showplan_in_xml(0)" statement was a clean XML (no text before "<?xml version="1.0" encoding="UTF-8"?>")
This seems to be a Sybase bug.
I execute the following queries in Query Analyzer and the result from select showplan_in_xml(0) has some extra text before the XML string. See the attached screenshot Issue10310.png.
set plan for show_execio_xml to message on go select uid from dbo.sysquerymetrics go select showplan_in_xml(0) go set plan for show_execio_xml off go
This problem is only reproducible when we query the "sysquerymetrics" view. If I try to query other tables and views, select showplan_in_xml(0) returns the correct XML string.
This seems to be a Sybase bug.
I execute the following queries in Query Analyzer and the result from select showplan_in_xml(0) has some extra text before the XML string. See the attached screenshot Issue10310.png.
set plan for show_execio_xml to message on go select uid from dbo.sysquerymetrics go select showplan_in_xml(0) go set plan for show_execio_xml off go
This problem is only reproducible when we query the "sysquerymetrics" view. If I try to query other tables and views, select showplan_in_xml(0) returns the correct XML string.
It appears that all columns listed under <missingHistogram> are pre-pended to the beginning of the XML. This is probably a Sybase bug, but we should find a workaround.
It appears that all columns listed under <missingHistogram> are pre-pended to the beginning of the XML. This is probably a Sybase bug, but we should find a workaround.
I've checked in fix from Kin-Hong under SVN #37020
I've checked in fix from Kin-Hong under SVN #37020
Issue #10310 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 14.0.10-7 |
No time estimate |
The AFExplainPlanUtil returns XML execution plan which has text embedded at the beginning. This is causing the display engine to not able to parse the XML. The XML attached to this issue was from the Sybase ASE tool which does not have the leading text.
idgiduidgiduididgiduidgiduidgiduididtypeidtypetypeidgiduidtypeid<?xml version="1.0" encoding="UTF-8"?><query>....</query>
I tried executing the following queries (which I believe are what AFExplainPlanUtil use to retreive the XML execution plan) in a query analyzer:
set plan for show_execio_xml to message on
SELECT uid, gid, hashkey, id, sequence, exec_min, exec_max, exec_avg, elap_min, elap_max, elap_avg, lio_min, lio_max, lio_avg, pio_min, pio_max, pio_avg, cnt, abort_cnt, qtext FROM dbo.sysquerymetrics
select showplan_in_xml(0)
set plan for show_execio_xml off
And the result of "select showplan_in_xml(0)" statement was a clean XML (no text before "<?xml version="1.0" encoding="UTF-8"?>")