Skip to content

Commit 352c368

Browse files
author
James Cor
committed
fix server engine test
1 parent dbc9769 commit 352c368

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sql/plan/common.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,22 @@ func NodeRepresentsSelect(s sql.Node) bool {
100100
if s == nil {
101101
return false
102102
}
103+
104+
// Special case for calling procedures that call other procedures.
105+
switch node := s.(type) {
106+
case *Call:
107+
return NodeRepresentsSelect(node.Procedure)
108+
case *Procedure:
109+
return NodeRepresentsSelect(node.Body)
110+
case *Block:
111+
for _, stmt := range node.statements {
112+
if NodeRepresentsSelect(stmt) {
113+
return true
114+
}
115+
}
116+
return false
117+
}
118+
103119
isSelect := false
104120
// All SELECT statements, including those that do not specify a table (using "dual"), have a TableNode.
105121
transform.Inspect(s, func(node sql.Node) bool {

0 commit comments

Comments
 (0)