query runs the given query and sends a CommandComplete message to the client
(query ConvertedQuery)
| 1003 | |
| 1004 | // query runs the given query and sends a CommandComplete message to the client |
| 1005 | func (h *ConnectionHandler) query(query ConvertedQuery) error { |
| 1006 | // |rowsAffected| gets altered by the callback below |
| 1007 | rowsAffected := int32(0) |
| 1008 | |
| 1009 | callback := h.spoolRowsCallback(query, &rowsAffected, false) |
| 1010 | err := h.doltgresHandler.ComQuery(context.Background(), h.mysqlConn, query.String, query.AST, callback) |
| 1011 | if err != nil { |
| 1012 | if strings.HasPrefix(err.Error(), "syntax error at position") { |
| 1013 | return errors.Errorf("This statement is not yet supported") |
| 1014 | } |
| 1015 | return err |
| 1016 | } |
| 1017 | |
| 1018 | return h.send(makeCommandComplete(query.StatementTag, rowsAffected)) |
| 1019 | } |
| 1020 | |
| 1021 | // spoolRowsCallback returns a callback function that will send RowDescription message, |
| 1022 | // then a DataRow message for each row in the result set. |
no test coverage detected