|
@@ -109,10 +109,10 @@ func insertWalk(sql string) (*insertClause, error) {
|
|
|
w := &walk.AstWalker{
|
|
|
Fn: func(ctx interface{}, node interface{}) (stop bool) {
|
|
|
realNode := node.(*tree.Insert)
|
|
|
+
|
|
|
|
|
|
- tableFmtCtx := tree.NewFmtCtx(tree.FmtSimple)
|
|
|
- realNode.Table.Format(tableFmtCtx)
|
|
|
- clause.table = tableFmtCtx.String()
|
|
|
+ tableName := realNode.Table.(*tree.TableName)
|
|
|
+ clause.table = tableName.Table()
|
|
|
|
|
|
|
|
|
clause.tableRow = make(map[string]clauseTableRowValue)
|
|
@@ -161,9 +161,8 @@ func deleteWalk(sql string) (*deleteClause, error) {
|
|
|
realNode := node.(*tree.Delete)
|
|
|
|
|
|
|
|
|
- tableFmtCtx := tree.NewFmtCtx(tree.FmtSimple)
|
|
|
- realNode.Table.Format(tableFmtCtx)
|
|
|
- clause.table = tableFmtCtx.String()
|
|
|
+ tableName := realNode.Table.(*tree.AliasedTableExpr)
|
|
|
+ clause.table = tableName.String()
|
|
|
|
|
|
|
|
|
clause.where = realNode.Where.Expr.String()
|
|
@@ -199,9 +198,8 @@ func updateWalk(sql string) (*updateClause, error) {
|
|
|
realNode := node.(*tree.Update)
|
|
|
|
|
|
|
|
|
- tableFmtCtx := tree.NewFmtCtx(tree.FmtSimple)
|
|
|
- realNode.Table.Format(tableFmtCtx)
|
|
|
- clause.table = tableFmtCtx.String()
|
|
|
+ tableName := realNode.Table.(*tree.AliasedTableExpr)
|
|
|
+ clause.table = tableName.String()
|
|
|
|
|
|
|
|
|
clause.where = realNode.Where.Expr.String()
|