mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Fixing Item_func_hybrid_field_type::date_op(,uint) to date_op(,ulonglong)
Fixing the data type for the "fuzzydate" parameter to Item_func_hybrid_field_type::date_op() from uint to ulonglong, for consistency with Item::get_date().
This commit is contained in:
parent
c3a44c2701
commit
64bfad6307
5 changed files with 25 additions and 16 deletions
|
@ -660,7 +660,8 @@ protected:
|
|||
return value;
|
||||
}
|
||||
bool get_date_with_conversion_from_item(Item *item,
|
||||
MYSQL_TIME *ltime, uint fuzzydate)
|
||||
MYSQL_TIME *ltime,
|
||||
ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
return (null_value= item->get_date_with_conversion(ltime, fuzzydate));
|
||||
|
@ -1386,14 +1387,14 @@ public:
|
|||
virtual longlong val_datetime_packed()
|
||||
{
|
||||
MYSQL_TIME ltime;
|
||||
uint fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES;
|
||||
ulonglong fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES;
|
||||
return get_date_with_conversion(<ime, fuzzydate) ? 0 : pack_time(<ime);
|
||||
}
|
||||
// Get a TIME value in numeric packed format for comparison
|
||||
virtual longlong val_time_packed()
|
||||
{
|
||||
MYSQL_TIME ltime;
|
||||
uint fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES | TIME_TIME_ONLY;
|
||||
ulonglong fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES | TIME_TIME_ONLY;
|
||||
return get_date(<ime, fuzzydate) ? 0 : pack_time(<ime);
|
||||
}
|
||||
// Get a temporal value in packed DATE/DATETIME or TIME format
|
||||
|
|
|
@ -2325,7 +2325,7 @@ Item_func_ifnull::str_op(String *str)
|
|||
}
|
||||
|
||||
|
||||
bool Item_func_ifnull::date_op(MYSQL_TIME *ltime, uint fuzzydate)
|
||||
bool Item_func_ifnull::date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (!args[0]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES))
|
||||
|
@ -2798,7 +2798,7 @@ Item_func_nullif::decimal_op(my_decimal * decimal_value)
|
|||
|
||||
|
||||
bool
|
||||
Item_func_nullif::date_op(MYSQL_TIME *ltime, uint fuzzydate)
|
||||
Item_func_nullif::date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
if (!compare())
|
||||
|
@ -2938,7 +2938,7 @@ my_decimal *Item_func_case::decimal_op(my_decimal *decimal_value)
|
|||
}
|
||||
|
||||
|
||||
bool Item_func_case::date_op(MYSQL_TIME *ltime, uint fuzzydate)
|
||||
bool Item_func_case::date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
Item *item= find_item();
|
||||
|
@ -3349,7 +3349,7 @@ double Item_func_coalesce::real_op()
|
|||
}
|
||||
|
||||
|
||||
bool Item_func_coalesce::date_op(MYSQL_TIME *ltime,uint fuzzydate)
|
||||
bool Item_func_coalesce::date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
for (uint i= 0; i < arg_count; i++)
|
||||
|
|
|
@ -995,7 +995,7 @@ public:
|
|||
longlong int_op();
|
||||
String *str_op(String *);
|
||||
my_decimal *decimal_op(my_decimal *);
|
||||
bool date_op(MYSQL_TIME *ltime,uint fuzzydate);
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
if (!aggregate_for_result(func_name(), args, arg_count, true))
|
||||
|
@ -1067,7 +1067,7 @@ public:
|
|||
longlong int_op();
|
||||
String *str_op(String *str);
|
||||
my_decimal *decimal_op(my_decimal *);
|
||||
bool date_op(MYSQL_TIME *ltime,uint fuzzydate);
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
Item_func_case_abbreviation2::fix_length_and_dec2(args);
|
||||
|
@ -1099,7 +1099,7 @@ public:
|
|||
:Item_func_case_abbreviation2(thd, a, b, c)
|
||||
{ }
|
||||
|
||||
bool date_op(MYSQL_TIME *ltime, uint fuzzydate)
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
return get_date_with_conversion_from_item(find_item(), ltime, fuzzydate);
|
||||
}
|
||||
|
@ -1212,7 +1212,7 @@ public:
|
|||
Item_func_hybrid_field_type::cleanup();
|
||||
arg_count= 2; // See the comment to the constructor
|
||||
}
|
||||
bool date_op(MYSQL_TIME *ltime, uint fuzzydate);
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
double real_op();
|
||||
longlong int_op();
|
||||
String *str_op(String *str);
|
||||
|
@ -2101,7 +2101,7 @@ public:
|
|||
longlong int_op();
|
||||
String *str_op(String *);
|
||||
my_decimal *decimal_op(my_decimal *);
|
||||
bool date_op(MYSQL_TIME *ltime, uint fuzzydate);
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
bool fix_fields(THD *thd, Item **ref);
|
||||
table_map not_null_tables() const { return 0; }
|
||||
const char *func_name() const { return "case"; }
|
||||
|
|
|
@ -489,7 +489,7 @@ public:
|
|||
bool get_date_from_date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
return date_op(ltime,
|
||||
(uint)(fuzzydate |
|
||||
(fuzzydate |
|
||||
(field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)));
|
||||
}
|
||||
|
||||
|
@ -610,7 +610,7 @@ public:
|
|||
field type is a temporal type.
|
||||
@return The result of the operation.
|
||||
*/
|
||||
virtual bool date_op(MYSQL_TIME *res, uint fuzzy_date)= 0;
|
||||
virtual bool date_op(MYSQL_TIME *res, ulonglong fuzzy_date)= 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -669,7 +669,11 @@ public:
|
|||
Item_func_hybrid_field_type(thd, list)
|
||||
{ }
|
||||
String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
|
||||
bool date_op(MYSQL_TIME *ltime, uint fuzzydate) { DBUG_ASSERT(0); return true; }
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -493,7 +493,11 @@ public:
|
|||
}
|
||||
double real_op() { DBUG_ASSERT(0); return 0; }
|
||||
String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
|
||||
bool date_op(MYSQL_TIME *ltime, uint fuzzydate) { DBUG_ASSERT(0); return true; }
|
||||
bool date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
||||
{
|
||||
DBUG_ASSERT(0);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue