diff options
-rw-r--r-- | Docs/manual.texi | 65 | ||||
-rw-r--r-- | client/mysql.cc | 1 | ||||
-rw-r--r-- | client/mysqlimport.c | 5 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | mysql-test/t/create.test | 8 | ||||
-rw-r--r-- | scripts/mysqlhotcopy.sh | 36 | ||||
-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 |
12 files changed, 71 insertions, 83 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 48571230291..19419371f9a 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -9638,63 +9638,12 @@ client/server and don't need to access the server from other hosts. Add some nice start and shutdown icons to the MySQL installation. @item -Create a tool to manage registry entries for the MySQL startup -options. The registry entry reading is already coded into @file{mysqld.cc}, -but it should be recoded to be more parameter oriented. The tool should -also be able to update the @file{C:\my.cnf} option file if the user prefers -to use that instead of the registry. @item -When registering @code{mysqld} as a service with @code{--install} (on NT) -it would be nice if you could also add default options on the command line. -For the moment, the workaround is to list the parameters in the -@file{C:\my.cnf} file instead. - -@item -It would be real nice to be able to kill @code{mysqld} from the task manager. -For the moment, you must use @code{mysqladmin shutdown}. - -@item -Port @code{readline} to Windows for use in the @code{mysql} command line tool. - -@item -GUI versions of the standard MySQL clients (@code{mysql}, -@code{mysqlshow}, @code{mysqladmin}, and @code{mysqldump}) would be nice. - -@item -It would be nice if the socket read and write functions in @file{net.c} were -interruptible. This would make it possible to kill open threads with -@code{mysqladmin kill} on Windows. - -@item -@code{mysqld} always starts in the "C" locale and not in the default locale. -We would like to have @code{mysqld} use the current locale for the sort order. - -@item -Implement UDF functions with @code{.DLL}s. - -@item -Add macros to use the faster thread-safe increment/decrement methods -provided by Windows. - -@end itemize - -Other Windows-specific issues are described in the @file{README} file that -comes with the MySQL-Windows distribution. - - -@node Solaris, BSD Notes, Windows, Operating System Specific Notes -@subsection Solaris Notes - -@cindex Solaris installation problems -@cindex problems, installing on Solaris -@cindex tar, problems on Solaris -@cindex errors, directory checksum -@cindex checksum errors - -On Solaris, you may run into trouble even before you get the MySQL -distribution unpacked! Solaris @code{tar} can't handle long file names, so -you may see an error like this when you unpack MySQL: +The CSSA-2001-SCO.35.2 (the patch is listed in custom as +erg711905-dscr_remap security patch (ver 2.0.0) breaks FSU threads and +makes mysqld instable. You have to remove this one if you want to run +mysqld on an OpenServer 5.0.6 machine. @example x mysql-3.22.12-beta/bench/Results/ATIS-mysql_odbc-NT_4.0-cmp-db2,\ @@ -49083,6 +49032,12 @@ not yet 100% confident in this code. @node News-3.23.50, News-3.23.49, News-3.23.x, News-3.23.x @appendixsubsec Changes in release 3.23.50 @itemize @bullet +@item +Fixed problem with @code{SHOW CREATE TABLE} and @code{PRIMARY KEY} when using +32 indexes. +@item +Fixed that one can use @code{SET PASSWORD} for the anonymous user. +@item Fixed core-dump bug when reading client groups from option files using @code{mysql_options()}. @item diff --git a/client/mysql.cc b/client/mysql.cc index df329b04481..7734eeadde0 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -530,6 +530,7 @@ static void usage(int version) -h, --host=... Connect to host.\n\ -H, --html Produce HTML output.\n\ -X, --xml Produce XML output.\n\ + --local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\ -L, --skip-line-numbers\n\ Don't write line number for errors.\n"); #ifndef __WIN__ diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 497197f0f89..d1140c74358 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -25,7 +25,7 @@ ** * * ** ************************* */ -#define IMPORT_VERSION "2.7" +#define IMPORT_VERSION "2.8" #include "client_priv.h" #include "mysql_version.h" @@ -397,6 +397,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd) mysql_init(&mysql_connection); if (opt_compress) mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS); + if (opt_local_file) + mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE, + (char*) &opt_local_file); #ifdef HAVE_OPENSSL if (opt_use_ssl) mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, diff --git a/configure.in b/configure.in index 5e36c1446de..3fe235693e9 100644 --- a/configure.in +++ b/configure.in @@ -606,7 +606,7 @@ AC_SUBST(MYSQLD_USER) AC_MSG_CHECKING(if we should should enable LOAD DATA LOCAL by default) AC_ARG_ENABLE(local-infile, [ --enable-local-infile - If LOAD DATA LOCAL INFILE is enabled by default.], + Enable LOAD DATA LOCAL INFILE (default: disabled)], [ ENABLED_LOCAL_INFILE=$enableval ], [ ENABLED_LOCAL_INFILE=no ] ) diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 17b098cae89..99d4e5ae229 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -81,3 +81,11 @@ drop table t2; create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; drop table t1,t2; + +# +# Test of primary key with 32 index +# + +create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b)); +show create table t1; +drop table t1; diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 642b1fb78c9..45f1f1ed24a 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.15"; +my $VERSION = "1.16"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -236,9 +236,7 @@ my $num_files = 0; foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; - eval { $dbh->do( "use $db" ); }; - die "Database '$db' not accessible: $@" if ( $@ ); - my @dbh_tables = $dbh->tables(); + my @dbh_tables = get_list_of_tables( $db ); ## generate regex for tables/files my $t_regex; @@ -307,7 +305,7 @@ foreach my $rdb ( @db_desc ) { $rdb->{files} = [ @db_files ]; $rdb->{index} = [ @index_files ]; - my @hc_tables = map { "`$db.$_`" } @dbh_tables; + my @hc_tables = map { "`$db`.`$_`" } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; $rdb->{raid_dirs} = [ get_raid_dirs( $rdb->{files} ) ]; @@ -562,14 +560,14 @@ sub copy_files { # add recursive option for scp push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; - my @non_raid = grep { ! m:/\d{2}/[^/]+$: } @$files; + my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; # add files to copy and the destination directory - safe_system( @cp, @non_raid, $target ); ++ safe_system( @cp, @non_raid, "'$target'" ); foreach my $rd ( @$raid_dirs ) { - my @raid = grep { m:$rd/: } @$files; - safe_system( @cp, @raid, "$target/$rd" ) if ( @raid ); + my @raid = map { "'$_'" } grep { m:$rd/: } @$files; + safe_system( @cp, @raid, "'$target'/$rd" ) if ( @raid ); } } else @@ -735,6 +733,25 @@ sub get_raid_dirs { return sort keys %dirs; } +sub get_list_of_tables { + my ( $db ) = @_; + + # "use database" cannot cope with database names containing spaces + # so create a new connection + + my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy", + $opt{user}, $opt{password}, + { + RaiseError => 1, + PrintError => 0, + AutoCommit => 1, + }); + + my @dbh_tables = eval { $dbh->tables() }; + $dbh->disconnect(); + return @dbh_tables; +} + __END__ =head1 DESCRIPTION @@ -975,3 +992,4 @@ Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which resulted in nothing being copied when a regexp was specified but no database name(s). +Martin Waite - Fix to handle database name that contains space. 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); |