mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixes and code cleanups after merge with 4.0.3
Warning handling and initial prepared statement handling (last not complete yet) Changed a lot of functions that returned 0/1 to my_bool type. GRANT handling now uses read/write locks instead of mutex Change basic net functions to use THD instead of NET (needed for 4.1 protocol) Use my_sprintf instead of sprintf() + strlen() Added alloc_query() to be able to chare query initialization code with prepared statements. Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID() Note that the following test fails (will be fixed ASAP): sub_select, union, rpl_rotate_logs and rpl_mystery22
This commit is contained in:
@ -224,7 +224,7 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
|
||||
char buff[80];
|
||||
String tmp((char*) buff,sizeof(buff),default_charset_info);
|
||||
String *res,*packet= &thd->packet;
|
||||
DBUG_ENTER("send_fields");
|
||||
DBUG_ENTER("send_convert_fields");
|
||||
|
||||
while ((item=it++))
|
||||
{
|
||||
@ -286,10 +286,10 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
|
||||
if (my_net_write(&thd->net, (char*) packet->ptr(),packet->length()))
|
||||
break; /* purecov: inspected */
|
||||
}
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
||||
@ -406,7 +406,8 @@ send_non_convert_fields(THD *thd,List<Item> &list,uint flag)
|
||||
bool
|
||||
send_fields(THD *thd, List<Item> &list, uint flag)
|
||||
{
|
||||
CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->convert_set;
|
||||
char buff[9]; // Big enough for store_length
|
||||
CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->variables.convert_set;
|
||||
DBUG_ENTER("send_fields");
|
||||
|
||||
if (thd->fatal_error) // We have got an error
|
||||
@ -414,7 +415,7 @@ send_fields(THD *thd, List<Item> &list, uint flag)
|
||||
|
||||
if (flag & 1)
|
||||
{ // Packet with number of elements
|
||||
char *pos=net_store_length(buff,(uint) list.elements);
|
||||
char *pos=net_store_length(buff, (uint) list.elements);
|
||||
(void) my_net_write(&thd->net, buff,(uint) (pos-buff));
|
||||
}
|
||||
|
||||
@ -430,11 +431,11 @@ send_fields(THD *thd, List<Item> &list, uint flag)
|
||||
else if (send_non_convert_fields(thd, list, flag))
|
||||
goto err;
|
||||
|
||||
send_eof(&thd->net);
|
||||
return 0;
|
||||
send_eof(thd);
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
send_error(&thd->net,ER_OUT_OF_RESOURCES); /* purecov: inspected */
|
||||
send_error(thd,ER_OUT_OF_RESOURCES); /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user