inputExpressionForSelectExpr returns the input expression for a tree.SelectExpr. Postgres has specific handling for function calls that differs from the default printing behavior.
(node tree.SelectExpr)
| 171 | // inputExpressionForSelectExpr returns the input expression for a tree.SelectExpr. |
| 172 | // Postgres has specific handling for function calls that differs from the default printing behavior. |
| 173 | func inputExpressionForSelectExpr(node tree.SelectExpr) string { |
| 174 | inputExpression := tree.AsStringWithFlags(&node, tree.FmtOmitFunctionArgs) |
| 175 | // To be consistent with vitess handling, InputExpression always gets its outer quotes trimmed |
| 176 | if strings.HasPrefix(inputExpression, "'") && strings.HasSuffix(inputExpression, "'") { |
| 177 | inputExpression = inputExpression[1 : len(inputExpression)-1] |
| 178 | } |
| 179 | return inputExpression |
| 180 | } |
| 181 | |
| 182 | // nodeSelectExprs handles tree.SelectExprs nodes. |
| 183 | func nodeSelectExprs(ctx *Context, node tree.SelectExprs) (vitess.SelectExprs, error) { |
no test coverage detected