MCPcopy Create free account
hub / github.com/bytebase/bytebase / selectIntoTarget

Function selectIntoTarget

backend/plugin/parser/tsql/query.go:56–67  ·  view source on GitHub ↗

selectIntoTarget returns the INTO target of sel, searching set-operation arms — T-SQL attaches INTO to the first arm of a UNION, not the root.

(sel *ast.SelectStmt)

Source from the content-addressed store, hash-verified

54// selectIntoTarget returns the INTO target of sel, searching set-operation
55// arms — T-SQL attaches INTO to the first arm of a UNION, not the root.
56func selectIntoTarget(sel *ast.SelectStmt) *ast.TableRef {
57 if sel == nil {
58 return nil
59 }
60 if sel.IntoTable != nil {
61 return sel.IntoTable
62 }
63 if target := selectIntoTarget(sel.Larg); target != nil {
64 return target
65 }
66 return selectIntoTarget(sel.Rarg)
67}

Callers 3

HasSelectIntoFunction · 0.85
classifyQueryTypeFunction · 0.85
extractChangedResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected