diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 14:43:29 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 14:43:29 +0200 |
commit | 25161e6219de4a65b7f8776771bad2af6eb0446e (patch) | |
tree | 28a3488cb929d63620d81d8ce4e0f42d0540ad65 /sql | |
parent | 7930ab7e3326408e6b4d18ca057db93a8b61cc49 (diff) | |
parent | 65350042a42b46e63d24e0e84453619d57d4e203 (diff) | |
download | mariadb-git-25161e6219de4a65b7f8776771bad2af6eb0446e.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_acl.cc | 8 | ||||
-rw-r--r-- | sql/sql_table.cc | 16 | ||||
-rw-r--r-- | sql/table.cc | 6 | ||||
-rw-r--r-- | sql/table.h | 2 |
4 files changed, 28 insertions, 4 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 76687dd0021..6958098d4a6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1593,8 +1593,7 @@ static bool fix_user_plugin_ptr(ACL_USER *user) else return true; - if (user->auth_string.length) - set_user_salt(user, user->auth_string.str, user->auth_string.length); + set_user_salt(user, user->auth_string.str, user->auth_string.length); return false; } @@ -2068,6 +2067,11 @@ static bool acl_load(THD *thd, const Grant_tables& tables) safe_str(user.user.str), safe_str(user.host.hostname)); } + else if (password_len) + { + user.auth_string.str= password; + user.auth_string.length= password_len; + } fix_user_plugin_ptr(&user); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9e72278db8d..1b426f80a88 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6634,6 +6634,12 @@ static bool fill_alter_inplace_info(THD *thd, KEY *new_key; KEY *new_key_end= ha_alter_info->key_info_buffer + ha_alter_info->key_count; + /* + Primary key index for the new table + */ + const KEY* const new_pk= (ha_alter_info->key_count > 0 && + is_candidate_key(ha_alter_info->key_info_buffer)) ? + ha_alter_info->key_info_buffer : NULL; DBUG_PRINT("info", ("index count old: %d new: %d", table->s->keys, ha_alter_info->key_count)); @@ -6709,6 +6715,16 @@ static bool fill_alter_inplace_info(THD *thd, goto index_changed; } + /* + Rebuild the index if following condition get satisfied: + + (i) Old table doesn't have primary key, new table has it and vice-versa + (ii) Primary key changed to another existing index + */ + if ((new_key == new_pk) != + ((uint) (table_key - table->key_info) == table->s->primary_key)) + goto index_changed; + /* Check that key comment is not changed. */ if (table_key->comment.length != new_key->comment.length || (table_key->comment.length && diff --git a/sql/table.cc b/sql/table.cc index 88e516955c3..58e90787925 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -337,6 +337,9 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data, &share->LOCK_ha_data, MY_MUTEX_INIT_FAST); + DBUG_EXECUTE_IF("simulate_big_table_id", + if (last_table_id < UINT_MAX32) + last_table_id= UINT_MAX32 - 1;); /* There is one reserved number that cannot be used. Remember to change this when 6-byte global table id's are introduced. @@ -345,7 +348,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, { share->table_map_id=(ulong) my_atomic_add64_explicit(&last_table_id, 1, MY_MEMORY_ORDER_RELAXED); - } while (unlikely(share->table_map_id == ~0UL)); + } while (unlikely(share->table_map_id == ~0UL || + share->table_map_id == 0)); } DBUG_RETURN(share); } diff --git a/sql/table.h b/sql/table.h index b8bd0c86ff4..f517f54ec82 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1892,7 +1892,7 @@ struct TABLE_LIST /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */ List<Index_hint> *index_hints; TABLE *table; /* opened table */ - uint table_id; /* table id (from binlog) for opened table */ + ulonglong table_id; /* table id (from binlog) for opened table */ /* select_result for derived table to pass it from table creation to table filling procedure |