mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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:
@@ -89,21 +89,21 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
|
||||
if ((*param->item)->type() != Item::INT_ITEM ||
|
||||
(*param->item)->val() < 0)
|
||||
{
|
||||
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
net_printf(thd, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
pc->max_tree_elements = (uint) (*param->item)->val_int();
|
||||
param = param->next;
|
||||
if (param->next) // no third parameter possible
|
||||
{
|
||||
net_printf(&thd->net, ER_WRONG_PARAMCOUNT_TO_PROCEDURE, proc_name);
|
||||
net_printf(thd, ER_WRONG_PARAMCOUNT_TO_PROCEDURE, proc_name);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
// second parameter
|
||||
if ((*param->item)->type() != Item::INT_ITEM ||
|
||||
(*param->item)->val() < 0)
|
||||
{
|
||||
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
net_printf(thd, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
pc->max_treemem = (uint) (*param->item)->val_int();
|
||||
@@ -111,7 +111,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
|
||||
else if ((*param->item)->type() != Item::INT_ITEM ||
|
||||
(*param->item)->val() < 0)
|
||||
{
|
||||
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
net_printf(thd, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
// if only one parameter was given, it will be the value of max_tree_elements
|
||||
@@ -387,8 +387,7 @@ void field_real::add()
|
||||
|
||||
if ((decs = decimals()) == NOT_FIXED_DEC)
|
||||
{
|
||||
sprintf(buff, "%g", num);
|
||||
length = (uint) strlen(buff);
|
||||
length= my_sprintf(buff, (buff, "%g", num));
|
||||
if (rint(num) != num)
|
||||
max_notzero_dec_len = 1;
|
||||
}
|
||||
@@ -397,11 +396,11 @@ void field_real::add()
|
||||
#ifdef HAVE_SNPRINTF
|
||||
buff[sizeof(buff)-1]=0; // Safety
|
||||
snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
|
||||
length = (uint) strlen(buff);
|
||||
#else
|
||||
sprintf(buff, "%-.*f", (int) decs, num);
|
||||
length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num));
|
||||
#endif
|
||||
|
||||
length = (uint) strlen(buff);
|
||||
|
||||
// We never need to check further than this
|
||||
end = buff + length - 1 - decs + max_notzero_dec_len;
|
||||
|
||||
Reference in New Issue
Block a user