summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-09-02 03:13:32 +0300
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:27:28 +0200
commit6079b46d8d371262882d1bbe7ebeec23b2f83075 (patch)
treead649946b27e58e5b451b6bbd470d14d1c161189 /sql/item_windowfunc.cc
parent7ca4e381f7af59dad07aebc5dc4f467b235ab962 (diff)
downloadmariadb-git-6079b46d8d371262882d1bbe7ebeec23b2f83075.tar.gz
Split item->flags into base_flags and with_flags
This was done to simplify copying of with_* flags Other things: - Changed Flags to C++ enums, which enables gdb to print out bit values for the flags. This also enables compiler errors if one tries to manipulate a non existing bit in a variable. - Added set_maybe_null() as a shortcut as setting the MAYBE_NULL flags was used in a LOT of places. - Renamed PARAM flag to SP_VAR to ensure it's not confused with persistent statement parameters.
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r--sql/item_windowfunc.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index cdf8ebf9879..262481d019b 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -120,7 +120,7 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
const_item_cache= false;
- flags= (flags & ~ITEM_FLAG_WITH_SUM_FUNC) | ITEM_FLAG_WITH_WINDOW_FUNC;
+ with_flags= (with_flags & ~item_with_t::SUM_FUNC) | item_with_t::WINDOW_FUNC;
if (fix_length_and_dec())
return TRUE;
@@ -128,7 +128,7 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
max_length= window_func()->max_length;
set_maybe_null(window_func()->maybe_null());
- flags|= ITEM_FLAG_FIXED;
+ base_flags|= item_base_t::FIXED;
set_phase_to_initial();
return false;
}
@@ -344,8 +344,7 @@ bool Item_sum_hybrid_simple::fix_fields(THD *thd, Item **ref)
{
if (args[i]->fix_fields_if_needed_for_scalar(thd, &args[i]))
return TRUE;
- flags|= (args[i]->flags & (ITEM_FLAG_WITH_WINDOW_FUNC |
- ITEM_FLAG_WITH_SUBQUERY));
+ with_flags|= args[i]->with_flags;
}
if (fix_length_and_dec())
@@ -359,14 +358,14 @@ bool Item_sum_hybrid_simple::fix_fields(THD *thd, Item **ref)
for (uint i= 0; i < arg_count; i++)
orig_args[i]= args[i];
- flags|= ITEM_FLAG_FIXED;
+ base_flags|= item_base_t::FIXED;
return FALSE;
}
bool Item_sum_hybrid_simple::fix_length_and_dec()
{
- flags|= ITEM_FLAG_MAYBE_NULL;
+ set_maybe_null();
null_value= true;
return args[0]->type_handler()->Item_sum_hybrid_fix_length_and_dec(this);
}