diff options
author | unknown <monty@mashka.mysql.fi> | 2003-08-11 22:44:43 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-08-11 22:44:43 +0300 |
commit | 034b44cb9ff914ceb6d32706a3a284eda00891b3 (patch) | |
tree | 3c0ddcb446b8be099c3ab2616c459a573ee3cf92 /scripts | |
parent | f4646c0d063fb541f48dd2824ecccea464a9958d (diff) | |
parent | 6db21de014d603477952c7a16449bcae40a70e5c (diff) | |
download | mariadb-git-034b44cb9ff914ceb6d32706a3a284eda00891b3.tar.gz |
Merge with 4.0.14
BitKeeper/etc/logging_ok:
auto-union
scripts/make_win_src_distribution.old:
Merge rename: scripts/make_win_src_distribution.sh -> scripts/make_win_src_distribution.old
BUILD/compile-pentium-debug-max:
Auto merged
BitKeeper/deleted/.del-sel000001.result~383913ae4505ec86:
Auto merged
BitKeeper/deleted/.del-sel000001.test~9567c1646058cc:
Auto merged
Build-tools/Bootstrap:
Auto merged
Build-tools/Do-compile:
Auto merged
Docs/Makefile.am:
Auto merged
client/get_password.c:
Auto merged
client/mysql.cc:
Auto merged
client/mysqltest.c:
Auto merged
extra/perror.c:
Auto merged
include/config-win.h:
Auto merged
include/my_sys.h:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/btr/btr0pcur.c:
Auto merged
innobase/buf/buf0buf.c:
Auto merged
innobase/buf/buf0flu.c:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/dict/dict0load.c:
Auto merged
innobase/include/buf0buf.h:
Auto merged
innobase/include/log0recv.h:
Auto merged
innobase/include/row0sel.h:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/include/ut0mem.h:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/mem/mem0pool.c:
Auto merged
innobase/os/os0file.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/trx/trx0sys.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
innobase/ut/ut0mem.c:
Auto merged
innobase/ut/ut0ut.c:
Auto merged
myisam/ft_boolean_search.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_extra.c:
Auto merged
myisam/mi_key.c:
Auto merged
myisam/myisamdef.h:
Auto merged
myisammrg/myrg_queue.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/ctype_latin1_de.result:
Auto merged
mysql-test/r/flush.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/grant_cache.result:
Auto merged
mysql-test/r/join.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/range.result:
Auto merged
mysql-test/r/rpl000018.result:
Auto merged
mysql-test/r/rpl_insert_id.result:
Auto merged
mysql-test/r/rpl_master_pos_wait.result:
Auto merged
mysql-test/r/rpl_relayspace.result:
Auto merged
mysql-test/r/select_safe.result:
Auto merged
mysql-test/r/symlink.result:
Auto merged
mysql-test/r/type_date.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
mysql-test/t/alias.test:
Auto merged
mysql-test/t/ctype_latin1_de.test:
Auto merged
mysql-test/t/fulltext_left_join.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/handler.test:
Auto merged
mysql-test/t/heap.test:
Auto merged
mysql-test/t/join.test:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
mysql-test/t/order_by.test:
Auto merged
mysql-test/t/range.test:
Auto merged
mysql-test/t/rpl000001.test:
Auto merged
mysql-test/t/rpl000018.test:
Auto merged
mysql-test/t/rpl_insert_id.test:
Auto merged
mysql-test/t/sel000100.test:
Auto merged
mysql-test/t/select_safe.test:
Auto merged
mysql-test/t/type_date.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysql-test/t/user_var.test:
Auto merged
mysys/default.c:
Auto merged
mysys/mf_format.c:
Auto merged
mysys/my_getopt.c:
Auto merged
mysys/thr_lock.c:
Auto merged
mysys/tree.c:
Auto merged
scripts/Makefile.am:
Auto merged
scripts/mysql_install_db.sh:
Auto merged
scripts/mysqld_safe.sh:
Auto merged
sql/Makefile.am:
Auto merged
sql/field_conv.cc:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_myisammrg.h:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/nt_servc.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_list.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_rename.cc:
Auto merged
sql/sql_repl.h:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/uniques.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
vio/viosocket.c:
Auto merged
BitKeeper/deleted/.del-ctype-latin1_de.c~c5d8f9208bceb98e:
merge
BitKeeper/deleted/.del-mini_client.cc~8677895ec8169183:
merge
acinclude.m4:
Merge with 4.0 (openssl patch)
client/mysqlbinlog.cc:
Merge with 4.0 in which we had added code from 4.1
(We are basicly only using the 4.1 code here)
configure.in:
Keep 4.1 file
heap/hp_open.c:
merge with 4.0
include/my_base.h:
merge with 4.0
include/my_global.h:
merge with 4.0
include/mysqld_error.h:
merge with 4.0
innobase/ha/ha0ha.c:
merge with 4.0
(Code should be same but we use indentaion from 4.0)
innobase/log/log0recv.c:
merge with 4.0
libmysql/libmysql.c:
Remove with 4.0 code that was ported from 4.1
libmysqld/lib_sql.cc:
merge with 4.0
myisam/mi_open.c:
Remove 4.0 specific code
myisam/myisamchk.c:
merge with 4.0
myisammrg/myrg_rkey.c:
merge with 4.0
mysql-test/r/alter_table.result:
May need to be fixed after merge
mysql-test/r/create.result:
May need to be fixed after merge
mysql-test/r/distinct.result:
May need to be fixed after merge
mysql-test/r/drop.result:
May need to be fixed after merge
mysql-test/r/fulltext.result:
May need to be fixed after merge
mysql-test/r/func_set.result:
May need to be fixed after merge
mysql-test/r/func_str.result:
May need to be fixed after merge
mysql-test/r/func_test.result:
May need to be fixed after merge
mysql-test/r/grant.result:
May need to be fixed after merge
mysql-test/r/group_by.result:
May need to be fixed after merge
mysql-test/r/handler.result:
May need to be fixed after merge
mysql-test/r/heap.result:
May need to be fixed after merge
mysql-test/r/innodb.result:
May need to be fixed after merge
mysql-test/r/insert.result:
May need to be fixed after merge
mysql-test/r/insert_select.result:
May need to be fixed after merge
mysql-test/r/key_diff.result:
May need to be fixed after merge
mysql-test/r/merge.result:
May need to be fixed after merge
mysql-test/r/myisam.result:
May need to be fixed after merge
mysql-test/r/order_by.result:
May need to be fixed after merge
mysql-test/r/query_cache.result:
May need to be fixed after merge
mysql-test/r/rpl_flush_log_loop.result:
May need to be fixed after merge
mysql-test/r/rpl_loaddata.result:
May need to be fixed after merge
mysql-test/r/rpl_log.result:
May need to be fixed after merge
mysql-test/r/rpl_log_pos.result:
May need to be fixed after merge
mysql-test/r/rpl_rotate_logs.result:
May need to be fixed after merge
mysql-test/r/select.result:
May need to be fixed after merge
mysql-test/r/union.result:
May need to be fixed after merge
mysql-test/r/user_var.result:
May need to be fixed after merge
mysql-test/t/alter_table.test:
merge with 4.0
mysql-test/t/create.test:
merge with 4.0
mysql-test/t/distinct.test:
merge with 4.0
mysql-test/t/drop.test:
merge with 4.0
mysql-test/t/flush.test:
merge with 4.0
mysql-test/t/fulltext.test:
merge with 4.0
mysql-test/t/func_set.test:
merge with 4.0
mysql-test/t/func_str.test:
merge with 4.0
mysql-test/t/func_test.test:
merge with 4.0
mysql-test/t/grant.test:
merge with 4.0
mysql-test/t/grant_cache.test:
merge with 4.0
mysql-test/t/innodb.test:
Add back EXPLAIN and SHOW KEYS statements, but make them independent of number of rows returned by InnoDB
mysql-test/t/insert.test:
merge with 4.0
mysql-test/t/insert_select.test:
merge with 4.0
mysql-test/t/merge.test:
merge with 4.0
mysql-test/t/query_cache.test:
merge with 4.0
mysql-test/t/rpl_flush_log_loop.test:
merge with 4.0
mysql-test/t/rpl_loaddata.test:
merge with 4.0
mysql-test/t/rpl_rotate_logs.test:
merge with 4.0
mysql-test/t/select.test:
merge with 4.0
mysql-test/t/symlink.test:
merge with 4.0
mysql-test/t/union.test:
merge with 4.0
mysys/charset.c:
merge with 4.0
scripts/mysql_fix_privilege_tables.sh:
merge with 4.0 (Add quoting for some variables)
sql/field.h:
merge with 4.0
sql/ha_innodb.cc:
merge with 4.0
sql/item_cmpfunc.cc:
merge with 4.0
sql/item_cmpfunc.h:
merge with 4.0
sql/item_func.h:
merge with 4.0
sql/item_strfunc.cc:
merge with 4.0
Fixed null handling with ELT()
sql/item_timefunc.h:
merge with 4.0
sql/lex.h:
merge with 4.0
sql/log.cc:
merge with 4.0
sql/log_event.cc:
Merge with 4.0
Cleanups:
- Indentation
- #endif comments
- Replace strmov() with *pos++= for two byte strings
- Moved variable declarations to start of functions
- Merged identical code (LOAD_EVENT)
- Added casts when subtracting pointers
Did a full diff between this and 4.0 to ensure that the file is correct after merge.
sql/log_event.h:
merge with 4.0
sql/mysql_priv.h:
merge with 4.0
sql/mysqld.cc:
merge with 4.0
sql/repl_failsafe.cc:
merge with 4.0
sql/set_var.cc:
merge with 4.0
sql/set_var.h:
merge with 4.0
sql/share/czech/errmsg.txt:
merge with 4.0
sql/share/danish/errmsg.txt:
merge with 4.0
sql/share/dutch/errmsg.txt:
merge with 4.0
sql/share/english/errmsg.txt:
merge with 4.0
sql/share/estonian/errmsg.txt:
merge with 4.0
sql/share/french/errmsg.txt:
merge with 4.0
sql/share/german/errmsg.txt:
merge with 4.0
sql/share/greek/errmsg.txt:
merge with 4.0
sql/share/hungarian/errmsg.txt:
merge with 4.0
sql/share/italian/errmsg.txt:
merge with 4.0
sql/share/japanese/errmsg.txt:
merge with 4.0
sql/share/korean/errmsg.txt:
merge with 4.0
sql/share/norwegian-ny/errmsg.txt:
merge with 4.0
sql/share/norwegian/errmsg.txt:
merge with 4.0
sql/share/polish/errmsg.txt:
merge with 4.0
sql/share/portuguese/errmsg.txt:
merge with 4.0
sql/share/romanian/errmsg.txt:
merge with 4.0
sql/share/russian/errmsg.txt:
merge with 4.0
sql/share/slovak/errmsg.txt:
merge with 4.0
sql/share/spanish/errmsg.txt:
merge with 4.0
sql/share/swedish/errmsg.txt:
merge with 4.0
sql/share/ukrainian/errmsg.txt:
merge with 4.0
sql/slave.cc:
Merge + some indentation fixes
sql/slave.h:
merge with 4.0
sql/sql_acl.cc:
merge with 4.0
Some end space removal to make it easier to do future merges
sql/sql_acl.h:
merge with 4.0
sql/sql_cache.cc:
merge with 4.0
sql/sql_class.h:
merge with 4.0
sql/sql_handler.cc:
merge with 4.0
sql/sql_lex.cc:
merge with 4.0
sql/sql_lex.h:
merge with 4.0
sql/sql_parse.cc:
merge with 4.0
sql/sql_repl.cc:
merge with 4.0
sql/sql_select.cc:
merge with 4.0
sql/sql_table.cc:
merge with 4.0
sql/sql_union.cc:
Merge with 4.0
Note that I couldn't find out how to merge OPTION_FOUND_ROWS handling so this has to be fixed later
sql/sql_yacc.yy:
merge with 4.0
Removed end space to make merge easier
vio/Makefile.am:
merge with 4.0
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 1 | ||||
-rwxr-xr-x | scripts/make_win_src_distribution.old | 402 | ||||
-rwxr-xr-x | scripts/make_win_src_distribution.sh | 2 | ||||
-rw-r--r-- | scripts/mysql_explain_log.sh | 15 | ||||
-rw-r--r-- | scripts/mysql_fix_privilege_tables.sh | 4 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 8 | ||||
-rw-r--r-- | scripts/mysqld_safe.sh | 35 | ||||
-rw-r--r-- | scripts/mysqlhotcopy.sh | 84 |
8 files changed, 513 insertions, 38 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index ff35170dcf3..7ccf35b9580 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -17,6 +17,7 @@ ## Process this file with automake to create Makefile.in bin_SCRIPTS = @server_scripts@ \ + make_win_src_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ diff --git a/scripts/make_win_src_distribution.old b/scripts/make_win_src_distribution.old new file mode 100755 index 00000000000..df7ac29ee0d --- /dev/null +++ b/scripts/make_win_src_distribution.old @@ -0,0 +1,402 @@ +#!/bin/sh + +# +# Script to create a Windows src package +# + +version=@VERSION@ +export version +SOURCE=`pwd` +CP="cp -p" + +DEBUG=0 +SILENT=0 +SUFFIX="" +DIRNAME="" +OUTTAR=0 + +# +# This script must run from MySQL top directory +# + +if [ ! -f scripts/make_win_src_distribution ]; then + echo "ERROR : You must run this script from the MySQL top-level directory" + exit 1 +fi + +# +# Check for source compilation/configuration +# + +if [ ! -f sql/sql_yacc.cc ]; then + echo "ERROR : Sorry, you must run this script after the complete build," + echo " hope you know what you are trying to do !!" + exit 1 +fi + +# +# Debug print of the status +# + +print_debug() +{ + for statement + do + if [ "$DEBUG" = "1" ] ; then + echo $statement + fi + done +} + +# +# Usage of the script +# + +show_usage() +{ + echo "MySQL utility script to create a Windows src package, and it takes" + echo "the following arguments:" + echo "" + echo " --debug Debug, without creating the package" + echo " --tmp Specify the temporary location" + echo " --suffix Suffix name for the package" + echo " --dirname Directory name to copy files (intermediate)" + echo " --silent Do not list verbosely files processed" + echo " --tar Create tar.gz package instead of .zip" + echo " --help Show this help message" + + exit 0 +} + +# +# Parse the input arguments +# + +parse_arguments() { + for arg do + case "$arg" in + --debug) DEBUG=1;; + --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; + --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; + --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;; + --silent) SILENT=1 ;; + --tar) OUTTAR=1 ;; + --help) show_usage ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" + +# +# Assign the tmp directory if it was set from the environment variables +# + +for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp +do + if [ "$i" ]; then + print_debug "Setting TMP to '$i'" + TMP=$i + break + fi +done + + +# + +# +# Create a tmp dest directory to copy files +# + +BASE=$TMP/my_win_dist$SUFFIX + +if [ -d $BASE ] ; then + print_debug "Destination directory '$BASE' already exists, deleting it" + rm -r -f $BASE +fi + +$CP -r $SOURCE/VC++Files $BASE +( +find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print +)|( + while read v + do + print_debug "Replacing LF -> CRLF from '$v'" + + # ^M -> type CTRL V + CTRL M + cat $v | sed 's/
//' | sed 's/$/
/' > $v.tmp + rm $v + mv $v.tmp $v + done +) + +# +# Move all error message files to root directory +# + +$CP -r $SOURCE/sql/share $BASE/ +rm -r -f "$BASE/share/Makefile" +rm -r -f "$BASE/share/Makefile.in" +rm -r -f "$BASE/share/Makefile.am" + +# +# Clean up if we did this from a bk tree +# + +if [ -d $BASE/SCCS ] +then + find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f +fi + +mkdir $BASE/Docs $BASE/extra $BASE/include + + +# +# Copy directory files +# + +copy_dir_files() +{ + for arg do + print_debug "Copying files from directory '$arg'" + cd $SOURCE/$arg + if [ ! -d $BASE/$arg ]; then + print_debug "Creating directory '$arg'" + mkdir $BASE/$arg + fi + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ + README INSTALL* LICENSE + do + if [ -f $i ] + then + $CP $SOURCE/$arg/$i $BASE/$arg/$i + fi + done + for i in *.cc + do + if [ -f $i ] + then + i=`echo $i | sed 's/.cc$//g'` + $CP $SOURCE/$arg/$i.cc $BASE/$arg/$i.cpp + fi + done + done +} + +# +# Copy directory contents recursively +# + +copy_dir_dirs() { + + for arg do + + basedir=$arg + + if [ ! -d $BASE/$arg ]; then + mkdir $BASE/$arg + fi + + copy_dir_files $arg + + cd $SOURCE/$arg/ + for i in * + do + if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then + copy_dir_files $basedir/$i + fi + done + done +} + +# +# Input directories to be copied +# + +for i in client dbug extra heap include isam \ + libmysql libmysqld merge myisam \ + myisammrg mysys regex sql strings sql-common \ + vio zlib +do + copy_dir_files $i +done + +# +# Input directories to be copied recursively +# + +for i in bdb innobase +do + copy_dir_dirs $i +done + +# +# Create dummy innobase configure header +# + +if [ -f $BASE/innobase/ib_config.h ]; then + rm -f $BASE/innobase/ib_config.h +fi +touch $BASE/innobase/ib_config.h + + +# +# Copy miscellaneous files +# + +cd $SOURCE +for i in COPYING ChangeLog README \ + INSTALL-SOURCE INSTALL-WIN \ + INSTALL-WIN-SOURCE \ + Docs/manual_toc.html Docs/manual.html \ + Docs/mysqld_error.txt Docs/INSTALL-BINARY + +do + print_debug "Copying file '$i'" + if [ -f $i ] + then + $CP $i $BASE/$i + fi +done + +# +# Fix some windows files +# + +./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp + +# +# Initialize the initial data directory +# + +if [ -f scripts/mysql_install_db ]; then + print_debug "Initializing the 'data' directory" + scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data +fi + +# +# Specify the distribution package name and copy it +# + +if test -z $DIRNAME +then + NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX +else + NEW_DIR_NAME=$DIRNAME +fi +NEW_NAME=$NEW_DIR_NAME-win-src + +BASE2=$TMP/$NEW_DIR_NAME +rm -r -f $BASE2 +mv $BASE $BASE2 +BASE=$BASE2 + +# +# If debugging, don't create a zip/tar/gz +# + +if [ "$DEBUG" = "1" ] ; then + echo "Please check the distribution files from $BASE" + echo "Exiting (without creating the package).." + exit +fi + +# +# This is needed to prefere gnu tar instead of tar because tar can't +# always handle long filenames +# + +PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` +which_1 () +{ + for cmd + do + for d in $PATH_DIRS + do + for file in $d/$cmd + do + if test -x $file -a ! -d $file + then + echo $file + exit 0 + fi + done + done + done + exit 1 +} + +# +# Create the result zip/tar file +# + +set_tarzip_options() +{ + for arg + do + if [ "$arg" = "tar" ]; then + ZIPFILE1=gnutar + ZIPFILE2=gtar + OPT=cvf + EXT=".tar" + NEED_COMPRESS=1 + if [ "$SILENT" = "1" ] ; then + OPT=cf + fi + else + ZIPFILE1=zip + ZIPFILE2="" + OPT="-r" + EXT=".zip" + NEED_COMPRESS=0 + if [ "$SILENT" = "1" ] ; then + OPT="$OPT -q" + fi + fi + done +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' +else + set_tarzip_options 'zip' +fi + +tar=`which_1 $ZIPFILE1 $ZIPFILE2` +if test "$?" = "1" -o "$tar" = "" +then + print_debug "Search failed for '$ZIPFILE1', '$ZIPFILE2', using default 'tar'" + tar=tar + set_tarzip_options 'tar' +fi + +# +# Create the archive +# + +print_debug "Using $tar to create archive" + +cd $TMP + +rm -f $SOURCE/$NEW_NAME$EXT +$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME +cd $SOURCE + +if [ "$NEED_COMPRESS" = "1" ] +then + print_debug "Compressing archive" + gzip -9 $NEW_NAME$EXT + EXT="$EXT.gz" +fi + +print_debug "Removing temporary directory" +rm -r -f $BASE + +if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" +fi +# End of script diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index df7ac29ee0d..8f8ee344e93 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -219,7 +219,7 @@ copy_dir_dirs() { for i in client dbug extra heap include isam \ libmysql libmysqld merge myisam \ - myisammrg mysys regex sql strings sql-common \ + myisammrg mysys regex sql strings \ vio zlib do copy_dir_files $i diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index c4a4ef21568..973d9e8a363 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -14,12 +14,14 @@ $Param->{host}=''; $Param->{user}=''; $Param->{password}=''; $Param->{PrintError}=0; +$Param->{socket}=''; if (!GetOptions ('date|d:i' => \$Param->{ViewDate}, 'host|h:s' => \$Param->{host}, 'user|u:s' => \$Param->{user}, 'password|p:s' => \$Param->{password}, 'printerror|e:s' => \$Param->{PrintError}, + 'socket|s:s' => \$Param->{socket}, )) { ShowOptions(); } @@ -50,7 +52,7 @@ else { #print "Date=$Param->{ViewDate}, host=$Param->{host}, user=$Param->{user}, password=$Param->{password}\n"; - $Param->{dbh}=DBI->connect("DBI:mysql:host=$Param->{host}",$Param->{user},$Param->{password},{PrintError=>0}); + $Param->{dbh}=DBI->connect("DBI:mysql:host=$Param->{host}".($Param->{socket}?";mysql_socket=$Param->{socket}":""),$Param->{user},$Param->{password},{PrintError=>0}); if (DBI::err()) { print "Error: " . DBI::errstr() . "\n"; } @@ -313,6 +315,8 @@ Usage: $0 [OPTIONS] < LOGFILE -u=USERNAME --password=PASSWORD password of db-user -p=PASSWORD +--socket=SOCKET mysqld socket file to connect +-s=SOCKET Read logfile from STDIN an try to EXPLAIN all SELECT statements. All UPDATE statements are rewritten to an EXPLAIN SELECT statement. The results of the EXPLAIN statement are collected and counted. All results with type=ALL are collected in an separete list. Results are printed to STDOUT. @@ -344,7 +348,7 @@ Then add indices to avoid table scans and remove those which aren't used. =head1 USAGE -explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] < logfile +explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] < logfile --date=YYMMDD select only entrys of date @@ -362,14 +366,19 @@ explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] -p=PASSWORD +--socket=SOCKET change path to the socket + +-s=SOCKET + =head1 EXAMPLE explain_log.pl --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log -=head1 AUTHOR +=head1 AUTHORS Stefan Nitz Jan Willamowius <jan@mobile.de>, http://www.mobile.de + Dennis Haney <davh@davh.dk> (Added socket support) =head1 RECRUITING diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 4b6f74eae06..bf7f082203d 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -88,12 +88,12 @@ fi # The following test is to make this script compatible with the 4.0 where # the first argument was the password -if test -z $password +if test -z "$password" then password=`echo $args | sed -e 's/ *//g'` fi -if test -z $password ; then +if test -z "$password" ; then cmd="$bindir/mysql -f --user=$user --host=$host mysql" else cmd="$bindir/mysql -f --user=$user --password=$password --host=$host mysql" diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index a69995e51a0..309463441b5 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -138,7 +138,13 @@ then fi fi -hostname=`@HOSTNAME@` # Install this too in the user table +# Try to determine the fully qualified domain name (FQDN) +HOSTNAME="@HOSTNAME@" +if $HOSTNAME -f > /dev/null 2>&1 ; then + hostname=`$HOSTNAME -f` +else + hostname=`$HOSTNAME` +fi # Check if hostname is valid if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a $force -eq 0 diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e400c27b84c..d7e3eedb84e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -10,6 +10,8 @@ # mysql.server works by first doing a cd to the base directory and from there # executing mysqld_safe +KILL_MYSQLD=1; + trap '' 1 2 3 15 # we shouldn't let anyone kill us umask 007 @@ -34,6 +36,9 @@ parse_arguments() { for arg do case "$arg" in + --skip-kill-mysqld*) + KILL_MYSQLD=0; + ;; # these get passed explicitly to mysqld --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; @@ -70,6 +75,7 @@ parse_arguments() { MYSQLD="mysqld" fi ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; *) if test -n "$pick_args" then @@ -82,6 +88,7 @@ parse_arguments() { done } + MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ @@ -110,6 +117,7 @@ fi MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} user=@MYSQLD_USER@ +niceness=0 # Use the mysqld-max binary by default if the user doesn't specify a binary if test -x $ledir/mysqld-max @@ -167,7 +175,12 @@ export MYSQL_UNIX_PORT export MYSQL_TCP_PORT -NOHUP_NICENESS="nohup" +if test $niceness -eq 0 +then + NOHUP_NICENESS="nohup" +else + NOHUP_NICENESS="nohup nice -$niceness" +fi # Using nice with no args to get the niceness level is GNU-specific. # This check could be extended for other operating systems (e.g., @@ -198,8 +211,10 @@ then nice --$nice_value_diff echo testing > /dev/null 2>&1 then # nohup increases the priority (bad), and we are permitted - # to lower the priority - NOHUP_NICENESS="nice --$nice_value_diff nohup" + # to lower the priority with respect to the value the user + # might have been given + niceness=`expr $niceness - $nice_value_diff` + NOHUP_NICENESS="nice -$niceness nohup" fi fi else @@ -259,12 +274,16 @@ then fi # -# Uncomment the following lines if you want all tables to be automaticly -# checked and repaired at start +# Uncomment the following lines if you want all tables to be automatically +# checked and repaired during startup. You should add sensible key_buffer +# and sort_buffer values to my.cnf to improve check performance or require +# less disk space. +# Alternatively, you can start mysqld with the "myisam-recover" option. See +# the manual for details. # # echo "Checking tables in $DATADIR" -# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check -O key_buffer=64M -O sort_buffer=64M $DATADIR/*/*.MYI -# $MY_BASEDIR_VERSION/bin/isamchk --silent --force -O sort_buffer=64M $DATADIR/*/*.ISM +# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI +# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM echo "Starting $MYSQLD daemon with databases from $DATADIR" @@ -289,7 +308,7 @@ do break fi - if @IS_LINUX@ + if test @IS_LINUX@ -a $KILL_MYSQLD -eq 1 then # Test if one process was hanging. # This is only a fix for Linux (running as base 3 mysqld processes) diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index a89a8919752..f23955da06a 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.18"; +my $VERSION = "1.19"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -81,8 +81,11 @@ sub usage { die @_, $OPTIONS; } +# Do not initialize user or password options; that way, any user/password +# options specified in option files will be used. If no values are specified +# all, the defaults will be used (login name, no password). + my %opt = ( - user => scalar getpwuid($>), noindices => 0, allowold => 0, # for safety keepold => 0, @@ -165,6 +168,9 @@ $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost"); $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; +# use mysql_read_default_group=mysqlhotcopy so that [client] and +# [mysqlhotcopy] groups will be read from standard options files. + my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", $opt{user}, $opt{password}, { @@ -563,22 +569,22 @@ sub copy_files { print "Copying ".@$files." files...\n" unless $opt{quiet}; if ($method =~ /^s?cp\b/) { # cp or scp with optional flags - my @cp = ($method); + my $cp = $method; # add option to preserve mod time etc of copied files # not critical, but nice to have - push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/; + $cp.= " -p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/; # add recursive option for scp - push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/; + $cp.= " -r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/; my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; # add files to copy and the destination directory - safe_system( @cp, @non_raid, "'$target'" ) if (@non_raid); + safe_system( $cp, @non_raid, "'$target'" ) if (@non_raid); foreach my $rd ( @$raid_dirs ) { my @raid = map { "'$_'" } grep { m:$rd/: } @$files; - safe_system( @cp, @raid, "'$target'/$rd" ) if ( @raid ); + safe_system( $cp, @raid, "'$target'/$rd" ) if ( @raid ); } } else @@ -640,26 +646,54 @@ sub copy_index } -sub safe_system -{ - my @cmd= @_; - - if ( $opt{dryrun} ) - { - print "@cmd\n"; - return; +sub safe_system { + my @sources= @_; + my $method= shift @sources; + my $target= pop @sources; + ## @sources = list of source file names + + ## We have to deal with very long command lines, otherwise they may generate + ## "Argument list too long". + ## With 10000 tables the command line can be around 1MB, much more than 128kB + ## which is the common limit on Linux (can be read from + ## /usr/src/linux/include/linux/binfmts.h + ## see http://www.linuxjournal.com/article.php?sid=6060). + + my $chunk_limit= 100 * 1024; # 100 kB + my @chunk= (); + my $chunk_length= 0; + foreach (@sources) { + push @chunk, $_; + $chunk_length+= length($_); + if ($chunk_length > $chunk_limit) { + safe_simple_system($method, @chunk, $target); + @chunk=(); + $chunk_length= 0; + } } - - ## for some reason system fails but backticks works ok for scp... - print "Executing '@cmd'\n" if $opt{debug}; - my $cp_status = system "@cmd > /dev/null"; - if ($cp_status != 0) { - warn "Burp ('scuse me). Trying backtick execution...\n" if $opt{debug}; #' - ## try something else - `@cmd` && die "Error: @cmd failed ($cp_status) while copying files.\n"; + if ($chunk_length > 0) { # do not forget last small chunk + safe_simple_system($method, @chunk, $target); } } +sub safe_simple_system { + my @cmd= @_; + + if ( $opt{dryrun} ) { + print "@cmd\n"; + } + else { + ## for some reason system fails but backticks works ok for scp... + print "Executing '@cmd'\n" if $opt{debug}; + my $cp_status = system "@cmd > /dev/null"; + if ($cp_status != 0) { + warn "Executing command failed ($cp_status). Trying backtick execution...\n"; + ## try something else + `@cmd` || die "Error: @cmd failed ($?) while copying files.\n"; + } + } +} + sub retire_directory { my ( @dir ) = @_; @@ -770,6 +804,10 @@ sub quote_names { my ($db, $table, @cruft) = split( /\./, $name ); die "Invalid db.table name '$name'" if (@cruft || !defined $db || !defined $table ); + # Earlier versions of DBD return table name non-quoted, + # such as DBD-2.1012 and the newer ones, such as DBD-2.9002 + # returns it quoted. Let's have a support for both. + $table=~ s/\`//g; return "`$db`.`$table`"; } |