Skip to content

Commit c7747dd

Browse files
angelamayxiefulghum
authored andcommitted
modified handler for insert returning nodes
1 parent 764333d commit c7747dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/handler.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ func (h *Handler) ComPrepare(ctx context.Context, c *mysql.Conn, query string, p
157157
// than they will at execution time.
158158
func nodeReturnsOkResultSchema(node sql.Node) bool {
159159
switch node.(type) {
160-
case *plan.InsertInto, *plan.Update, *plan.UpdateJoin, *plan.DeleteFrom:
160+
case *plan.InsertInto:
161+
insertNode, _ := node.(*plan.InsertInto)
162+
return insertNode.Returning == nil
163+
case *plan.Update, *plan.UpdateJoin, *plan.DeleteFrom:
161164
return true
162165
}
163166
return false

0 commit comments

Comments
 (0)