Skip to content

Commit

Permalink
Fix #18 - No icon for Table Valued Functions.
Browse files Browse the repository at this point in the history
Turns out that table valued functions have "Table-valued functrion" as their @LogicalOp. Looking for `:sTableValued` function seems like a more reliable way of identifying the node type, but this change only does this for Table valued functions for now to fix the bug.
  • Loading branch information
Justin Pealing authored and Justin Pealing committed Oct 18, 2016
1 parent a003aaa commit d25b1dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qp.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
<div class="qp-icon-KeyLookup"></div>
</xsl:template>

<xsl:template match="s:RelOp[s:TableValuedFunction]" mode="NodeIcon" priority="1">
<div class="qp-icon-TableValuedFunction"></div>
</xsl:template>

<!-- Use the physical operation to determine icon if it is present. -->
<xsl:template match="*[@PhysicalOp]" mode="NodeIcon">
<xsl:element name="div">
Expand Down
11 changes: 11 additions & 0 deletions test/qp_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var plan_NotShowingSeekPredicates = require('raw!../test_plans/Not showing Seek
var plan_KeyLookup = require('raw!../test_plans/KeyLookup.sqlplan');
var plan_ClusteredIndexScan = require('raw!../test_plans/clustered index scan.sqlplan');
var plan_ClusteredIndexSeek = require('raw!../test_plans/clustered index seek.sqlplan');
var plan_QueryPlan293288248 = require('raw!../test_plans/QueryPlan-293288248.sqlplan');

function findNodeById(container, nodeId, statementId) {
var statmentElement = findStatmentElementById(container, statementId);
Expand Down Expand Up @@ -240,6 +241,16 @@ describe('qp.js', () => {

});

it('Has correct icon for Table Valued Functions', () => {

var container = document.createElement('div');
QP.showPlan(container, plan_QueryPlan293288248);

var tableValuedFunction = findNodeById(container, '7', '1');
assert.notEqual(null, tableValuedFunction.querySelector('.qp-icon-TableValuedFunction'))

});

});

});

0 comments on commit d25b1dc

Please sign in to comment.