1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Monty
2020-09-02 03:13:32 +03:00
committed by Sergei Golubchik
parent 7ca4e381f7
commit 6079b46d8d
37 changed files with 522 additions and 460 deletions

View File

@ -2711,45 +2711,45 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
field_list.push_back(item= new (mem_root)
Item_return_int(this, "id", 3,
MYSQL_TYPE_LONGLONG), mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(new (mem_root)
Item_empty_string(this, "select_type", 19, cs),
mem_root);
field_list.push_back(item= new (mem_root)
Item_empty_string(this, "table", NAME_CHAR_LEN, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
if (explain_flags & DESCRIBE_PARTITIONS)
{
/* Maximum length of string that make_used_partitions_str() can produce */
item= new (mem_root) Item_empty_string(this, "partitions",
MAX_PARTITIONS * (1 + FN_LEN), cs);
field_list.push_back(item, mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
}
field_list.push_back(item= new (mem_root)
Item_empty_string(this, "type", 10, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(item= new (mem_root)
Item_empty_string(this, "possible_keys",
NAME_CHAR_LEN*MAX_KEY, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(item=new (mem_root)
Item_empty_string(this, "key", NAME_CHAR_LEN, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(item=new (mem_root)
Item_empty_string(this, "key_len",
NAME_CHAR_LEN*MAX_KEY),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(item=new (mem_root)
Item_empty_string(this, "ref",
NAME_CHAR_LEN*MAX_REF_PARTS, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(item=new (mem_root)
Item_empty_string(this, "rows", NAME_CHAR_LEN, cs),
mem_root);
@ -2758,7 +2758,7 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
field_list.push_back(item= new (mem_root)
Item_empty_string(this, "r_rows", NAME_CHAR_LEN, cs),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
}
if (is_analyze || (explain_flags & DESCRIBE_EXTENDED))
@ -2766,7 +2766,7 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
field_list.push_back(item= new (mem_root)
Item_float(this, "filtered", 0.1234, 2, 4),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
}
if (is_analyze)
@ -2774,10 +2774,10 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
field_list.push_back(item= new (mem_root)
Item_float(this, "r_filtered", 0.1234, 2, 4),
mem_root);
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
}
item->flags|= ITEM_FLAG_MAYBE_NULL;
item->set_maybe_null();
field_list.push_back(new (mem_root)
Item_empty_string(this, "Extra", 255, cs),
mem_root);