Skip to content

Commit

Permalink
MDEV-27595 Backport SQL service, introduced by MDEV-19275.
Browse files Browse the repository at this point in the history
Embedded-server related fixes.
  • Loading branch information
Alexey Botchkov committed Nov 5, 2023
1 parent 3a8eb40 commit f814325
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion libmysqld/emb_qcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= NULL;
data->embedded_info->prev_ptr= prev_row;
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());
DBUG_RETURN(0);
err:
Expand Down
11 changes: 5 additions & 6 deletions libmysqld/lib_sql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)

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;
}

Expand Down Expand Up @@ -1240,8 +1240,7 @@ bool Protocol_binary::write()
@retval FALSE Success
*/

bool
net_send_ok(THD *thd,
bool Protocol::net_send_ok(THD *thd,
uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong id, const char *message,
bool, bool)
Expand Down Expand Up @@ -1276,16 +1275,16 @@ net_send_ok(THD *thd,
*/

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);
thd->cur_data= 0;
return error;
}


bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char *sqlstate)
bool Protocol::net_send_error_packet(THD *thd, uint sql_errno, const char *err,
const char *sqlstate)
{
uint error;
char converted_err[MYSQL_ERRMSG_SIZE];
Expand Down
4 changes: 2 additions & 2 deletions sql/protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
for (uint pos= 0; (item=it++); pos++)
{
prot.prepare_for_resend();
if (prot.store_field_metadata(thd, item, pos))
if (prot.store_item_metadata(thd, item, pos))
goto err;
if (prot.write())
DBUG_RETURN(1);
Expand Down Expand Up @@ -986,7 +986,7 @@ bool Protocol::write()
#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);
return store_field_metadata(thd, field, item->charset_for_protocol(), pos);
Expand Down
2 changes: 1 addition & 1 deletion sql/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Protocol_text :public Protocol
bool store_field_metadata(const THD *thd, const Send_field &field,
CHARSET_INFO *charset_for_protocol,
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,
const TABLE_LIST *table_list,
uint pos);
Expand Down

0 comments on commit f814325

Please sign in to comment.