ComExecuteBound implements the Handler interface.
(ctx context.Context, conn *mysql.Conn, query string, boundQuery mysql.BoundQuery, formatCodes []int16, callback func(*sql.Context, *Result) error)
| 139 | |
| 140 | // ComExecuteBound implements the Handler interface. |
| 141 | func (h *DoltgresHandler) ComExecuteBound(ctx context.Context, conn *mysql.Conn, query string, boundQuery mysql.BoundQuery, formatCodes []int16, callback func(*sql.Context, *Result) error) error { |
| 142 | analyzedPlan, ok := boundQuery.(sql.Node) |
| 143 | if !ok { |
| 144 | return errors.Errorf("boundQuery must be a sql.Node, but got %T", boundQuery) |
| 145 | } |
| 146 | |
| 147 | // TODO: This technically isn't query start and underestimates query execution time |
| 148 | start := time.Now() |
| 149 | if h.sel != nil { |
| 150 | h.sel.QueryStarted() |
| 151 | } |
| 152 | |
| 153 | err := h.doQuery(ctx, conn, query, nil, analyzedPlan, h.executeBoundPlan, callback, formatCodes) |
| 154 | if err != nil { |
| 155 | err = sql.CastSQLError(err) |
| 156 | } |
| 157 | |
| 158 | if h.sel != nil { |
| 159 | h.sel.QueryCompleted(err == nil, time.Since(start)) |
| 160 | } |
| 161 | |
| 162 | return err |
| 163 | } |
| 164 | |
| 165 | // ComPrepareParsed implements the Handler interface. |
| 166 | func (h *DoltgresHandler) ComPrepareParsed(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement) (mysql.ParsedQuery, []pgproto3.FieldDescription, error) { |