Closed ftlynx closed 3 years ago
hi. which version of pingcap/parser
are you using?
version: v4.0.2
MacBook-Pro:~ ftlynx$ cat go.mod | grep ping github.com/pingcap/parser v0.0.0-20200623164729-3a18f1e5dceb github.com/pingcap/tidb v1.1.0-beta.0.20200630082100-328b6d0a955c
CTE parser was implemented in #1207 & #1217, you'll need a parser version of at least 20210429.
thanks
Question
func Parse(sql string) (*ast.StmtNode, error) { p := parser.New() stmtNode, err := p.ParseOneStmt(sql, "", "") if err != nil { return nil, err } return &stmtNode, nil }
sql: with tmp_table as (select * from t1) select * from tmp_table
result: syntax error