diff options
author | unknown <monty@hundin.mysql.fi> | 2002-03-12 11:38:22 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-03-12 11:38:22 +0200 |
commit | 4c221321b624e55238c641b515e24ad1091cdc93 (patch) | |
tree | c217663c9f7a4fba0c5a00acb72b3e980954f780 /sql | |
parent | c13baf70ec937501389ed6e9f94c98635f1c1b76 (diff) | |
download | mariadb-git-4c221321b624e55238c641b515e24ad1091cdc93.tar.gz |
Added help for --local-infile
Fix for bug on intel where (int32) 1 << 32 == 1, which gave problems when using 32 keys.
Allow SET PASSWORD for anonymous user
Docs/manual.texi:
Changelog
client/mysql.cc:
Added help for --local-infile
client/mysqlimport.c:
Merge with 4.0.
Patch for LOCAL INFILE handling
configure.in:
cleanup
include/global.h:
Fix for bug on intel where (int32) 1 << 32 == 1
mysql-test/r/create.result:
Test of CREATE TABLE with 32 keys
mysql-test/t/create.test:
Test of CREATE TABLE with 32 keys
scripts/mysqlhotcopy.sh:
Patch for databasenames with space.
sql/ha_isam.cc:
Fix for bug on intel where (int32) 1 << 32 == 1
sql/ha_myisam.cc:
Fix for bug on intel where (int32) 1 << 32 == 1
sql/ha_myisammrg.cc:
Fix for bug on intel where (int32) 1 << 32 == 1
sql/mysqld.cc:
Added help for --local-infile
sql/sql_acl.cc:
Allow SET PASSWORD of anonymous user
sql/table.cc:
Fix for bug on intel where (int32) 1 << 32 == 1
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 | 22 | ||||
-rw-r--r-- | sql/table.cc | 4 |
6 files changed, 18 insertions, 15 deletions
diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index 746fdd2f585..ac37d09e6b4 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -191,7 +191,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 fb98708c317..595c83ff8ef 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -664,7 +664,7 @@ bool ha_myisam::activate_all_index(THD *thd) MI_CHECK param; MYISAM_SHARE* share = file->s; DBUG_ENTER("activate_all_index"); - if (share->state.key_map != ((ulonglong) 1L << share->base.keys)-1) + if (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 9499c42fdc9..e5fb0310a36 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -169,7 +169,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 b3c67fd5126..9aabf97701a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3243,6 +3243,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 7ad778cf5d0..33924ada8ab 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -765,11 +765,6 @@ bool change_password(THD *thd, const char *host, const char *user, char *new_password) { uint length=0; - if (!user[0]) - { - send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER); - return 1; - } if (!initialized) { send_error(&thd->net, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */ @@ -781,15 +776,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)) return 1; } + if (!thd->slave_thread && !thd->user[0]) + { + send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER); + return 1; + } VOID(pthread_mutex_lock(&acl_cache->lock)); ACL_USER *acl_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)); @@ -797,7 +798,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 */ @@ -817,7 +819,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 247e1dda196..66cbe7cfa16 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); |