diff options
author | monty@hundin.mysql.fi <> | 2002-03-12 12:21:51 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2002-03-12 12:21:51 +0200 |
commit | e6b9734e0af874ad1ea3ce2f5ecff54064e5c165 (patch) | |
tree | 22118eeb643bce89493c98e11ef020fc49668cbe /sql | |
parent | 8eadb024dcf60ad16c9d9246a9f8cdfeeaa501e9 (diff) | |
parent | a01775c5ebf9d6a8386621f01408514f82bab1da (diff) | |
download | mariadb-git-e6b9734e0af874ad1ea3ce2f5ecff54064e5c165.tar.gz |
merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_isam.cc | 2 | ||||
-rw-r--r-- | sql/ha_myisam.cc | 2 | ||||
-rw-r--r-- | sql/ha_myisammrg.cc | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 1 | ||||
-rw-r--r-- | sql/sql_acl.cc | 26 | ||||
-rw-r--r-- | sql/table.cc | 4 |
6 files changed, 20 insertions, 17 deletions
diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 4b8c40f8fe6..7c9c7a64c9d 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -201,7 +201,7 @@ void ha_isam::info(uint flag) sortkey = info.sortkey; block_size=nisam_block_size; table->keys = min(table->keys,info.keys); - table->keys_in_use= (((key_map) 1) << table->keys)- (key_map) 1; + table->keys_in_use= set_bits(key_map,table->keys); table->db_options_in_use= info.options; table->db_record_offset= (table->db_options_in_use & diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 78ac9f3b309..d9a4b89783e 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -691,7 +691,7 @@ bool ha_myisam::activate_all_index(THD *thd) mi_extra(file, HA_EXTRA_BULK_INSERT_END); if (enable_activate_all_index && - share->state.key_map != ((ulonglong) 1L << share->base.keys)-1) + share->state.key_map != set_bits(ulonglong, share->base.keys)) { const char *save_proc_info=thd->proc_info; thd->proc_info="Creating index"; diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 63a23fb708f..42f8b807898 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -189,7 +189,7 @@ void ha_myisammrg::info(uint flag) deleted = (ha_rows) info.deleted; data_file_length=info.data_file_length; errkey = info.errkey; - table->keys_in_use=(((key_map) 1) << table->keys)- (key_map) 1; + table->keys_in_use= set_bits(key_map, table->keys); table->db_options_in_use = info.options; table->is_view=1; mean_rec_length=info.reclength; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 71ecc1ca2df..94fe76f8408 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3389,6 +3389,7 @@ Starts the MySQL server\n"); --init-file=file Read SQL commands from this file at startup\n\ -L, --language=... Client error messages in given language. May be\n\ given as a full path\n\ + --local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\ -l, --log[=file] Log connections and queries to file\n\ --log-bin[=file] Log queries in new binary format (for replication)\n\ --log-bin-index=file File that holds the names for last binary log files\n\ diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2682122dd8f..104b431bdbb 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -922,14 +922,10 @@ bool acl_check_host(const char *host, const char *ip) bool change_password(THD *thd, const char *host, const char *user, char *new_password) { + uint length=0; DBUG_ENTER("change_password"); DBUG_PRINT("enter",("thd=%x, host='%s', user='%s', new_password='%s'",thd,host,user,new_password)); - uint length=0; - if (!user[0]) - { - send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER); - DBUG_RETURN(1); - } + if (!initialized) { send_error(&thd->net, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */ @@ -941,16 +937,21 @@ bool change_password(THD *thd, const char *host, const char *user, length=(uint) strlen(new_password); new_password[length & 16]=0; - if (!thd || (!thd->slave_thread && ( strcmp(thd->user,user) || - my_strcasecmp(host,thd->host ? thd->host : thd->ip)))) + if (!thd->slave_thread && + (strcmp(thd->user,user) || + my_strcasecmp(host,thd->host ? thd->host : thd->ip))) { if (check_access(thd, UPDATE_ACL, "mysql",0,1)) DBUG_RETURN(1); } + if (!thd->slave_thread && !thd->user[0]) + { + send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER); + DBUG_RETURN(1); + } VOID(pthread_mutex_lock(&acl_cache->lock)); ACL_USER *acl_user; - DBUG_PRINT("info",("host=%s, user=%s",host,user)); - if (!(acl_user= find_acl_user(host,user)) || !acl_user->user) + if (!(acl_user= find_acl_user(host,user))) { send_error(&thd->net, ER_PASSWORD_NO_MATCH); VOID(pthread_mutex_unlock(&acl_cache->lock)); @@ -958,7 +959,8 @@ bool change_password(THD *thd, const char *host, const char *user, } if (update_user_table(thd, acl_user->host.hostname ? acl_user->host.hostname : "", - acl_user->user, new_password)) + acl_user->user ? acl_user->user : "", + new_password)) { VOID(pthread_mutex_unlock(&acl_cache->lock)); /* purecov: deadcode */ send_error(&thd->net,0); /* purecov: deadcode */ @@ -978,7 +980,7 @@ bool change_password(THD *thd, const char *host, const char *user, qinfo.q_len = my_sprintf(buff, (buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"", - acl_user->user, + acl_user->user ? acl_user->user : "", acl_user->host.hostname ? acl_user->host.hostname : "", new_password)); mysql_update_log.write(thd,buff,qinfo.q_len); diff --git a/sql/table.cc b/sql/table.cc index b1cd63d465a..023d4d85df9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -130,8 +130,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, VOID(my_seek(file,(ulong) uint2korr(head+6),MY_SEEK_SET,MYF(0))); if (read_string(file,(gptr*) &disk_buff,(uint) uint2korr(head+28))) goto err_not_open; /* purecov: inspected */ - outparam->keys=keys=disk_buff[0]; - outparam->keys_in_use= (((key_map) 1) << keys)- (key_map) 1; + outparam->keys=keys= disk_buff[0]; + outparam->keys_in_use= set_bits(key_map, keys); outparam->key_parts=key_parts=disk_buff[1]; n_length=keys*sizeof(KEY)+key_parts*sizeof(KEY_PART_INFO); |