(sqlStr string)
| 624 | } |
| 625 | |
| 626 | func (l *lexer) ParseExpr(sqlStr string) (plpgsqltree.Expr, error) { |
| 627 | // Use ParseExprs instead of ParseExpr in order to correctly handle the case |
| 628 | // when multiple expressions are incorrectly passed. |
| 629 | exprs, err := parser.ParseExprs([]string{sqlStr}) |
| 630 | if err != nil { |
| 631 | return nil, err |
| 632 | } |
| 633 | if len(exprs) != 1 { |
| 634 | return nil, pgerror.Newf(pgcode.Syntax, "query returned %d columns", len(exprs)) |
| 635 | } |
| 636 | return exprs[0], nil |
| 637 | } |
| 638 | |
| 639 | // ReadTarget reads a comma-separated list of target variables from the current |
| 640 | // position. |
no test coverage detected