From cf45545f0e6b33bfb1b6af049edc89f5a1577a8b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Sep 2001 11:34:00 -0500 Subject: [PATCH 1/3] manual.texi typo fixes Docs/manual.texi: typo fixes --- Docs/manual.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 1aebc88d4c3..36a1757d072 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -33949,7 +33949,7 @@ mysql> select * from bar; For each row in table @code{foo}, a row is inserted in @code{bar} with the values from @code{foo} and default values for the new columns. -@code{CREATE TABLE ... SELECT} will not automaticly create any indexes +@code{CREATE TABLE ... SELECT} will not automatically create any indexes for you. This is done intentionally to make the command as flexible as possible. If you want to have indexes in the created table, you should specify these before the @code{SELECT} statement: @@ -41735,7 +41735,7 @@ MySQL function. This initializes some global variables that MySQL needs. If you are using a thread safe client library, this will also call @code{my_thread_init()} for this thread. -This is automaticly called by @code{mysql_init()} +This is automatically called by @code{mysql_init()} and @code{mysql_connect()}. @subsubheading Return Values @@ -41752,7 +41752,7 @@ none. This function needs to be called for each created thread to initialize thread specific variables. -This is automaticly called by @code{my_init()} and @code{mysql_connect()}. +This is automatically called by @code{my_init()} and @code{mysql_connect()}. @subsubheading Return Values @@ -41768,7 +41768,7 @@ none. This function needs to be called before calling @code{pthread_exit()} to freed memory allocated by @code{my_thread_init()}. -Note that this function is NOT invoked automaticly be the client +Note that this function is NOT invoked automatically by the client library! @subsubheading Return Values From 1efe6fe956823ef5c617292f4277c11f18c70df9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Sep 2001 21:41:10 -0500 Subject: [PATCH 2/3] manual.texi fix example that uses INDEX() as function (there manual.texi is no such function) Docs/manual.texi: fix example that uses INDEX() as function (there is no such function) --- Docs/manual.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 36a1757d072..b25f35f9691 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -44506,7 +44506,7 @@ By default, MySQL searches are case-insensitive (although there are some character sets that are never case insensitive, such as @code{czech}). That means that if you search with @code{col_name LIKE 'a%'}, you will get all column values that start with @code{A} or @code{a}. If you want to make this -search case-sensitive, use something like @code{INDEX(col_name, "A")=0} to +search case-sensitive, use something like @code{INSTR(col_name, "A")=1} to check a prefix. Or use @code{STRCMP(col_name, "A") = 0} if the column value must be exactly @code{"A"}. From 1a9bf29e9956ccd113d87f8ffe82781d6515ff61 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Sep 2001 15:24:56 +0300 Subject: [PATCH 3/3] Fixed bug in --safe-create-user Docs/manual.texi: Changelog isam/_dbug.c: Cleanup sql/mysqld.cc: Cleanup sql/net_serv.cc: Cleanup --- Docs/manual.texi | 2 + isam/_dbug.c | 2 +- sql/mysqld.cc | 8 +- sql/net_serv.cc | 1 - sql/sql_acl.cc | 6 +- support-files/make_mysql_pkg.sh | 159 ++++++++++++++++++++++++++++++++ 6 files changed, 170 insertions(+), 8 deletions(-) create mode 100644 support-files/make_mysql_pkg.sh diff --git a/Docs/manual.texi b/Docs/manual.texi index 1aebc88d4c3..8f3f33a800f 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46859,6 +46859,8 @@ as @code{NULL}. Fixed problem with @code{myisampack} when using pre-space filled CHAR columns. @item Applied patch from Yuri Dario for OS2. +@item +Fixed bug in @code{--safe-user-create} @end itemize @node News-3.23.42, News-3.23.41, News-3.23.43, News-3.23.x diff --git a/isam/_dbug.c b/isam/_dbug.c index d632d5931a5..18e671793ed 100644 --- a/isam/_dbug.c +++ b/isam/_dbug.c @@ -89,7 +89,7 @@ void _nisam_print_key(FILE *stream, register N_KEYSEG *keyseg, const uchar *key) key=end; break; case HA_KEYTYPE_UINT24: - VOID(fprintf(stream,"%ld",uint3korr(key))); + VOID(fprintf(stream,"%ld",(long) uint3korr(key))); key=end; break; case HA_KEYTYPE_FLOAT: diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9aa56ea7fc1..ee72bdb1c3b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2811,13 +2811,13 @@ CHANGEABLE_VAR changeable_vars[] = { 0, 1, ~0L, 0, 1 }, { "max_write_lock_count", (long*) &max_write_lock_count, ~0L, 1, ~0L, 0, 1 }, - { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size, - 8192*1024, 4, ~0L, 0, 1 }, { "myisam_max_extra_sort_file_size", (long*) &myisam_max_extra_sort_file_size, (long) (MI_MAX_TEMP_LENGTH/(1024L*1024L)), 0, ~0L, 0, 1 }, { "myisam_max_sort_file_size", (long*) &myisam_max_sort_file_size, (long) (LONG_MAX/(1024L*1024L)), 0, ~0L, 0, 1 }, + { "myisam_sort_buffer_size", (long*) &myisam_sort_buffer_size, + 8192*1024, 4, ~0L, 0, 1 }, { "net_buffer_length", (long*) &net_buffer_length, 16384, 1024, 1024*1024L, MALLOC_OVERHEAD, 1024 }, { "net_retry_count", (long*) &mysqld_net_retry_count, @@ -2896,7 +2896,7 @@ struct show_var_st init_vars[]= { {"have_innodb", (char*) &have_innodb, SHOW_HAVE}, {"have_isam", (char*) &have_isam, SHOW_HAVE}, {"have_raid", (char*) &have_raid, SHOW_HAVE}, - {"have_ssl", (char*) &have_ssl, SHOW_HAVE}, + {"have_openssl", (char*) &have_ssl, SHOW_HAVE}, {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, #ifdef HAVE_INNOBASE_DB {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, @@ -2935,10 +2935,10 @@ struct show_var_st init_vars[]= { {"max_user_connections", (char*) &max_user_connections, SHOW_LONG}, {"max_tmp_tables", (char*) &max_tmp_tables, SHOW_LONG}, {"max_write_lock_count", (char*) &max_write_lock_count, SHOW_LONG}, - {"myisam_recover_options", (char*) &myisam_recover_options, SHOW_LONG}, {"myisam_max_extra_sort_file_size", (char*) &myisam_max_extra_sort_file_size, SHOW_LONG}, {"myisam_max_sort_file_size",(char*) &myisam_max_sort_file_size, SHOW_LONG}, + {"myisam_recover_options", (char*) &myisam_recover_options, SHOW_LONG}, {"myisam_sort_buffer_size", (char*) &myisam_sort_buffer_size, SHOW_LONG}, {"net_buffer_length", (char*) &net_buffer_length, SHOW_LONG}, {"net_read_timeout", (char*) &net_read_timeout, SHOW_LONG}, diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 4d4603ed586..750079b39a5 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -34,7 +34,6 @@ #include #include #include -#include #ifdef MYSQL_SERVER ulong max_allowed_packet=65536; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 798cd78cab1..835b873aee6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1613,6 +1613,7 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list, List_iterator str_list (user_list); LEX_USER *Str; TABLE_LIST tables[3]; + bool create_new_users=0; DBUG_ENTER("mysql_table_grant"); if (!initialized) @@ -1680,6 +1681,8 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list, DBUG_RETURN(-1); /* purecov: deadcode */ } + if (!revoke_grant) + create_new_users= test_if_create_new_users(thd); int result=0; pthread_mutex_lock(&LOCK_grant); MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); @@ -1705,8 +1708,7 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list, *Str, 0, revoke_grant ? 'N' : 'Y', - (revoke_grant ? 0 : - test_if_create_new_users(thd)))) + create_new_users)) { result= -1; // Remember error continue; // Add next user diff --git a/support-files/make_mysql_pkg.sh b/support-files/make_mysql_pkg.sh new file mode 100644 index 00000000000..b0eb817fff4 --- /dev/null +++ b/support-files/make_mysql_pkg.sh @@ -0,0 +1,159 @@ +#!/bin/sh +# +# make_mysql_pkg.sh +# +# This script creates a Mac OS X installation package +# for Apple's Installer application. +# +# To use it: +# +# 1.) unpack the MySQL source tarball +# 2.) cd to into the resulting directory and stay there for the next steps +# 3.) "configure" the source (preferably with --mandir=/usr/local/share/man) +# 4.) "make" the package +# 5.) invoke this script with superuser privileges (sudo or in a root shell) +# +# Written by Marc Liyanage (http://www.entropy.ch) +# +# History: +# +# When Who What +# ------------------------------------------------------------- +# 2001-09-13 Marc Liyanage First version + + +# Find the version number of this particular MySQL build +# +OLDWD=`pwd` +VERSION_H_FILE=$OLDWD/include/mysql_version.h + +if [ ! -e $VERSION_H_FILE ] +then +echo $VERSION_H_FILE not found, make sure you are in the mysql source dir +exit 1 +fi + +MYSQLVERSION=`egrep 'MYSQL_SERVER_VERSION' $VERSION_H_FILE | perl -e '$_ = <>; $_ =~ /"(.+?)"/; print $1'` + + + +# We will temporarily rename /usr/local to this name +# and then mkdir a new, empty /usr/local +# +LOCAL_TMPDIR=/usr/local.tmp + +# At the end, we'll keep our temporary /usr/local +# to this name +# +LOCAL_BACKUPDIR=/usr/local.mysql-package + +# Where do we create the package directory +# +PKG_DIR=/tmp/mysql-$MYSQLVERSION.pkg + +# Where is the resources directory within the +# package directory +# +PKG_RESOURCES_DIR=$PKG_DIR/Contents/Resources + +# Check if old stuff is in our way +# +if [ -e $LOCAL_BACKUPDIR ] +then +echo $LOCAL_BACKUPDIR exists, please remove first... +exit 1 +fi + +if [ -e $LOCAL_TMPDIR ] +then +echo $LOCAL_TMPDIR exists, please remove first... +exit 1 +fi + +if [ -e $PKG_DIR ] +then +echo $PKG_DIR exists, please remove first... +exit 1 +fi + +# Now create the package dir +# +mkdir -p $PKG_RESOURCES_DIR + +# Move the existing /usr/local out of our way +# +mv /usr/local $LOCAL_TMPDIR + +# Now create our new empty temporary /usr/local +# +mkdir /usr/local + +# And install MySQL there +# +make install + + +# cd there so the next few commands will use it +# as base directory +# +cd /usr/local + +# First, create the gzipped pax archive file +# which contains the actual files +# +pax -w . | gzip -c > $PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.pax.gz + +# Create the bom ("Bill Of Materials") file +# +mkbom . $PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.bom + +# Create the sizes file with the package space +# requirement numbers and file count +# +SIZE_UNCOMPRESSED=`du -sk /usr/local | cut -f 1` +SIZE_COMPRESSED=`du -sk $PKG_DIR | cut -f 1` +NUMFILES=`find /usr/local | wc -l | perl -e '$_ = <>; $_ =~ /\s+(\d+)/; print $1 - 1'` + +echo NumFiles $NUMFILES >> $PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.sizes +echo InstalledSize $SIZE_UNCOMPRESSED >> $PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.sizes +echo CompressedSize $SIZE_COMPRESSED >> $PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.sizes + + +# Finally create the info file which drives the "Installer" application +# +cat >$PKG_RESOURCES_DIR/mysql-$MYSQLVERSION.info <<- EOF + Title MySQL + Version $MYSQLVERSION + Description The MySQL database server in a convenient Mac OS X package. Some additional configuration is necessary, please see http://www.entropy.ch/software/macosx/mysql/ + DefaultLocation /usr/local + Diskname (null) + DeleteWarning + NeedsAuthorization YES + DisableStop NO + UseUserMask NO + Application NO + Relocatable NO + Required NO + InstallOnly NO + RequiresReboot NO + InstallFat NO +EOF + +# Create a .tar.gz file for the package directory +# +cd $PKG_DIR +cd .. +DIRNAME=`dirname $PKG_DIR` +BASENAME=`basename $PKG_DIR` +FILENAME=$BASENAME.tar.gz +tar -cvzf $FILENAME $BASENAME + +# Move our temporary /usr/local out of the way +# and the original one back +# +mv /usr/local $LOCAL_BACKUPDIR +mv $LOCAL_TMPDIR /usr/local + +echo output package is in $DIRNAME/$FILENAME + +