diff options
author | Michael Widenius <monty@mariadb.org> | 2020-08-02 12:31:14 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:27:28 +0200 |
commit | 3105c9e7a5eb3706f6520e1566ed4a2add06c6a5 (patch) | |
tree | 628f083d286f970ac8358f882195ea834c16131e /sql/sql_class.cc | |
parent | 451c4ae548fd4b0dda93ac499682e95b249bfcf4 (diff) | |
download | mariadb-git-3105c9e7a5eb3706f6520e1566ed4a2add06c6a5.tar.gz |
Change bitfields in Item to an uint16
The reason for the change is that neither clang or gcc can do efficient
code when several bit fields are change at the same time or when copying
one or more bits between identical bit fields.
Updated bits explicitely with & and | is MUCH more efficient than what
current compilers can do.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 5b4eb35ea27..aa621d4b7f1 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -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->maybe_null= 1; + item->flags|= ITEM_FLAG_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->maybe_null= 1; + item->flags|= ITEM_FLAG_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->maybe_null= 1; + item->flags|= ITEM_FLAG_MAYBE_NULL; } field_list.push_back(item= new (mem_root) Item_empty_string(this, "type", 10, cs), mem_root); - item->maybe_null= 1; + item->flags|= ITEM_FLAG_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->maybe_null=1; + item->flags|= ITEM_FLAG_MAYBE_NULL; field_list.push_back(item=new (mem_root) Item_empty_string(this, "key", NAME_CHAR_LEN, cs), mem_root); - item->maybe_null=1; + item->flags|= ITEM_FLAG_MAYBE_NULL; field_list.push_back(item=new (mem_root) Item_empty_string(this, "key_len", NAME_CHAR_LEN*MAX_KEY), mem_root); - item->maybe_null=1; + item->flags|= ITEM_FLAG_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->maybe_null=1; + item->flags|= ITEM_FLAG_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->maybe_null=1; + item->flags|= ITEM_FLAG_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->maybe_null=1; + item->flags|= ITEM_FLAG_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->maybe_null=1; + item->flags|= ITEM_FLAG_MAYBE_NULL; } - item->maybe_null= 1; + item->flags|= ITEM_FLAG_MAYBE_NULL; field_list.push_back(new (mem_root) Item_empty_string(this, "Extra", 255, cs), mem_root); |