Commit f8143251 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-27595 Backport SQL service, introduced by MDEV-19275.

Embedded-server related fixes.
parent 3a8eb405
...@@ -490,7 +490,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) ...@@ -490,7 +490,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= NULL; *prev_row= NULL;
data->embedded_info->prev_ptr= prev_row; data->embedded_info->prev_ptr= prev_row;
return_ok: return_ok:
net_send_eof(thd, thd->server_status, thd->protocol->net_send_eof(thd, thd->server_status,
thd->get_stmt_da()->current_statement_warn_count()); thd->get_stmt_da()->current_statement_warn_count());
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
......
...@@ -1125,7 +1125,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) ...@@ -1125,7 +1125,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
for (uint pos= 0 ; (item= it++); pos++) for (uint pos= 0 ; (item= it++); pos++)
{ {
if (prot.store_field_metadata(thd, item, pos)) if (prot.store_item_metadata(thd, item, pos))
goto err; goto err;
} }
...@@ -1240,8 +1240,7 @@ bool Protocol_binary::write() ...@@ -1240,8 +1240,7 @@ bool Protocol_binary::write()
@retval FALSE Success @retval FALSE Success
*/ */
bool bool Protocol::net_send_ok(THD *thd,
net_send_ok(THD *thd,
uint server_status, uint statement_warn_count, uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong id, const char *message, ulonglong affected_rows, ulonglong id, const char *message,
bool, bool) bool, bool)
...@@ -1276,7 +1275,7 @@ net_send_ok(THD *thd, ...@@ -1276,7 +1275,7 @@ net_send_ok(THD *thd,
*/ */
bool bool
net_send_eof(THD *thd, uint server_status, uint statement_warn_count) Protocol::net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
{ {
bool error= write_eof_packet(thd, server_status, statement_warn_count); bool error= write_eof_packet(thd, server_status, statement_warn_count);
thd->cur_data= 0; thd->cur_data= 0;
...@@ -1284,8 +1283,8 @@ net_send_eof(THD *thd, uint server_status, uint statement_warn_count) ...@@ -1284,8 +1283,8 @@ net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
} }
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, bool Protocol::net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char *sqlstate) const char *sqlstate)
{ {
uint error; uint error;
char converted_err[MYSQL_ERRMSG_SIZE]; char converted_err[MYSQL_ERRMSG_SIZE];
......
...@@ -906,7 +906,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) ...@@ -906,7 +906,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
for (uint pos= 0; (item=it++); pos++) for (uint pos= 0; (item=it++); pos++)
{ {
prot.prepare_for_resend(); prot.prepare_for_resend();
if (prot.store_field_metadata(thd, item, pos)) if (prot.store_item_metadata(thd, item, pos))
goto err; goto err;
if (prot.write()) if (prot.write())
DBUG_RETURN(1); DBUG_RETURN(1);
...@@ -986,7 +986,7 @@ bool Protocol::write() ...@@ -986,7 +986,7 @@ bool Protocol::write()
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
bool Protocol_text::store_field_metadata(THD *thd, Item *item, uint pos) bool Protocol_text::store_item_metadata(THD *thd, Item *item, uint pos)
{ {
Send_field field(thd, item); Send_field field(thd, item);
return store_field_metadata(thd, field, item->charset_for_protocol(), pos); return store_field_metadata(thd, field, item->charset_for_protocol(), pos);
......
...@@ -201,7 +201,7 @@ class Protocol_text :public Protocol ...@@ -201,7 +201,7 @@ class Protocol_text :public Protocol
bool store_field_metadata(const THD *thd, const Send_field &field, bool store_field_metadata(const THD *thd, const Send_field &field,
CHARSET_INFO *charset_for_protocol, CHARSET_INFO *charset_for_protocol,
uint pos); uint pos);
bool store_field_metadata(THD *thd, Item *item, uint pos); bool store_item_metadata(THD *thd, Item *item, uint pos);
bool store_field_metadata_for_list_fields(const THD *thd, Field *field, bool store_field_metadata_for_list_fields(const THD *thd, Field *field,
const TABLE_LIST *table_list, const TABLE_LIST *table_list,
uint pos); uint pos);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment