diff options
author | Monty <monty@mariadb.org> | 2018-01-01 19:39:59 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-01-01 19:39:59 +0200 |
commit | fbab79c9b8a58b90292e900cf46ab6d6632ebb68 (patch) | |
tree | 49738ad2561489954fa0973d82be10fafbf42e0b /sql/table.cc | |
parent | afbb72b3b6988f4c5242d46588754517724b2950 (diff) | |
parent | aed2050e40cb332d54e8d40eb7242309b962c4e1 (diff) | |
download | mariadb-git-fbab79c9b8a58b90292e900cf46ab6d6632ebb68.tar.gz |
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts:
cmake/make_dist.cmake.in
mysql-test/r/func_json.result
mysql-test/r/ps.result
mysql-test/t/func_json.test
mysql-test/t/ps.test
sql/item_cmpfunc.h
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/table.cc b/sql/table.cc index 5173cc7250e..c65e29a44d1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1000,7 +1000,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, Virtual_column_info **check_constraint_ptr= table->check_constraints; sql_mode_t saved_mode= thd->variables.sql_mode; Query_arena backup_arena; - Virtual_column_info *vcol; + Virtual_column_info *vcol= 0; StringBuffer<MAX_FIELD_WIDTH> expr_str; bool res= 1; DBUG_ENTER("parse_vcol_defs"); @@ -1171,7 +1171,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint new_frm_ver, field_pack_length, new_field_pack_flag; uint interval_count, interval_parts, read_length, int_length; uint db_create_options, keys, key_parts, n_length; - uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count; + uint com_length, null_bit_pos, UNINIT_VAR(mysql57_vcol_null_bit_pos), bitmap_count; uint i; bool use_hash, mysql57_null_bits= 0; char *keynames, *names, *comment_pos; @@ -2121,6 +2121,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, } } + key_first_info= keyinfo; for (uint key=0 ; key < keys ; key++,keyinfo++) { uint usable_parts= 0; @@ -2138,9 +2139,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, keyinfo->name_length+1); } - if (!key) - key_first_info= keyinfo; - if (ext_key_parts > share->key_parts && key) { KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part + @@ -6784,6 +6782,14 @@ void TABLE::create_key_part_by_field(KEY_PART_INFO *key_part_info, might be reused. */ key_part_info->store_length= key_part_info->length; + /* + For BIT fields null_bit is not set to 0 even if the field is defined + as NOT NULL, look at Field_bit::Field_bit + */ + if (!field->real_maybe_null()) + { + key_part_info->null_bit= 0; + } /* The total store length of the key part is the raw length of the field + |