mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Automerge from mysql-next-mr-runtime.
This commit is contained in:
@ -1493,8 +1493,8 @@ int THD::send_explain_fields(select_result *result)
|
||||
}
|
||||
item->maybe_null= 1;
|
||||
field_list.push_back(new Item_empty_string("Extra", 255, cs));
|
||||
return (result->send_fields(field_list,
|
||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));
|
||||
return (result->send_result_set_metadata(field_list,
|
||||
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));
|
||||
}
|
||||
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
@ -1618,10 +1618,10 @@ bool sql_exchange::escaped_given(void)
|
||||
}
|
||||
|
||||
|
||||
bool select_send::send_fields(List<Item> &list, uint flags)
|
||||
bool select_send::send_result_set_metadata(List<Item> &list, uint flags)
|
||||
{
|
||||
bool res;
|
||||
if (!(res= thd->protocol->send_fields(&list, flags)))
|
||||
if (!(res= thd->protocol->send_result_set_metadata(&list, flags)))
|
||||
is_result_set_started= 1;
|
||||
return res;
|
||||
}
|
||||
@ -1662,10 +1662,13 @@ void select_send::cleanup()
|
||||
|
||||
bool select_send::send_data(List<Item> &items)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
DBUG_ENTER("select_send::send_data");
|
||||
|
||||
if (unit->offset_limit_cnt)
|
||||
{ // using limit offset,count
|
||||
unit->offset_limit_cnt--;
|
||||
return 0;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1675,36 +1678,18 @@ bool select_send::send_data(List<Item> &items)
|
||||
*/
|
||||
ha_release_temporary_latches(thd);
|
||||
|
||||
List_iterator_fast<Item> li(items);
|
||||
Protocol *protocol= thd->protocol;
|
||||
char buff[MAX_FIELD_WIDTH];
|
||||
String buffer(buff, sizeof(buff), &my_charset_bin);
|
||||
DBUG_ENTER("select_send::send_data");
|
||||
|
||||
protocol->prepare_for_resend();
|
||||
Item *item;
|
||||
while ((item=li++))
|
||||
{
|
||||
if (item->send(protocol, &buffer))
|
||||
{
|
||||
protocol->free(); // Free used buffer
|
||||
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
|
||||
break;
|
||||
}
|
||||
/*
|
||||
Reset buffer to its original state, as it may have been altered in
|
||||
Item::send().
|
||||
*/
|
||||
buffer.set(buff, sizeof(buff), &my_charset_bin);
|
||||
}
|
||||
thd->sent_row_count++;
|
||||
if (thd->is_error())
|
||||
if (protocol->send_result_set_row(&items))
|
||||
{
|
||||
protocol->remove_last_row();
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
thd->sent_row_count++;
|
||||
|
||||
if (thd->vio_ok())
|
||||
DBUG_RETURN(protocol->write());
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user