I use sqlparser parse sql, and the code is below:
sql := "rename table a to b;"
tree, err := sqlparser.Parse(sql)
if err != nil {
fmt.Println("sql parser failed!")
return
}
out := sqlparser.String(tree)
fmt.Println(out)
the output is : "rename table a b",
the sql can't run success in mysql, forget add the "to"?