Commit 86984d76 authored by andrew's avatar andrew

Match maria/10.0, files divergd on merge for some reason

parent a25962a9
......@@ -1212,9 +1212,9 @@ struct handlerton
/*
Optional clauses in the CREATE/ALTER TABLE
*/
const ha_create_table_option *table_options; // table level options
const ha_create_table_option *field_options; // these are specified per field
const ha_create_table_option *index_options; // these are specified per index
ha_create_table_option *table_options; // table level options
ha_create_table_option *field_options; // these are specified per field
ha_create_table_option *index_options; // these are specified per index
/**
The list of extensions of files created for a single table in the
......
......@@ -3607,23 +3607,6 @@ void Item_udf_func::print(String *str, enum_query_type query_type)
}
longlong Item_func_udf_float::val_int()
{
DBUG_ASSERT(fixed == 1);
return (longlong) rint(Item_func_udf_float::val_real());
}
my_decimal *Item_func_udf_float::val_decimal(my_decimal *dec_buf)
{
double res=val_real();
if (null_value)
return NULL;
double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
double Item_func_udf_float::val_real()
{
double res;
......@@ -3753,32 +3736,6 @@ String *Item_func_udf_str::val_str(String *str)
return res;
}
double Item_func_udf_str::val_real()
{
int err_not_used;
char *end_not_used;
String *res;
res= val_str(&str_value);
return res ? my_strntod(res->charset(),(char*) res->ptr(),
res->length(), &end_not_used, &err_not_used) : 0.0;
}
longlong Item_func_udf_str::val_int()
{
int err_not_used;
String *res; res=val_str(&str_value);
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,
(char**) 0, &err_not_used) : (longlong) 0;
}
my_decimal *Item_func_udf_str::val_decimal(my_decimal *dec_buf)
{
String *res=val_str(&str_value);
if (!res)
return NULL;
string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
/**
@note
......
......@@ -1374,8 +1374,19 @@ class Item_func_udf_float :public Item_udf_func
Item_func_udf_float(udf_func *udf_arg,
List<Item> &list)
:Item_udf_func(udf_arg, list) {}
longlong val_int();
my_decimal *val_decimal(my_decimal *dec_buf);
longlong val_int()
{
DBUG_ASSERT(fixed == 1);
return (longlong) rint(Item_func_udf_float::val_real());
}
my_decimal *val_decimal(my_decimal *dec_buf)
{
double res=val_real();
if (null_value)
return NULL;
double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
double val_real();
String *val_str(String *str);
void fix_length_and_dec() { fix_num_length_and_dec(); }
......@@ -1422,9 +1433,30 @@ public:
Item_func_udf_str(udf_func *udf_arg, List<Item> &list)
:Item_udf_func(udf_arg, list) {}
String *val_str(String *);
double val_real();
longlong val_int();
my_decimal *val_decimal(my_decimal *dec_buf);
double val_real()
{
int err_not_used;
char *end_not_used;
String *res;
res= val_str(&str_value);
return res ? my_strntod(res->charset(),(char*) res->ptr(),
res->length(), &end_not_used, &err_not_used) : 0.0;
}
longlong val_int()
{
int err_not_used;
String *res; res=val_str(&str_value);
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,
(char**) 0, &err_not_used) : (longlong) 0;
}
my_decimal *val_decimal(my_decimal *dec_buf)
{
String *res=val_str(&str_value);
if (!res)
return NULL;
string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec();
};
......
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