Commit 64bfad63 authored by Alexander Barkov's avatar Alexander Barkov

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().
parent c3a44c27
...@@ -660,7 +660,8 @@ class Item: public Value_source, ...@@ -660,7 +660,8 @@ class Item: public Value_source,
return value; return value;
} }
bool get_date_with_conversion_from_item(Item *item, bool get_date_with_conversion_from_item(Item *item,
MYSQL_TIME *ltime, uint fuzzydate) MYSQL_TIME *ltime,
ulonglong fuzzydate)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
return (null_value= item->get_date_with_conversion(ltime, fuzzydate)); return (null_value= item->get_date_with_conversion(ltime, fuzzydate));
...@@ -1386,14 +1387,14 @@ class Item: public Value_source, ...@@ -1386,14 +1387,14 @@ class Item: public Value_source,
virtual longlong val_datetime_packed() virtual longlong val_datetime_packed()
{ {
MYSQL_TIME ltime; MYSQL_TIME ltime;
uint fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES; ulonglong fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES;
return get_date_with_conversion(&ltime, fuzzydate) ? 0 : pack_time(&ltime); return get_date_with_conversion(&ltime, fuzzydate) ? 0 : pack_time(&ltime);
} }
// Get a TIME value in numeric packed format for comparison // Get a TIME value in numeric packed format for comparison
virtual longlong val_time_packed() virtual longlong val_time_packed()
{ {
MYSQL_TIME ltime; 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(&ltime, fuzzydate) ? 0 : pack_time(&ltime); return get_date(&ltime, fuzzydate) ? 0 : pack_time(&ltime);
} }
// Get a temporal value in packed DATE/DATETIME or TIME format // Get a temporal value in packed DATE/DATETIME or TIME format
......
...@@ -2325,7 +2325,7 @@ Item_func_ifnull::str_op(String *str) ...@@ -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); DBUG_ASSERT(fixed == 1);
if (!args[0]->get_date_with_conversion(ltime, fuzzydate & ~TIME_FUZZY_DATES)) 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) ...@@ -2798,7 +2798,7 @@ Item_func_nullif::decimal_op(my_decimal * decimal_value)
bool 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); DBUG_ASSERT(fixed == 1);
if (!compare()) if (!compare())
...@@ -2938,7 +2938,7 @@ my_decimal *Item_func_case::decimal_op(my_decimal *decimal_value) ...@@ -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); DBUG_ASSERT(fixed == 1);
Item *item= find_item(); Item *item= find_item();
...@@ -3349,7 +3349,7 @@ double Item_func_coalesce::real_op() ...@@ -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); DBUG_ASSERT(fixed == 1);
for (uint i= 0; i < arg_count; i++) for (uint i= 0; i < arg_count; i++)
......
...@@ -995,7 +995,7 @@ class Item_func_coalesce :public Item_func_case_expression ...@@ -995,7 +995,7 @@ class Item_func_coalesce :public Item_func_case_expression
longlong int_op(); longlong int_op();
String *str_op(String *); String *str_op(String *);
my_decimal *decimal_op(my_decimal *); 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() void fix_length_and_dec()
{ {
if (!aggregate_for_result(func_name(), args, arg_count, true)) if (!aggregate_for_result(func_name(), args, arg_count, true))
...@@ -1067,7 +1067,7 @@ class Item_func_ifnull :public Item_func_case_abbreviation2 ...@@ -1067,7 +1067,7 @@ class Item_func_ifnull :public Item_func_case_abbreviation2
longlong int_op(); longlong int_op();
String *str_op(String *str); String *str_op(String *str);
my_decimal *decimal_op(my_decimal *); 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() void fix_length_and_dec()
{ {
Item_func_case_abbreviation2::fix_length_and_dec2(args); Item_func_case_abbreviation2::fix_length_and_dec2(args);
...@@ -1099,7 +1099,7 @@ class Item_func_case_abbreviation2_switch: public Item_func_case_abbreviation2 ...@@ -1099,7 +1099,7 @@ class Item_func_case_abbreviation2_switch: public Item_func_case_abbreviation2
:Item_func_case_abbreviation2(thd, a, b, c) :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); return get_date_with_conversion_from_item(find_item(), ltime, fuzzydate);
} }
...@@ -1212,7 +1212,7 @@ class Item_func_nullif :public Item_func_case_expression ...@@ -1212,7 +1212,7 @@ class Item_func_nullif :public Item_func_case_expression
Item_func_hybrid_field_type::cleanup(); Item_func_hybrid_field_type::cleanup();
arg_count= 2; // See the comment to the constructor 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(); double real_op();
longlong int_op(); longlong int_op();
String *str_op(String *str); String *str_op(String *str);
...@@ -2101,7 +2101,7 @@ class Item_func_case :public Item_func_case_expression ...@@ -2101,7 +2101,7 @@ class Item_func_case :public Item_func_case_expression
longlong int_op(); longlong int_op();
String *str_op(String *); String *str_op(String *);
my_decimal *decimal_op(my_decimal *); 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); bool fix_fields(THD *thd, Item **ref);
table_map not_null_tables() const { return 0; } table_map not_null_tables() const { return 0; }
const char *func_name() const { return "case"; } const char *func_name() const { return "case"; }
......
...@@ -489,7 +489,7 @@ class Item_func_hybrid_field_type: public Item_hybrid_func ...@@ -489,7 +489,7 @@ class Item_func_hybrid_field_type: public Item_hybrid_func
bool get_date_from_date_op(MYSQL_TIME *ltime, ulonglong fuzzydate) bool get_date_from_date_op(MYSQL_TIME *ltime, ulonglong fuzzydate)
{ {
return date_op(ltime, return date_op(ltime,
(uint)(fuzzydate | (fuzzydate |
(field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0))); (field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)));
} }
...@@ -610,7 +610,7 @@ class Item_func_hybrid_field_type: public Item_hybrid_func ...@@ -610,7 +610,7 @@ class Item_func_hybrid_field_type: public Item_hybrid_func
field type is a temporal type. field type is a temporal type.
@return The result of the operation. @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 @@ class Item_func_numhybrid: public Item_func_hybrid_field_type ...@@ -669,7 +669,11 @@ class Item_func_numhybrid: public Item_func_hybrid_field_type
Item_func_hybrid_field_type(thd, list) Item_func_hybrid_field_type(thd, list)
{ } { }
String *str_op(String *str) { 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;
}
}; };
......
...@@ -493,7 +493,11 @@ class Item_func_seconds_hybrid: public Item_func_numhybrid ...@@ -493,7 +493,11 @@ class Item_func_seconds_hybrid: public Item_func_numhybrid
} }
double real_op() { DBUG_ASSERT(0); return 0; } double real_op() { DBUG_ASSERT(0); return 0; }
String *str_op(String *str) { 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;
}
}; };
......
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