containsVariable inspects if the plan contains a system or user variable.
(n sql.Node)
| 270 | // DDL and SHOW plans are intentionally executed by GMS's catalog builder. |
| 271 | // Several of them also satisfy sql.Expressioner, so this guard must precede |
| 272 | // the interface case below. |
| 273 | if plan.IsDDLNode(root) || plan.IsShowNode(root) { |
| 274 | return false |
| 275 | } |
| 276 | switch node := root.(type) { |
| 277 | case *plan.Use, |
| 278 | *plan.ResolvedTable, |
| 279 | *plan.SubqueryAlias, |
| 280 | *plan.TableAlias, |
| 281 | *plan.Distinct, |
| 282 | *plan.OrderedDistinct, |
| 283 | *plan.DeleteFrom, |
| 284 | sql.Expressioner: |
| 285 | return true |
| 286 | case *plan.TableCopier: |