MCPcopy Create free account
hub / github.com/dolthub/doltgresql / ComExecuteBound

Method ComExecuteBound

server/doltgres_handler.go:141–163  ·  view source on GitHub ↗

ComExecuteBound implements the Handler interface.

(ctx context.Context, conn *mysql.Conn, query string, boundQuery mysql.BoundQuery, formatCodes []int16, callback func(*sql.Context, *Result) error)

Source from the content-addressed store, hash-verified

139
140// ComExecuteBound implements the Handler interface.
141func (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.
166func (h *DoltgresHandler) ComPrepareParsed(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement) (mysql.ParsedQuery, []pgproto3.FieldDescription, error) {

Callers

nothing calls this directly

Calls 2

doQueryMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected