From f4c589ff6c653d1d2a09c26e46ead3c8a15655d8 Mon Sep 17 00:00:00 2001 From: "bk@work.mysql.com" <> Date: Mon, 31 Jul 2000 21:29:14 +0200 Subject: Import changeset --- scripts/.cvsignore | 15 + scripts/Makefile.am | 104 ++ scripts/make_binary_distribution.sh | 131 ++ scripts/msql2mysql.sh | 16 + scripts/mysql_config.sh | 74 + scripts/mysql_convert_table_format.sh | 114 ++ scripts/mysql_find_rows.sh | 148 ++ scripts/mysql_fix_privilege_tables.sh | 110 ++ scripts/mysql_install_db.sh | 342 ++++ scripts/mysql_setpermission.sh | 669 +++++++ scripts/mysql_zap.sh | 156 ++ scripts/mysqlaccess.conf | 45 + scripts/mysqlaccess.sh | 3248 +++++++++++++++++++++++++++++++++ scripts/mysqlbug.sh | 380 ++++ scripts/mysqlhotcopy.sh | 591 ++++++ scripts/safe_mysqld-watch.sh | 149 ++ scripts/safe_mysqld.sh | 188 ++ 17 files changed, 6480 insertions(+) create mode 100644 scripts/.cvsignore create mode 100644 scripts/Makefile.am create mode 100755 scripts/make_binary_distribution.sh create mode 100644 scripts/msql2mysql.sh create mode 100644 scripts/mysql_config.sh create mode 100755 scripts/mysql_convert_table_format.sh create mode 100755 scripts/mysql_find_rows.sh create mode 100644 scripts/mysql_fix_privilege_tables.sh create mode 100644 scripts/mysql_install_db.sh create mode 100755 scripts/mysql_setpermission.sh create mode 100755 scripts/mysql_zap.sh create mode 100755 scripts/mysqlaccess.conf create mode 100755 scripts/mysqlaccess.sh create mode 100755 scripts/mysqlbug.sh create mode 100755 scripts/mysqlhotcopy.sh create mode 100755 scripts/safe_mysqld-watch.sh create mode 100755 scripts/safe_mysqld.sh (limited to 'scripts') diff --git a/scripts/.cvsignore b/scripts/.cvsignore new file mode 100644 index 00000000000..b8444752a0d --- /dev/null +++ b/scripts/.cvsignore @@ -0,0 +1,15 @@ +Makefile +Makefile.in +make_binary_distribution +msql2mysql +mysql_config +mysql_convert_table_format +mysql_find_rows +mysql_fix_privilege_tables +mysql_install_db +mysql_setpermission +mysql_zap +mysqlaccess +mysqlbug +mysqlhotcopy +safe_mysqld diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 00000000000..e2e37996c90 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,104 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## Process this file with automake to create Makefile.in + +bin_SCRIPTS = @server_scripts@ \ + msql2mysql \ + mysql_config \ + mysql_fix_privilege_tables \ + mysql_setpermission \ + mysql_zap \ + mysqlaccess \ + mysqlbug \ + mysql_convert_table_format \ + mysql_find_rows \ + mysqlhotcopy + +EXTRA_SCRIPTS = make_binary_distribution.sh \ + msql2mysql.sh \ + mysql_config.sh \ + mysql_fix_privilege_tables.sh \ + mysql_install_db.sh \ + mysql_setpermission.sh \ + mysql_zap.sh \ + mysqlaccess.sh \ + mysqlbug.sh \ + mysql_convert_table_format.sh \ + mysql_find_rows.sh \ + mysqlhotcopy.sh \ + safe_mysqld.sh + +EXTRA_DIST = $(EXTRA_SCRIPTS) \ + mysqlaccess.conf \ + mysqlbug + +pkgdata_DATA = make_binary_distribution + +# mysqlbug should be distributed built so that people can report build +# failures with it. +CLEANFILES = @server_scripts@ \ + make_binary_distribution \ + msql2mysql \ + mysql_fix_privilege_tables \ + mysql_setpermission \ + mysql_zap \ + mysqlaccess \ + mysql_convert_table_format \ + mysql_find_rows + +SUPERCLEANFILES = mysqlbug + +# We want the right version and configure comand line in mysqlbug +mysqlbug: ${top_builddir}/config.status ${top_builddir}/config.cache mysqlbug.sh + +SUFFIXES = .sh + +.sh: + @RM@ -f $@ $@-t + @SED@ \ + -e 's!@''bindir''@!$(bindir)!g' \ + -e 's!@''scriptdir''@!$(bindir)!g' \ + -e 's!@''prefix''@!$(prefix)!g' \ + -e 's!@''datadir''@!$(datadir)!g' \ + -e 's!@''localstatedir''@!$(localstatedir)!g' \ + -e 's!@''libexecdir''@!$(libexecdir)!g' \ + -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ + -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ + -e 's!@''CC''@!@CC@!'\ + -e 's!@''CXX''@!@CXX@!'\ + -e 's!@''GXX''@!@GXX@!'\ + -e 's!@''PERL''@!@PERL@!' \ + -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\ + -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ + -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ + -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''VERSION''@!@VERSION@!' \ + -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ + -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \ + -e 's!@''HOSTNAME''@!@HOSTNAME@!' \ + -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \ + -e 's!@''CHECK_PID''@!@CHECK_PID@!' \ + -e 's!@''FIND_PROC''@!@FIND_PROC@!' \ + -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ + -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ + -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ + -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ + -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ + -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ + $< > $@-t + @CHMOD@ +x $@-t + @MV@ $@-t $@ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh new file mode 100755 index 00000000000..65d259a5307 --- /dev/null +++ b/scripts/make_binary_distribution.sh @@ -0,0 +1,131 @@ +#!/bin/sh +# The default path should be /usr/local + +# Get some info from configure +# chmod +x ./scripts/setsomevars + +machine=@MACHINE_TYPE@ +system=@SYSTEM_TYPE@ +version=@VERSION@ +export machine system version +SOURCE=`pwd` + +# Save temporary distribution here (must be full path) +TMP=/tmp +if test $# -gt 0 +then + TMP=$1 +fi + +#make + +# This should really be integrated with automake and not duplicate the +# installation list. + +BASE=$TMP/my_dist +mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ + $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ + $BASE/tests $BASE/scripts $BASE/sql-bench + +chmod o-rwx $BASE/data $BASE/data/* + +for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + Docs/manual.html Docs/manual.txt Docs/manual_toc.html +do + cp -p $i $BASE +done + +for i in extra/comp_err extra/replace extra/perror extra/resolveip \ + extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ + client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump client/mysqlimport client/mysql-test \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysql-test +do + cp -p $i $BASE/bin +done + +cp -p config.h include/* $BASE/include +rm $BASE/include/Makefile*; rm $BASE/include/*.in + +cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests +cp -p support-files/* $BASE/support-files +cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib +cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $BASE/share/CVS $BASE/share/*/CVS + +cp -p scripts/* $BASE/bin +rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh + +$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@prefix\@ . < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db +$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server +$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld + +mv $BASE/support-files/binary-configure $BASE/configure +chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure +cp -r -p sql-bench/* $BASE/sql-bench +rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la + +# Change the distribution to a long descreptive name +NEW_NAME=mysql-$version-$system-$machine +BASE2=$TMP/$NEW_NAME +rm -rf $BASE2 +mv $BASE $BASE2 +BASE=$BASE2 +# +# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a +# + +if test "@GXX@" = "yes" +then + cd $BASE/lib + gcclib=`@CC@ --print-libgcc-file` + if test $? -ne 0 + then + print "Warning: Couldn't find libgcc.a!" + else + cp -p $gcclib libmygcc.a + fi + cd $SOURCE +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 tar file +# + +tar=`which_1 gtar` +if test "$?" = "1" -o "$tar" = "" +then + tar=tar +fi + +echo "Using $tar to create archive" +cd $TMP +$tar cvf $SOURCE/$NEW_NAME.tar $NEW_NAME +cd $SOURCE +echo "Compressing archive" +gzip -9 $NEW_NAME.tar +echo "Removing temporary directory" +rm -rf $BASE + +echo "$NEW_NAME.tar.gz created" diff --git a/scripts/msql2mysql.sh b/scripts/msql2mysql.sh new file mode 100644 index 00000000000..89a1fcea959 --- /dev/null +++ b/scripts/msql2mysql.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Copyright (C) 1979-1996 TcX AB & Monty Program KB & Detron HB +# +# This software is distributed with NO WARRANTY OF ANY KIND. No author or +# distributor accepts any responsibility for the consequences of using it, or +# for whether it serves any particular purpose or works at all, unless he or +# she says so in writing. Refer to the Free Public License (the "License") +# for full details. +# +# Every copy of this file must include a copy of the License, normally in a +# plain ASCII text file named PUBLIC. The License grants you the right to +# copy, modify and redistribute this file, but only under certain conditions +# described in the License. Among other things, the License requires that +# the copyright notice and this notice be preserved on all copies. + +@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh new file mode 100644 index 00000000000..09f81c70a1f --- /dev/null +++ b/scripts/mysql_config.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# This script reports various configuration settings that may be needed +# when using the MySQL client library. + +ldata='@localstatedir@' +execdir='@libexecdir@' +bindir='@bindir@' +pkglibdir='@pkglibdir@' +pkgincludedir='@pkgincludedir@' +version='@VERSION@' +socket='@MYSQL_UNIX_ADDR@' +port='@MYSQL_TCP_PORT@' +ldflags='@LDFLAGS@' +client_libs='@CLIENT_LIBS@' + +libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" +cflags="-I'$pkgincludedir'" + +usage () { + cat <connect("DBI:mysql:$opt_database:$opt_host", + $opt_user, + $opt_password, + { PrintError => 0}) + || die "Can't connect to database $opt_database: $DBI::errstr\n"; + +if ($#ARGV < 0) +{ + # Fetch all table names from the database + my ($sth,$row); + $sth=$dbh->prepare("show tables"); + $sth->execute || die "Can't get tables from $opt_database; $DBI::errstr\n"; + while (($row = $sth->fetchrow_arrayref)) + { + push(@ARGV,$row->[0]); + } + $sth->finish; +} + +print "Converting tables:\n" if ($opt_verbose); +foreach $table (@ARGV) +{ + my ($sth,$row); + + # Check if table is already converted + $sth=$dbh->prepare("show table status like '$table'"); + if ($sth->execute && ($row = $sth->fetchrow_arrayref)) + { + if (uc($row->[1]) eq uc($opt_type)) + { + print "$table is alread of type $opt_type; Ignored\n"; + next; + } + } + print "converting $table\n" if ($opt_verbose); + if (!$dbh->do("ALTER TABLE $table type=$opt_type")) + { + print STDERR "Can't convert $table: Error $DBI::errstr\n"; + exit(1) if (!$opt_force); + $exit_status=1; + } +} + +$dbh->disconnect; +exit($exit_status); + + +sub usage +{ + my($version)=shift; + print "$0 version 1.1\n"; + exit(0) if ($version); + + print <) +{ + next if (length($query) == 0 && /^\#/); # Skipp comments + $query.=search($_); + if ($eoq) + { + if ($query =~ /^use /i || $query =~ /^SET / || + ($query =~ /$opt_regexp/o && $database =~ /$opt_dbregexp/o)) + { + if ($opt_skip_use_db && $query =~ /^use /i) + { + $query=""; + next; + } + if ($opt_start_row <= 1) + { + if ($database) + { + print $database, $set; + $database=$set=""; + } + print $query; + last if (--$opt_rows == 0); + } + else + { + $opt_start_row--; + if ($query =~ /^use /) + { + $database=$query; + $set=""; + } + elsif ($query =~ /^SET/) + { + $set=$query; + } + else + { + $set=""; + } + } + } + $query=""; $search=""; $eoq=0; + } +} + +exit 0; + +sub search +{ + my($row)=shift; + my($i); + + for ($i=0 ; $i < length($row) ; $i++) + { + if (length($search)) + { + if (length($search) > 1) + { # Comment + next if (substr($row,$i,length($search)) ne $search); + $i+=length($search)-1; + $search=""; + } + elsif (substr($row,$i,1) eq '\\') # Escaped char in string + { + $i++; + } + elsif (substr($row,$i,1) eq $search) + { + if (substr($row,$i+1,1) eq $search) # Double " or ' + { + $i++; + } + else + { + $search=""; + } + } + next; + } + if (substr($row,$i,2) eq '/*') # Comment + { + $search="*/"; + $i++; + } + elsif (substr($row,$i,1) eq "'" || substr($row,$i,1) eq '"') + { + $search=substr($row,$i,1); + } + } + $eoq=1 if (!length($search) && $row =~ /;\s*$/); + return $row; +} + + +sub usage +{ + print < Grant +# and Create -> Alter, Index, References + +if test $res = 0 +then + echo "Setting default privileges for the new grant, index and alter privileges" + @bindir@/mysql --user=root --password="$root_password" --host="$host" mysql < Column_priv from MySQL 3.22.12 +# + +echo "Changing name of columns_priv.Type -> columns_priv.Column_priv" +echo "You can ignore any errors from this" + +@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql </dev/null + then + ldata=`grep "^datadir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` + fi + if grep "^execdir" $conf >/dev/null + then + execdir=`grep "^execdir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` + fi + if grep "^bindir" $conf >/dev/null + then + bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` + fi + if grep "^user" $conf >/dev/null + then + user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` + fi +fi + +for arg +do + case "$arg" in + --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;; + --datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;; + --user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;; + esac +done + +mdata=$ldata/mysql + +if test ! -x $execdir/mysqld +then + if test "$IN_RPM" -eq 1 + then + echo "FATAL ERROR $execdir/mysqld not found!" + exit 1 + else + echo "Didn't find $execdir/mysqld" + echo "You should do a 'make install' before executing this script" + exit 1 + fi +fi + +# On IRIX hostname is in /usr/bsd so add this to the path +PATH=$PATH:/usr/bsd +hostname=`hostname` # Install this too in the user table + +# Check if hostname is valid +if test "$IN_RPM" -eq 0 -a $force -eq 0 +then + resolved=`$bindir/resolveip $hostname 2>&1` + if [ $? -ne 0 ] + then + resolved=`$bindir/resolveip localhost 2>&1` + if [ $? -eq 0 ] + then + echo "Sorry, the host '$hostname' could not be looked up." + echo "Please configure the 'hostname' command to return a correct hostname." + echo "If you want to solve this at a later stage, restart this script with" + echo "the --force option" + exit 1 + fi + echo "WARNING: Your libc libraries are not 100 % compatible with this MySQL version" + echo "mysqld should work normally with the exception that host name resolving" + echo "will not work. This means that you should use IP addresses instead" + echo "of hostnames when specifying MySQL privileges !" + fi +fi + +# Create database directories mysql & test +if test "$IN_RPM" -eq 0 +then + if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi + if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi + if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi + if test -w / -a ! -z "$user"; then + chown $user $ldata $ldata/mysql $ldata/test; + fi +fi + +# Initialize variables +c_d="" i_d="" +c_h="" i_h="" +c_u="" i_u="" +c_f="" i_f="" +c_t="" c_c="" + +# Check for old tables +if test ! -f $mdata/db.frm +then + echo "Creating db table" + + # mysqld --bootstrap wants one command/line + c_d="$c_d CREATE TABLE db (" + c_d="$c_d Host char(60) DEFAULT '' NOT NULL," + c_d="$c_d Db char(64) DEFAULT '' NOT NULL," + c_d="$c_d User char(16) DEFAULT '' NOT NULL," + c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d PRIMARY KEY Host (Host,Db,User)," + c_d="$c_d KEY User (User)" + c_d="$c_d )" + c_d="$c_d comment='Database privileges';" + + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y');" +fi + +if test ! -f $mdata/host.frm +then + echo "Creating host table" + + c_h="$c_h CREATE TABLE host (" + c_h="$c_h Host char(60) DEFAULT '' NOT NULL," + c_h="$c_h Db char(64) DEFAULT '' NOT NULL," + c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h PRIMARY KEY Host (Host,Db)" + c_h="$c_h )" + c_h="$c_h comment='Host privileges; Merged with database privileges';" +fi + +if test ! -f $mdata/user.frm +then + echo "Creating user table" + + c_u="$c_u CREATE TABLE user (" + c_u="$c_u Host char(60) DEFAULT '' NOT NULL," + c_u="$c_u User char(16) DEFAULT '' NOT NULL," + c_u="$c_u Password char(16) DEFAULT '' NOT NULL," + c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u PRIMARY KEY Host (Host,User)" + c_u="$c_u )" + c_u="$c_u comment='Users and global privileges';" + + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + + REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + + INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N'); + INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N');" +fi + +if test ! -f $mdata/func.frm +then + echo "Creating func table" + + c_f="$c_f CREATE TABLE func (" + c_f="$c_f name char(64) DEFAULT '' NOT NULL," + c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," + c_f="$c_f dl char(128) DEFAULT '' NOT NULL," + c_f="$c_f type enum ('function','aggregate') NOT NULL," + c_f="$c_f PRIMARY KEY (name)" + c_f="$c_f )" + c_f="$c_f comment='User defined functions';" +fi + +if test ! -f $mdata/tables_priv.frm +then + echo "Creating tables_priv table" + + c_t="$c_t CREATE TABLE tables_priv (" + c_t="$c_t Host char(60) DEFAULT '' NOT NULL," + c_t="$c_t Db char(64) DEFAULT '' NOT NULL," + c_t="$c_t User char(16) DEFAULT '' NOT NULL," + c_t="$c_t Table_name char(60) DEFAULT '' NOT NULL," + c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," + c_t="$c_t Timestamp timestamp(14)," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," + c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," + c_t="$c_t KEY Grantor (Grantor)" + c_t="$c_t )" + c_t="$c_t comment='Table privileges';" +fi + +if test ! -f $mdata/columns_priv.frm +then + echo "Creating columns_priv table" + + c_c="$c_c CREATE TABLE columns_priv (" + c_c="$c_c Host char(60) DEFAULT '' NOT NULL," + c_c="$c_c Db char(64) DEFAULT '' NOT NULL," + c_c="$c_c User char(16) DEFAULT '' NOT NULL," + c_c="$c_c Table_name char(64) DEFAULT '' NOT NULL," + c_c="$c_c Column_name char(64) DEFAULT '' NOT NULL," + c_c="$c_c Timestamp timestamp(14)," + c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" + c_c="$c_c )" + c_c="$c_c comment='Column privileges';" +fi + + if $execdir/mysqld $defaults --bootstrap --skip-grant-tables \ + --basedir=@prefix@ --datadir=$ldata "$@" << END_OF_DATA +use mysql; +$c_d +$i_d + +$c_h +$i_h + +$c_u +$i_u + +$c_f +$i_f + +$c_t +$c_c +END_OF_DATA +then + echo "" + if test "$IN_RPM" -eq 0 + then + echo "To start mysqld at boot time you have to copy support-files/mysql.server" + echo "to the right place for your system" + echo + fi + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "This is done with:" + echo "$bindir/mysqladmin -u root -p password 'new-password'" + echo "$bindir/mysqladmin -u root -h `hostname` -p password 'new-password'" + echo "See the manual for more instructions." + # + # Print message about upgrading unless we have created a new db table. + if test -z "$c_d" + then + echo + echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" + echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" + echo "able to use the new GRANT command!" + fi + echo + if test -z "$IN_RPM" + then + echo "You can start the MySQL demon with:" + echo "cd @prefix@ ; $bindir/safe_mysqld &" + echo + echo "You can test the MySQL demon with the benchmarks in the 'sql-bench' directory:" + echo "cd sql-bench ; run-all-tests" + echo + fi + echo "Please report any problems with the @scriptdir@/mysqlbug script!" + echo + echo "The latest information about MySQL is available on the web at" + echo "http://www.mysql.com" + echo "Support MySQL by buying support/licenses at http://www.mysql.com/license.htmy." + echo + exit 0 +else + echo "Installation of grant tables failed!" + echo + echo "Examine the logs in $ldata for more information." + echo "You can also try to start the mysqld demon with:" + echo "$execdir/mysqld --skip-grant &" + echo "You can use the command line tool" + echo "$bindir/mysql to connect to the mysql" + echo "database and look at the grant tables:" + echo + echo "shell> $bindir/mysql -u root mysql" + echo "mysql> show tables" + echo + echo "Try 'mysqld --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" + echo "http://www.mysql.com" + echo "Please consult the MySQL manual section: 'Problems running mysql_install_db'," + echo "and the manual section that describes problems on your OS." + echo "Another information source is the MySQL email archive." + echo "Please check all of the above before mailing us!" + echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" + exit 1 +fi diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh new file mode 100755 index 00000000000..43bf8a14c06 --- /dev/null +++ b/scripts/mysql_setpermission.sh @@ -0,0 +1,669 @@ +#!@PERL@ +## Emacs, this is -*- perl -*- mode? :-) +## +## Permission setter for MySQL +## +## mady by Luuk de Boer (luuk@wxs.nl) 1998. +## it's made under GPL ...:-)) +## +## +############################################################################ +## History +## +## 1.0 first start of the program +## 1.1 some changes from monty and after that +## initial release in mysql 3.22.10 (nov 1998) +## 1.2 begin screen now in a loop + quit is using 0 instead of 9 +## after ideas of Paul DuBois. +## 1.2a Add Grant, References, Index and Alter privilege handling (Monty) + +#### TODO +# +# empty ... suggestions ... mail them to me ... + + +$version="1.2"; + +use DBI; +use Getopt::Long; +use strict; +use vars qw($dbh $hostname $opt_user $opt_password $opt_help $opt_host + $opt_socket $opt_port $host $version); + + +$dbh=$host=$opt_user= $opt_password= $opt_help= $opt_host= $opt_socket= ""; +$opt_port=0; + +read_my_cnf(); # Read options from ~/.my.cnf + +GetOptions("user=s","password=s","help","host=s","socket=s","port=i"); + +usage() if ($opt_help); # the help function + +if ($opt_host eq '') +{ + $hostname = "localhost"; +} +else +{ + $hostname = $opt_host; +} + +# ask for a password if no password is set already +if ($opt_password eq '') +{ + system "stty -echo"; + print "Password for user $opt_user to connect to MySQL: "; + $opt_password = ; + chomp($opt_password); + system "stty echo"; + print "\n"; +} + + +# make the connection to MySQL +$dbh= DBI->connect("DBI:mysql:mysql:host=$hostname:port=$opt_port:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) || + die("Can't make a connection to the mysql server.\n The error: $DBI::errstr"); + +# the start of the program +&q1(); +exit(0); # the end... + +##### +# below all subroutines of the program +##### + +### +# the beginning of the program +### +sub q1 { # first question ... + my ($answer,$end); + while (! $end) { + print "#"x70; + print "\n"; + print "## Welcome to the permission setter $version for MySQL.\n"; + print "## made by Luuk de Boer\n"; + print "#"x70; + print "\n"; + print "What would you like to do:\n"; + print " 1. Set password for a user.\n"; + print " 2. Add a database + user privilege for that database.\n"; + print " - user can do all except all admin functions\n"; + print " 3. Add user privilege for an existing database.\n"; + print " - user can do all except all admin functions\n"; + print " 4. Add user privilege for an existing database.\n"; + print " - user can do all except all admin functions + no create/drop\n"; + print " 5. Add user privilege for an existing database.\n"; + print " - user can do only selects (no update/delete/insert etc.)\n"; + print " 0. exit this program\n"; + print "\nMake your choice [1,2,3,4,5,0]: "; + while () { + $answer = $_; + chomp($answer); + if ($answer =~ /1|2|3|4|5|0/) { + &setpwd if ($answer == 1); + &addall($answer) if ($answer =~ /^[2345]$/); + if ($answer == 0) { + print "Sorry, hope we can help you next time \n\n"; + $end = 1; + } + } else { + print "Your answer was $answer\n"; + print "and that's wrong .... Try again\n"; + } + last; + } + } +} + +### +# set a password for a user +### +sub setpwd +{ + my ($user,$pass,$host); + print "\n\nSetting a (new) password for a user.\n"; + + $user = user(); + $pass = newpass($user); + $host = hosts($user); + + print "#"x70; + print "\n\n"; + print "That was it ... here is an overview of what you gave to me:\n"; + print "The username : $user\n"; +# print "The password : $pass\n"; + print "The host : $host\n"; + print "#"x70; + print "\n\n"; + print "Are you pretty sure you would like to implement this [yes/no]: "; + my $no = ; + chomp($no); + if ($no =~ /n/i) + { + print "Okay .. that was it then ... See ya\n\n"; + return(0); + } + else + { + print "Okay ... let's go then ...\n\n"; + } + $user = $dbh->quote($user); + $host = $dbh->quote($host); + if ($pass eq '') + { + $pass = "''"; + } + else + { + $pass = "PASSWORD(". $dbh->quote($pass) . ")"; + } + my $sth = $dbh->prepare("update user set Password=$pass where User = $user and Host = $host") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + $sth->finish; + print "The password is set for user $user.\n\n"; + +} + +### +# all things which will be added are done here +### +sub addall +{ + my ($todo) = @_; + my ($answer,$good,$db,$user,$pass,$host,$priv); + + if ($todo == 2) + { + $db = newdatabase(); + } + else + { + $db = database(); + } + + $user = newuser(); + $pass = newpass(); + $host = newhosts(); + + print "#"x70; + print "\n\n"; + print "That was it ... here is an overview of what you gave to me:\n"; + print "The database name : $db\n"; + print "The username : $user\n"; +# print "The password : $pass\n"; + print "The host(s) : $host\n"; + print "#"x70; + print "\n\n"; + print "Are you pretty sure you would like to implement this [yes/no]: "; + my $no = ; + chomp($no); + if ($no =~ /n/i) + { + print "Okay .. that was it then ... See ya\n\n"; + return(0); + } + else + { + print "Okay ... let's go then ...\n\n"; + } + + if ($todo == 2) + { + # create the database + my $sth = $dbh->do("create database $db") || $dbh->errstr; + } + + # select the privilege .... + if (($todo == 2) || ($todo == 3)) + { + $priv = "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"; + } + elsif ($todo == 4) + { + $priv = "'Y','Y','Y','Y','N','N','N','Y','Y','Y'"; + } + elsif ($todo == 5) + { + $priv = "'Y','N','N','N','N','N','N','N','N','N'"; + } + else + { + print "Sorry, choice number $todo isn't known inside the program .. See ya\n"; + quit(); + } + + my @hosts = split(/,/,$host); + $user = $dbh->quote($user); + $db = $dbh->quote($db); + if ($pass eq '') + { + $pass = "''"; + } + else + { + $pass = "PASSWORD(". $dbh->quote($pass) . ")"; + } + foreach my $key (@hosts) + { + my $key1 = $dbh->quote($key); + my $sth = $dbh->prepare("select Host,User from user where Host = $key1 and User = $user") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + my @r = $sth->fetchrow_array; + if ($r[0]) + { + print "WARNING WARNING SKIPPING CREATE FOR USER $user AND HOST $key\n"; + print "Reason: entry already exists in the user table.\n"; + } + else + { + $sth = $dbh->prepare("insert into user (Host,User,Password) values($key1,$user,$pass)") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + $sth->finish; + } + $sth = $dbh->prepare("INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References_priv,Index_priv,Alter_priv) VALUES ($key1,$db,$user,$priv)") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + $sth->finish; + } + $dbh->do("flush privileges") || print "Can't load privileges\n"; + print "Everything is inserted and mysql privileges have been reloaded.\n\n"; +} + +### +# ask for a new database name +### +sub newdatabase +{ + my ($answer,$good,$db); + print "\n\nWhich database would you like to add: "; + while () + { + $answer = $_; + $good = 0; + chomp($answer); + if ($answer) + { + my $sth = $dbh->prepare("show databases") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + while (my @r = $sth->fetchrow_array) + { + if ($r[0] eq $answer) + { + print "\n\nSorry, this database name is already in use; try something else: "; + $good = 1; + } + } + } + else + { + print "You must type something ...\nTry again: "; + next; + } + last if ($good == 0); + } + $db = $answer; + print "The new database $db will be created\n"; + return($db); +} + +### +# select a database +### +sub database +{ + my ($answer,$good,$db); + print "\n\nWhich database would you like to select: \n"; + print "You can choose from: \n"; + my $sth = $dbh->prepare("show databases") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + while (my @r = $sth->fetchrow_array) + { + print " - $r[0] \n"; + } + print "Which database will it be (case sensitive): "; + while () + { + $answer = $_; + $good = 0; + chomp($answer); + if ($answer) + { + my $sth = $dbh->prepare("show databases") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + while (my @r = $sth->fetchrow_array) + { + if ($r[0] eq $answer) + { + $good = 1; + $db = $r[0]; + last; + } + } + } + else + { + print "You must type something ...\nTry again: "; + next; + } + if ($good == 1) + { + last; + } + else + { + print "You must select one from the list.\nTry again: "; + next; + } + } + print "The database $db will be used.\n"; + return($db); +} + +### +# ask for a new username +### +sub newuser +{ + my ($answer,$user); + + print "\nWhat username is to be created: "; + while() + { + $answer = $_; + chomp($answer); + if ($answer) + { + $user = $answer; + } + else + { + print "You must type something ...\nTry again: "; + next; + } + last; + } + print "Username = $user\n"; + return($user); +} + +### +# ask for a user which is already in the user table +### +sub user +{ + my ($answer,$user); + + print "\nFor which user do you want to specify a password: "; + while() + { + $answer = $_; + chomp($answer); + if ($answer) + { + my $sth = $dbh->prepare("select User from user where User = '$answer'") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + my @r = $sth->fetchrow_array; + if ($r[0]) + { + $user = $r[0]; + } + else + { + print "Sorry, user $answer isn't known in the user table.\nTry again: "; + next; + } + } + else + { + print "You must type something ...\nTry again: "; + next; + } + last; + } + print "Username = $user\n"; + return($user); +} + +### +# ask for a new password +### +sub newpass +{ + my ($user) = @_; + my ($answer,$good,$pass,$yes); + + print "Would you like to set a password for $user [y/n]: "; + $yes = ; + chomp($yes); + if ($yes =~ /y/) + { + system "stty -echo"; + print "What password do you want to specify for $user: "; + while() + { + $answer = $_; + chomp($answer); + system "stty echo"; + print "\n"; + if ($answer) + { + system "stty -echo"; + print "Type the password again: "; + my $second = ; + chomp($second); + system "stty echo"; + print "\n"; + if ($answer ne $second) + { + print "Passwords aren't the same; we begin from scratch again.\n"; + system "stty -echo"; + print "Password please: "; + next; + } + else + { + $pass = $answer; + } + } + else + { + print "You must type something ...\nTry again: "; + next; + } + last; + } +# print "The password for $user is $pass.\n"; + } + else + { + print "We won't set a password so the user doesn't have to use it\n"; + $pass = ""; + } + return($pass); +} + +### +# ask for new hosts +### +sub newhosts +{ + my ($answer,$good,$host); + + print "We now need to know from what host(s) the user will connect.\n"; + print "Keep in mind that % means 'from any host' ...\n"; + print "The host please: "; + while() + { + $answer = $_; + chomp($answer); + if ($answer) + { + $host .= ",$answer"; + print "Would you like to add another host [yes/no]: "; + my $yes = ; + chomp($yes); + if ($yes =~ /y/i) + { + print "Okay, give us the host please: "; + next; + } + else + { + print "Okay we keep it with this ...\n"; + } + } + else + { + print "You must type something ...\nTry again: "; + next; + } + last; + } + $host =~ s/^,//; + print "The following host(s) will be used: $host.\n"; + return($host); +} + +### +# ask for a host which is already in the user table +### +sub hosts +{ + my ($user) = @_; + my ($answer,$good,$host); + + print "We now need to know which host for $user we have to change.\n"; + print "Choose from the following hosts: \n"; + $user = $dbh->quote($user); + my $sth = $dbh->prepare("select Host,User from user where User = $user") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + while (my @r = $sth->fetchrow_array) + { + print " - $r[0] \n"; + } + print "The host please (case sensitive): "; + while() + { + $answer = $_; + chomp($answer); + if ($answer) + { + $sth = $dbh->prepare("select Host,User from user where Host = '$answer' and User = $user") || die $dbh->errstr; + $sth->execute || die $dbh->errstr; + my @r = $sth->fetchrow_array; + if ($r[0]) + { + $host = $answer; + last; + } + else + { + print "You have to select a host from the list ...\nTry again: "; + next; + } + } + else + { + print "You have to type something ...\nTry again: "; + next; + } + last; + } + print "The following host will be used: $host.\n"; + return($host); +} + +### +# a nice quit (first disconnect and then exit +### +sub quit +{ + $dbh->disconnect; + exit(0); +} + +### +# Read variables password, port and socket from .my.cnf under the client +# or perl groups +### + +sub read_my_cnf +{ + open(TMP,$ENV{'HOME'} . "/.my.cnf") || return 1; + while () + { + if (/^\[(client|perl)\]/i) + { + while ((defined($_=)) && !/^\[\w+\]/) + { + print $_; + if (/^host\s*=\s*(\S+)/i) + { + $opt_host = $1; + } + elsif (/^user\s*=\s*(\S+)/i) + { + $opt_user = $1; + } + elsif (/^password\s*=\s*(\S+)/i) + { + $opt_password = $1; + } + elsif (/^port\s*=\s*(\S+)/i) + { + $opt_port = $1; + } + elsif (/^socket\s*=\s*(\S+)/i) + { + $opt_socket = $1; + } + } + } + } + close(TMP); +} + +### +# the help text +### +sub usage +{ + print < +---------------------------------------------------------------------- + +The permission setter is a little program which can help you add users +or databases or change passwords in MySQL. Keep in mind that we don't +check permissions which already been set in MySQL. So if you can't +connect to MySQL using the permission you just added, take a look at +the permissions which have already been set in MySQL. + +The permission setter first reads your .my.cnf file in your Home +directory if it exists. + +Options for the permission setter: + +--help : print this help message and exit. + +The options shown below are used for making the connection to the MySQL +server. Keep in mind that the permissions for the user specified via +these options must be sufficient to add users / create databases / set +passwords. + +--user : is the username to connect with. +--password : the password of the username. +--host : the host to connect to. +--socket : the socket to connect to. +--port : the port number of the host to connect to. + +If you don't give a password and no password is set in your .my.cnf +file, then the permission setter will ask for a password. + + +EOL +exit(0); +} diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh new file mode 100755 index 00000000000..b94bbb80ca7 --- /dev/null +++ b/scripts/mysql_zap.sh @@ -0,0 +1,156 @@ +#!@PERL@ +# This is a utility for MySQL. It is not needed by any standard part +# of MySQL. + +# Usage: mysql_zap [-signal] [-f] [-t] pattern + +# Configuration parameters. + +$sig = ""; # Default to try all signals +$ans = "y"; +$opt_f= 0; +$opt_t= 0; +$opt_a = ""; + +$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; +$LINUX = $^O eq 'linux'; +$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; + +open(TTYIN, "/dev/tty") || die "can't write /dev/tty: $!"; +select(TTYOUT); +$| = 1; +select(STDOUT); +$SIG{'INT'} = 'cleanup'; + +while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) { + if ($ARGV[0] =~ /(ZERO|HUP|INT|QUIT|ILL|TRAP|ABRT|EMT|FPE|KILL|BUS|SEGV|SYS|PIPE|ALRM|TERM|URG|STOP|TSTP|CONT|CLD|TTIN|TTOU|IO|XCPU|XFSZ|VTALRM|PROF|WINCH|LOST|USR1|USR2)/ || $ARGV[0] =~ /-(\d+)$/) { + $sig = $1; + } elsif ($ARGV[0] eq "-f") { + $opt_f=1; + } elsif ($ARGV[0] eq "-t") { + $opt_t=1; + $ans = "n"; + } + elsif ($ARGV[0] eq "-a") + { + $opt_a = 1; + } + elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I") + { + &usage; + } + else { + print STDERR "$0: illegal argument $ARGV[0] ignored\n"; + } + shift; +} + +&usage if $#ARGV < 0; + +if (!$opt_f) +{ + if ($BSD) { + system "stty cbreak /dev/tty 2>&1"; + } + else { + system "stty", 'cbreak', + system "stty", 'eol', '^A'; + } +} + +open(PS, "$pscmd|") || die "can't run $pscmd: $!"; +$title = ; +print TTYOUT $title; + +# Catch any errors with eval. A bad pattern, for instance. +eval <<'EOF'; +process: while ($cand = ) +{ + chop($cand); + ($user, $pid) = split(' ', $cand); + next if $pid == $$; + $found = !@ARGV; + if ($opt_a) { $found = 1; } + foreach $pat (@ARGV) + { + if ($opt_a) + { + if (! ($cand =~ $pat)) + { + next process; + } + } + else + { + $found = 1 if $cand =~ $pat; + } + } + next if (!$found); + if (! $opt_f && ! $opt_t) + { + print TTYOUT "$cand? "; + read(TTYIN, $ans, 1); + print TTYOUT "\n" if ($ans ne "\n"); + } + else + { + print TTYOUT "$cand\n"; + } + if ($ans =~ /^y/i) { &killpid($sig, $pid); } + if ($ans =~ /^q/i) { last; } +} +EOF + +&cleanup; + + +sub usage { + print </dev/tty 2>&1"; + } + else { + system "stty", 'icanon'; + system "stty", 'eol', '^@'; + } + print "\n"; + exit; +} + +sub killpid { + local($signal,$pid) = @_; + if ($signal) + { + kill $signal,$pid; + } + else + { + print "kill -15\n"; + kill 15, $pid; + for (1..5) { + sleep 2; + return if kill(0, $pid) == 0; + } + print "kill -9\n"; + kill 9, $pid; + for (1..5) { + sleep 2; + return if kill(0, $pid) == 0; + } + print "$pid will not die!\n"; + } +} diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf new file mode 100755 index 00000000000..faf47da5f6c --- /dev/null +++ b/scripts/mysqlaccess.conf @@ -0,0 +1,45 @@ +# ------------------------------------------------------------------------- # +# MySQLaccess version 2.0p2 # +# (c) Yves.Carlier@rug.ac.be, 1997 # +# # +# *** Configuration file *** # +# # +# -Default values read by mysqlaccess during initialisation. # +# This file is looked for in # +# 1) the current directory # +# 2) /etc/ # +# -Options given on the command-line override the values given in here # +# -Given options can't be overruled by empty/blanc options!! # +# ------------------------------------------------------------------------- # + + +# ----------------# +# Global settings # +# --------------- # + #$Param{'host'} = ''; + $Param{'user'} = 'nobody'; + $Param{'db'} = 'test'; + $Param{'password'} = 'foobar'; + $Param{'debug'} = 0; + +# --------------------------# +# Settings for Command-line # +# ------------------------- # +if ($CMD) { + $Param{'superuser'} = 'root'; + $Param{'rhost'} = 'localhost'; + $Param{'spassword'} = ''; + $Param{'brief'} = 1; +} + +# ---------------------# +# Settings for CGI-BIN # +# -------------------- # +if ($CGI) { + $Param{'superuser'} = 'root'; + $Param{'rhost'} = 'localhost'; + $Param{'spassword'} = ''; + $Param{'table'} = 1; +} + +1; #to make require happy diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh new file mode 100755 index 00000000000..dfc88ecad98 --- /dev/null +++ b/scripts/mysqlaccess.sh @@ -0,0 +1,3248 @@ +#!@PERL@ +# **************************** +package MySQLaccess; +#use strict; +use POSIX qw(tmpnam); +use Fcntl; + +BEGIN { + # **************************** + # static information... + $VERSION = "2.05, 17 Feb 2000"; + $0 =~ m%/([^/]+)$%o; + $script = $1; + $script = 'MySQLAccess' unless $script; + $script_conf = "$script.conf"; + $script_log = "~/$script.log"; + + # **************************** + # information on MySQL + $MYSQL = '@bindir@/mysql'; # path to mysql executable + $SERVER = '3.21'; + $MYSQL_OPT = ' --batch --unbuffered'; + $ACCESS_DB = 'mysql'; # name of DB with grant-tables + $ACCESS_H = 'host'; # + $ACCESS_U = 'user'; # + $ACCESS_D = 'db'; # + # Add/Edit privileges + $ACCESS_H_TMP = 'host_tmp'; + $ACCESS_U_TMP = 'user_tmp'; + $ACCESS_D_TMP = 'db_tmp'; + $ACCESS_H_BCK = 'host_backup'; + $ACCESS_U_BCK = 'user_backup'; + $ACCESS_D_BCK = 'db_backup'; + $DIFF = '/usr/bin/diff'; + $TMP_PATH = '/tmp'; #path to writable tmp-directory + $MYSQLDUMP = '@bindir@/mysqldump'; + #path to mysqldump executable + + $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; + #URL of CGI for manipulating + #the temporary grant-tables +} + +END { + unlink $MYSQL_CNF if defined $MYSQL_CNF and not $DEBUG; +} + +$INFO = <<"_INFO"; +-------------------------------------------------------------------------- + mysqlaccess (Version $VERSION) + ~~~~~~~~~~~ + Copyright (C) 1997,1998 Yves.Carlier\@rug.ac.be + University of Ghent (RUG), Belgium + Administratieve Informatieverwerking (AIV) + + report the access-privileges for a USER from a HOST to a DB + + Many thanks go to and + for their suggestions, debugging and patches. + + use `$script -?' to get more information on available options. + + From version 2.0x, $script can also be used through a WEB-browser + if it is ran as a CGI-script. (See the release-notes) + +-------------------------------------------------------------------------- +_INFO + +$OPTIONS = <<_OPTIONS; + +Usage: $script [host [user [db]]] OPTIONS + + -?, --help display this helpscreen and exit + -v, --version print information on the program `$script' + + -u, --user=# username for logging in to the db + -p, --password=# validate password for user + -h, --host=# name or IP-number of the host + -d, --db=# name of the database + + -U, --superuser=# connect as superuser + -P, --spassword=# password for superuser + -H, --rhost=# remote MySQL-server to connect to + --old_server connect to old MySQL-server (before v3.21) which + does not yet know how to handle full where clauses. + + -b, --brief single-line tabular report + -t, --table report in table-format + + --relnotes print release-notes + --plan print suggestions/ideas for future releases + --howto some examples of how to run `$script' + --debug=N enter debuglevel N (0..3) + + --copy reload temporary grant-tables from original ones + --preview show differences in privileges after making + changes in (temporary) grant-tables + --commit copy grant-rules from temporary tables to grant-tables + (!don't forget to do an mysqladmin reload) + --rollback undo the last changes to the grant-tables. + + Note: + + At least the user and the db must be given (even with wildcards) + + If no host is given, `localhost' is assumed + + Wilcards (*,?,%,_) are allowed for host, user and db, but be sure + to escape them from your shell!! (ie type \\* or '*') +_OPTIONS + +$RELEASE = <<'_RELEASE'; + +Release Notes: +------------- + 0.1-beta1: internal + - first trial. + + 0.1-beta2: (1997-02-27) + - complete rewrite of the granting-rules, based on the documentation + found in de FAQ. + - IP-number and name for a host are equiv. + + 0.1-beta3: (1997-03-10) + - more information + - 'localhost' and the name/ip of the local machine are now equiv. + + 0.1-beta4: (1997-03-11) + - inform the user if he has not enough priv. to read the mysql db + + 1.0-beta1: (1997-03-12) + suggestions by Monty: + - connect as superuser with superpassword. + - mysqlaccess could also notice if all tables are empty. This means + that all user have full access! + - It would be nice if one could optionally start mysqlaccess without + any options just the arguments 'user db' or 'host user db', where + host is 'localhost' if one uses only two arguments. + + 1.0-beta2: (1997-03-14) + - bugfix: translation to reg.expr of \_ and \%. + - bugfix: error in matching regular expression and string given + by user which resulted in + 'test_123' being matched with 'test' + + 1.0-beta3: (1997-03-14) + - bugfix: the user-field should not be treated as a sql-regexpr, + but as a plain string. + - bugfix: the host-table should not be used if the host isn't empty in db + or if the host isn't emty in user + (Monty) + + 1.0-beta4: (1997-03-14) + - bugfix: in an expression "$i = $j or $k", the '=' binds tighter than the or + which results in problems... + (by Monty) + - running mysqlaccess with "perl -w" gives less warnings... ;-) + + 1.0-beta5: (1997-04-04) + - bugfix: The table sorting was only being applied to the "user" table; all + the tables need to be sorted. Rewrote the sort algorithm, and + the table walk algorithm (no temp file anymore), and various + other cleanups. I believe the access calculation is 100% correct. + (by Paul D. Smith ) + - Allow the debug level to be set on the cmd line with --debug=N. + (by Paul D. Smith ) + - More -w cleanups; should be totally -w-clean. + (by Paul D. Smith ) + + 1.1-beta1: (1997-04-xx) + 1.1-beta2: (1997-04-11) + - new options: + --all_users : report access-rights for all possible users + --all_dbs : report access-rights for all possible dbs + --all_hosts : report access-rights for all possible hosts + --brief : as brief as possible, don't mention notes,warnings and rules + --password : validate password for user + - layout: long messages are wrapped on the report. + - functionality: + more descriptive notes and warnings + wildcards (*,?) are allowed in the user,host and db options + setting xxxx=* is equiv to using option --all_xxxx + note: make sure you escape your wildcards, so they don't get + interpreted by the shell. use \* or '*' + - bugfix: Fieldnames which should be skipped on the output can now have + a first capital letter. + - bugfix: any option with a '.' (eg ip-number) was interpreted as + a wildcard-expression. + - bugfix: When no entry was found in the db-table, the default accessrights are + N, instead of the faulty Y in a previous version. + + 1.1-beta-3 : (1997-04-xx) + 1.1-beta-4 : (1997-04-xx) + 1.1-beta-5 : (1997-04-xx) + 1.1 : (1997-04-28) + - new options: + --rhost : name of mysql-server to connect to + --plan : print suggestions/ideas for future releases + --relnotes : display release-notes + --howto : display examples on how to use mysqlaccess + --brief : single-line tabular output + - functionality/bugfix: + * removed options --all_users,--all_dbs,--all_hosts, which + were redundant with the wildcard-expressions for the corresponding + options. They made the processing of the commandline too painful + and confusing ;-) + (suggested by psmith) + * redefined the option --brief, which now gives a single-line + tabular output + * Now we check if the right version of the mysql-client is used, + since we might use an option not yet implemented in an + older version (--unbuffered, since 3.0.18) + Also the error-messages the mysql-client reports are + better interpreted ;-) + * Wildcards can now be given following the SQL-expression + (%,_) and the Regular-expression (*,?) syntax. + - speed: we now open a bidirectional pipe to the mysql-client, and keep + it open throughout the whole run. Queries are written to, + and the answers read from the pipe. + (suggested by monty) + - bugfixes: + * the Rules were not properly reset over iterations + * when in different tables the field-names were not identical, + eg. Select_priv and select_priv, they were considered as + definitions of 2 different access-rights. + * the IP-number of a host with a name containing wildcards should + not be searched for in Name2IP and IP2Name. + * various other small things, pointed out by and + + 1.2 : (1997-05-13) + - bugfix: + * Fixed bug in acl with anonymous user: Now if one gets accepted by the + user table as a empty user name, the user name is set to '' when + checking against the 'db' and 'host' tables. (Bug fixed in MySQL3.20.19) + + 1.2-1 : (1997-xx-xx) + - bugfix: + * hashes should be initialized with () instead of {} + * "my" variable $name masks earlier declaration in same scope, + using perl 5.004 + + 1.2-2 : (1997-06-10) + + 2.0p1-3 : (1997-10-xx) + - new + * packages + * log-file for debug-output : /tmp/mysqlaccess.log + * default values are read from a configuration file $script.conf + first this file is looked for in the current directory; if not + found it is looked for in /etc/ + Note that when default-values are given, these can't get overriden + by empty (blanc) values! + * CGI-BIN version with HTML and forms interface. Simply place the + script in an ScriptAliased directory, make the configuration file + available in the that directory or in /etc, and point your browser + to the right URL. + * copy the grant-rules to temporary tables, where you are safe to + play with them. + * preview changes in privileges after changing grant-rules, + before taking them into production + * copy the new grant-rules from the temporary tables back to the + grant-tables. + * Undo all changes made in the grant-tables (1-level undo). + -new options: + * --table : as opposite of the --brief option. + * --copy : (re)load temporary grant-tables from original ones. + * --preview : preview changes in privileges after changing + some or more entries in the grant-tables. + * --commit : copy grant-rules from temporary tables to grant-tables + (!don't forget to do an mysqladmin reload) + * --rollback: undo the last changes to the grant-tables. + + - bugfix: + * if the table db is empty, mysqlaccess freezed + (by X Zhu ) + + 2.0 : (1997-10-09) + - fixed some "-w" warnings. + - complain when certain programs and paths can't be found. + + 2.01 : (1997-12-12) + - bugfix: + * rules for db-table where not calculated and reported correctly. + 2.02 : (1998-01-xx) + - bugfix: + * Privileges of the user-table were not AND-ed properly with the + other privileges. (reported by monty) + - new option: + * --old_server: mysqlaccess will now use a full where clause when + retrieving information from the MySQL-server. If + you are connecting to an old server (before v3.21) + use the option --old_server. + 2.03 : (1998-02-27) + - bugfix: + * in Host::MatchTemplate: incorrect match if host-field was left empty. + + 2.04-alpha1 : (2000-02-11) + Closes vulnerability due to former implementation requiring passwords + to be passed on the command line. + - functionality + Option values for --password -p -spassword -P may now be omitted from + command line, in which case the values will be prompted for. + (fix supplied by Steve Harvey ) + + 2.05: (2000-02-17) Monty + Moved the log file from /tmp to ~ + +_RELEASE + +$TODO = <<_TODO; + + Plans: + ----- + -a full where clause is use now. How can we handle older servers? + -add some more functionality for DNS. + -select the warnings more carefuly. + >> I think that the warnings should either be enhanced to _really_ + >> understand and report real problems accurately, or restricted to + >> only printing things that it knows with 100% certainty. > Why do I have both '%' and 'any_other_host' in there? Isn't that + >> the same thing? I think it's because I have an actual host '%' in + >> one of my tables. Probably the script should catch that and not + >> duplicate output. + +_TODO + +# From the FAQ: the Grant-algorithm +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# The host table is mainly to maintain a list of "secure" servers. +# At TCX hosts contain a list of all machines on local network. These are granted +# all privileges. +# Technically the user grant is calculated by: +# +# 1.First sort all entries by host by putting host without wildcards first, +# after this host with wildcards and entries with host = ". +# Under each host sort user by the same criterias. +# 2.Get grant for user from the "db" table. +# 3.If hostname is "empty" for the found entry, AND the privileges with +# the privileges for the host in "host" table. +# (Remove all which is not "Y" in both) +# 4.OR (add) the privileges for the user from the "user" table. +# (add all privileges which is "Y" in "user") +# +# When matching, use the first found match. +# +# ----------------------------------------------------------------------------------- + +$HOWTO = <<_HOWTO; + +Examples of how to call $script: +~~~~~~~~ +1)Calling $script with 2 arguments: + + \$ $script root mysql + ->report rights of user root logged on at the local host in db mysql + + Access-rights + for USER 'root', from HOST 'localhost', to DB 'mysql' + +-----------------+---+ +-----------------+---+ + | select_priv | Y | | drop_priv | Y | + | insert_priv | Y | | reload_priv | Y | + | update_priv | Y | | shutdown_priv | Y | + | delete_priv | Y | | process_priv | Y | + | create_priv | Y | | file_priv | Y | + +-----------------+---+ +-----------------+---+ + BEWARE: Everybody can access your DB as user 'root' + : WITHOUT supplying a password. Be very careful about it!! + + The following rules are used: + db : 'No matching rule' + host : 'Not processed: host-field is not empty in db-table.' + user : 'localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y' + +2)Calling $script with 3 arguments: + + \$ $script foo.bar nobody Foo + ->report rights of user root logged in at machine foobar to db Foo + + Access-rights + for USER 'nobody', from HOST 'foo.bar', to DB 'Foo' + +-----------------+---+ +-----------------+---+ + | select_priv | Y | | drop_priv | N | + | insert_priv | Y | | reload_priv | N | + | update_priv | Y | | shutdown_priv | N | + | delete_priv | Y | | process_priv | N | + | create_priv | N | | file_priv | N | + +-----------------+---+ +-----------------+---+ + BEWARE: Everybody can access your DB as user 'nobody' + : WITHOUT supplying a password. Be very careful about it!! + + The following rules are used: + db : 'foo.bar','Foo','nobody','Y','Y','Y','N','N','N' + host : 'Not processed: host-field is not empty in db-table.' + user : 'foo.bar','nobody','','N','N','N','Y','N','N','N','N','N','N' + +3)Using wildcards: + + \$ $script \\* nobody Foo --brief + ->report access-rights of user nobody from all machines to db Foo, + and use a matrix-report. + + Sel Ins Upd Del Crea Drop Reld Shut Proc File Host,User,DB + ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -------------------- + Y Y Y Y N N N N N N localhost,nobody,Foo + N N N N N N N N N N %,nobody,Foo + N N N N N N N N N N any_other_host,nobody,Foo + +_HOWTO + + +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # +# START OF THE PROGRAM # +# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # + +use Getopt::Long; +use Sys::Hostname; +use IPC::Open3; +#use CGI; #moved to use of CGI by monty + + +# **************************** +# debugging flag +# can be set to 0,1,2,3 +# a higher value gives more info +# ! this can also be set on the command-line + $DEBUG = 0; + +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>8 +# Normaly nothing should be changed beneeth this line + + +# **************************** +# no caching on STDOUT + $|=1; + + $MYSQL_CNF = POSIX::tmpnam(); + %MYSQL_CNF = (client => { }, + mysql => { }, + mysqldump => { }, + ); + + + +$NEW_USER = 'ANY_NEW_USER'; +$NEW_DB = 'ANY_NEW_DB' ; + + +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # +# mysqlaccess: # +# ~~~~~~~~~~~ # +# Lets get to it, # +# and start the program by processing the parameters # +# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # + +($CMD,$CGI) = GetMode(); + +# **************************** +# the copyright message should +# always be printed (once) +MySQLaccess::Report::Print_Header(); + +# ***************************** +# Read configuration-file + MySQLaccess::Debug::Print(1, "Reading configuration file..."); + if (-f "./$script_conf") { + require "./$script_conf"; + } + elsif (-f "/etc/$script_conf") { + require "/etc/$script_conf"; + } + +# **************************** +# Read in all parameters +if ($MySQLaccess::CMD) { #command-line version + # ---------------------------- + # Get options from commandline + $Getopt::Long::ignorecase=0; #case sensitive options + if ( grep(/\-\?/,@ARGV) ) { MySQLaccess::Report::Print_Usage(); exit 0; } + GetOptions("help" => \$Param{'help'} + ,"host|h=s" => \$Param{'host'} + ,"user|u=s" => \$Param{'user'} + ,"password|p:s" => \$Param{'password'} + ,"db|d=s" => \$Param{'db'} + ,"superuser|U=s" => \$Param{'superuser'} + ,"spassword|P:s" => \$Param{'spassword'} + ,"rhost|H=s" => \$Param{'rhost'} + ,"old_server" => \$Param{'old_server'} + ,"debug=i" => \$Param{'DEBUG'} + ,"brief|b" => \$Param{'brief'} + ,"table|t" => \$Param{'table'} + ,"relnotes" => \$Param{'relnotes'} + ,"plan" => \$Param{'plan'} + ,"howto" => \$Param{'howto'} + ,"version|v" => \$Param{'version'} + ,"preview" => \$Param{'preview'} + ,"copy" => \$Param{'copy'} + ,"commit" => \$Param{'commit'} + ,'rollback' => \$Param{'rollback'} + ); + + # ----------------------------- + # set DEBUG + $DEBUG = $Param{'DEBUG'} if ($Param{'DEBUG'}>=$DEBUG); + + # ----------------------------- + # check for things which aren't + # declared as options: + # 2 arguments: (user,db) -> ('localhost','user','db') + if ($#ARGV == 1) { + MySQLaccess::Debug::Print(2,"$script called with 2 arguments:"); + $Param{'host'} = $Param{'host'} || 'localhost'; + $Param{'user'} = $ARGV[0] || $Param{'user'}; + $Param{'db'} = $ARGV[1] || $Param{'db'}; + } + # 3 arguments: (host,user,db) + if ($#ARGV == 2) { + MySQLaccess::Debug::Print(2,"$script called with 3 arguments:"); + $Param{'host'} = $ARGV[0] || $Param{'host'}; + $Param{'user'} = $ARGV[1] || $Param{'user'}; + $Param{'db'} = $ARGV[2] || $Param{'db'}; + } + + # ------------------------------------- + # prompt for user password if requested + if ( defined($Param{'password'}) && length($Param{'password'}) == 0 ) { + $Param{'password'} = PromptPass( + "Password for MySQL user $Param{'user'}: "); + } +} +if ($MySQLaccess::CGI) { #CGI-version + use CGI; + $Q = new CGI; + $Param{'help'} = $Q->param('help') ; + $Param{'host'} = $Q->param('host') || $Q->param('h') || $Param{'host'}; + $Param{'user'} = $Q->param('user') || $Q->param('u') || $Param{'user'}; + $Param{'db'} = $Q->param('db') || $Q->param('d') || $Param{'db'}; + $Param{'password'} = $Q->param('password') || $Q->param('p') || $Param{'password'}; + $Param{'superuser'} = $Q->param('superuser') || $Q->param('U') || $Param{'superuser'}; + $Param{'spassword'} = $Q->param('spassword') || $Q->param('P') || $Param{'spassword'}; + $Param{'rhost'} = $Q->param('rhost') || $Q->param('H') || $Param{'rhost'}; + $Param{'old_server'}= $Q->param('old_server')|| $Param{'old_server'}; + $Param{'debug'} = $Q->param('debug') || $Param{'debug'}; + $Param{'brief'} = $Q->param('brief') || $Param{'brief'}; + $Param{'table'} = $Q->param('table') || $Param{'table'}; + $Param{'relnotes'} = $Q->param('relnotes'); + $Param{'plan'} = $Q->param('plan'); + $Param{'howto'} = $Q->param('howto'); + $Param{'version'} = $Q->param('version') ? $Q->param('version') : $Q->param('v'); + $Param{'edit'} = $Q->param('edit'); + $Param{'preview'} = $Q->param('preview'); + $Param{'copy'} = $Q->param('copy'); + $Param{'commit'} = $Q->param('commit'); + $Param{'rollback'} = $Q->param('rollback'); + # ----------------------------- + # set DEBUG + $DEBUG = $Q->param('debug') if ($Q->param('debug')>=$DEBUG); +} + +# ---------------------- +# brief and table-format +# exclude each-other +# table-format is prefered +if (defined($Param{'table'})) { undef($Param{'brief'}); } +if (defined($Param{'preview'}) or + defined($Param{'copy'}) or + defined($Param{'commit'}) or + defined($Param{'rollback'}) ) { $Param{'edit'}='on'; } + + +# ---------------------- +# if no host is given +# assume we mean 'localhost' +if (!defined($Param{'host'})) { $Param{'host'}='localhost'; } + +# ---------------------- +# perform some checks +# -> eliminate 'broken pipe' error +push(@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); +push(@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); +push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); +push(@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); +push(@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); +if (@MySQLaccess::Grant::Error) { + MySQLaccess::Report::Print_Error_Messages() ; + exit 0; +} + +#----------------------- +# get info/help if necc. +$print_usage=1; +if ( defined($Param{'version'}) ) { + MySQLaccess::Report::Print_Version(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; +# exit 0; +} +if ( defined($Param{'relnotes'}) ) { + MySQLaccess::Report::Print_Relnotes(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; +# exit 0; +} +if ( defined($Param{'plan'}) ) { + MySQLaccess::Report::Print_Plans(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; +# exit 0; +} +if ( defined($Param{'howto'}) ) { + MySQLaccess::Report::Print_HowTo(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; +# exit 0; +} + +# ----------------------------- +# generate a help-screen in CMD-mode +# or a blanc form in CGI-mode +if ( defined($Param{'help'}) + or !defined($Param{'user'}) + or !defined($Param{'host'}) + or !defined($Param{'db'}) + ) { + push(@MySQLaccess::Grant::Error,'user_required') unless defined($Param{'user'}); + push(@MySQLaccess::Grant::Error,'db_required') unless defined($Param{'db'}); + push(@MySQLaccess::Grant::Error,'host_required') unless defined($Param{'host'}); + MySQLaccess::Report::Print_Usage() if $print_usage; + exit 0; +} + + +# ---------------------------- +# get hostname and local-ip +# for localhost +$localhost = MySQLaccess::Host::LocalHost(); +$local_ip = MySQLaccess::Host::Name2IP($localhost); +$MySQLaccess::Host::localhost = MySQLaccess::Host::LocalHost(); +$MySQLaccess::Host::local_ip = MySQLaccess::Host::Name2IP($localhost); +MySQLaccess::Debug::Print(3, "localhost name=$localhost, ip=$local_ip"); + +#----------------------------------- +# version of MySQL-server to connect +# to determine use of full where clause +$MySQLaccess::Host::SERVER = $Param{'old_server'} ? '3.20' : $SERVER; + +#--------------------------------- +# create the config file for mysql and mysqldump +# to avoid passing authentication info on the command line +# +MergeConfigFiles(); +die "Unsafe config file found: $unsafeConfig\n" if $unsafeConfig; +if (defined($Param{'superuser'})) { + $MYSQL_CNF{'mysql'}{'user'} = $Param{'superuser'}; + $MYSQL_CNF{'mysqldump'}{'user'} = $Param{'superuser'}; +} +if (defined($Param{'spassword'})) { + if ( $CMD && length($Param{'spassword'}) == 0 ) { + $Param{'spassword'} = + PromptPass("Password for MySQL superuser $Param{'superuser'}: "); + } + if ( length($Param{'spassword'}) > 0 ) { + $MYSQL_CNF{'mysql'}{'password'} = $Param{'spassword'}; + $MYSQL_CNF{'mysqldump'}{'password'} = $Param{'spassword'}; + } +} +WriteTempConfigFile(); + +#--------------------------------- +# Inform user if he has not enough +# privileges to read the access-db +if ( $nerror=MySQLaccess::DB::OpenConnection() ) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; +} + +# ----------------------- +# Read MySQL ACL-files +if ($nerror=MySQLaccess::Grant::ReadTables()) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; +}; +if ($Param{'edit'} and $nerror=MySQLaccess::Grant::ReadTables('tmp')) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; +} + +#--------------------------------- +# reload temporay grant-tables +# with data from original ones +if ( defined($Param{'copy'}) ) { + $nerror=MySQLaccess::DB::LoadTmpTables(); + if ($nerror) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; + } + my $msg = "The grant-rules are copied from the grant-tables to\n" + . "the temporary tables."; + MySQLaccess::Report::Print_Message([$msg]); +# MySQLaccess::Report::Print_Footer(); +# MySQLaccess::DB::CloseConnection(); +# exit 0; +} + + +#--------------------------------- +# preview result of changes in the +# grant-tables +if ( defined($Param{'preview'}) ) { + $aref=MySQLaccess::Grant::Diff_Privileges(); + MySQLaccess::Report::Print_Diff_ACL($aref); +# MySQLaccess::Report::Print_Footer(); +# MySQLaccess::DB::CloseConnection(); +# exit 0; +} + + +#--------------------------------- +# reload grant-tables +# with data from temporary tables +if ( defined($Param{'commit'}) ) { + if ($nerror = MySQLaccess::DB::CommitGrantTables()) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; + } + my $msg = "The grant-rules have been copied from the temporary tables\n" + . "to the grant-tables."; + my $msg1= "Don't forget to do an 'mysqladmin reload' before these\n" + . "changes take effect."; + my $msg2= "A backup-version of your original grant-rules are saved in the\n" + . "backup-tables, so you can always perform a 1-level rollback."; + MySQLaccess::Report::Print_Message([$msg,$msg1,$msg2]); +# MySQLaccess::Report::Print_Footer(); +# MySQLaccess::DB::CloseConnection(); +# exit 0; +} + +#--------------------------------- +# restore previous grant-rules +# with data from backup tables +if ( defined($Param{'rollback'}) ) { + if ($nerror = MySQLaccess::DB::RollbackGrantTables()) { + MySQLaccess::Report::Print_Error_Access($nerror); + exit 0; + } + my $msg = "The old grant-rules have been copied back from the backup tables\n" + . "to the grant-tables."; + my $msg1= "Don't forget to do an 'mysqladmin reload' before these\n" + . "changes take effect."; + MySQLaccess::Report::Print_Message([$msg,$msg1]); +# MySQLaccess::Report::Print_Footer(); +# MySQLaccess::DB::CloseConnection(); +# exit 0; +} +#---------------------------------- +# show edit-taskbar +if ( defined($Param{'edit'})) { + if ($MySQLaccess::CGI ) { + MySQLaccess::Report::Print_Edit(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; + } + else { + MySQLaccess::Report::Print_Edit(); + $print_usage=0; + MySQLaccess::Report::Print_Footer(); + MySQLaccess::DB::CloseConnection(); + exit 0; + } +} + + +# ----------------------------- +# Build list of users,dbs,hosts +# to process... +@all_dbs = @{MySQLaccess::DB::Get_All_dbs($Param{'db'})}; +@all_users = @{MySQLaccess::DB::Get_All_users($Param{'user'})}; +@all_hosts = @{MySQLaccess::DB::Get_All_hosts($Param{'host'})}; +#if EDIT-mode +#@all_dbs_tmp = @{MySQLaccess::DB::Get_All_dbs($Param{'db'},'tmp')}; +#@all_users_tmp = @{MySQLaccess::DB::Get_All_users($Param{'user'},'tmp')}; +#@all_hosts_tmp = @{MySQLaccess::DB::Get_All_hosts($Param{'host'},'tmp')}; + +# ----------------------------- +# Report access-rights for each +# tuple (host,user,db) +#$headers=0; +my %Access = (); +foreach $host (@all_hosts) { + foreach $user (@all_users) { + foreach $db (@all_dbs) { + MySQLaccess::Grant::Initialize(); + %Access = MySQLaccess::Grant::Get_Access_Rights($host,$user,$db); + MySQLaccess::Report::Print_Access_rights($host,$user,$db,\%Access); + } + } +} + +# ----------------------------- +# End script +MySQLaccess::Report::Print_Footer(); +MySQLaccess::DB::CloseConnection(); +exit 0; + +############################################################# +# FUNCTIONS # +############### +sub GetMode { + my $cmd=0; + my $cgi=0; + if (defined($ENV{'HTTP_HOST'})) { $cmd=0; $cgi=1; } + else { $cmd=1; $cgi=0; } + return ($cmd,$cgi); +} + +# ================================ +# sub PromptPass +# prompt tty for a password +# ================================ +sub PromptPass { + my ($prompt) = @_; + my $password; + $ENV{PATH} = "/bin:/usr/bin"; + $ENV{IFS} = " \t\n"; + $ENV{SHELL} = "/bin/sh"; + system "stty -echo"; + print $prompt; + chomp($password = ); + print "\n"; + system "stty echo"; + $password; +} + +# ================================= +# sub CheckUnsafeFile +# tell if a config file containing a password is unsafe +# ================================= +sub CheckUnsafeFile { + my ($fname) = @_; + my ($dev, $ino, $mode, $nlink, + $uid, $gid, $rdev, $size, + $atime, $mtime, $ctime, $blksize, $blocks) = stat($fname); + + if ( $uid != $< ) { # unsafe if owned by other than current user + return 1; + } + if ( $mode & 066 ) { # unsafe if accessible by other + return 1; + } + $fname =~ s#/[^/]+$##; + if ( (length $fname) > 0 ) { + return CheckUnsafeDir($fname); + } + return 0; +} + +# ================================= +# sub CheckUnsafeDir +# tell if a directory is unsafe +# ================================= +sub CheckUnsafeDir { + my ($fname) = @_; + my ($dev, $ino, $mode, $nlink, + $uid, $gid, $rdev, $size, + $atime, $mtime, $ctime, $blksize, $blocks) = stat($fname); + + # not owned by me or root + if ( ($uid != $<) && ($uid != 0) ) { + return 1; + } + if ( $mode & 022 ) { # unsafe if writable by other + return 1 unless $mode & 01000; # but sticky bit ok + } + $fname =~ s#/[^/]+$##; + if ( (length $fname) > 0 ) { + return CheckUnsafeDir($fname); + } + return 0; +} + +# ================================= +# sub MergeConfigFile +# merge data from .cnf file +# ================================= +sub MergeConfigFile { + my ($fname) = @_; + my ($group, $item, $value); + if ( open CNF, $fname ) { + while () { + s/^\s+//; + next if /^[#;]/; + if ( /\[\s*(\w+)\s*]/ ) { + $group = $1; + $group =~ tr/A-Z/a-z/; + if ( !exists $MYSQL_CNF{$group} ) { + undef $group; + } + } elsif ( defined $group ) { + ($item, $value) = /((?:\w|-)+)\s*=\s*(\S+)/; + # don't unquote backslashes as we just write it back out + if ( defined $item ) { + if ( $item =~ /^password$/ ) { + if ( CheckUnsafeFile($fname) ) { + $unsafeConfig = $fname; + } + } + if ( $group eq 'client' ) { + $MYSQL_CNF{'mysql'}{$item} = $value; + $MYSQL_CNF{'mysqldump'}{$item} = $value; + } else { + $MYSQL_CNF{$group}{$item} = $value; + } + } + } + } + close(CNF); + } +} + +# ================================= +# sub MergeConfigFiles +# merge options from config files +# NOTE: really should do two separate merges for each +# client to exactly duplicate order of resulting argument lists +# ================================= +sub MergeConfigFiles { + my ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid $<; + MergeConfigFile("/etc/my.cnf"); + MergeConfigFile("$dir/.my.cnf"); +} + +# ================================= +# sub WriteTempConfigFile +# write +# ================================= +sub WriteTempConfigFile { + sysopen CNFFILE, $MYSQL_CNF, O_RDWR|O_CREAT|O_EXCL, 0700 + or die "sysopen $MYSQL_CNF: $!"; + + # groups may be in any order, generic groups such as [client] assumed + # here to be empty + foreach $group (keys %MYSQL_CNF) { + print CNFFILE "[$group]\n"; + foreach $item (keys %{$MYSQL_CNF{$group}}) { + if ( defined $MYSQL_CNF{$group}{$item} ) { + print CNFFILE "$item=$MYSQL_CNF{$group}{$item}\n"; + } else { + print CNFFILE "$item\n"; + } + } + print CNFFILE "\n"; + } + close(CNFFILE); +} + +###################################################################### +package MySQLaccess::DB; +########### +BEGIN { + $DEBUG = 2; + $DEBUG = $MySQLaccess::DEBUG unless ($DEBUG); + # Error-messages from the MySQL client + %ACCESS_ERR= ('Access_denied' => 'Access denied' + ,'Dbaccess_denied' => 'Access to database denied' + ,'Unrecognized_option' => 'unrecognized option' + ,'Unknown_table' => "Can't find file:" + ,'unknown_error' => '^ERROR:' + ); +} +# ###################################### +# Connecting to the MYSQL DB +# ====================================== +# sub OpenConnection +# Open an connection to the mysql-db +# questions to MYSQL_Q +# answers from MYSQL_A +# ====================================== +sub OpenConnection { + my $pid; + MySQLaccess::Debug::Print(2,"OpenConnection:"); + + # check path to mysql-client executable + if (! -f $MySQLaccess::MYSQL) { + if ($MySQLaccess::CMD) { die "Could not find MySQL-client '$MySQLaccess::MYSQL'"; } + if ($MySQLaccess::CGI) { + print "
\n\n"; + print "ERROR: Could not find MySQL-client '$MySQLaccess::MYSQL'"; + print "
\n\n"; + exit 0; + } + } + + # path to mysql executable + my $connect = "$MySQLaccess::MYSQL --defaults-file=$MySQLaccess::MYSQL_CNF"; + $connect .= " $MySQLaccess::MYSQL_OPT"; + # superuser, spassword transmitted via defaults-file + if (defined($MySQLaccess::Param{'rhost'})) { $connect .= " --host=$MySQLaccess::Param{'rhost'}"; } + # other options?? + + # grant-database + $connect .= " $MySQLaccess::ACCESS_DB"; + + # open connection (not using /bin/sh -c) + MySQLaccess::Debug::Print(2,"Connecting to: $connect"); + $pid=IPC::Open3::open3(\*MYSQL_Q,\*MYSQL_A,"",split /\s+/,$connect); + MySQLaccess::Debug::Print(2,"PID of open pipe: $pid"); + + # check connection + print MYSQL_Q "select 'ok';\n"; + $answer = ; #answer from mysql + MySQLaccess::Debug::Print(2,"Answer: $answer\n"); + foreach $nerror (sort(keys(%ACCESS_ERR))) { + MySQLaccess::Debug::Print(3,"check answer for error $ACCESS_ERR{$nerror}"); + if (grep(/$ACCESS_ERR{$nerror}/i,$answer)) { + MySQLaccess::Debug::Print(2,"Answer contain error [$nerror]"); + return $nerror; + } + } + +if (0) { + # check server-version + print MYSQL_Q "select 'ok';\n"; + $answer = ; #answer from mysql + MySQLaccess::Debug::Print(2,"Answer: $answer\n"); + foreach $nerror (sort(keys(%ACCESS_ERR))) { + MySQLaccess::Debug::Print(3,"check answer for error $ACCESS_ERR{$nerror}"); + if (grep(/$ACCESS_ERR{$nerror}/i,$answer)) { + MySQLaccess::Debug::Print(2,"Answer contain error [$nerror]"); + return $nerror; + } + } +} + + my $skip=; + return 0; +} + +# ====================================== +# sub CloseConnection +# Close the connection to the mysql-db +# ====================================== +sub CloseConnection { + close MYSQL_Q; + close MYSQL_A; +} + +# =========================================================== +# sub CreateTable($table) +# Create temporary/backup table +# =========================================================== +sub CreateTable { + my $pid; + my ($table,$force) = @_; + my %tables = ( $MySQLaccess::ACCESS_U_TMP => $MySQLaccess::ACCESS_U, + $MySQLaccess::ACCESS_H_TMP => $MySQLaccess::ACCESS_H, + $MySQLaccess::ACCESS_D_TMP => $MySQLaccess::ACCESS_D, + $MySQLaccess::ACCESS_U_BCK => $MySQLaccess::ACCESS_U, + $MySQLaccess::ACCESS_H_BCK => $MySQLaccess::ACCESS_H, + $MySQLaccess::ACCESS_D_BCK => $MySQLaccess::ACCESS_D, + $MySQLaccess::ACCESS_U => $MySQLaccess::ACCESS_U_BCK, + $MySQLaccess::ACCESS_H => $MySQLaccess::ACCESS_H_BCK, + $MySQLaccess::ACCESS_D => $MySQLaccess::ACCESS_D_BCK, + ); + my $tbl; + my $query=""; + my $delim; + my $skip; + my $create; + my @known_tables=(); + +# print STDERR "CreateTable($table)\n"; + MySQLaccess::Debug::Print(1,"CreateTable($table):"); + + ## error-handling + return 'Unknown_table' unless defined($tables{$table}); + + ## build list of known/existing tables; + ## if 'force' existing table is dropped first + if (defined($force) and $force) { + @known_tables = Show_Tables(); + if (grep(/^$table$/,@known_tables)) { + $query = "DROP TABLE $table;"; + } + } + + ## path to mysqldump executable + my $connect = $MySQLaccess::MYSQLDUMP; + $connect .= " --defaults-file=$MySQLaccess::MYSQL_CNF --no-data"; + # superuser, spassword transmitted via defaults-file + if (defined($MySQLaccess::Param{'rhost'})) { $connect .= " --host=$MySQLaccess::Param{'rhost'}"; } + $connect .= " $MySQLaccess::ACCESS_DB"; + $connect .= " $tables{$table}"; + + + ## get creation-data for original table + $create = ''; + my $mysqldump = $connect; + $mysqldump =~ s/ \$TABLE / $tbl /; + + # open connection (not using /bin/sh -c) + MySQLaccess::Debug::Print(2,"Connecting to: $connect"); + $pid=IPC::Open3::open3(\*DONTCARE,\*CREATE,"",split /\s+/,$mysqldump); + MySQLaccess::Debug::Print(2,"PID of open pipe: $pid"); + #open(CREATE,"$mysqldump"); + @create = ; + $create = "@create"; + foreach $nerror (sort(keys(%ACCESS_ERR))) { + MySQLaccess::Debug::Print(3,"check answer for error $ACCESS_ERR{$nerror}"); + if (grep(/$ACCESS_ERR{$nerror}/i,$create)) { + MySQLaccess::Debug::Print(2,"Answer contain error [$nerror]"); + return $nerror; + } + } + close(CREATE); + close(DONTCARE); + + ## manipulate result for creation-data for temporary table + $create =~ s/CREATE TABLE $tables{$table} \(/CREATE TABLE $table \(/; + + ## recreate temporary table + $query .= "$create\n"; + $query .= "select 'ok';"; + + ## execute query + print MYSQL_Q "$query\n"; +# print STDERR $query; + + $answer = ; #answer from mysql +# print STDERR "A>",$answer; + MySQLaccess::Debug::Print(2,"Answer: $answer\n"); + foreach $nerror (sort(keys(%ACCESS_ERR))) { +# print STDERR "->$nerror?"; + MySQLaccess::Debug::Print(3,"check answer for error $ACCESS_ERR{$nerror}"); + if (grep(/$ACCESS_ERR{$nerror}/i,$answer)) { +# print STDERR "Yes!"; + MySQLaccess::Debug::Print(2,"Answer contain error [$nerror]"); + return $nerror; + } + } + + $delim = ; # read header + if ($delim ne "ok\n") { + while (($line=) ne "ok\n") + { MySQLaccess::Debug::Print(3," A> $line"); } + $skip = ; # skip result 'ok' + } +# print STDERR "CreateTable done\n"; + return 0; +} + + +# =========================================================== +# sub CopyTable() +# Copy the structure and the data of a table to another table +# =========================================================== +sub CopyTable { + my ($from,$to,$force) = @_; + my @known_tables = Show_Tables(); + my $query = ""; + my $nerror= 0; + my $skip; + +# print STDERR "CopyTable($from,$to)\n"; + MySQLaccess::Debug::Print(1,"MySQLaccess::DB::CopyTable($from,$to)"); + + ## error-handling + if (!grep(/^$from$/,@known_tables)) { return 'Unknown_table'; } + + ## copy structure + ## if forced + if (defined($force) and $force) { + return $nerror if ($nerror=CreateTable($to,$force)); +# print STDERR "Structure copied\n"; + } + + ## copy data + $query .= "DELETE FROM $to;"; + $query .= "INSERT INTO $to SELECT * FROM $from;"; + $query .= "SELECT 'ok';\n"; + MySQLaccess::Debug::Print(2,"Query: $query"); + + ## execute query + print MYSQL_Q "$query\n"; +# print STDERR $query; + + ## check for errors... + my $answer = ; #answer from mysql +# print STDERR $answer; + MySQLaccess::Debug::Print(2,"Answer: $answer\n"); + foreach $nerror (sort(keys(%ACCESS_ERR))) { + MySQLaccess::Debug::Print(3,"check answer for error $ACCESS_ERR{$nerror}"); + if (grep(/$ACCESS_ERR{$nerror}/i,$answer)) { + MySQLaccess::Debug::Print(2,"Answer contain error [$nerror]"); + return $nerror; + } + } + + my $delim = ; # read header +# print STDERR $delim; + if ($delim ne "ok\n") { + while (($line=) ne "ok\n") + { MySQLaccess::Debug::Print(3," A> $line"); } + $skip = ; # skip result 'ok' + } + + return 0; +} + +# =========================================================== +# sub LoadTmpTables() +# (Re)load temporary tables with entries of ACL-tables +# =========================================================== +sub LoadTmpTables { + my %tables = ( $MySQLaccess::ACCESS_U => $MySQLaccess::ACCESS_U_TMP, + $MySQLaccess::ACCESS_H => $MySQLaccess::ACCESS_H_TMP, + $MySQLaccess::ACCESS_D => $MySQLaccess::ACCESS_D_TMP, + ); + my $tbl; + my $nerror; + +# print STDERR "LoadTmpTables:\n"; + MySQLaccess::Debug::Print(1,"LoadTmpTables():"); + foreach $tbl (keys(%tables)) { +# print STDERR "$tbl -> $tables{$tbl}\n"; + MySQLaccess::Debug::Print(2,"Loading table $tbl -> $tables{$tbl}."); + return $nerror if ($nerror=CopyTable($tbl,$tables{$tbl},'force')); + } + return 0; +} + +# =========================================================== +# sub BackupGrantTables() +# Make a backup of the original grant-tables +# =========================================================== +sub BackupGrantTables { + my %tables = ( $MySQLaccess::ACCESS_U => $MySQLaccess::ACCESS_U_BCK, + $MySQLaccess::ACCESS_H => $MySQLaccess::ACCESS_H_BCK, + $MySQLaccess::ACCESS_D => $MySQLaccess::ACCESS_D_BCK, + ); + my $tbl; + my $nerror; + +# print STDERR "BackupGrantTables:\n"; + MySQLaccess::Debug::Print(1,"BackupGrantTables():"); + foreach $tbl (keys(%tables)) { +# print STDERR "$tbl -> $tables{$tbl}\n"; + MySQLaccess::Debug::Print(2,"Backup table $tbl -> $tables{$tbl}."); + return $nerror if ($nerror=CopyTable($tbl,$tables{$tbl},'force')); + } + return 0; +} + +# =========================================================== +# sub RollbackGrantTables() +# Rollback the backup of the grant-tables +# =========================================================== +sub RollbackGrantTables { + my %tables = ( $MySQLaccess::ACCESS_U_BCK => $MySQLaccess::ACCESS_U, + $MySQLaccess::ACCESS_H_BCK => $MySQLaccess::ACCESS_H, + $MySQLaccess::ACCESS_D_BCK => $MySQLaccess::ACCESS_D, + ); + my $tbl; + my $nerror; + +# print STDERR "RollbackGrantTables:\n"; + MySQLaccess::Debug::Print(1,"RollbackGrantTables():"); + foreach $tbl (keys(%tables)) { +# print STDERR "$tbl -> $tables{$tbl}\n"; + MySQLaccess::Debug::Print(2,"Rollback table $tbl -> $tables{$tbl}."); + return $nerror if ($nerror=CopyTable($tbl,$tables{$tbl},'force')); + } + return 0; +} + + +# =========================================================== +# sub CommitGrantTables() +# Copy grant-rules from temporary tables to the ACL-tables +# =========================================================== +sub CommitGrantTables { + my %tables = ( $MySQLaccess::ACCESS_U => $MySQLaccess::ACCESS_U_TMP, + $MySQLaccess::ACCESS_H => $MySQLaccess::ACCESS_H_TMP, + $MySQLaccess::ACCESS_D => $MySQLaccess::ACCESS_D_TMP, + ); + my $tbl; + my $query; + my $delim; + my $skip; + my $create; + + print STDERR "CommitGrantTables()\n"; + MySQLaccess::Debug::Print(1,"CommitGrantTables():"); + + ## Make backup of original grant-tables + MySQLaccess::Debug::Print(2,"Making backup of original grant-tables..."); + BackupGrantTables(); + + ## Copy data from temporay tables to grant-tables + foreach $tbl (keys(%tables)) { + print STDERR "$tbl -> $tables{$tbl}\n"; + MySQLaccess::Debug::Print(2,"Loading data $tables{$tbl} -> $tbl."); + return $nerror if ($nerror=CopyTable($tables{$tbl},$tbl)); + } + return 0; +} + + +# =========================================================== +# sub Show_Fields($table): +# return (a reference to) a hash which holds the names +# of all relevant grant-fields, with their index in the record, +# and (a reference to) an array which holds the fieldnames. +# =========================================================== +sub Show_Fields { + my ($table) = @_; + my %skip = ('host' => [0,1] + ,'user' => [0,1,2] + ,'db' => [0,1,2] + ); + my %Struct = (); + my @Struct = (); + my $query = "show fields from $table;select 'ok';\n"; + my $i=0; + my $line; + +#print STDERR $query; + MySQLaccess::Debug::Print(1,"Show_Fields($table):"); + MySQLaccess::Debug::Print(2,"SQL: $query"); + + print MYSQL_Q "$query"; + my $skip = ; #skip header + while (($line=) ne "ok\n") + { +#print STDERR ">",$line; + chop($line); + MySQLaccess::Debug::Print(2," $table>: $line"); + my ($field,$type,$null,$key,$default,$extra) = split(' ',$line); + $field = ucfirst($field); + MySQLaccess::Debug::Print(3, " added column[$i]: $field ($Struct{$field})"); + } + else { + MySQLaccess::Debug::Print(3," ==> skipped column[$i], value=[$field]"); + } + $i++; + } + + $skip=; # Get ok row (found already ok header) + + MySQLaccess::Debug::Print(2, "Array:"); + foreach $field (@Struct) { MySQLaccess::Debug::Print(2,"+ $field"); } + MySQLaccess::Debug::Print(2,"Hash:"); + foreach $field (keys(%Struct)) { MySQLaccess::Debug::Print(2,"+ $field -> $Struct{$field}"); } + + return (\%Struct,\@Struct); +} + +# =========================================================== +# sub Show_Tables(): +# return (a reference to) an array which holds all +# known tables. +# =========================================================== +sub Show_Tables { + my @Tables = (); + my $query = "show tables;select 'ok';\n"; + my $i=0; + my $line; + + MySQLaccess::Debug::Print(1,"Show_Tables():"); + MySQLaccess::Debug::Print(2,"SQL: $query"); + + print MYSQL_Q "$query"; + my $skip = ; #skip header + while (($line=) ne "ok\n") + { + chop($line); + push(@Tables,$line); #array + MySQLaccess::Debug::Print(3," ==> added table: $line"); + } + + $skip=; # Get ok row (found already ok header) + + MySQLaccess::Debug::Print(2, "Array:"); + foreach $tbl (@Tables) { MySQLaccess::Debug::Print(2,"+ $tbl"); } + + return @Tables; +} + +# ====================================== +# sub Validate_Password($passwd,$host,$user,$encpw) +# Validate the given password +# for user '$user' +# connecting from host '$host' +# ====================================== +sub Validate_Password { + my ($password,$host,$user,$encpw) = @_; + my $valid=0; + + MySQLaccess::Debug::Print(1,"Validate_Password($password,$host,$user,$encpw)"); + my $sql = "select host,user,password from user having " + ."host='$host' and user='$user' and password='$encpw' " + ."and password=PASSWORD('$password');\n"; + $sql .= "select 'ok';\n"; + MySQLaccess::Debug::Print(2,"SQL = $sql"); + print MYSQL_Q "$sql"; + + # if password is valid, at least 1 row returns before we read 'ok' + while ( ($line=) ne "ok\n") { + MySQLaccess::Debug::Print(2," A> $line"); + $valid = defined($line); + } + my $skip = ; # read 'ok' + + return $valid; +} + + +# ========================================================== +# sub Sort_fields: (rewritten by psmith) +# Build the query for an ordered list of entries +# ========================================================== +sub Sort_fields { + my ($start, $end, $sofar, $this, @rest) = (@_); + my @where = ("((FIELD not like '\\%') AND (FIELD <> ''))", + "((FIELD like '%\\%%') OR (FIELD like '%\\_%'))", + "(FIELD = '')"); + my $res = ''; + + $this or return ("$start $sofar $end"); + + $sofar .= ' AND ' if $sofar; + + foreach $w (@where) { + my $f = $w; + $f =~ s/FIELD/$this/g; + + $res .= Sort_fields($start, $end, "$sofar$f", @rest); + } + + return ($res); +} + +# =========================================================== +# sub Sort_table: (rewritten by psmith) +# return all entries in the given table, +# in an ordered fashion +# =========================================================== +sub Sort_table { + my ($tbl, @order) = @_; + my @res=(); + + # as long as there's no full where clause (Distrib 3.20)... + # use having :-( + # NOTE: this clause WILL NOT work on 3.21, because of the + # order of 'ORDER BY' and 'HAVING' + my $start = "SELECT *,UCASE(host) as ucase_host FROM $tbl "; + $start .= 'ORDER BY ' . join(',', @order) ." HAVING "; + my $end = ";\n"; + + # server version 3.21 has a full where clause :-) + if ($MySQLaccess::Host::SERVER >= '3.21') { +print "+++USING FULL WHERE CLAUSE+++\n"; + $start = "SELECT *,UCASE(host) as ucase_host FROM $tbl WHERE "; + $end = ' ORDER BY ' . join(',', @order) . ";\n"; + } + + MySQLaccess::Debug::Print(1,"Sort_table():"); + MySQLaccess::Debug::Print(2,"Sorting table $tbl by `@order'"); + + my $tmp; + foreach $tmp (@order) + { + $tmp="UCASE(host)" if ($tmp eq "ucase_host"); + } + my $query = Sort_fields($start, $end, '', @order); + $query .= "select 'ok';\n"; + MySQLaccess::Debug::Print(2,"Query: $query"); + + print MYSQL_Q "$query\n"; + + my $delim = ; # read header + MySQLaccess::Debug::Print(3," A> $delim"); + if ($delim ne "ok\n") { + if ($delim =~ /^ERROR/) { + push(@MySQLaccess::Grant::Error,'use_old_server'); + MySQLaccess::Report::Print_Error_Messages() ; + exit 1; + } + while (($line=) ne "ok\n") + { + MySQLaccess::Debug::Print(3," A> $line"); + push(@res,$line); + } + } + my $skip = ; # skip result 'ok' + + # remove columnheaders from output + @res = grep(!/^\Q$delim\E$/, @res); + # remove trailing \n from each returned record + chomp(@res); + # each record has 1 field to much : ucase_host + @res = grep { /(.*)\t.*$/; $_ = $1; } @res; + + MySQLaccess::Debug::Print(2,"Result of sorted table $tbl:"); + foreach $line (@res) { MySQLaccess::Debug::Print(2," >>$line"); } + return @res; +} + +# =========================================================== +# sub Get_All_db(template): +# return all db the grant-tables are working on, +# which conform to the template +# =========================================================== +sub Get_All_dbs { + my ($template,$tmp) = @_; + my @db=(); + my $aref; + + # working with temporary tables or production tables + if (defined($tmp) and $tmp) { + $aref = \@MySQLaccess::Grant::sorted_db_tmp_table ; + } + else { + $aref = \@MySQLaccess::Grant::sorted_db_table; + } + + MySQLaccess::Debug::Print(1," template=[$template]"); + + # get all db for which access-rights can be calculated, + # which conform to the template. + # !! these db's don't have to exist yet, so it's not + # enough to look which db already exist on the system + $reg_expr = $template; + if ($template =~ /[\*\?]/) { + $reg_expr =~ tr/*?/%_/; + #$reg_expr = MySQLaccess::Wildcards::Wild2Reg($template); + } + $reg_expr = MySQLaccess::Wildcards::SQL2Reg("$reg_expr"); + + if ( ! ($template =~ /[\*\?%_]/) ) { + push(@db,$template); + return \@db; + } + + MySQLaccess::Debug::Print(2,"#Reading db-table..."); + foreach $record (@{$aref}) { #MySQLaccess::Grant::sorted_db_table) { + my @record=split(/\t/,$record); + my $db = $record[1]; + MySQLaccess::Debug::Print(2,"> $db "); + if ( (!grep(/$db/i,@db)) and ($db =~/$reg_expr/i) ) { + push(@db,$db); + MySQLaccess::Debug::Print(2,"added"); + } + else { + MySQLaccess::Debug::Print(2,"skipped"); + } + } + # if no rule is found for a certain db in the db-table, + # the rights of the user are used, so we should inform + # the user for + if (!grep(/^%$/,@db)) { push(@db,"$MySQLaccess::NEW_DB"); } + return \@db; +} + +# =========================================================== +# sub Get_All_users(template): +# return all users the grant-tables are working on, +# which conform to the template +# =========================================================== +sub Get_All_users { + ($template,$tmp) = @_; # nog verder uitwerken!!! + my @user=(); + my $aref; + + # working with temporary tables or production tables + if (defined($tmp) and $tmp) { + $aref = \@MySQLaccess::Grant::sorted_user_tmp_table ; + } + else { + $aref = \@MySQLaccess::Grant::sorted_user_table; + } + + MySQLaccess::Debug::Print(1,"Debug Get_All_users:"); + # get all db for which access-rights can be calculated. + # !! these db's don't have to exist yet, so it's not + # enough to look which db already exist on the system + $reg_expr = $template; + if ($template =~ /[\*\?]/) { + $reg_expr =~ tr/*?/%_/; + #$reg_expr = MySQLaccess::Wildcards::Wild2Reg($template); + } + $reg_expr = MySQLaccess::Wildcards::SQL2Reg("$reg_expr"); + + if ( ! ($template =~ /[\*\?%_]/) ) { + push(@user,$template); + return \@user; + } + + MySQLaccess::Debug::Print(2,"#Reading user-table..."); + foreach $record (@{$aref}) { #MySQLaccess::Grant::sorted_user_table) { + my @record=split(/\t/,$record); + my $user = $record[1]; + MySQLaccess::Debug::Print(2,"> $user "); + if ( (!grep(/$user/,@user)) and ($user=~/$reg_expr/)) { + push(@user,$user); + MySQLaccess::Debug::Print(2, "added"); + } + else { + MySQLaccess::Debug::Print(2, "skipped"); + } + } + # Any user means also: + # - the 'empty' user, ie without supplying a username + # - any user still to be defined/created + #push(@user,''); #without_suplying_a_username + push(@user,"$MySQLaccess::NEW_USER"); + #push(@Warnings,'minimum_priv'); + return \@user; +} + +# =========================================================== +# sub Get_All_hosts(template): +# return all hosts the grant-tables are working on, +# which conform to the template +# =========================================================== +sub Get_All_hosts { + my ($template,$tmp) = @_; + my @host=(); + my $aref; + my $aref1; + + # working with temporary tables or production tables + if (defined($tmp) and $tmp) { + $aref = \@MySQLaccess::Grant::sorted_host_tmp_table ; + $aref1= \@MySQLaccess::Grant::sorted_db_tmp_table ; + } + else { + $aref = \@MySQLaccess::Grant::sorted_host_table; + $aref1= \@MySQLaccess::Grant::sorted_db_table ; + } + + MySQLaccess::Debug::Print(1, "Debug Get_All_hosts:"); + # get all db for which access-rights can be calculated. + # !! these db's don't have to exist yet, so it's not + # enough to look which db already exist on the system + $reg_expr = $template; + if ($template =~ /[\*\?]/) { + $reg_expr =~ tr/*?/%_/; + #$reg_expr = MySQLaccess::Wildcards::Wild2Reg($template); + } + $reg_expr = MySQLaccess::Wildcards::SQL2Reg("$reg_expr"); + + if ( ! ($template =~ /[\*\?%_]/) ) { + push(@host,$template); + return \@host; + } + + MySQLaccess::Debug::Print(1, "#Reading db-table..."); + foreach $record (@{$aref1}) { #MySQLaccess::Grant::sorted_db_table) { + my @record=split(/\t/,$record); + my $host = $record[0]; + MySQLaccess::Debug::Print(2, "> $host "); + if (! grep(/$host/i,@host)) { + push(@host,$host); + MySQLaccess::Debug::Print(2, "added"); + } + else { + MySQLaccess::Debug::Print(2, "skipped"); + } + } + MySQLaccess::Debug::Print(1, "#Reading host-table..."); + foreach $record (@{$aref}) { + my @record=split(/\t/,$record); + my $host = $record[0]; + MySQLaccess::Debug::Print(2, "> $host "); + if ( (!grep(/$host/,@host)) and ($host=~/$reg_expr/)) { + push(@host,$host); + MySQLaccess::Debug::Print(2, "added"); + } + else { + MySQLaccess::Debug::Print(2, "skipped"); + } + } + # DOUBT: + #print "#Reading user-table...\n" if ($DEBUG>1); + #foreach $record (@MySQLaccess::Grant::sorted_user_table) { + # my @record=split(/\t/,$record); + # my $host = $record[0]; + # print "> $host " if ($DEBUG>2); + # if ( (!grep(/$host/,@host)) and ($host=~/$reg_expr/)) { + # push(@host,$host); + # print "added\n" if ($DEBUG>2); + # } + # else { + # print "skipped\n" if ($DEBUG>2); + # } + #} + # Any host also means: + # - any host still to be defined/created + #push(@host,"any_other_host"); + + @host = sort(@host); + return \@host; +} + + +########################################################################## +package MySQLaccess::Grant; +############## +BEGIN { + $DEBUG = 0; + $DEBUG = $MySQLaccess::DEBUG unless ($DEBUG); +} + + + +# =========================================================== +# sub Diff_Privileges() +# Calculate diff between temporary and original grant-tables +# =========================================================== +sub Diff_Privileges { + my @before=(); + my @after =(); + my @diffs =(); + + # ----------------------------- + # Build list of users,dbs,hosts + # to process... + my @all_dbs = @{MySQLaccess::DB::Get_All_dbs('*')}; + my @all_users = @{MySQLaccess::DB::Get_All_users('*')}; + my @all_hosts = @{MySQLaccess::DB::Get_All_hosts('*')}; + #if EDIT-mode + my @all_dbs_tmp = @{MySQLaccess::DB::Get_All_dbs('*','tmp')}; + my @all_users_tmp = @{MySQLaccess::DB::Get_All_users('*','tmp')}; + my @all_hosts_tmp = @{MySQLaccess::DB::Get_All_hosts('*','tmp')}; + + + my %Access; + # ------------------------------------ + # Build list of priv. for grant-tables + foreach $host (@all_hosts) { + foreach $user (@all_users) { + foreach $db (@all_dbs) { + MySQLaccess::Grant::Initialize(); + %Access = MySQLaccess::Grant::Get_Access_Rights($host,$user,$db); + push(@before,MySQLaccess::Report::Raw_Report($host,$user,$db,\%Access)); + } + } + } + + # ---------------------------------- + # Build list of priv. for tmp-tables + foreach $host (@all_hosts_tmp) { + foreach $user (@all_users_tmp) { + foreach $db (@all_dbs_tmp) { + MySQLaccess::Grant::Initialize('tmp'); + %Access = MySQLaccess::Grant::Get_Access_Rights($host,$user,$db,'tmp'); + push(@after,MySQLaccess::Report::Raw_Report($host,$user,$db,\%Access)); + } + } + } + + # ---------------------------------- + # Write results to temp-file to make + # DIFF + @before = sort(@before); + @after = sort(@after); + + $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; + $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; + #$after = "/tmp/t0"; + open(BEFORE,"> $before") || + push(@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); + open(AFTER,"> $after") || + push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); + print BEFORE join("\n",@before); + print AFTER join("\n",@after); + close(BEFORE); + close(AFTER); + + # ---------------------------------- + # compute difference + my $cmd="$MySQLaccess::DIFF $before $after |"; + open(DIFF,"$cmd"); + @diffs = ; + @diffs = grep(/[<>]/,@diffs); + chomp(@diffs); + close(DIFF); + + # ---------------------------------- + # cleanup temp. files + unlink(BEFORE); + unlink(AFTER); + + return \@diffs; +} + +# =========================================================== +# sub Initialize() +# +# =========================================================== +sub Initialize { + %MySQLaccess::Grant::Access = %{Default_Access_Rights()}; + @MySQLaccess::Grant::Errors = (); + @MySQLaccess::Grant::Warnings = (); + @MySQLaccess::Grant::Notes = (); + # ----- + # rules + $MySQLaccess::Grant::Rules{'user'} = 'no_rule_found'; + $MySQLaccess::Grant::Rules{'db'} = 'no_rule_found'; + $MySQLaccess::Grant::Rules{'host'} = 'no_equiv_host'; + $MySQLaccess::Grant::full_access = 1; + + $MySQLaccess::Grant::process_host_table = 0; + return 1; +} + +# =========================================================== +# sub ReadTables() +# +# =========================================================== +sub ReadTables { + my ($tmp) = @_; + my ($HOST,$DB,$USER); + my @tables; + + # build list of available tables + @tables = MySQLaccess::DB::Show_Tables(); + + # reading production grant-tables or temporary tables? + $tmp = (defined($tmp) and $tmp) ? 1 : 0; + if ($tmp) { #reading temporary tables + $HOST=$MySQLaccess::ACCESS_H_TMP; + $DB =$MySQLaccess::ACCESS_D_TMP; + $USER=$MySQLaccess::ACCESS_U_TMP; + + # ---------------------------- + # do tables exist? + if (!grep(/$HOST/,@tables)) { MySQLaccess::DB::CreateTable($HOST); } + if (!grep(/$USER/,@tables)) { MySQLaccess::DB::CreateTable($USER); } + if (!grep(/$DB/,@tables)) { MySQLaccess::DB::CreateTable($DB); } + + MySQLaccess::Debug::Print(1,"Finding fields in tmp-ACL files:"); + # ----------------------------- + # Get record-layout + my ($h1,$h2) = MySQLaccess::DB::Show_Fields($HOST); + my ($d1,$d2) = MySQLaccess::DB::Show_Fields($DB); + my ($u1,$u2) = MySQLaccess::DB::Show_Fields($USER); + %MySQLaccess::Grant::H_tmp = %{$h1}; @MySQLaccess::Grant::H_tmp = @{$h2}; + %MySQLaccess::Grant::D_tmp = %{$d1}; @MySQLaccess::Grant::D_tmp = @{$d2}; + %MySQLaccess::Grant::U_tmp = %{$u1}; @MySQLaccess::Grant::U_tmp = @{$u2}; + +# @MySQLaccess::Grant::Privileges_tmp=@{Make_Privlist()}; +# + MySQLaccess::Debug::Print(1, "Reading sorted temp-tables:"); + @MySQLaccess::Grant::sorted_db_tmp_table = MySQLaccess::DB::Sort_table($DB, 'ucase_host', 'user', 'db'); + @MySQLaccess::Grant::sorted_host_tmp_table= MySQLaccess::DB::Sort_table($HOST, 'ucase_host', 'db'); + @MySQLaccess::Grant::sorted_user_tmp_table= defined($MySQLaccess::Param{'password'}) ? + MySQLaccess::DB::Sort_table($USER, 'ucase_host', 'user', 'password'): + MySQLaccess::DB::Sort_table($USER, 'ucase_host', 'user'); + } + else { #reading production grant-tables + $HOST=$MySQLaccess::ACCESS_H; + $DB =$MySQLaccess::ACCESS_D; + $USER=$MySQLaccess::ACCESS_U; + + MySQLaccess::Debug::Print(1,"Finding fields in ACL files:"); + # ----------------------------- + # Get record-layout + my ($h1,$h2) = MySQLaccess::DB::Show_Fields($HOST); + my ($d1,$d2) = MySQLaccess::DB::Show_Fields($DB); + my ($u1,$u2) = MySQLaccess::DB::Show_Fields($USER); + %MySQLaccess::Grant::H = %{$h1}; @MySQLaccess::Grant::H = @{$h2}; + %MySQLaccess::Grant::D = %{$d1}; @MySQLaccess::Grant::D = @{$d2}; + %MySQLaccess::Grant::U = %{$u1}; @MySQLaccess::Grant::U = @{$u2}; + + @MySQLaccess::Grant::Privileges=@{Make_Privlist()}; + + MySQLaccess::Debug::Print(1, "Reading sorted tables:"); + @MySQLaccess::Grant::sorted_db_table = MySQLaccess::DB::Sort_table($DB, 'ucase_host', 'user', 'db'); + @MySQLaccess::Grant::sorted_host_table= MySQLaccess::DB::Sort_table($HOST, 'ucase_host', 'db'); + @MySQLaccess::Grant::sorted_user_table= defined($MySQLaccess::Param{'password'}) ? + MySQLaccess::DB::Sort_table($USER, 'ucase_host', 'user', 'password'): + MySQLaccess::DB::Sort_table($USER, 'ucase_host', 'user'); + } + + return 0; +} + +# =========================================================== +# sub Get_Access_Rights(host,user,db) +# report the access_rights for the tuple ($host,$user,$db). +# =========================================================== +sub Get_Access_Rights { + local ($host,$user,$db,$tmp) = @_; + + my $aref_user; + my $aref_host; + my $aref_db; + # working with temporary tables or production tables + if (defined($tmp) and $tmp) { + $aref_user = \@MySQLaccess::Grant::sorted_user_tmp_table; + $aref_host = \@MySQLaccess::Grant::sorted_host_tmp_table; + $aref_db = \@MySQLaccess::Grant::sorted_db_tmp_table; + } + else { + $aref_user = \@MySQLaccess::Grant::sorted_user_table; + $aref_host = \@MySQLaccess::Grant::sorted_host_table; + $aref_db = \@MySQLaccess::Grant::sorted_db_table; + } + + + my ($refrecord,$refgrant); + my ($_host_,$_user_,$encpw_); + my %_Access_; + + MySQLaccess::Debug::Print(1, "for ($host,$user,$db):"); + + # ****************************************************************************** + # Create default access-rights + # default access-rights are no access at all!! + + + # ****************************************************************************** + # get hostname for IP-address + # get IP-address for hostname + local $host_name = MySQLaccess::Host::IP2Name($host); + local $host_ip = MySQLaccess::Host::Name2IP($host); + + MySQLaccess::Debug::Print(3,"host=$host, hostname=$host_name, host-ip =$host_ip"); + MySQLaccess::Debug::Print(3,"user=$user"); + MySQLaccess::Debug::Print(3,"db =$db"); + + # *********************************************************************** + # retrieve information on USER + # check all records in mysql::user for matches with the tuple (host,user) + # *********************************************************************** + # 4.OR (add) the privileges for the user from the "user" table. + # (add all privileges which is "Y" in "user") + ($refrecord,$refgrant) = Get_grant_from_user($host,$user,$aref_user); + ($_host_,$_user_,$encpw_) = @{$refrecord}; + %_access_ = %{$refgrant}; + + foreach $field (keys(%U)) { ##only priv. set in user-table + $MySQLaccess::Grant::Access{$field} = ($MySQLaccess::Grant::Access{$field} or $_access_{$field}); + } + + if ($_user_ eq $MySQLaccess::NEW_USER) { + push(@Warnings,'minimum_priv'); + } + if ($_user_ ne $user) { + $user=$_user_; + push(@Warnings,'anonymous_access'); + } + + # ******************************************************* + # Validate password if this has been asked to do + # ******************************************************* + if (defined($password)) { + $valid = Validate_Password($password,$_host_,$_user_,$_encpw_,$aref_user); + if (!$valid) { push(@Errors,'invalid_password'); } + else { push(@Notes,'valid_password'); } + } + + # ****************************************************************************** + # retrieve information on DB + # check all records in mysql::db for matches with the triple (host,db,user) + # first match is used. + # ****************************************************************************** + # 2.Get grant for user from the "db" table. + + ($refrecord,$refgrant)=Get_grant_from_db($host,$db,$user,$aref_db); #set process_host_table + ($_host_,$_user_,$encpw_) = @{$refrecord}; + %_access_ = %{$refgrant}; + + foreach $field (keys(%D)) { ##only priv. set in db-table + $MySQLaccess::Grant::Access{$field} = ($MySQLaccess::Grant::Access{$field} or $_access_{$field}); + } + + # *********************************************************************** + # retrieve information on HOST + # check all records in mysql::host for matches with the tuple (host,db) + # + # ' The host table is mainly to maintain a list of "secure" servers. ' + # *********************************************************************** + # 3.If hostname is "empty" for the found entry, AND the privileges with + # the privileges for the host in "host" table. + # (Remove all which is not "Y" in both) + + if ($MySQLaccess::Grant::process_host_table) { + ($refrecord,$refgrant)=Get_grant_from_host($host,$db,$aref_host); + ($_host_,$_user_,$encpw_) = @{$refrecord}; + %_access_ = %{$refgrant}; + + foreach $field (keys(%H)) { ##only priv. set in host-table + $MySQLaccess::Grant::Access{$field} = ($MySQLaccess::Grant::Access{$field} and $_access_{$field}); + } + } + + MySQLaccess::Debug::Print(1,"done for ($host,$user,$db)"); + return %MySQLaccess::Grant::Access; +} + +# #################################### +# FINDING THE RIGHT GRANT-RULE +# ========================================================== +# sub Get_grant_from_user: +# ========================================================== +sub Get_grant_from_user { + my ($host,$user,$aref) = @_; + + MySQLaccess::Debug::Print(1, ""); + MySQLaccess::Debug::Print(1, "(host=$host,user=$user)"); + + my %Access_user = %{Default_Access_Rights()}; + + my $rule_found=0; + my @record = (); + my $record; + + foreach $record (@{$aref}) { + $MySQLaccess::Grant::full_access=0; + MySQLaccess::Debug::Print(3, "Record= $record"); + @record=split(/\t/,$record); + + # check host and db + # with possible wildcards in field + # replace mysql-wildcards by reg-wildcards + my $host_tpl = MySQLaccess::Wildcards::SQL2Reg($record[0]); + my $user_tpl = $record[1]; #user field isn't pattern-matched!! + my $passwd = $record[2]; + + MySQLaccess::Debug::Print(3, "=>host_tpl : read=$record[0] -> converted=$host_tpl"); + MySQLaccess::Debug::Print(3, "=>user_tpl : read=$record[1] -> $user_tpl"); + MySQLaccess::Debug::Print(3, "=>password : read=$record[2] -> $passwd"); + + + if ( MySQLaccess::Host::MatchTemplate($host,$host_tpl) and + MySQLaccess::Wildcards::MatchTemplate($user_tpl,$user) + ) + { + MySQLaccess::Debug::Print(2, "FOUND!!"); + if ($passwd eq '') { push(@Warnings,'insecure_user'); } + else { push(@Notes,'password_required'); } + + foreach $field (keys(%U)) { + $Access_user{$field} = $MySQLaccess::Report::Answer{$record[$U{$field}]}; + } + #print "\n" if $DEBUG; + $MySQLaccess::Grant::Rules{'user'} = $record; + $rule_found=1; + last; + } + } + + # ------------------------------- + # setting privileges to user-priv + MySQLaccess::Debug::Print(2, "Rights after parsing user-table..:"); + if (! $rule_found ) { + @record=(); + MySQLaccess::Debug::Print(2, "NO record found in the user-table!!"); + } + else { + MySQLaccess::Debug::Print(2, "Selected record=@record"); + MySQLaccess::Debug::Print(2, "<=?=> $record"); + } + + MySQLaccess::Debug::Print(1, "returning @record"); + + return (\@record,\%Access_user); #matching record in user-table +} + +# ========================================================== +# sub Get_grant_from_db: +# ========================================================== +sub Get_grant_from_db { + my ($host,$db,$user,$aref) = @_; + + MySQLaccess::Debug::Print(1, "(host=$host,user=$user,db=$db)"); + + my %Access_db = %{Default_Access_Rights()}; + my $rule_found=0; + + foreach $record (@{$aref}) { + $full_access=0; + MySQLaccess::Debug::Print(2, "Read db: $record"); + @record=split(/\t/,$record); + + # check host and db + # with possible wildcards in field + # replace mysql-wildcards by reg-wildcards + my $host_tpl = MySQLaccess::Wildcards::SQL2Reg($record[0]); + my $db_tpl = MySQLaccess::Wildcards::SQL2Reg($record[1]); + my $user_tpl = $record[2]; #user field isn't pattern matched!! + MySQLaccess::Debug::Print(3, "=>host_tpl : read=$record[0] -> converted=$host_tpl"); + MySQLaccess::Debug::Print(3, "=>db_tpl : read=$record[1] -> $db_tpl"); + MySQLaccess::Debug::Print(3, "=>user_tpl : read=$record[2] -> $user_tpl"); + + if ( ( MySQLaccess::Host::Is_localhost($host_tpl) + or MySQLaccess::Wildcards::MatchTemplate($host_tpl,$host_name) + or MySQLaccess::Wildcards::MatchTemplate($host_tpl,$host_ip) ) + and ( MySQLaccess::Wildcards::MatchTemplate($db_tpl,$db) ) + and ( MySQLaccess::Wildcards::MatchTemplate($user_tpl,$user) ) ) { + + $MySQLaccess::Grant::process_host_table = ($record[0] eq ''); + + if ($user_tpl eq '') { push(@Warnings,'public_database'); } + + foreach $field (keys(%D)) { + $Access_db{$field} = $MySQLaccess::Report::Answer{$record[$D{$field}]}; + } + $rule_found=1; + $MySQLaccess::Grant::Rules{'db'} = $record; + last; + } + } + + # ------------------------------- + # setting privileges to db-priv + MySQLaccess::Debug::Print(2, "Rights after parsing db-table..:"); + if (! $rule_found ) { + MySQLaccess::Debug::Print(2, "NO rule found in db-table => no access granted!!"); + } + + return (\@record,\%Access_db); +} + +# ========================================================== +# sub Get_grant_from_host: +# ========================================================== +sub Get_grant_from_host { + my ($host,$db,$aref) = @_; + + MySQLaccess::Debug::Print(1, "Get_grant_from_host()"); + + my %Access_host = %{Default_Access_Rights()}; + + # the host-table doesn't have to be processed if the host-field + # in the db-table isn't empty + if (!$MySQLaccess::Grant::process_host_table) { + MySQLaccess::Debug::Print(2, ">> Host-table doesn't have to be processed!!"); + $MySQLaccess::Grant::Rules{'host'} = 'no_equiv_host'; + return ([],\%Access_host); + } + + my $rule_found=0; + my @record = (); + + foreach $record (@{$aref}) { + $full_access=0; + MySQLaccess::Debug::Print(2, "host: $record"); + @record=split(/\t/,$record); + + # check host and db + # with possible wildcards in field + # replace mysql-wildcards by reg-wildcards + my $host_tpl = MySQLaccess::Wildcards::SQL2Reg($record[0]); + my $db_tpl = MySQLaccess::Wildcards::SQL2Reg($record[1]); + MySQLaccess::Debug::Print(3, "=>host_tpl : $record[0] -> $host_tpl"); + MySQLaccess::Debug::Print(3, "=>db_tpl : $record[1] -> $db_tpl"); + + if ( ( MySQLaccess::Host::Is_localhost($host_tpl) + or MySQLaccess::Wildcards::MatchTemplate($host_tpl,$host_name) + or MySQLaccess::Wildcards::MatchTemplate($host_tpl,$host_ip) ) + and ( MySQLaccess::Wildcards::MatchTemplate($db_tpl,$db) ) ) { + + $MySQLaccess::Grant::Rules{'host'} = $record; + $rule_found=1; + foreach $field (keys(%H)) { + $Access_host{$field} = $MySQLaccess::Report::Answer{$record[$H{$field}]}; + } + last; + } + } + + # ------------------------------- + # setting privileges to host-priv + MySQLaccess::Debug::Print(2, "Rights after parsing host-table..:"); + if (! $rule_found ) { + @record=(); + MySQLaccess::Debug::Print(2, "NO restrictions found in the host-table!!"); + } + + # -------------------------------- + # debugging access-rights in db + + return (\@record,\%Access_host); #matching record in host-table +} + + + +# =========================================================== +# sub Default_Access_Rights(): +# return (a reference to) a hash which holds all default +# priviliges currently defined in the grant-tables. +# =========================================================== +sub Default_Access_Rights { + my %right = (); + + MySQLaccess::Debug::Print(2, "Debug Default_Access_Rights():"); + # add entry for all fields in the HOST-table + foreach $field (keys(%MySQLaccess::Grant::H)) { + $right{$field}='0' unless (defined($right{$field})); + } + # add entry for all fields in the DB-table + foreach $field (keys(%MySQLaccess::Grant::D)) { + $right{$field}='0' unless (defined($right{$field})); + } + # add entry for all fields in the USER-table + foreach $field (keys(%MySQLaccess::Grant::U)) { + $right{$field}='0' unless (defined($right{$field})); + } + # -------------- + # debugging info + foreach $field (keys(%right)) { MySQLaccess::Debug::Print(3, sprintf("> %15s : %1s",$field,$right{$field})); } + + return \%right; +} + +# ====================================== +# sub Make_Privlist +# Make an ordered list of the privileges +# that should be reported +# ====================================== +sub Make_Privlist { + # layout: + #'select_priv', 'create_priv', + #'insert_priv', 'drop_priv', + #'update_priv', 'reload_priv', + #'delete_priv', 'process_priv', + #'file_priv', 'shutdown_priv'); + my $right; + my @privlist=(); + foreach $right (@U) { + if (! grep(/$right/,@privlist)) { push(@privlist,$right); } + }; + foreach $right (@D) { + if (! grep(/$right/,@privlist)) { push(@privlist,$right); } + }; + foreach $right (@H) { + if (! grep(/$right/,@privlist)) { push(@privlist,$right); } + }; +# print "Privileges:\n"; +# foreach $field (@privlist) { print " > $field\n"; } + return \@privlist; +} + + + +######################################################################## +package MySQLaccess::Report; +use Exporter (); +@EXPORT = qw(&Print_Header()); +BEGIN { + $FORM = $ENV{'SCRIPT_NAME'}; + $DEBUG = 0; + $DEBUG = $MySQLaccess::DEBUG unless ($DEBUG); + + # translation-table for poss. answers + %Answer = ('Y' => 1 , 'N' => 0 + , 1 => 'Y', 0 => 'N' + ,'?' => '?', '' => '?' + ); + $headers = 0; + $separator = 0; + +# **************************** +# Notes and warnings +%MESSAGES = ( + 'insecure_user' + => "Everybody can access your DB as user `\$user' from host `\$host'\n" + ."WITHOUT supplying a password.\n" + ."Be very careful about it!!" + ,'password_required' + => "A password is required for user `\$user' :-(" + ,'invalid_password' + => "The password '\$password' for user `\$user' is invalid :-P" + , 'valid_password' + => "You supplied the right password for user `\$user' :-)" + ,'public_database' + => "Any user with the appropriate permissions has access to your DB!\n" + ."Check your users!" + ,'full_access' + => "All grant-tables are empty, which gives full access to ALL users !!" + ,'no_rule_found' + => "No matching rule" + ,'no_equiv_host' + => "Not processed: host-field is not empty in db-table." + ,'least_priv' + => "If the final priveliges of the user are more then you gave the user,\n" + ."check the priveliges in the db-table `\$db'." + ,'minimum_priv' + => "The privileges for any new user are AT LEAST\n" + ."the ones shown in the table above,\n" + ."since these are the privileges of the db `\$db'.\n" + ,'not_found_mysql' + => "The MySQL client program <$MySQLaccess::MYSQL> could not be found.\n" + ."+ Check your path, or\n" + ."+ edit the source of this script to point \$MYSQL to the mysql client.\n" + ,'not_found_mysqldump' + => "The MySQL dump program <$MySQLaccess::MYSQLDUMP> could not be found.\n" + ."+ Check your path, or\n" + ."+ edit the source of this script to point \$MYSQLDUMP to the mysqldump program.\n" + ,'not_found_diff' + => "The diff program <$MySQLaccess::DIFF> could not be found.\n" + ."+ Check your path, or\n" + ."+ edit the source of this script to point \$DIFF to the diff program.\n" + ,'not_found_tmp' + => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" + ."+ create this directory (writeable!), or\n" + ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" + ,'write_err_tmp' + => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" + ."+ make this directory writeable!, or\n" + ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" + ,'Unrecognized_option' + => "Sorry,\n" + ."You are using an old version of the mysql-program,\n" + ."which does not yet implement a neccessary option.\n" + ."\n" + ."You need at least Version 6.2 of the mysql-client,\n" + ."which was build in MySQL v3.0.18, to use this version\n" + ."of `$MySQLaccess::script'." + ,'Access_denied' + => "Sorry,\n" + ."An error occured when trying to connect to the database\n" + ."with the grant-tables:\n" + ."* Maybe YOU do not have READ-access to this database?\n" + ."* If you used the -U option, you may have supplied an invalid username?\n" + ." for the superuser?\n" + ."* If you used the -U option, it may be possible you have to supply\n" + ." a superuser-password to, with the -P option?\n" + ."* If you used the -P option, you may have supplied an invalid password?\n" + ,'Dbaccess_denied' + => "Sorry,\n" + ."An error occured when trying to connect to the database\n" + ."with the grant-tables. (dbaccess denied)\n" + ,'Unknown_tmp_table' + => "Sorry,\n" + ."An error occured when trying to work with the temporary tables in the database\n" + ."with the grant-tables. (One of the temporary tables does not exist)\n" + ,'Unknown_table' + => "Sorry,\n" + ."An error occured when trying to work with some tables in the database\n" + ."with the grant-tables. (table does not exist)\n" + ,'use_old_server' + => "Sorry,\n" + ."An error occured when executing an SQL statement.\n" + ."You might consider altering the use of the parameter `--old_server' when \n" + ."calling `$MySQLaccess::script'." + ,'unknown_error' + => "Sorry,\n" + ."An error occured when trying to connect to the database\n" + ."with the grant-tables. (unknown error)\n" + ,'anonymous_access' + => "Accessing the db as an anonymous user.\n" + ."Your username has no relevance\n" + ,'user_required' + => "You have to supply a userid." + ,'db_required' + => "You have to supply the name of a database." + ,'host_required' + => "You have to supply the name of a host." + ); + + +} +# ===================================== +# sub Print_Header: +# print header info +# ===================================== +sub Print_Header { + if ($MySQLaccess::CMD) { #command-line mode + print "$MySQLaccess::script Version $MySQLaccess::VERSION\n" + ."By RUG-AIV, by Yves Carlier (Yves.Carlier\@rug.ac.be)\n" + ."Changes by Steve Harvey (sgh\@vex.net)\n" + ."This software comes with ABSOLUTELY NO WARRANTY.\n"; + } + if ($MySQLaccess::CGI) { #CGI-BIN mode + print "content-type: text/html\n\n" + . "\n" + ."\n" + ."MySQLaccess\n" + ."\n" + ."\n" + ."

$MySQLaccess::script Version $MySQLaccess::VERSION

\n" + ."
\n
\n" + ."By RUG-AIV, by Yves Carlier (Yves.Carlier\@rug.ac.be)
\n" + ."Changes by Steve Harvey (sgh\@vex.net)
\n" + ."This software comes with ABSOLUTELY NO WARRANTY.
\n" + ."
\n
\n" + ."
\n"; + Print_Taskbar(); + print "
\n"; + } + return 1; +} + +# ===================================== +# sub Print_Footer: +# print footer info +# ===================================== +sub Print_Footer { + if ($MySQLaccess::CMD) { #command-line mode + print "\n" + ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be\n"; + } + if ($MySQLaccess::CGI) { #CGI-BIN mode + if ($MySQLaccess::Param{'brief'}) { + print "\n"; #close table in brief-output + } + print "
\n" + ."
\n" + ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be
\n" +# ."Don't forget to mention the version $VERSION!
\n" + ."
\n" + ."\n" + ."\n"; + } + return 1; +} + +# ===================================== +# sub Print_Taskbar: +# print taskbar on STDOUT +# ===================================== +sub Print_Taskbar { + print "
\n" + ."[Release Notes] \n" + ."[Version] \n" + ."[Future Plans] \n" + ."[Examples] \n" + ."[New check] \n" + ."[Change/edit ACL] \n" + ."
\n"; + return 1; +} + +# ===================================== +# sub Print_Form: +# print CGI-form +# ===================================== +sub Print_Form { +print < + +
+ + + + + + + + + + + + + + + + +
MySQL serverUser informationReports
+ + + + + + + + + + + + + +
Host
(Host on which MySQL-server resides.)
Superuser
(User which has read-access to grant-tables.)
Password
(of Superuser.)
+
+ + + + + + + + + + + + + + + + + +
User
(Userid used to connect to MySQL-database.)
Password
(Password user has to give to get access to MySQL-database.)
Database
(Name of MySQL-database user tries to connect to.
Wildcards (*,?,%,_) are allowed.)
Host
(Host from where the user is trying to connect to MySQL-database.
Wildcards (*,?,%,_) are allowed.)
+
+ + + + + + + + + + +

+
+
+
+ + + + +EOForm + return 1; +} + +# ===================================== +# sub Print_Usage: +# print some information on STDOUT +# ===================================== +sub Print_Usage { + Print_Error_Messages(); + if ($MySQLaccess::CMD) { #command-line mode + Print_Options(); + } + if ($MySQLaccess::CGI) { #CGI-BIN mode + Print_Form(); + } + return 1; +} + +# ====================================== +# sub Print_Version: +# ====================================== +sub Print_Version { + if ($MySQLaccess::CMD) { + print $MySQLaccess::INFO; + } + if ($MySQLaccess::CGI) { + print "
\n"; 
+       print $MySQLaccess::INFO;
+       print "
\n"; + } + return 1; +} + +# ====================================== +# sub Print_Relnotes: +# ====================================== +sub Print_Relnotes { + if ($MySQLaccess::CMD) { + print $MySQLaccess::RELEASE; + } + if ($MySQLaccess::CGI) { + print "
\n";
+       print $MySQLaccess::RELEASE;
+       print "
\n"; + } + return 1; +} + +# ====================================== +# sub Print_Plans: +# ====================================== +sub Print_Plans { + if ($MySQLaccess::CMD) { + print $MySQLaccess::TODO; + } + if ($MySQLaccess::CGI) { + print "
\n";
+       print $MySQLaccess::TODO;
+       print "
\n"; + } + return 1; +} + +# ====================================== +# sub Print_HowTo: +# ====================================== +sub Print_HowTo { + if ($MySQLaccess::CMD) { + print $MySQLaccess::HOWTO; + } + if ($MySQLaccess::CGI) { + print "
\n"; 
+       print $MySQLaccess::HOWTO;
+       print "
\n"; + } + return 1; +} + +# ====================================== +# sub Print_Options: +# ====================================== +sub Print_Options { + if ($MySQLaccess::CGI) { print "
\n"; }
+    print $MySQLaccess::OPTIONS;
+    if ($MySQLaccess::CGI) { print "
\n"; } + return 1; +} + +# ====================================== +# sub Print_Error_Access: +# ====================================== +sub Print_Error_Access { + my ($error) = @_; + print "\n"; + if ($MySQLaccess::CGI) { print "\n
\n"; }
+    print $MESSAGES{$error};
+    if ($MySQLaccess::CGI) { print "
\n
\n"; } + print "\n"; + return 1; +} + +# ====================================== +# sub Print_Error_Messages: +# ====================================== +sub Print_Error_Messages { +# my ($error) = @_; + print "\n"; + if ($MySQLaccess::CGI) { print "\n
\n"; } + foreach $error (@MySQLaccess::Grant::Error) { + print $MESSAGES{$error}; + print $MySQLaccess::CGI ? "
\n" : "\n"; + } + if ($MySQLaccess::CGI) { print "
\n
\n"; } + print "\n"; + return 1; +} + +# ====================================== +# sub Print_Message: +# ====================================== +sub Print_Message { + my ($aref) = @_; + my @messages = @{$aref}; + print "\n"; + if ($MySQLaccess::CGI) { print "\n
\n"; } + foreach $msg (@messages) { + print $msg; + print $MySQLaccess::CGI ? "
\n" : "\n"; + } + if ($MySQLaccess::CGI) { print "
\n
\n"; } + print "\n"; + return 1; +} + +# ====================================== +# sub Print_Edit: +# ====================================== +sub Print_Edit { + print "\n"; + if (!$MySQLaccess::CGI) { + print "Note: Editing the temporary tables is NOT supported in CMD-line mode!\n"; + return 0; + } + print "
\n" + ."
\n" + ."\n" + ."\n" + ." \n" + ." \n" + ."\n" + ."\n" + ." \n" + ."\n" + ."\n" + ." \n" + ."\n" + ."\n" + ." \n" + ."\n" + ."\n" + ." \n" + ."\n" + ."\n" + ." \n" + ."\n" + ."
Copy grant-rules to temporary tables
Edit temporary tables with external application:
" + ." $MySQLaccess::MYSQLADMIN
Preview changes made in temporary tables
Make changes permanent
Restore previous grand-rules
You need write,delete and drop-privileges to perform the above actions
\n" + ."
\n" + ."
\n"; + + return 1; +} + + +# ====================================== +# sub Print_Access_rights: +# print the access-rights on STDOUT +# ====================================== +sub Print_Access_rights { + my ($host,$user,$db,$refhash) = @_; + + if (defined($MySQLaccess::Param{'brief'})) { +# if ($MySQLaccess::CGI) { print "
\n"; }
+       Matrix_Report($host,$user,$db,$refhash);  
+#       if ($MySQLaccess::CGI) { print "
\n"; } + } + else { + Tabular_Report($host,$user,$db,$refhash); + $MySQLaccess::Report::separator = $MySQLaccess::CGI ? "
" : "-"x80; + } + return 1; +} + +# ====================================== +# sub Print_Diff_ACL: +# print the diff. in the grants before and after +# ====================================== +sub Print_Diff_ACL { + my ($aref) = @_; + my @diffs = @{$aref}; + my %block = ( '<' => 'Before', + '>' => 'After', + ); + my %color = ( '<' => 'Green', + '>' => 'Red', + ); + my $curblock = ''; + + # ----------------------------- + # create column-headers + foreach $field (@MySQLaccess::Grant::Privileges) { + push(@headers,substr($field,0,4)); + } + + if ($MySQLaccess::CMD) { + print "\n"; + print "Differences in access-rights BEFORE and AFTER changes in grant-tables\n"; +# print "---------------------------------------------------------------------\n"; + my $line1=""; + my $line2=""; + $line1 .= sprintf("| %-30s|",'Host,User,DB'); + $line2 .= sprintf("+-%-30s+",'-' x 30); + foreach $header (@headers) { + $line1 .= sprintf("%-4s|",$header); + $line2 .= sprintf("%s+",'----'); + } + print "$line2\n"; + print "$line1\n"; + print "$line2\n"; + + $format = "format STDOUT = \n" + . "^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< " . " @|||" x 10 ."\n" + . '$host_user_db,@priv' . "\n" + . ".\n"; +#print $format; + eval $format; + } + if ($MySQLaccess::CGI) { + print "\n"; + print "\n"; + print ""; + print "\n"; + print "\n"; + $line1 .= sprintf("",'Host, User, DB'); + foreach $header (@headers) { + $line1 .= sprintf("",$header); + } + print "$line1\n"; + } + + foreach $line (@diffs) { + $type = substr($line,0,1); + $line = substr($line,1); + ($host,$user,$db,@priv) = split(/,/,$line); + if ($MySQLaccess::CMD) { + if ($type ne $curblock) { + $curblock = $type; + print $block{$curblock},":\n"; + } + #print "$line\n"; + write; + } + if ($MySQLaccess::CGI) { + if ($type ne $curblock) { + $curblock = $type; + print "\n"; + } + $line1=""; + foreach $field (@priv) { + $line1 .= sprintf("",$field); + } + print "$line1\n"; + } + } + print "\n"; + if ($MySQLaccess::CMD) { + print "---------------------------------------------------------------------\n"; + } + if ($MySQLaccess::CGI) { + print "
"; + print "Differences in access-rights BEFORE " + ."and '}>AFTER changes to grant-tables\n"; + print "
%-20s%-4s
$block{$curblock}
$host, $user, $db%-4s

"; + } + + + return 1; +} + +# ====================================== +# sub Tabular_Report +# Tabular report, +# suitable for 1 triple (host,db,user) +# ====================================== +sub Tabular_Report { + my ($host,$user,$db,$a) = @_; + my $column=2; + + # ----------------------------- + # separator + if ($MySQLaccess::Report::separator) { print "$MySQLaccess::Report::separator\n"; } + + # ----------------------------- + # print table of access-rights + my $rows = int(@MySQLaccess::Grant::Privileges/2); #round up + my @table=(); + $j=0; + for $i (0 .. $rows-1) { + $table[$j]=$MySQLaccess::Grant::Privileges[$i]; + $j = $j+2; + } + $j=1; + for $i ($rows .. $#MySQLaccess::Grant::Privileges) { + $table[$j]=$MySQLaccess::Grant::Privileges[$i]; + $j = $j+2; + } + if ($MySQLaccess::CMD) { + print "\n"; + print "Access-rights\n"; + print "for USER '$user', from HOST '$host', to DB '$db'\n"; + } + if ($MySQLaccess::CGI) { + print "\n"; + print "\n"; + } + if ($MySQLaccess::CGI) { + print ""; + print "\n"; + print "\n"; + } + if ($MySQLaccess::CMD) { + print "\t+-----------------+---+\t+-----------------+---+"; + } + foreach $field (@table) { + if ($MySQLaccess::CMD) { + if ($column==2) { print "\n\t"; $column=1;} + else { print "\t"; $column=2;} + printf "| %-15s | %s |",$field,$Answer{$a->{$field}}; + } + if ($MySQLaccess::CGI) { + if ($column==2) { print "\n\n"; $column=1;} + else { print ""; $column=2;} + printf " \n",$field,$Answer{$a->{$field}}; + } + } + print "\n"; + if ($MySQLaccess::CMD) { + print "\t+-----------------+---+\t+-----------------+---+\n"; + } + if ($MySQLaccess::CGI) { + print "\n
"; + print "Access-rights\n"; + print "for USER '$user', from HOST '$host', to DB '$db'\n"; + print "
%-15s%s

"; + } + + # --------------- + # print notes: + foreach $note (@MySQLaccess::Grant::Notes) { + my $message = $MESSAGES{$note}; + $message =~ s/\$user/$user/g; + $message =~ s/\$db/$db/g; + $message =~ s/\$host/$host/g; + $message =~ s/\$password/$password/g; + $PREFIX='NOTE'; + if ($MySQLaccess::CMD) { + my @lines = split(/\n/,$message); + foreach $line (@lines) { + print "$PREFIX:\t $line\n"; + $PREFIX=' '; + } + } + if ($MySQLaccess::CGI) { + print "$PREFIX: $message
\n"; + } + } + + # --------------- + # print warnings: + foreach $warning (@MySQLaccess::Grant::Warnings) { + my $message = $MESSAGES{$warning}; + $message =~ s/\$user/$user/g; + $message =~ s/\$db/$db/g; + $message =~ s/\$host/$host/g; + $message =~ s/\$password/$password/g; + $PREFIX='BEWARE'; + if ($MySQLaccess::CMD) { + my @lines = split(/\n/,$message); + foreach $line (@lines) { + print "$PREFIX:\t $line\n"; + $PREFIX=' '; + } + } + if ($MySQLaccess::CGI) { + print "$PREFIX: $message
\n"; + } + } + + # --------------- + # print errors: + foreach $error (@MySQLaccess::Grant::Errors) { + my $message = $MESSAGES{$error}; + $message =~ s/\$user/$user/g; + $message =~ s/\$db/$db/g; + $message =~ s/\$host/$host/g; + $message =~ s/\$password/$password/g; + $PREFIX='ERROR'; + if ($MySQLaccess::CMD) { + my @lines = split(/\n/,$message); + foreach $line (@lines) { + print "$PREFIX:\t $line\n"; + $PREFIX=' '; + } + } + if ($MySQLaccess::CGI) { + print "$PREFIX: $message
\n"; + } + } + + # --------------- + # inform if there are no rules ==> full access for everyone. + if ($MySQLaccess::Grant::full_access) { print "$MESSAGES{'full_access'}\n"; } + + # --------------- + # print the rules used + print "\n"; + if ($MySQLaccess::CMD) { + print "The following rules are used:\n"; + foreach $field (sort(keys(%MySQLaccess::Grant::Rules))) { + my $rule = (defined($MESSAGES{$MySQLaccess::Grant::Rules{$field}}) ? $MESSAGES{$MySQLaccess::Grant::Rules{$field}} : $MySQLaccess::Grant::Rules{$field}); + $rule =~ s/\t/','/g; + printf " %-5s : '%s'\n",$field,$rule; + } + } + if ($MySQLaccess::CGI) { + print "
\n"; + print "\n"; + print "\n"; + foreach $field (sort(keys(%MySQLaccess::Grant::Rules))) { + my $rule = (defined($MESSAGES{$MySQLaccess::Grant::Rules{$field}}) ? $MESSAGES{$MySQLaccess::Grant::Rules{$field}} : $MySQLaccess::Grant::Rules{$field}); + $rule =~ s/\t/','/g; + printf "\n",$field,$rule; + } + print "
The following rules are used:
%-5s'%s'
\n"; + } + + return 1; +} + +# ====================================== +# sub Matrix_Report: +# single-line output foreach triple, +# no notes,warnings,... +# ====================================== +sub Matrix_Report { + my ($host,$user,$db,$a) = @_; + my @headers = (); + + if (! $headers) { + # ----------------------------- + # create column-headers + foreach $field (@MySQLaccess::Grant::Privileges) { + push(@headers,substr($field,0,4)); + } + + # ----------------------------- + # print column-headers + print "\n"; + if ($MySQLaccess::CMD) { + my $line1=""; + my $line2=""; + foreach $header (@headers) { + $line1 .= sprintf("%-4s ",$header); + $line2 .= sprintf("%s ",'----'); + } + $line1 .= sprintf("| %-20s",'Host,User,DB'); + $line2 .= sprintf("+ %-20s",'-' x 20); + print "$line1\n"; + print "$line2\n"; + } + if ($MySQLaccess::CGI) { + print "\n"; + my $line1=""; + foreach $header (@headers) { + $line1 .= sprintf("",$header); + } + $line1 .= sprintf("",'Host, User, DB'); + print "$line1\n"; + } + + # ---------------------------- + # column-headers should only be + # printed once. + $MySQLaccess::Report::headers=1; + } + + # ------------------------ + # print access-information + if ($MySQLaccess::CMD) { + foreach $field (@MySQLaccess::Grant::Privileges) { + printf " %-2s ",$Answer{$a->{$field}}; + } + printf "| %-20s",join(',',$host,$user,$db); + print "\n"; + } + if ($MySQLaccess::CGI) { + print ""; + foreach $field (@MySQLaccess::Grant::Privileges) { + printf "",$Answer{$a->{$field}}; + } + printf "",join(', ',$host,$user,$db); + print "\n"; + } + + return 1; +} + + +# ====================================== +# sub Raw_Report: +# single-line output foreach triple, +# no notes,warnings,... +# ====================================== +sub Raw_Report { + my ($host,$user,$db,$a) = @_; + my @headers = (); + my $string = ""; + + # ------------------------ + # print access-information + $string = "$host,$user,$db,"; + foreach $field (@MySQLaccess::Grant::Privileges) { + $string .= $Answer{$a->{$field}} . ","; + } + return $string; +} + + +####################################################################### +package MySQLaccess::Wildcards; +BEGIN { + $DEBUG = 0; + $DEBUG = $MySQLaccess::DEBUG unless ($DEBUG); +} +# ############################################ +# SQL, WILDCARDS and REGULAR EXPRESSIONS +# ============================================ +# translage SQL-expressions to Reg-expressions +# ============================================ +sub SQL2Reg { + my ($expr) = @_; + my $expr_o = $expr; + $expr =~ s/\./\\./g; + $expr =~ s/\\%/\002/g; + $expr =~ s/%/.*/g; + $expr =~ s/\002/%/g; + $expr =~ s/\\_/\002/g; + $expr =~ s/_/.+/g; + $expr =~ s/\002/_/g; + MySQLaccess::Debug::Print(2,"$expr_o --> $expr"); + return $expr; +} + +# translage WILDcards to Reg-expressions +# ============================================ +sub Wild2Reg { + my ($expr) = @_; + my $expr_o = $expr; + $expr =~ s/\./\\./g; + $expr =~ s/\\\*/\002/g; + $expr =~ s/\*/.*/g; + $expr =~ s/\002/*/g; + $expr =~ s/\\\?/\002/g; + $expr =~ s/\?/.+/g; + $expr =~ s/\002/?/g; + MySQLaccess::Debug::Print(2,"$expr_o --> $expr"); + return $expr; +} + +# ============================================= +# match a given string with a template +# ============================================= +sub MatchTemplate { + my ($tpl,$string) = @_; + my $match=0; + if ($string=~ /^$tpl$/ or $tpl eq '') { $match=1; } + else { $match=0;} + MySQLaccess::Debug::Print(2,"($tpl,$string) --> $match"); + return $match; +} + +####################################################################### +package MySQLaccess::Host; +BEGIN { + $localhost = undef; + $DEBUG = 2; + $DEBUG = $MySQLaccess::DEBUG unless ($DEBUG); +} +# ====================================== +# sub IP2Name +# return the Name with the corr. IP-nmbr +# (no aliases yet!!) +# ====================================== +sub IP2Name { + my ($ip) = @_; + my $ip_o = $ip; + if ($ip !~ /([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/o) { + MySQLaccess::Debug::Print(3,"'$ip' is not an ip-number, returning IP=$ip"); + return $ip; + } + MySQLaccess::Debug::Print(4,"IP=$ip split up => $1.$2.$3.$4"); + $ip = pack "C4",$1,$2,$3,$4; + MySQLaccess::Debug::Print(4,"IP packed -> >>$ip<<\n"); + my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr($ip, AF_INET); + MySQLaccess::Debug::Print(3,"IP=$ip_o => hostname=$name"); + MySQLaccess::Debug::Print(4,"aliases=$aliases"); + MySQLaccess::Debug::Print(4,"addrtype=$addrtype - length=$length"); + return ($name || $ip); + #return ($name || undef); +} + +# ====================================== +# sub Name2IP +# return the IP-number of the host +# ====================================== +sub Name2IP { + my ($name) = @_; + if ($name =~ /[%_]/) { + MySQLaccess::Debug::Print(3,"'$name' contains SQL-wildcards, returning name=$name"); + return $name; + } + my ($_name,$aliases,$addrtype,$length,@addrs) = gethostbyname($name); + my ($a,$b,$c,$d) = unpack('C4',$addrs[0]); + my $ip = "$a.$b.$c.$d"; + MySQLaccess::Debug::Print(3,"hostname=$name => IP=$ip"); + MySQLaccess::Debug::Print(4,"aliases=$aliases"); + MySQLaccess::Debug::Print(4,"addrtype=$addrtype - length=$length"); + #if ($ip ne "") { return "$ip"; } + #else { return undef; } + return ($ip || $name); +} + +# ======================================== +# sub LocalHost +# some special action has to be taken for +# the localhost +# ======================================== +sub LocalHost { + if (!defined($MySQLaccess::Host::localhost)) { + $MySQLaccess::Host::localhost = Sys::Hostname::hostname(); + MySQLaccess::Debug::Print(3,"Setting package variable \$localhost=$MySQLaccess::Host::localhost"); + } + my $host = $localhost; + MySQLaccess::Debug::Print(3,"localhost = $host"); + return $host; +} + +# ======================================== +# check if the given hostname (or ip) +# corresponds with the localhost +# ======================================== +sub Is_localhost { + my ($host_tpl) = @_; + my $isit = 0; + if (($MySQLaccess::host_name eq $localhost) or ($MySQLaccess::host_ip eq $local_ip)) { + MySQLaccess::Debug::Print(2,"Checking for localhost"); + MySQLaccess::Debug::Print(3,"because ($MySQLaccess::host_name EQ $localhost) AND ($MySQLaccess::host_ip EQ $local_ip)"); + $isit = ( 'localhost' =~ /$host_tpl/ ) ? 1 : 0; + MySQLaccess::Debug::Print(3," 'localhost' =?= $host_tpl -> $isit"); + return $isit; + } + else { + MySQLaccess::Debug::Print(4,"Not checking for localhost"); + MySQLaccess::Debug::Print(4,"because ($MySQLaccess::host_name != $localhost) AND ($MySQLaccess::host_ip != $local_ip)"); + return 0; + } +} + + +# ========================================= +# check if host (IP or name) can be matched +# on the template. +# ========================================= +sub MatchTemplate { + my ($host,$tpl) = @_; + my $match = 0; + + MySQLaccess::Debug::Print(1, "($host) =?= ($tpl)"); + + my $host_name = IP2Name($host); + my $host_ip = Name2IP($host); + + MySQLaccess::Debug::Print(2, "name=$host_name ; ip=$host_ip"); + $match = (MySQLaccess::Wildcards::MatchTemplate($tpl,$host_name) or + MySQLaccess::Wildcards::MatchTemplate($tpl,$host_ip)); + + MySQLaccess::Debug::Print(2, "($host_name,$host_ip) =?= ($tpl): $ncount"); + + return $match; +} + +######################################################################## +package MySQLaccess::Debug; +BEGIN { + my $dbg_file = "$MySQLaccess::script_log"; + open(DEBUG,"> $dbg_file") or warn "Could not open outputfile $dbg_file for debugging-info\n"; + select DEBUG; + $| = 1; + select STDOUT; +} +# ========================================= +# Print debugging information on STDERR +# ========================================= +sub Print { + my ($level,$mesg) = @_; + my ($pack,$file,$line,$subname,$hasargs,$wantarray) = caller(1); + my ($PACK) = split('::',$subname); + my $DEBUG = ${$PACK."::DEBUG"} ? ${$PACK."::DEBUG"} : $MySQLaccess::DEBUG ; + my ($sec,$min,$hour) = localtime(); + print DEBUG "[$hour:$min:$sec $subname] $mesg\n" if ($DEBUG>=$level); +} + diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh new file mode 100755 index 00000000000..77744777c1c --- /dev/null +++ b/scripts/mysqlbug.sh @@ -0,0 +1,380 @@ +#!/bin/sh +# Create a bug report and mail it to the mysql mailing list +# Based on glibc bug reporting script. + +echo "Finding system information for a MySQL bug report" + +VERSION="@VERSION@" +COMPILATION_COMMENT="@COMPILATION_COMMENT@" +BUGmysql="mysql@lists.mysql.com" +# This is set by configure +COMP_ENV_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@'" +CONFIGURE_LINE="@CONF_COMMAND@" + +LIBC_INFO="" +for pat in /lib/libc.* /lib/libc-* /usr/lib/libc.* /usr/lib/libc-* +do + TMP=`ls -l $pat 2>/dev/null` + if test $? = 0 + then + LIBC_INFO="$LIBC_INFO +$TMP" + fi +done + +PATH=../client:$PATH:/bin:/usr/bin:/usr/local/bin +export PATH + +BUGADDR=${1-$BUGmysql} +ENVIRONMENT=`uname -a` + +: ${USER=${LOGNAME-`whoami`}} + +COMMAND=`echo $0|sed 's%.*/\([^/]*\)%\1%'` + +# Try to create a secure tmpfile +umask 077 +TEMPDIR=/tmp/mysqlbug-$$ +mkdir $TEMPDIR || (echo "can not create directory in /tmp, aborting"; exit 1;) +TEMP=${TEMPDIR}/mysqlbug + +trap 'rm -f $TEMP $TEMP.x; rmdir $TEMPDIR; exit 1' 1 2 3 13 15 +trap 'rm -f $TEMP $TEMP.x; rmdir $TEMPDIR' 0 + +# How to read the passwd database. +PASSWD="cat /etc/passwd" + +if test -f /usr/lib/sendmail +then + MAIL_AGENT="/usr/lib/sendmail -oi -t" +elif test -f /usr/sbin/sendmail +then + MAIL_AGENT="/usr/sbin/sendmail -oi -t" +else + MAIL_AGENT="rmail $BUGmysql" +fi + +# Figure out how to echo a string without a trailing newline +N=`echo 'hi there\c'` +case "$N" in + *c) ECHON1='echo -n' ECHON2= ;; + *) ECHON1=echo ECHON2='\c' ;; +esac + +# Find out the name of the originator of this PR. +if test -n "$NAME" +then + ORIGINATOR="$NAME" +elif test -f $HOME/.fullname +then + ORIGINATOR="`sed -e '1q' $HOME/.fullname`" +else + # Must use temp file due to incompatibilities in quoting behavior + # and to protect shell metacharacters in the expansion of $LOGNAME + $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP + ORIGINATOR="`cat $TEMP`" + rm -f $TEMP +fi + +if test -n "$ORGANIZATION" +then + if test -f "$ORGANIZATION" + then + ORGANIZATION="`cat $ORGANIZATION`" + fi +else + if test -f $HOME/.organization + then + ORGANIZATION="`cat $HOME/.organization`" + elif test -f $HOME/.signature + then + ORGANIZATION=`sed -e "s/^/ /" $HOME/.signature; echo ">"` + fi +fi + +PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` + +which_1 () +{ + for cmd + do + # Absolute path ?. + if expr "x$cmd" : "x/" > /dev/null + then + echo "$cmd" + exit 0 + else + for d in $PATH_DIRS + do + file="$d/$cmd" + if test -x "$file" -a ! -d "$file" + then + echo "$file" + exit 0 + fi + done + fi + done + exit 1 +} + +change_editor () +{ + echo "You can change editor by setting the environment variable VISUAL." + echo "If your shell is a bourne shell (sh) do" + echo "VISUAL=your_editors_name; export VISUAL" + echo "If your shell is a C shell (csh) do" + echo "setenv VISUAL your_editors_name" +} + +# If they don't have a preferred editor set, then use emacs +if test -z "$VISUAL" +then + if test -z "$EDITOR" + then + EDIT=emacs + else + EDIT="$EDITOR" + fi +else + EDIT="$VISUAL" +fi + +#which_1 $EDIT +used_editor=`which_1 $EDIT` + +echo "test -x $used_editor" +if test -x "$used_editor" +then + echo "Using editor $used_editor"; + change_editor + sleep 2 +else + echo "Could not find a text editor. (tried $EDIT)" + change_editor + exit 1 +fi + +# Find out some information. +SYSTEM=`( test -f /bin/uname && /bin/uname -a ) || \ + ( test -f /usr/bin/uname && /usr/bin/uname -a ) || echo ""` +ARCH=`test -f /bin/arch && /bin/arch` +MACHINE=`test -f /bin/machine && /bin/machine` +FILE_PATHS= + +for cmd in perl make gmake gcc cc +do + file=`which_1 $cmd` + if test $? = 0 + then + if test $cmd = "gcc" + then + GCC_INFO=`$file -v 2>&1` + elif test $cmd = "perl" + then + PERL_INFO=`$file -v | grep -i version 2>&1` + fi + FILE_PATHS="$FILE_PATHS $file" + fi +done + +admin=`which_1 mysqladmin` +MYSQL_SERVER= +if test -x "$admin" +then + MYSQL_SERVER=`$admin version 2> /dev/null` + if test "$?" = "1" + then + MYSQL_SERVER="" + fi +fi + +SUBJECT_C="[50 character or so descriptive subject here (for reference)]" +ORGANIZATION_C='' +LICENCE_C='[none | licence | email support | extended email support ]' +SYNOPSIS_C='' +SEVERITY_C='<[ non-critical | serious | critical ] (one line)>' +PRIORITY_C='<[ low | medium | high ] (one line)>' +CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>' +RELEASE_C='' +ENVIRONMENT_C='' +DESCRIPTION_C='' +HOW_TO_REPEAT_C='' +FIX_C='' + + +cat > $TEMP <'). +SEND-PR: +From: ${USER} +To: ${BUGADDR} +Subject: $SUBJECT_C + +>Description: + $DESCRIPTION_C +>How-To-Repeat: + $HOW_TO_REPEAT_C +>Fix: + $FIX_C + +>Submitter-Id: +>Originator: ${ORIGINATOR} +>Organization: +${ORGANIZATION- $ORGANIZATION_C} +>MySQL support: $LICENCE_C +>Synopsis: $SYNOPSIS_C +>Severity: $SEVERITY_C +>Priority: $PRIORITY_C +>Category: mysql +>Class: $CLASS_C +>Release: mysql-${VERSION} ($COMPILATION_COMMENT) +`test -n "$MYSQL_SERVER" && echo ">Server: $MYSQL_SERVER"` +>Environment: + $ENVIRONMENT_C +`test -n "$SYSTEM" && echo "System: $SYSTEM"` +`test -n "$ARCH" && echo "Architecture: $ARCH"` +`test -n "$MACHINE" && echo "Machine: $MACHINE"` +`test -n "$FILE_PATHS" && echo "Some paths: $FILE_PATHS"` +`test -n "$GCC_INFO" && echo "GCC: $GCC_INFO"` +`test -n "$COMP_ENV_INFO" && echo "Compilation info: $COMP_ENV_INFO"` +`test -n "$LIBC_INFO" && echo "LIBC: $LIBC_INFO"` +`test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"` +`test -n "$PERL_INFO" && echo "Perl: $PERL_INFO"` +EOF + +chmod u+w $TEMP +cp $TEMP $TEMP.x + +eval $EDIT $TEMP + +if cmp -s $TEMP $TEMP.x +then + echo "File not changed, no bug report submitted." + cp $TEMP /tmp/failed-mysql-bugreport + echo "The raw bug report exists in /tmp/failed-mysql-bugreport" + echo "If you use this remember that the first lines of the report now is a lie.." + exit 1 +fi + +# +# Check the enumeration fields + +# This is a "sed-subroutine" with one keyword parameter +# (with workaround for Sun sed bug) +# +SED_CMD=' +/$PATTERN/{ +s||| +s|<.*>|| +s|^[ ]*|| +s|[ ]*$|| +p +q +}' + + +while :; do + CNT=0 + + # + # 1) Severity + # + PATTERN=">Severity:" + SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$SEVERITY" in + ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'." + esac + # + # 2) Priority + # + PATTERN=">Priority:" + PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$PRIORITY" in + ""|low|medium|high) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'." + esac + # + # 3) Class + # + PATTERN=">Class:" + CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP` + case "$CLASS" in + ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;; + *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'." + esac + + # + # 4) Synopsis + # + VALUE=`grep "^>Synopsis:" $TEMP | sed 's/>Synopsis:[ ]*//'` + case "$VALUE" in + "$SYNOPSIS_C") echo "$COMMAND: \`$VALUE' is not a valid value for \`Synopsis'." ;; + *) CNT=`expr $CNT + 1` + esac + + test $CNT -lt 4 && + echo "Errors were found with the problem report." + + + # Check if subject of mail was changed, if not, use Synopsis field + # + subject=`grep "^Subject" $TEMP| sed 's/^Subject:[ ]*//'` + if [ X"$subject" = X"$SUBJECT_C" -o X"$subject" = X"$SYNOPSIS_C" ]; then + subject=`grep Synopsis $TEMP | sed 's/>Synopsis:[ ]*//'` + sed "s/^Subject:[ ]*.*/Subject: $subject/" $TEMP > $TEMP.tmp + mv -f $TEMP.tmp $TEMP + fi + + while :; do + $ECHON1 "a)bort, e)dit or s)end? $ECHON2" + read input + case "$input" in + a*) + echo "$COMMAND: problem report saved in $HOME/dead.mysqlbug." + cat $TEMP >> $HOME/dead.mysqlbug + xs=1; exit + ;; + e*) + eval $EDIT $TEMP + continue 2 + ;; + s*) + break 2 + ;; + esac + done +done +# +# Remove comments and send the problem report +# (we have to use patterns, where the comment contains regex chars) +# +# /^>Originator:/s;$ORIGINATOR;; +sed -e " +/^SEND-PR:/d +/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;; +/^>Confidential:/s;<.*>;; +/^>Synopsis:/s;$SYNOPSIS_C;; +/^>Severity:/s;<.*>;; +/^>Priority:/s;<.*>;; +/^>Class:/s;<.*>;; +/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;; +/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;; +/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;; +/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;; +/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;; +" $TEMP > $TEMP.x + +if $MAIL_AGENT < $TEMP.x +then + echo "$COMMAND: problem report sent" + xs=0; exit +else + echo "$COMMAND: mysterious mail failure, report not sent." + echo "$COMMAND: problem report saved in $HOME/dead.mysqlbug." + cat $TEMP >> $HOME/dead.mysqlbug +fi + +exit 0 diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh new file mode 100755 index 00000000000..85a92c6ea88 --- /dev/null +++ b/scripts/mysqlhotcopy.sh @@ -0,0 +1,591 @@ +#!@PERL@ + +use strict; +use Getopt::Long; +use Data::Dumper; +use File::Basename; +use File::Path; +use DBI; + +=head1 NAME + +mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases + +=head1 SYNOPSIS + + mysqlhotcopy db_name + + mysqlhotcopy --suffix=_copy db_name_1 ... db_name_n + + mysqlhotcopy db_name_1 ... db_name_n /path/to/new_directory + +WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. + +=cut + +# Documentation continued at end of file + +my $VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/o); + +my $OPTIONS = <<"_OPTIONS"; + +Usage: $0 db_name new_db_name + + -?, --help display this helpscreen and exit + -u, --user=# user for database login if not current user + -p, --password=# password to use when connecting to server + -P, --port=# port to use when connecting to local server + -S, --socket=# socket to use when connecting to local server + + --allowold don't abort if target already exists (rename it _old) + --keepold don't delete previous (now renamed) target when done + --noindices don't copy index files + --method=# method for copy (only "cp" currently supported) + + -q, --quiet be silent except for errors + --debug enable debug + -n, --dryrun report actions without doing them + + --regexp=# copy all databases with names matching regexp + --suffix=# suffix for names of copied databases + --checkpoint=# insert checkpoint entry into specified db.table + --flushlog flush logs once all tables are locked +_OPTIONS + +sub usage { + die @_, $OPTIONS; +} + +my %opt = ( + user => getpwuid($>), + indices => 1, # for safety + allowold => 0, # for safety + keepold => 0, + method => "cp", + flushlog => 0, +); +Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P +GetOptions( \%opt, + "help", + "user|u=s", + "password|p=s", + "port|P=s", + "socket|S=s", + "allowold!", + "keepold!", + "indices!", + "method=s", + "debug", + "quiet|q", + "mv!", + "regexp=s", + "suffix=s", + "checkpoint=s", + "flushlog", + "dryrun|n", +) or usage("Invalid option"); + +# @db_desc +# ========== +# a list of hash-refs containing: +# +# 'src' - name of the db to copy +# 'target' - destination directory of the copy +# 'tables' - array-ref to list of tables in the db +# 'files' - array-ref to list of files to be copied +# + +my @db_desc = (); +my $tgt_name = undef; + +if ( $opt{regexp} || $opt{suffix} || @ARGV > 2 ) { + $tgt_name = pop @ARGV unless ( exists $opt{suffix} ); + @db_desc = map { { 'src' => $_ } } @ARGV; +} +else { + usage("Database name to hotcopy not specified") unless ( @ARGV ); + + @db_desc = ( { 'src' => $ARGV[0] } ); + if ( @ARGV == 2 ) { + $tgt_name = $ARGV[1]; + } + else { + $opt{suffix} = "_copy"; + } +} + +my $mysqld_help; +my %mysqld_vars; +my $start_time = time; +$0 = $1 if $0 =~ m:/([^/]+)$:; +$opt{quiet} = 0 if $opt{debug}; +$opt{allowold} = 1 if $opt{keepold}; + +# --- connect to the database --- +my $dsn = ";host=localhost"; +$dsn .= ";port=$opt{port}" if $opt{port}; +$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; + +my $dbh = DBI->connect("dbi:mysql:$dsn", $opt{user}, $opt{password}, { + RaiseError => 1, + PrintError => 0, + AutoCommit => 1, +}); + +# --- check that checkpoint table exists if specified --- +if ( $opt{checkpoint} ) { + eval { $dbh->do( qq{ select time_stamp, src, dest, msg + from $opt{checkpoint} where 1 != 1} ); + }; + + die "Error accessing Checkpoint table ($opt{checkpoint}): $@" + if ( $@ ); +} + +# --- get variables from database --- +my $sth_vars = $dbh->prepare("show variables"); +$sth_vars->execute; +while ( my ($var,$value) = $sth_vars->fetchrow_array ) { + $mysqld_vars{ $var } = $value; +} +my $datadir = $mysqld_vars{datadir} + || die "datadir not in mysqld variables"; +$datadir =~ s:/$::; + + +# --- get target path --- +my $tgt_dirname; +if ($tgt_name =~ m:^\w+$:) { + $tgt_dirname = "$datadir/$tgt_name"; +} +elsif ($tgt_name =~ m:/: || $tgt_name eq '.') { + $tgt_dirname = $tgt_name; +} +elsif ( $opt{suffix} ) { + print "copy suffix $opt{suffix}\n" unless $opt{quiet}; +} +else { + die "Target '$tgt_name' doesn't look like a database name or directory path.\n"; +} + +# --- resolve database names from regexp --- +if ( defined $opt{regexp} ) { + my $sth_dbs = $dbh->prepare("show databases"); + $sth_dbs->execute; + while ( my ($db_name) = $sth_dbs->fetchrow_array ) { + push @db_desc, { 'src' => $db_name } if ( $db_name =~ m/$opt{regexp}/o ); + } +} + +# --- get list of tables to hotcopy --- + +my $hc_locks = ""; +my $num_tables = 0; +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->func( '_ListTables' ); + + my $db_dir = "$datadir/$db"; + opendir(DBDIR, $db_dir ) + or die "Cannot open dir '$db_dir': $!"; + + my @db_files = grep { /.+\.\w+$/ } readdir(DBDIR) + or warn "'$db' is an empty database\n"; + + closedir( DBDIR ); + + unless ($opt{indices}) { + @db_files = grep { not /\.(ISM|MYI)$/ } @db_files; + } + + $rdb->{files} = [ @db_files ]; + my @hc_tables = map { "$db.$_" } @dbh_tables; + $rdb->{tables} = [ @hc_tables ]; + + $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); + $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; + + $num_tables += scalar @hc_tables; + $num_files += scalar @{$rdb->{files}}; +} + +# --- resolve targets for copies --- + +my @targets = (); + +if (length $tgt_name ) { + # explicit destination directory specified + + # GNU `cp -r` error message + die "copying multiple databases, but last argument ($tgt_name) is not a directory\n" + if ( @db_desc > 1 && !(-e $tgt_name && -d $tgt_name ) ); + + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$tgt_name/$rdb->{src}"; + } +} +else { + die "Error: expected \$opt{suffix} to exist" unless ( exists $opt{suffix} ); + + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$datadir/$rdb->{src}$opt{suffix}"; + } +} + +print Dumper( \@db_desc ) if ( $opt{debug} ); + +# --- bail out if all specified databases are empty --- + +die "No tables to hot-copy" unless ( length $hc_locks ); + +# --- create target directories --- + +my @existing = (); +foreach my $rdb ( @db_desc ) { + push @existing, $rdb->{target} if ( -d $rdb->{target} ); +} + +die "Can't hotcopy to '", join( "','", @existing ), "' because already exist and --allowold option not given.\n" + if ( @existing && !$opt{allowold} ); + +retire_directory( @existing ) if ( @existing ); + +foreach my $rdb ( @db_desc ) { + my $tgt_dirpath = $rdb->{target}; + if ( $opt{dryrun} ) { + print "mkdir $tgt_dirpath, 0750\n"; + } + else { + mkdir($tgt_dirpath, 0750) + or die "Can't create '$tgt_dirpath': $!\n"; + } +} + +############################## +# --- PERFORM THE HOT-COPY --- +# +# Note that we try to keep the time between the LOCK and the UNLOCK +# as short as possible, and only start when we know that we should +# be able to complete without error. + +# read lock all the tables we'll be copying +# in order to get a consistent snapshot of the database + +if ( $opt{checkpoint} ) { + # convert existing READ lock on checkpoint table into WRITE lock + unless ( $hc_locks =~ s/$opt{checkpoint}\s+READ/$opt{checkpoint} WRITE/ ) { + $hc_locks .= ", $opt{checkpoint} WRITE"; + } +} + +my $hc_started = time; # count from time lock is granted + +if ( $opt{dryrun} ) { + print "LOCK TABLES $hc_locks\n"; + print "FLUSH TABLES\n"; + print "FLUSH LOGS\n" if ( $opt{flushlog} ); +} +else { + my $start = time; + $dbh->do("LOCK TABLES $hc_locks"); + printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; + $hc_started = time; # count from time lock is granted + + # flush tables to make on-disk copy uptodate + $start = time; + $dbh->do("FLUSH TABLES"); + printf "Flushed tables in %d seconds.\n", time-$start unless $opt{quiet}; + $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); +} + +my @failed = (); + +foreach my $rdb ( @db_desc ) { + my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; + next unless @files; + eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; + + push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" + if ( $@ ); + + if ( $opt{checkpoint} ) { + my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; + + eval { + $dbh->do( qq{ insert into $opt{checkpoint} (src, dest, msg) + VALUES ( '$rdb->{src}', '$rdb->{target}', '$msg' ) + } ); + }; + + if ( $@ ) { + warn "Failed to update checkpoint table: $@\n"; + } + } +} + +if ( $opt{dryrun} ) { + print "UNLOCK TABLES\n"; + if ( @existing && !$opt{keepold} ) { + my @oldies = map { $_ . '_old' } @existing; + print "rm -rf @oldies\n" + } + $dbh->disconnect(); + exit(0); +} +else { + $dbh->do("UNLOCK TABLES"); +} + +my $hc_dur = time - $hc_started; +printf "Unlocked tables.\n" unless $opt{quiet}; + +# +# --- HOT-COPY COMPLETE --- +########################### + +$dbh->disconnect; + +if ( @failed ) { + # hotcopy failed - cleanup + # delete any @targets + # rename _old copy back to original + + print "Deleting @targets \n" if $opt{debug}; + rmtree([@targets]); + if (@existing) { + print "Restoring @existing from back-up\n" if $opt{debug}; + foreach my $dir ( @existing ) { + rename("${dir}_old", $dir ) + or warn "Can't rename ${dir}_old to $dir: $!\n"; + } + } + + die join( "\n", @failed ); +} +else { + # hotcopy worked + # delete _old unless $opt{keepold} + + if ( @existing && !$opt{keepold} ) { + my @oldies = map { $_ . '_old' } @existing; + print "Deleting previous copy in @oldies\n" if $opt{debug}; + rmtree([@oldies]); + } + + printf "$0 copied %d tables (%d files) in %d second%s (%d seconds overall).\n", + $num_tables, $num_files, + $hc_dur, ($hc_dur==1)?"":"s", time - $start_time + unless $opt{quiet}; +} + +exit 0; + + +# --- + +sub copy_files { + my ($method, $files, $target) = @_; + my @cmd; + print "Copying ".@$files." files...\n" unless $opt{quiet}; + if ($method =~ /^s?cp\b/) { # cp or scp with optional flags + @cmd = ($method); + # add option to preserve mod time etc of copied files + # not critical, but nice to have + push @cmd, "-p" if $^O =~ m/^(solaris|linux)$/; + # add files to copy and the destination directory + push @cmd, @$files, $target; + } + else { + die "Can't use unsupported method '$method'\n"; + } + + if ( $opt{dryrun} ) { + print "@cmd\n"; + next; + } + + print "Executing '@cmd'\n" if $opt{debug}; + my $cp_status = system @cmd; + if ($cp_status != 0) { + die "Error: @cmd failed ($cp_status) while copying files.\n"; + } +} + +sub retire_directory { + my ( @dir ) = @_; + + foreach my $dir ( @dir ) { + my $tgt_oldpath = $dir . '_old'; + if ( $opt{dryrun} ) { + print "rmtree $tgt_oldpath\n" if ( -d $tgt_oldpath ); + print "rename $dir, $tgt_oldpath\n"; + next; + } + + if ( -d $tgt_oldpath ) { + print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet}; + rmtree([$tgt_oldpath]) + } + rename($dir, $tgt_oldpath) + or die "Can't rename $dir=>$tgt_oldpath: $!\n"; + print "Existing hotcopy directory renamed to '$tgt_oldpath'\n" unless $opt{quiet}; + } +} + +__END__ + +=head1 DESCRIPTION + +mysqlhotcopy is designed to make stable copies of live MySQL databases. + +Here "live" means that the database server is running and the database +may be in active use. And "stable" means that the copy will not have +any corruptions that could occur if the table files were simply copied +without first being locked and flushed from within the server. + +=head1 OPTIONS + +=over 4 + +=item --checkpoint checkpoint-table + +As each database is copied, an entry is written to the specified +checkpoint-table. This has the happy side-effect of updating the +MySQL update-log (if it is switched on) giving a good indication of +where roll-forward should begin for backup+rollforward schemes. + +The name of the checkpoint table should be supplied in database.table format. +The checkpoint-table must contain at least the following fields: + +=over 4 + + time_stamp timestamp not null + src varchar(32) + dest varchar(60) + msg varchar(255) + +=back + +=item --suffix suffix + +Each database is copied back into the originating datadir under +a new name. The new name is the original name with the suffix +appended. + +If only a single db_name is supplied and the --suffix flag is not +supplied, then "--suffix=_copy" is assumed. + +=item --allowold + +Move any existing version of the destination to a backup directory for +the duration of the copy. If the copy successfully completes, the backup +directory is deleted - unless the --keepold flag is set. If the copy fails, +the backup directory is restored. + +The backup directory name is the original name with "_old" appended. +Any existing versions of the backup directory are deleted. + +=item --keepold + +Behaves as for the --allowold, with the additional feature +of keeping the backup directory after the copy successfully completes. + +=item --flushlog + +Rotate the log files by executing "FLUSH LOGS" after all tables are +locked, and before they are copied. + +=item --regexp pattern + +Copy all databases with names matching the pattern. + +=item -?, --help + +Display helpscreen and exit + +=item -u, --user=# + +user for database login if not current user + +=item -p, --password=# + +password to use when connecting to server + +=item -P, --port=# + +port to use when connecting to local server + +=item -S, --socket=# + +UNIX domain socket to use when connecting to local server + +=item --noindices + +don't copy index files + +=item --method=# + +method for copy (only "cp" currently supported) + +=item -q, --quiet + +be silent except for errors + +=item --debug + +Debug messages are displayed + +=item -n, --dryrun + +Display commands without actually doing them + +=back + +=head1 WARRANTY + +This software is free and comes without warranty of any kind. You +should never trust backup software without studying the code yourself. +Study the code inside this script and only rely on it if I believe +that it does the right thing for you. + +Patches adding bug fixes, documentation and new features are welcome. + +=head1 TO DO + +Allow a list of tables (or regex) to be given on the command line to +enable a logically-related subset of the tables to be hot-copied +rather than force the whole db to be copied in one go. + +Extend the above to allow multiple subsets of tables to be specified +on the command line: + + mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : + + +where ":" delimits the subsets, the /^foo_/ indicates all tables +with names begining with "foo_" and the "+" indicates all tables +not copied by the previous subsets. + +Add option to lock each table in turn for people who don't need +cross-table integrity. + +Add option to FLUSH STATUS just before UNLOCK TABLES. + +Add support for other copy methods (eg tar to single file?). + +Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. + +Add option to only copy the first 65KB of index files. That simplifies +recovery (recovery with no index file at all is complicated). + +=head1 AUTHOR + +Tim Bunce + +Martin Waite - added checkpoint, flushlog, regexp and dryrun options + +Ralph Corderoy - Added synonyms for commands +=cut diff --git a/scripts/safe_mysqld-watch.sh b/scripts/safe_mysqld-watch.sh new file mode 100755 index 00000000000..0111a41969c --- /dev/null +++ b/scripts/safe_mysqld-watch.sh @@ -0,0 +1,149 @@ +#!/bin/sh +# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB +# This file is public domain and comes with NO WARRANTY of any kind +# +# scripts to start the MySQL demon and restart it if it dies unexpectedly +# +# This should be executed in the MySQL base directory if you are using a +# binary installation that has other paths than you are using. +# +# mysql.server works by first doing a cd to the base directory and from there +# executing safe_mysqld + +# Check if we are starting this relative (for the binary release) +if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./bin/mysqld +then + MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is + DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are +# Check if this is a 'moved install directory' +elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./libexec/mysqld +then + MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is + DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are +else + MY_BASEDIR_VERSION=/usr/local/mysql + DATADIR=/usr/local/mysql/var + ledir=/usr/local/mysql/libexec +fi + +pidfile=$DATADIR/`/bin/hostname`.pid +log=$DATADIR/`/bin/hostname`.log +err=$DATADIR/`/bin/hostname`.err +lockfile=$DATADIR/`/bin/hostname`.lock + +# +# If there exists an old pid file, check if the demon is already running +# Note: The switches to 'ps' may depend on your operating system + +if test -f $pidfile +then + PID=`cat $pidfile` + if /bin/kill -0 $PID + then + if /bin/ps -p $PID | grep mysqld > /dev/null + then # The pid contains a mysqld process + echo "A mysqld process already exists" + echo "A mysqld process already exists at " `date` >> $log + exit 1; + fi + fi + rm -f $pidfile + if test -f $pidfile + then + echo "Fatal error: Can't remove the pid file: $pidfile" + echo "Fatal error: Can't remove the pid file: $pidfile at " `date` >> $log + echo "Please remove it manually and start $0 again" + echo "mysqld demon not started" + exit 1; + fi +fi + +echo "Starting mysqld demon with databases from $DATADIR" + +#Default communication ports +#MYSQL_TCP_PORT=3306 +if test -z "$MYSQL_UNIX_PORT" +then + MYSQL_UNIX_PORT="/tmp/mysql.sock" + export MYSQL_UNIX_PORT +fi +#export MYSQL_TCP_PORT + +# Does this work on all systems? +#if type ulimit | grep "shell builtin" > /dev/null +#then +# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems +#fi + +echo "mysqld started on " `date` >> $log +bin/zap -f $lockfile < /dev/null > /dev/null 2>&1 +rm -f $lockfile +$MY_BASEDIR_VERSION/bin/watchdog_mysqld $lockfile $pidfile $MY_BASEDIR_VERSION/bin $DATADIR 3 10 >> $err 2>&1 & +restart_pid=$! + +while true +do + rm -f $MYSQL_UNIX_PORT $pidfile # Some extra safety + lockfile -1 -r10 $lockfile >/dev/null 2>&1 + if test "$#" -eq 0 + then + nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ + --skip-locking >> $err 2>&1 & + else + nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ + --skip-locking "$@" >> $err 2>&1 & + fi + pid=$! + rm -f $lockfile + wait $pid; + + lockfile -1 -r10 $lockfile >/dev/null 2>&1 + rm -f $lockfile + if test ! -f $pidfile # This is removed if normal shutdown + then + break; + fi + if true + then + # Test if one proces was hanging. + # This is only a fix for Linux (running as base 3 mysqld processes) + # but should work for the rest of the servers. + # The only thing is ps x => redhat 5 gives warnings when using ps -x. + # kill -9 is used or the proces won't react on the kill. + numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld` + echo -e "\nNumber of processes running now: $numofproces" | tee -a $log + I=1 + while test "$I" -le "$numofproces" + do + PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1` + for T in $PROC + do + break + done + # echo "TEST $I - $T **" + if kill -9 $T + then + echo "mysqld proces hanging, pid $T - killed" | tee -a $log + else + break + fi + I=`expr $I + 1` + done + fi + echo "mysqld restarted" | tee -a $log + # Check all tables and repair any wrong tables. + $MY_BASEDIR_VERSION/bin/isamchk -sf $DATADIR/*/*.ISM >> $err 2>&1 +done +if test $restart_pid -gt 0 +then + kill $restart_pid > /dev/null 2>&1 + sleep 1; + kill -9 $restart_pid > /dev/null 2>&1 +fi + +echo -n "mysqld ended on " `date` >> $log +echo "mysqld demon ended" diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh new file mode 100755 index 00000000000..b2965bced90 --- /dev/null +++ b/scripts/safe_mysqld.sh @@ -0,0 +1,188 @@ +#!/bin/sh +# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB +# This file is public domain and comes with NO WARRANTY of any kind +# +# scripts to start the MySQL daemon and restart it if it dies unexpectedly +# +# This should be executed in the MySQL base directory if you are using a +# binary installation that has other paths than you are using. +# +# mysql.server works by first doing a cd to the base directory and from there +# executing safe_mysqld + +trap '' 1 2 3 15 # we shouldn't let anyone kill us + +defaults= +case "$1" in + --no-defaults|--defaults-file=*) + defaults="$1"; shift + ;; +esac + +# Parse arguments to see if caller wants the pid_file somewhere else. +parse_arguments() { + for arg; do + case $arg in + --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; + --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; + --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --log=*) log=`echo "$arg" | sed -e "s;--log=;;"` ;; + --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; + --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + esac + 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 \ + -x ./bin/mysqld +then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + DATADIR=$MY_BASEDIR_VERSION/data +# Check if this is a 'moved install directory' +elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./libexec/mysqld +then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is + DATADIR=$MY_BASEDIR_VERSION/var +else + MY_BASEDIR_VERSION=@prefix@ + DATADIR=@localstatedir@ + ledir=@libexecdir@ +fi + +pid_file=$DATADIR/`/bin/hostname`.pid +MYSQL_UNIX_PORT=@MYSQL_UNIX_ADDR@ +MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ +log=$DATADIR/`/bin/hostname`.log +err_log=$DATADIR/`/bin/hostname`.err +user=@MYSQLD_USER@ + +# Get first arguments from the my.cfg file, groups [mysqld] and [safe_mysqld] +# and then merge with the command line arguments +if test -x ./bin/my_print_defaults; then + print_defaults="./bin/my_print_defaults" +elif test -x @bindir@/my_print_defaults; then + print_defaults="@bindir@/my_print_defaults" +elif test -x @bindir@/mysql_print_defaults; then + print_defaults="@bindir@/mysql_print_defaults" +else + print_defaults="my_print_defaults" +fi +parse_arguments `$print_defaults $defaults mysqld safe_mysqld` +parse_arguments "$@" + +if test ! -x $ledir/mysqld +then + echo "The file $ledir/mysqld doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" + echo "./bin/safe_mysqld". + exit 1; +fi + + +NOHUP_NICENESS=`nohup nice` +if [ "x$NOHUP_NICENESS" = "x0" ] || ! nice --1 nice >/dev/null 2>&1 ; then + NOHUP_NICENESS="nohup" +else + NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" +fi + + +export MYSQL_UNIX_PORT +#export MYSQL_TCP_PORT +touch $err_log; chown $user $err_log + +# +# If there exists an old pid file, check if the daemon is already running +# Note: The switches to 'ps' may depend on your operating system +if test -f $pid_file +then + PID=`cat $pid_file` + if @CHECK_PID@ + then + if @FIND_PROC@ + then # The pid contains a mysqld process + echo "A mysqld process already exists" + echo "A mysqld process already exists at " `date` >> $err_log + exit 1; + fi + fi + rm -f $pid_file + if test -f $pid_file + then + echo "Fatal error: Can't remove the pid file: $pid_file" + echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log + echo "Please remove it manually and start $0 again" + echo "mysqld daemon not started" + exit 1; + fi +fi + +# +# Uncomment the following lines if you want all tables to be automaticly +# checked and repaired at start +# +# echo "Checking tables in $DATADIR" +# $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" + +# Does this work on all systems? +#if type ulimit | grep "shell builtin" > /dev/null +#then +# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems +#fi + +echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log +while true +do + rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety + if test "$#" -eq 0 + then + (trap "" 1 ; exec $NOHUP_NICENESS $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 ) + else + (trap "" ; exec $NOHUP_NICENESS $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ "$@" >> $err_log 2>&1 ) + fi + if test ! -f $pid_file # This is removed if normal shutdown + then + break; + fi + if @IS_LINUX@ + then + # Test if one process was hanging. + # This is only a fix for Linux (running as base 3 mysqld processes) + # but should work for the rest of the servers. + # The only thing is ps x => redhat 5 gives warnings when using ps -x. + # kill -9 is used or the process won't react on the kill. + numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld` + echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log + I=1 + while test "$I" -le "$numofproces" + do + PROC=`ps xa | grep $ledir/mysqld | grep -v "grep" | tail -1` + for T in $PROC + do + break + done + # echo "TEST $I - $T **" + if kill -9 $T + then + echo "mysqld process hanging, pid $T - killed" | tee -a $err_log + else + break + fi + I=`expr $I + 1` + done + fi + echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log +done + +echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log -- cgit v1.2.1 From 16f1f1bc8a350d3f67cf69dd207d36b6a7f6e005 Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Tue, 1 Aug 2000 17:38:08 -0600 Subject: Tim's niceness fix in safe_mysqld.sh - also a test to see if mail notification works --- scripts/safe_mysqld.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index b2965bced90..a5ea4635ab9 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -88,13 +88,12 @@ fi NOHUP_NICENESS=`nohup nice` -if [ "x$NOHUP_NICENESS" = "x0" ] || ! nice --1 nice >/dev/null 2>&1 ; then +if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then NOHUP_NICENESS="nohup" else NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" fi - export MYSQL_UNIX_PORT #export MYSQL_TCP_PORT touch $err_log; chown $user $err_log -- cgit v1.2.1 From 407d7bb8f3e3b53a2f6e3f04a1b7c236512f0cdd Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Wed, 2 Aug 2000 21:19:47 -0600 Subject: Fixed the mess created when I did LOD branch on accident --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index a5ea4635ab9..1f481f07fed 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -21,7 +21,7 @@ esac # Parse arguments to see if caller wants the pid_file somewhere else. parse_arguments() { - for arg; do + for arg in "$@"; do case $arg in --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; -- cgit v1.2.1 From 621c7db2f7162bf6a7ba8ef92010c652524654b9 Mon Sep 17 00:00:00 2001 From: "tim@localhost.polyesthetic.msg" <> Date: Wed, 9 Aug 2000 14:57:59 -0400 Subject: Use @HOSTNAME@ instead of hardcoded /bin/hostname. --- scripts/mysql_install_db.sh | 6 ++---- scripts/safe_mysqld-watch.sh | 9 +++++---- scripts/safe_mysqld.sh | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9cd4af94042..ce6f7155b05 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -77,9 +77,7 @@ then fi fi -# On IRIX hostname is in /usr/bsd so add this to the path -PATH=$PATH:/usr/bsd -hostname=`hostname` # Install this too in the user table +hostname=`@HOSTNAME@` # Install this too in the user table # Check if hostname is valid if test "$IN_RPM" -eq 0 -a $force -eq 0 @@ -287,7 +285,7 @@ then echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "This is done with:" echo "$bindir/mysqladmin -u root -p password 'new-password'" - echo "$bindir/mysqladmin -u root -h `hostname` -p password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname -p password 'new-password'" echo "See the manual for more instructions." # # Print message about upgrading unless we have created a new db table. diff --git a/scripts/safe_mysqld-watch.sh b/scripts/safe_mysqld-watch.sh index 0111a41969c..30f95fd7a86 100755 --- a/scripts/safe_mysqld-watch.sh +++ b/scripts/safe_mysqld-watch.sh @@ -30,10 +30,11 @@ else ledir=/usr/local/mysql/libexec fi -pidfile=$DATADIR/`/bin/hostname`.pid -log=$DATADIR/`/bin/hostname`.log -err=$DATADIR/`/bin/hostname`.err -lockfile=$DATADIR/`/bin/hostname`.lock +hostname=`@HOSTNAME@` +pidfile=$DATADIR/$hostname.pid +log=$DATADIR/$hostname.log +err=$DATADIR/$hostname.err +lockfile=$DATADIR/$hostname.lock # # If there exists an old pid file, check if the demon is already running diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 1f481f07fed..c2da0f2ea73 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -56,11 +56,11 @@ else ledir=@libexecdir@ fi -pid_file=$DATADIR/`/bin/hostname`.pid +pid_file=$DATADIR/`@HOSTNAME@`.pid MYSQL_UNIX_PORT=@MYSQL_UNIX_ADDR@ MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ -log=$DATADIR/`/bin/hostname`.log -err_log=$DATADIR/`/bin/hostname`.err +log=$DATADIR/`@HOSTNAME@`.log +err_log=$DATADIR/`@HOSTNAME@`.err user=@MYSQLD_USER@ # Get first arguments from the my.cfg file, groups [mysqld] and [safe_mysqld] -- cgit v1.2.1 From ea013c2152301e459504451efdb17f4c9bb30877 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 15 Aug 2000 20:09:37 +0300 Subject: Fixed for Ia64 + delayed key creation + a lot of small bug fixes --- scripts/mysqlhotcopy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 85a92c6ea88..bc150ff61a5 100755 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -25,7 +25,7 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/o); +my $VERSION = "1.5"; my $OPTIONS = <<"_OPTIONS"; -- cgit v1.2.1 From a753a3a2ce252a3972cfcd47cf27c689de61b602 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 18 Aug 2000 12:48:00 +0300 Subject: Updated benchmark and results for PostgreSQL 7.0.2 Added more status to the MyISAM files to avoid checking files that has already been checked. --- scripts/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e2e37996c90..f16901a384f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -102,3 +102,6 @@ SUFFIXES = .sh $< > $@-t @CHMOD@ +x $@-t @MV@ $@-t $@ + +# Don't update the files from bitkeeper +%::SCCS/s.% -- cgit v1.2.1 From 90e6424641646d73dec010256e28c05da70cc520 Mon Sep 17 00:00:00 2001 From: "jcole@tetra.spaceapes.com" <> Date: Wed, 23 Aug 2000 07:07:24 -0500 Subject: Updated mysqlhotcopy to use the new ``FLUSH TABLES table_list'' syntax. --- scripts/mysqlhotcopy.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index bc150ff61a5..2084a0b2c02 100755 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -25,7 +25,7 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.5"; +my $VERSION = "1.6"; my $OPTIONS = <<"_OPTIONS"; @@ -180,6 +180,7 @@ if ( defined $opt{regexp} ) { # --- get list of tables to hotcopy --- my $hc_locks = ""; +my $hc_tables = ""; my $num_tables = 0; my $num_files = 0; @@ -208,6 +209,7 @@ foreach my $rdb ( @db_desc ) { $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; + $hc_tables .= join ", ", @hc_tables; $num_tables += scalar @hc_tables; $num_files += scalar @{$rdb->{files}}; @@ -286,7 +288,7 @@ my $hc_started = time; # count from time lock is granted if ( $opt{dryrun} ) { print "LOCK TABLES $hc_locks\n"; - print "FLUSH TABLES\n"; + print "FLUSH TABLES /*!32323 $hc_tables */\n"; print "FLUSH LOGS\n" if ( $opt{flushlog} ); } else { @@ -297,8 +299,8 @@ else { # flush tables to make on-disk copy uptodate $start = time; - $dbh->do("FLUSH TABLES"); - printf "Flushed tables in %d seconds.\n", time-$start unless $opt{quiet}; + $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); } -- cgit v1.2.1 From 066d55c0c09d589d17bf466682134af50cb59e14 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 29 Aug 2000 12:31:01 +0300 Subject: Bug fixes for 3.23.23 --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 65d259a5307..a68df18c41a 100755 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -48,7 +48,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p support-files/* $BASE/support-files -cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib +cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_a.a libmysql_r/.libs/libmysqlclient.so* libmysql_r/libmysqlclient.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $BASE/share/CVS $BASE/share/*/CVS cp -p scripts/* $BASE/bin -- cgit v1.2.1 From 454044ac9e857cf66a48cbe4711e0e6d46d9ea8e Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Wed, 30 Aug 2000 23:58:23 +0300 Subject: Added --port to safe_mysqld --- scripts/safe_mysqld.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index c2da0f2ea73..55147a84852 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -26,6 +26,7 @@ parse_arguments() { --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; --log=*) log=`echo "$arg" | sed -e "s;--log=;;"` ;; --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; @@ -95,7 +96,7 @@ else fi export MYSQL_UNIX_PORT -#export MYSQL_TCP_PORT +export MYSQL_TCP_PORT touch $err_log; chown $user $err_log # -- cgit v1.2.1 From 91033f872c82ade18f6e44f88628f8712fe65892 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Thu, 31 Aug 2000 17:25:30 +0300 Subject: Update to get 3.23.23 to compile --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a68df18c41a..8318ae3d696 100755 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,7 +54,7 @@ cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/ cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@prefix\@ . < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db +$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld -- cgit v1.2.1 From 4496d43faa14cc8d3f81fb861eed37c5974ed6ab Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 2 Sep 2000 07:58:42 +0300 Subject: Quoting of TIMESTAMP columns and small optimizations --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index ce6f7155b05..9d87a0a31cb 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -310,7 +310,7 @@ then echo echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" - echo "Support MySQL by buying support/licenses at http://www.mysql.com/license.htmy." + echo "Support MySQL by buying support/licenses at https://order.mysql.com" echo exit 0 else -- cgit v1.2.1 From be5e4e72b67c1ce6d25ec6d961ed0f6b4d13a106 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Thu, 7 Sep 2000 04:55:17 +0300 Subject: Small bug fixes --- scripts/Makefile.am | 1 + scripts/mysql_install_db.sh | 110 +++++++++++++++++++++++++++----------------- 2 files changed, 69 insertions(+), 42 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index f16901a384f..d4e62172a08 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -71,6 +71,7 @@ SUFFIXES = .sh @RM@ -f $@ $@-t @SED@ \ -e 's!@''bindir''@!$(bindir)!g' \ + -e 's!@''sbindir''@!$(sbindir)!g' \ -e 's!@''scriptdir''@!$(bindir)!g' \ -e 's!@''prefix''@!$(prefix)!g' \ -e 's!@''datadir''@!$(datadir)!g' \ diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9d87a0a31cb..50d147c1ade 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -11,56 +11,82 @@ ldata=@localstatedir@ execdir=@libexecdir@ bindir=@bindir@ +sbindir=@sbindir@ force=0 IN_RPM=0 defaults= -# Are we doing an rpm install? -if test "$1" = "-IN-RPM"; then IN_RPM=1; shift; fi -if test "$1" = "--force"; then force=1; shift; fi - -# Get mysqld/safe_mysqld options from /etc/my.cnf or ~/.my.cnf -case "$1" in - --no-defaults) defaults="$1"; conf=/nonexistent; shift ;; - --defaults-file=*) defaults="$1"; conf=`echo "$1"|sed 's;^--defaults-file=;;'`; shift ;; - *) - if test -w / - then - conf=/etc/my.cnf - else - conf=$HOME/.my.cnf - fi - ;; -esac +while [ "x$1" != x ] +do + case "$1" in + -*) eqvalue="`echo $1 |sed 's/[-_a-zA-Z0-9]*=//'`" + case "$1" in + -IN-RPM) IN_RPM=1 + ;; + --force) force=1 + ;; + --no-defaults=*) CONFIG_FILES=/nonexistent + ;; + --defaults-file=*) CONFIG_FILES="$eqvalue" + ;; + --basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bon\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; " + ;; + --ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";" + ;; + --user=*) SETVARS="$SETVARS user=\"$eqvalue\";" + ;; + esac + ;; + esac + shift +done + +GetCNF () { -if test -f "$conf" -then - if grep "^datadir" $conf >/dev/null - then - ldata=`grep "^datadir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` - fi - if grep "^execdir" $conf >/dev/null - then - execdir=`grep "^execdir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` - fi - if grep "^bindir" $conf >/dev/null - then - bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` - fi - if grep "^user" $conf >/dev/null - then - user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'` - fi -fi +VARIABLES="basedir bindir datadir sbindir user pid-file log port socket" +# set it not already set +CONFIG_FILES=${CONFIG_FILES:-"/etc/my.cnf ./my.cnf $HOME/.my.cnf"} -for arg +for c in $CONFIG_FILES do - case "$arg" in - --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;; - --datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;; - --user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;; - esac + if [ -f $c ] + then + #echo "Processing $c..." + for v in $VARIABLES + do + # This method assumes last of duplicate $variable entries will be the + # value set ([mysqld]) + # This could easily be rewritten to gather [xxxxx]-specific entries, + # but for now it looks like only the mysqld ones are needed for + # server startup scripts + eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\ + awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'` + + # it would be easier if the my.cnf and variable values were + # all matched, but since they aren't we need to map them here. + case $v in + pid-file) v=pid_file ;; + log) v=log_file ;; + datadir) v=ldata ;; + esac + + # As long as $thevar isn't blank, use it to set or override current + # value + [ "$thevar" != "" ] && eval $v=$thevar + + done + #else + # echo "No $c config file." + fi done +} + +# run function to get config values +GetCNF + +# Override/set with command-line values +eval $SETVARS + mdata=$ldata/mysql -- cgit v1.2.1 From 11c7092c301865f6e7571a7b9c84605c74451426 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Thu, 7 Sep 2000 23:58:43 +0300 Subject: Small portability fixes --- scripts/make_binary_distribution.sh | 2 +- scripts/mysql_install_db.sh | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8318ae3d696..4bb981aba14 100755 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,7 +54,7 @@ cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/ cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db +$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 50d147c1ade..f166b996edf 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -25,11 +25,11 @@ do ;; --force) force=1 ;; - --no-defaults=*) CONFIG_FILES=/nonexistent + --no-defaults=*) defaults="$1"; CONFIG_FILES=/nonexistent ;; - --defaults-file=*) CONFIG_FILES="$eqvalue" + --defaults-file=*) defaults="$1"; CONFIG_FILES="$eqvalue" ;; - --basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bon\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; " + --basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bin\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; " ;; --ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";" ;; @@ -120,10 +120,12 @@ then echo "the --force option" exit 1 fi - echo "WARNING: Your libc libraries are not 100 % compatible with this MySQL version" - echo "mysqld should work normally with the exception that host name resolving" - echo "will not work. This means that you should use IP addresses instead" - echo "of hostnames when specifying MySQL privileges !" + echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "This probably means that your libc libraries are not 100 % compatible" + echo "with this binary MySQL version. The MySQL deamon, mysqld, should work" + echo "normally with the exception that host name resolving will not work." + echo "This means that you should use IP addresses instead of hostnames" + echo "when specifying MySQL privileges !" fi fi -- cgit v1.2.1 From 497007e2bd9cb127d54a4fdb02253301f404ce7f Mon Sep 17 00:00:00 2001 From: "monty@work.mysql.com" <> Date: Fri, 8 Sep 2000 08:45:56 +0200 Subject: Fixed --no-defaults in installation --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f166b996edf..1c3bad0c534 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -25,7 +25,7 @@ do ;; --force) force=1 ;; - --no-defaults=*) defaults="$1"; CONFIG_FILES=/nonexistent + --no-defaults) defaults="$1"; CONFIG_FILES=/nonexistent ;; --defaults-file=*) defaults="$1"; CONFIG_FILES="$eqvalue" ;; -- cgit v1.2.1 From 9fcc7174dafb2625f7b84fda0fbe6c202b9761cf Mon Sep 17 00:00:00 2001 From: "monty@work.mysql.com" <> Date: Fri, 8 Sep 2000 09:49:25 +0200 Subject: Fixes for 3.23.24 --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4bb981aba14..3dd4a4a6acd 100755 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -48,7 +48,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p support-files/* $BASE/support-files -cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_a.a libmysql_r/.libs/libmysqlclient.so* libmysql_r/libmysqlclient.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib +cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $BASE/share/CVS $BASE/share/*/CVS cp -p scripts/* $BASE/bin -- cgit v1.2.1 From 2776500c220c92bb78df03513cc3dd33588f40e5 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 12 Sep 2000 03:02:33 +0300 Subject: Update to new root alloc, OPTIMIZE TABLE and some other changes --- scripts/safe_mysqld.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 55147a84852..1ad9e962096 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -58,8 +58,8 @@ else fi pid_file=$DATADIR/`@HOSTNAME@`.pid -MYSQL_UNIX_PORT=@MYSQL_UNIX_ADDR@ -MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ +MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} +MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} log=$DATADIR/`@HOSTNAME@`.log err_log=$DATADIR/`@HOSTNAME@`.err user=@MYSQLD_USER@ -- cgit v1.2.1 From 47265938625c8cb7832cf15a8e39caf6b64c4b30 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Wed, 13 Sep 2000 01:08:34 +0300 Subject: Fixes for FULLTEXT and TIME type --- scripts/safe_mysqld.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 1ad9e962096..5a5f8dddb02 100755 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -88,16 +88,24 @@ then fi -NOHUP_NICENESS=`nohup nice` -if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then - NOHUP_NICENESS="nohup" -else - NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" +NOHUP_NICENESS="nohup" +if test -w / +then + NOHUP_NICENESS=`nohup nice` + if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then + NOHUP_NICENESS="nohup" + else + NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + fi fi export MYSQL_UNIX_PORT export MYSQL_TCP_PORT -touch $err_log; chown $user $err_log +if test -w / +then + # If we are root, change the err log to the right user. + touch $err_log; chown $user $err_log +fi # # If there exists an old pid file, check if the daemon is already running -- cgit v1.2.1 From 25106ec7551d143d4a8b53b78b04da23876497b6 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Thu, 14 Sep 2000 15:10:06 +0300 Subject: configure fixes --- scripts/Makefile.am | 4 +++- scripts/make_binary_distribution.sh | 0 scripts/mysql_convert_table_format.sh | 0 scripts/mysql_find_rows.sh | 0 scripts/mysql_setpermission.sh | 0 scripts/mysql_zap.sh | 0 scripts/mysqlaccess.conf | 0 scripts/mysqlaccess.sh | 0 scripts/mysqlbug.sh | 0 scripts/mysqlhotcopy.sh | 0 scripts/safe_mysqld-watch.sh | 0 scripts/safe_mysqld.sh | 0 12 files changed, 3 insertions(+), 1 deletion(-) mode change 100755 => 100644 scripts/make_binary_distribution.sh mode change 100755 => 100644 scripts/mysql_convert_table_format.sh mode change 100755 => 100644 scripts/mysql_find_rows.sh mode change 100755 => 100644 scripts/mysql_setpermission.sh mode change 100755 => 100644 scripts/mysql_zap.sh mode change 100755 => 100644 scripts/mysqlaccess.conf mode change 100755 => 100644 scripts/mysqlaccess.sh mode change 100755 => 100644 scripts/mysqlbug.sh mode change 100755 => 100644 scripts/mysqlhotcopy.sh mode change 100755 => 100644 scripts/safe_mysqld-watch.sh mode change 100755 => 100644 scripts/safe_mysqld.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d4e62172a08..b3ac40d9959 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -53,12 +53,14 @@ pkgdata_DATA = make_binary_distribution CLEANFILES = @server_scripts@ \ make_binary_distribution \ msql2mysql \ + mysql_config \ mysql_fix_privilege_tables \ mysql_setpermission \ mysql_zap \ mysqlaccess \ mysql_convert_table_format \ - mysql_find_rows + mysql_find_rows \ + mysqlhotcopy SUPERCLEANFILES = mysqlbug diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh old mode 100755 new mode 100644 diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh old mode 100755 new mode 100644 diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh old mode 100755 new mode 100644 diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh old mode 100755 new mode 100644 diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh old mode 100755 new mode 100644 diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100755 new mode 100644 diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh old mode 100755 new mode 100644 diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh old mode 100755 new mode 100644 diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh old mode 100755 new mode 100644 diff --git a/scripts/safe_mysqld-watch.sh b/scripts/safe_mysqld-watch.sh old mode 100755 new mode 100644 diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh old mode 100755 new mode 100644 -- cgit v1.2.1 From 50486eeb807aefb8af2e03636544fd167ded7f00 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 22 Sep 2000 01:46:26 +0300 Subject: Fixes for MyISAM and packed keys + AIX --- scripts/safe_mysqld.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 5a5f8dddb02..91d99c283f6 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -92,10 +92,10 @@ NOHUP_NICENESS="nohup" if test -w / then NOHUP_NICENESS=`nohup nice` - if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then - NOHUP_NICENESS="nohup" - else + if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1; then NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + else + NOHUP_NICENESS="nohup" fi fi @@ -193,4 +193,5 @@ do echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log done -echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log +echo "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log +echo "" | tee -a $err_log -- cgit v1.2.1 From d4b54a2139b5d64e612a29924e19ae41ebf43e52 Mon Sep 17 00:00:00 2001 From: "tim@threads.polyesthetic.msg" <> Date: Sat, 23 Sep 2000 12:39:40 -0400 Subject: safe_mysqld.sh remove stray warning message from nohup nice configure.in the & in 2>&1 gets replaced by sed during AC_SUBST --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 91d99c283f6..f2478c086f7 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -91,7 +91,7 @@ fi NOHUP_NICENESS="nohup" if test -w / then - NOHUP_NICENESS=`nohup nice` + NOHUP_NICENESS=`nohup nice 2>&1` if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1; then NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else -- cgit v1.2.1 From c079bfc04e0e65f9d5d95449e4196f19d7c14b28 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 26 Sep 2000 02:57:29 +0300 Subject: Small fixes --- scripts/mysqlhotcopy.sh | 56 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 2084a0b2c02..bb1f00671d6 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -25,11 +25,11 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.6"; +my $VERSION = "1.7"; my $OPTIONS = <<"_OPTIONS"; -Usage: $0 db_name new_db_name +Usage: $0 db_name [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user @@ -126,7 +126,9 @@ my $dsn = ";host=localhost"; $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; -my $dbh = DBI->connect("dbi:mysql:$dsn", $opt{user}, $opt{password}, { +my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", + $opt{user}, $opt{password}, +{ RaiseError => 1, PrintError => 0, AutoCommit => 1, @@ -143,20 +145,23 @@ if ( $opt{checkpoint} ) { } # --- get variables from database --- -my $sth_vars = $dbh->prepare("show variables"); +my $sth_vars = $dbh->prepare("show variables like 'datadir'"); $sth_vars->execute; while ( my ($var,$value) = $sth_vars->fetchrow_array ) { $mysqld_vars{ $var } = $value; } -my $datadir = $mysqld_vars{datadir} +my $datadir = $mysqld_vars{'datadir'} || die "datadir not in mysqld variables"; $datadir =~ s:/$::; # --- get target path --- -my $tgt_dirname; -if ($tgt_name =~ m:^\w+$:) { +my ($tgt_dirname, $to_other_database); +$to_other_database=0; +if ($tgt_name =~ m:^\w+$: && @db_desc <= 1) +{ $tgt_dirname = "$datadir/$tgt_name"; + $to_other_database=1; } elsif ($tgt_name =~ m:/: || $tgt_name eq '.') { $tgt_dirname = $tgt_name; @@ -209,6 +214,7 @@ foreach my $rdb ( @db_desc ) { $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; + $hc_tables .= ", " if ( length $hc_tables && @hc_tables ); $hc_tables .= join ", ", @hc_tables; $num_tables += scalar @hc_tables; @@ -223,19 +229,30 @@ if (length $tgt_name ) { # explicit destination directory specified # GNU `cp -r` error message - die "copying multiple databases, but last argument ($tgt_name) is not a directory\n" - if ( @db_desc > 1 && !(-e $tgt_name && -d $tgt_name ) ); - - foreach my $rdb ( @db_desc ) { - $rdb->{target} = "$tgt_name/$rdb->{src}"; + die "copying multiple databases, but last argument ($tgt_dirname) is not a directory\n" + if ( @db_desc > 1 && !(-e $tgt_dirname && -d $tgt_dirname ) ); + + if ($to_other_database) + { + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$tgt_dirname"; + } } -} -else { - die "Error: expected \$opt{suffix} to exist" unless ( exists $opt{suffix} ); - - foreach my $rdb ( @db_desc ) { - $rdb->{target} = "$datadir/$rdb->{src}$opt{suffix}"; + else + { + die "Last argument ($tgt_dirname) is not a directory\n" + if (!(-e $tgt_dirname && -d $tgt_dirname ) ); + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$tgt_dirname/$rdb->{src}"; + } } + } +else { + die "Error: expected \$opt{suffix} to exist" unless ( exists $opt{suffix} ); + + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$datadir/$rdb->{src}$opt{suffix}"; + } } print Dumper( \@db_desc ) if ( $opt{debug} ); @@ -571,6 +588,9 @@ where ":" delimits the subsets, the /^foo_/ indicates all tables with names begining with "foo_" and the "+" indicates all tables not copied by the previous subsets. +newdb is either another not existing database or a full path to a directory +where we can create a directory 'db' + Add option to lock each table in turn for people who don't need cross-table integrity. -- cgit v1.2.1 From c270903acc81c2dfba11a86749fc1d6b643a9578 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Wed, 27 Sep 2000 04:04:25 +0300 Subject: Fixed mysql_install_db.sh --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 1c3bad0c534..7172fc8f77b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -59,6 +59,7 @@ do # This could easily be rewritten to gather [xxxxx]-specific entries, # but for now it looks like only the mysqld ones are needed for # server startup scripts + thevar="" eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\ awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'` -- cgit v1.2.1 From ae80d2a5a3bd11714ca5e2dab171e7805be92523 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Wed, 11 Oct 2000 00:48:03 +0300 Subject: Portability fixes --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index f2478c086f7..ee9f40ed5dd 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -26,7 +26,7 @@ parse_arguments() { --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; --log=*) log=`echo "$arg" | sed -e "s;--log=;;"` ;; --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; -- cgit v1.2.1 From 2fedd7bae70d3b9ad3c5d5e26999e27c5380168e Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 20 Oct 2000 17:39:23 +0300 Subject: Bug fixes + defines for INNOBASE --- scripts/make_binary_distribution.sh | 4 ++-- scripts/safe_mysqld.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3dd4a4a6acd..7fc492439d0 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -37,8 +37,8 @@ done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ - client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump client/mysqlimport client/mysql-test \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysql-test + client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump client/mysqlimport \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport do cp -p $i $BASE/bin done diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index ee9f40ed5dd..43023e0fb8b 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -14,7 +14,7 @@ trap '' 1 2 3 15 # we shouldn't let anyone kill us defaults= case "$1" in - --no-defaults|--defaults-file=*) + --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift ;; esac @@ -138,8 +138,8 @@ fi # checked and repaired at start # # echo "Checking tables in $DATADIR" -# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI -# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM +# $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 echo "Starting mysqld daemon with databases from $DATADIR" @@ -155,9 +155,9 @@ do rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test "$#" -eq 0 then - (trap "" 1 ; exec $NOHUP_NICENESS $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 ) + (trap "" 1 ; exec $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 ) else - (trap "" ; exec $NOHUP_NICENESS $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ "$@" >> $err_log 2>&1 ) + (trap "" ; exec $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ "$@" >> $err_log 2>&1 ) fi if test ! -f $pid_file # This is removed if normal shutdown then -- cgit v1.2.1 From 7a013339f84c48ea6194a35d9c00d0d549466b1d Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.com" <> Date: Mon, 13 Nov 2000 23:55:10 +0200 Subject: Bug fixes, TRUNCATE, safer passwords on command line and connect timeout --- scripts/safe_mysqld.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 43023e0fb8b..615670326bb 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -28,10 +28,13 @@ parse_arguments() { --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; --log=*) log=`echo "$arg" | sed -e "s;--log=;;"` ;; - --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; - --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; + --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; + --core-file-size*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; + --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; esac done } @@ -105,6 +108,14 @@ if test -w / then # If we are root, change the err log to the right user. touch $err_log; chown $user $err_log + if test -n "$open_files" + then + ulimit -n $open_files + fi + if test -n "$core_file_size" + then + ulimit -c $core_file_size + fi fi # -- cgit v1.2.1 From 22415489f2bef07e1617cb93a5c3f3a8c332ce25 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Fri, 17 Nov 2000 02:36:46 +0200 Subject: Fixes for bugs in the usage of IO_CACHE --- scripts/Makefile.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b3ac40d9959..ec1b33fb42b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -26,7 +26,8 @@ bin_SCRIPTS = @server_scripts@ \ mysqlbug \ mysql_convert_table_format \ mysql_find_rows \ - mysqlhotcopy + mysqlhotcopy \ + mysqldumpslow EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ @@ -40,6 +41,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_convert_table_format.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ + mysqldumpslow.sh \ safe_mysqld.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ @@ -60,7 +62,8 @@ CLEANFILES = @server_scripts@ \ mysqlaccess \ mysql_convert_table_format \ mysql_find_rows \ - mysqlhotcopy + mysqlhotcopy \ + mysqldumpslow SUPERCLEANFILES = mysqlbug -- cgit v1.2.1 From e5dcd8bed327259fa09cfe7e82fc4dbe7642b8bd Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 18 Nov 2000 02:15:06 +0200 Subject: Portability fixes --- scripts/mysqlhotcopy.sh | 142 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 110 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index bb1f00671d6..fc69ab01b9f 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -19,13 +19,24 @@ mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases mysqlhotcopy db_name_1 ... db_name_n /path/to/new_directory + mysqlhotcopy db_name./regex/ + + mysqlhotcopy db_name./^\(foo\|bar\)/ + + mysqlhotcopy db_name./~regex/ + + mysqlhotcopy db_name_1./regex_1/ db_name_1./regex_2/ ... db_name_n./regex_n/ /path/to/new_directory + + mysqlhotcopy --method='scp -Bq -i /usr/home/foo/.ssh/identity' --user=root --password=secretpassword \ + db_1./^nice_table/ user@some.system.dom:~/path/to/new_directory + WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. =cut # Documentation continued at end of file -my $VERSION = "1.7"; +my $VERSION = "1.8"; my $OPTIONS = <<"_OPTIONS"; @@ -39,7 +50,7 @@ Usage: $0 db_name [new_db_name | directory] --allowold don't abort if target already exists (rename it _old) --keepold don't delete previous (now renamed) target when done - --noindices don't copy index files + --indices include index files in copy --method=# method for copy (only "cp" currently supported) -q, --quiet be silent except for errors @@ -50,6 +61,8 @@ Usage: $0 db_name [new_db_name | directory] --suffix=# suffix for names of copied databases --checkpoint=# insert checkpoint entry into specified db.table --flushlog flush logs once all tables are locked + + Try 'perldoc $0 for more complete documentation' _OPTIONS sub usage { @@ -89,23 +102,26 @@ GetOptions( \%opt, # ========== # a list of hash-refs containing: # -# 'src' - name of the db to copy -# 'target' - destination directory of the copy -# 'tables' - array-ref to list of tables in the db -# 'files' - array-ref to list of files to be copied +# 'src' - name of the db to copy +# 't_regex' - regex describing tables in src +# 'target' - destination directory of the copy +# 'tables' - array-ref to list of tables in the db +# 'files' - array-ref to list of files to be copied # my @db_desc = (); my $tgt_name = undef; - + if ( $opt{regexp} || $opt{suffix} || @ARGV > 2 ) { $tgt_name = pop @ARGV unless ( exists $opt{suffix} ); - @db_desc = map { { 'src' => $_ } } @ARGV; + @db_desc = map { s{^([^\.]+)\./(.+)/$}{$1}; { 'src' => $_, 't_regex' => ( $2 ? $2 : '.*' ) } } @ARGV; } else { usage("Database name to hotcopy not specified") unless ( @ARGV ); - @db_desc = ( { 'src' => $ARGV[0] } ); + $ARGV[0] =~ s{^([^\.]+)\./(.+)/$}{$1}; + @db_desc = ( { 'src' => $ARGV[0], 't_regex' => ( $2 ? $2 : '.*' ) } ); + if ( @ARGV == 2 ) { $tgt_name = $ARGV[1]; } @@ -195,15 +211,35 @@ foreach my $rdb ( @db_desc ) { die "Database '$db' not accessible: $@" if ( $@ ); my @dbh_tables = $dbh->func( '_ListTables' ); + ## generate regex for tables/files + my $t_regex = $rdb->{t_regex}; ## assign temporary regex + my $negated = $t_regex =~ tr/~//d; ## remove and count negation operator: we don't allow ~ in table names + $t_regex = qr/$t_regex/; ## make regex string from user regex + + ## filter (out) tables specified in t_regex + print "Filtering tables with '$t_regex'\n" if $opt{debug}; + @dbh_tables = ( $negated + ? grep { $_ !~ $t_regex } @dbh_tables + : grep { $_ =~ $t_regex } @dbh_tables ); + + ## get list of files to copy my $db_dir = "$datadir/$db"; opendir(DBDIR, $db_dir ) or die "Cannot open dir '$db_dir': $!"; - - my @db_files = grep { /.+\.\w+$/ } readdir(DBDIR) - or warn "'$db' is an empty database\n"; + my %db_files; + map { ( /(.+)\.\w+$/ ? { $db_files{$_} = $1 } : () ) } readdir(DBDIR); + unless( keys %db_files ) { + warn "'$db' is an empty database\n"; + } closedir( DBDIR ); + ## filter (out) files specified in t_regex + my @db_files = sort ( $negated + ? grep { $db_files{$_} !~ $t_regex } keys %db_files + : grep { $db_files{$_} =~ $t_regex } keys %db_files ); + + ## remove indices unless we're told to keep them unless ($opt{indices}) { @db_files = grep { not /\.(ISM|MYI)$/ } @db_files; } @@ -238,6 +274,12 @@ if (length $tgt_name ) { $rdb->{target} = "$tgt_dirname"; } } + elsif ($opt{method} =~ /^scp\b/) + { # we have to trust scp to hit the target + foreach my $rdb ( @db_desc ) { + $rdb->{target} = "$tgt_dirname/$rdb->{src}"; + } + } else { die "Last argument ($tgt_dirname) is not a directory\n" @@ -249,7 +291,7 @@ if (length $tgt_name ) { } else { die "Error: expected \$opt{suffix} to exist" unless ( exists $opt{suffix} ); - + foreach my $rdb ( @db_desc ) { $rdb->{target} = "$datadir/$rdb->{src}$opt{suffix}"; } @@ -278,6 +320,10 @@ foreach my $rdb ( @db_desc ) { if ( $opt{dryrun} ) { print "mkdir $tgt_dirpath, 0750\n"; } + elsif ($opt{method} =~ /^scp\b/) { + ## assume it's there? + ## ... + } else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n"; @@ -320,26 +366,26 @@ else { printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); } - + my @failed = (); foreach my $rdb ( @db_desc ) { my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; next unless @files; eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; - + push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); - + if ( $opt{checkpoint} ) { my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; - + eval { $dbh->do( qq{ insert into $opt{checkpoint} (src, dest, msg) VALUES ( '$rdb->{src}', '$rdb->{target}', '$msg' ) } ); }; - + if ( $@ ) { warn "Failed to update checkpoint table: $@\n"; } @@ -410,11 +456,16 @@ sub copy_files { my ($method, $files, $target) = @_; my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; + if ($method =~ /^s?cp\b/) { # cp or scp with optional flags @cmd = ($method); # add option to preserve mod time etc of copied files # not critical, but nice to have - push @cmd, "-p" if $^O =~ m/^(solaris|linux)$/; + push @cmd, "-p" if $^O =~ m/^(solaris|linux|freebsd)$/; + + # add recursive option for scp + push @cmd, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; + # add files to copy and the destination directory push @cmd, @$files, $target; } @@ -427,10 +478,13 @@ sub copy_files { next; } + ## for some reason system fails but backticks works ok for scp... print "Executing '@cmd'\n" if $opt{debug}; my $cp_status = system @cmd; if ($cp_status != 0) { - die "Error: @cmd failed ($cp_status) while copying files.\n"; + 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"; } } @@ -520,7 +574,22 @@ locked, and before they are copied. =item --regexp pattern -Copy all databases with names matching the pattern. +Copy all databases with names matching the pattern + +=item db_name./pattern/ + +Copy only tables matching pattern. Shell metacharacters ( (, ), |, !, +etc.) have to be escaped (e.g. \). For example, to select all tables +in database db1 whose names begin with 'foo' or 'bar': + + mysqlhotcopy --indices --method=cp db1./^\(foo\|bar\)/ + +=item db_name./~pattern/ + +Copy only tables not matching pattern. For example, to copy tables +that do not begin with foo nor bar: + + mysqlhotcopy --indices --method=cp db1./~^\(foo\|bar\)/ =item -?, --help @@ -542,13 +611,25 @@ port to use when connecting to local server UNIX domain socket to use when connecting to local server -=item --noindices +=item --indices -don't copy index files +include index files in copy =item --method=# -method for copy (only "cp" currently supported) +method for copy (only "cp" currently supported). Alpha support for +"scp" was added in November 2000. Your experience with the scp method +will vary with your ability to understand how scp works. 'man scp' +and 'man ssh' are your friends. + +The destination directory _must exist_ on the target machine using +the scp method. Liberal use of the --debug option will help you figure +out what's really going on when you do an scp. + +Note that using scp will lock your tables for a _long_ time unless +your network connection is _fast_. If this is unacceptable to you, +use the 'cp' method to copy the tables to some temporary area and then +scp or rsync the files at your leisure. =item -q, --quiet @@ -575,12 +656,8 @@ Patches adding bug fixes, documentation and new features are welcome. =head1 TO DO -Allow a list of tables (or regex) to be given on the command line to -enable a logically-related subset of the tables to be hot-copied -rather than force the whole db to be copied in one go. - -Extend the above to allow multiple subsets of tables to be specified -on the command line: +Extend the individual table copy to allow multiple subsets of tables +to be specified on the command line: mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : + @@ -609,5 +686,6 @@ Tim Bunce Martin Waite - added checkpoint, flushlog, regexp and dryrun options -Ralph Corderoy - Added synonyms for commands -=cut +Ralph Corderoy - added synonyms for commands + +Scott Wiersdorf - added table regex and scp support -- cgit v1.2.1 From 80a4d37e12c10a5aaf8e6b0178cf8bb3783cd004 Mon Sep 17 00:00:00 2001 From: "tim@threads.polyesthetic.msg" <> Date: Sat, 18 Nov 2000 20:34:20 -0500 Subject: safe_mysqld.sh - set pid_file and err_log relative to DATADIR as specified in the my.cnf file, instead of the default value - do not pass safe_mysqld-specific options to mysqld - minor style changes (remove extra ; at end of line, make spacing more consistent, etc.) manual.ja.texi - Turn off SCCS flag --- scripts/safe_mysqld.sh | 93 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 29 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 615670326bb..315859530b5 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -19,22 +19,44 @@ case "$1" in ;; esac -# Parse arguments to see if caller wants the pid_file somewhere else. parse_arguments() { - for arg in "$@"; do - case $arg in - --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg do + case "$arg" in + # these get passed explicitly to mysqld + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; + --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; - --log=*) log=`echo "$arg" | sed -e "s;--log=;;"` ;; - --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; - --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + + # these two might have been set in a [safe_mysqld] section of my.cnf + # they get passed via environment variables to safe_mysqld + --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; + + # safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! + --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; + --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; - --core-file-size*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; + --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + fi + ;; esac done } @@ -60,26 +82,32 @@ else ledir=@libexecdir@ fi -pid_file=$DATADIR/`@HOSTNAME@`.pid MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} -log=$DATADIR/`@HOSTNAME@`.log -err_log=$DATADIR/`@HOSTNAME@`.err user=@MYSQLD_USER@ +# these rely on $DATADIR by default, so we'll set them later on +pid_file= +err_log= + # Get first arguments from the my.cfg file, groups [mysqld] and [safe_mysqld] # and then merge with the command line arguments -if test -x ./bin/my_print_defaults; then +if test -x ./bin/my_print_defaults +then print_defaults="./bin/my_print_defaults" -elif test -x @bindir@/my_print_defaults; then +elif test -x @bindir@/my_print_defaults +then print_defaults="@bindir@/my_print_defaults" -elif test -x @bindir@/mysql_print_defaults; then +elif test -x @bindir@/mysql_print_defaults +then print_defaults="@bindir@/mysql_print_defaults" else print_defaults="my_print_defaults" fi + +args= parse_arguments `$print_defaults $defaults mysqld safe_mysqld` -parse_arguments "$@" +parse_arguments PICK-ARGS-FROM-ARGV "$@" if test ! -x $ledir/mysqld then @@ -87,23 +115,28 @@ then echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/safe_mysqld". - exit 1; + exit 1 fi +test -z "$pid_file" && pid_file=$DATADIR/`@HOSTNAME@`.pid +test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err + +export MYSQL_UNIX_PORT +export MYSQL_TCP_PORT + NOHUP_NICENESS="nohup" if test -w / then NOHUP_NICENESS=`nohup nice 2>&1` - if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1; then + if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 + then NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else NOHUP_NICENESS="nohup" fi fi -export MYSQL_UNIX_PORT -export MYSQL_TCP_PORT if test -w / then # If we are root, change the err log to the right user. @@ -130,7 +163,7 @@ then then # The pid contains a mysqld process echo "A mysqld process already exists" echo "A mysqld process already exists at " `date` >> $err_log - exit 1; + exit 1 fi fi rm -f $pid_file @@ -140,7 +173,7 @@ then echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log echo "Please remove it manually and start $0 again" echo "mysqld daemon not started" - exit 1; + exit 1 fi fi @@ -164,16 +197,17 @@ echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety - if test "$#" -eq 0 + if test -z "$args" then - (trap "" 1 ; exec $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 ) + $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 else - (trap "" ; exec $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ "$@" >> $err_log 2>&1 ) + eval "$NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" fi if test ! -f $pid_file # This is removed if normal shutdown then - break; + break fi + if @IS_LINUX@ then # Test if one process was hanging. @@ -201,6 +235,7 @@ do I=`expr $I + 1` done fi + echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log done -- cgit v1.2.1 From 174047268af5a3476047adb846d6d137ce8b8f90 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 21 Nov 2000 18:28:46 +0200 Subject: mysqldumpslow.sh BitKeeper file /my/bk/mysql/scripts/mysqldumpslow.sh --- scripts/mysqldumpslow.sh | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 scripts/mysqldumpslow.sh (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh new file mode 100755 index 00000000000..c2c88005c80 --- /dev/null +++ b/scripts/mysqldumpslow.sh @@ -0,0 +1,76 @@ +#@perl@ +# mysqldumpslow - parse and summarize the MySQL slow query log + +use strict; +use Getopt::Long; + +# t=time, l=lock time, r=rows +# at, al, and ar are the corresponding averages + +my %opt = ( + s => 'at', + h => '*', +); + +GetOptions(\%opt, + 'v+', # verbose + 'd+', # debug + 's=s', # what to sort by (t, at, l, al, r, ar etc) + 'a!', # don't abstract all numbers to N and strings to 'S' + 'g=s', # grep: only consider stmts that include this string + 'h=s', # hostname of db server (can be wildcard) +) or die "Bad option"; + +my %stmt; + +my $datadir = "/var/lib/mysql"; # XXX should fetch dynamically +@ARGV = <$datadir/$opt{h}-slow.log>; + +$/ = "\n#"; # read entire statements using paragraph mode +while (<>) { + print "[$_]\n" if $opt{v}; + s/^#// unless %stmt; + + s/\s*Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; + my ($t, $l, $r) = ($1, $2, $3); + + s/^use \w+;\n//; # not consistently added + s/^SET timestamp=\d+;\n//; + + s/^[ ]*\n//mg; # delete blank lines + s/^[ ]*/ /mg; # normalize leading whitespace + s/\s*;\s*(#\s*)?$//; # remove traing semicolon(+newline-hash) + + next if $opt{g} and !m/$opt{g}/i; + + unless ($opt{a}) { + s/\b\d+\b/N/g; + s/\b0x[0-9A-Fa-f]+\b/N/g; + s/'.*?'/'S'/g; + s/".*?"/"S"/g; + } + + $stmt{$_}->{c} += 1; + $stmt{$_}->{t} += $t; + $stmt{$_}->{l} += $l; + $stmt{$_}->{r} += $r; + + warn "[$_]" if $opt{d}; +} + +foreach (keys %stmt) { + my $v = $stmt{$_} || die; + my ($c, $t, $l, $r) = @{ $v }{qw(c t l r)}; + $v->{at} = $t / $c; + $v->{al} = $l / $c; + $v->{ar} = $r / $c; +} + +my @sorted = sort { $stmt{$a}->{$opt{s}} <=> $stmt{$b}->{$opt{s}} } keys %stmt; + +foreach (@sorted) { + my $v = $stmt{$_} || die; + my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)}; + printf "Count: %d Time: %.2f (%d) Lock_time: %.2f (%d) Rows_sent: %.1f (%d) \n%s\n\n", + $c, $at,$t, $al,$l, $ar,$r, $_; +} -- cgit v1.2.1 From 08a2c58ed1fb3c11484681d1eabe8906cfd1d001 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Wed, 29 Nov 2000 05:09:28 +0200 Subject: Fixed bug in 'drop table' Portability fixes --- scripts/mysqlhotcopy.sh | 152 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 109 insertions(+), 43 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index fc69ab01b9f..735fbdcf2aa 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -36,7 +36,8 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.8"; +my $VERSION = "1.9"; +my $opt_tmpdir= $main::env{TMPDIR}; my $OPTIONS = <<"_OPTIONS"; @@ -50,7 +51,7 @@ Usage: $0 db_name [new_db_name | directory] --allowold don't abort if target already exists (rename it _old) --keepold don't delete previous (now renamed) target when done - --indices include index files in copy + --noindices don't include full index files in copy --method=# method for copy (only "cp" currently supported) -q, --quiet be silent except for errors @@ -61,6 +62,7 @@ Usage: $0 db_name [new_db_name | directory] --suffix=# suffix for names of copied databases --checkpoint=# insert checkpoint entry into specified db.table --flushlog flush logs once all tables are locked + --tmpdir=# temporary directory (instead of $opt_tmpdir) Try 'perldoc $0 for more complete documentation' _OPTIONS @@ -71,7 +73,7 @@ sub usage { my %opt = ( user => getpwuid($>), - indices => 1, # for safety + noindices => 0, allowold => 0, # for safety keepold => 0, method => "cp", @@ -86,7 +88,7 @@ GetOptions( \%opt, "socket|S=s", "allowold!", "keepold!", - "indices!", + "noindices!", "method=s", "debug", "quiet|q", @@ -95,6 +97,7 @@ GetOptions( \%opt, "suffix=s", "checkpoint=s", "flushlog", + "tmpdir|t=s", "dryrun|n", ) or usage("Invalid option"); @@ -133,6 +136,7 @@ else { my $mysqld_help; my %mysqld_vars; my $start_time = time; +my $opt_tmpdir= $opt{tempdir} ? $opt{tmpdir} : $main::env{TMPDIR}; $0 = $1 if $0 =~ m:/([^/]+)$:; $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; @@ -238,13 +242,16 @@ foreach my $rdb ( @db_desc ) { my @db_files = sort ( $negated ? grep { $db_files{$_} !~ $t_regex } keys %db_files : grep { $db_files{$_} =~ $t_regex } keys %db_files ); + my @index_files=(); ## remove indices unless we're told to keep them - unless ($opt{indices}) { + if ($opt{noindices}) { + @index_files= grep { /\.(ISM|MYI)$/ } @db_files; @db_files = grep { not /\.(ISM|MYI)$/ } @db_files; } $rdb->{files} = [ @db_files ]; + $rdb->{index} = [ @index_files ]; my @hc_tables = map { "$db.$_" } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; @@ -369,27 +376,78 @@ else { my @failed = (); -foreach my $rdb ( @db_desc ) { - my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; - next unless @files; - eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; - - push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" - if ( $@ ); - - if ( $opt{checkpoint} ) { - my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; - - eval { - $dbh->do( qq{ insert into $opt{checkpoint} (src, dest, msg) - VALUES ( '$rdb->{src}', '$rdb->{target}', '$msg' ) - } ); - }; - - if ( $@ ) { - warn "Failed to update checkpoint table: $@\n"; - } +foreach my $rdb ( @db_desc ) +{ + my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; + next unless @files; + + eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; + push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" + if ( $@ ); + + @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{index}}; + if ($rdb->{index}) + { + # + # Copy only the header of the index file + # + + my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; + foreach my $file ($rdb->{index}) + { + my $from="$datadir/$rdb->{src}/$file"; + my $to="$rdb->{target}/$file"; + my $buff; + open(INPUT, $from) || die "Can't open file $from: $!\n"; + my $length=read INPUT, $buff, 2048; + die "Can't read index header from $from\n" if ($length <= 1024); + close INPUT; + + if ( $opt{dryrun} ) + { + print '$opt{method}-header $from $to\n'; + } + elsif ($opt{method} eq 'cp') + { + !open(OUTPUT,$to) || die "Can\'t create file $to: $!\n"; + if (write(OUTPUT,$buff) != length($buff)) + { + die "Error when writing data to $to: $!\n"; + } + close OUTPUT || die "Error on close of $to: $!\n"; + } + elsif ($opt{method} eq 'scp') + { + my $tmp=$tmpfile; + open(OUTPUT,"$tmp") || die "Can\'t create file $tmp: $!\n"; + if (write(OUTPUT,$buff) != length($buff)) + { + die "Error when writing data to $tmp: $!\n"; + } + close OUTPUT || die "Error on close of $tmp: $!\n"; + safe_system('scp $tmp $to'); + } + else + { + die "Can't use unsupported method '$opt{method}'\n"; + } + } + unlink "$opt_tmpdir/mysqlhotcopy$$"; + } + + if ( $opt{checkpoint} ) { + my $msg = ( $@ ) ? "Failed: $@" : "Succeeded"; + + eval { + $dbh->do( qq{ insert into $opt{checkpoint} (src, dest, msg) + VALUES ( '$rdb->{src}', '$rdb->{target}', '$msg' ) + } ); + }; + + if ( $@ ) { + warn "Failed to update checkpoint table: $@\n"; } + } } if ( $opt{dryrun} ) { @@ -469,25 +527,34 @@ sub copy_files { # add files to copy and the destination directory push @cmd, @$files, $target; } - else { + else + { die "Can't use unsupported method '$method'\n"; } + safe_system (@cmd); +} - if ( $opt{dryrun} ) { - print "@cmd\n"; - next; - } +sub safe_system +{ + my @cmd=shift; - ## for some reason system fails but backticks works ok for scp... - print "Executing '@cmd'\n" if $opt{debug}; - my $cp_status = system @cmd; - 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 ( $opt{dryrun} ) + { + print "@cmd\n"; + return; + } + + ## for some reason system fails but backticks works ok for scp... + print "Executing '@cmd'\n" if $opt{debug}; + my $cp_status = system @cmd; + 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"; + } } + sub retire_directory { my ( @dir ) = @_; @@ -611,9 +678,9 @@ port to use when connecting to local server UNIX domain socket to use when connecting to local server -=item --indices +=item --noindices -include index files in copy +don't include index files in copy =item --method=# @@ -677,9 +744,6 @@ Add support for other copy methods (eg tar to single file?). Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. -Add option to only copy the first 65KB of index files. That simplifies -recovery (recovery with no index file at all is complicated). - =head1 AUTHOR Tim Bunce @@ -689,3 +753,5 @@ Martin Waite - added checkpoint, flushlog, regexp and dryrun options Ralph Corderoy - added synonyms for commands Scott Wiersdorf - added table regex and scp support + +Monty - working --noindex (copy only first 2048 bytes of index file) -- cgit v1.2.1 From 7f877deb47ed2f6d5df9944b35f70268c8c048d5 Mon Sep 17 00:00:00 2001 From: "tim@threads.polyesthetic.msg" <> Date: Wed, 29 Nov 2000 15:21:48 -0500 Subject: Clean up safe_mysqld, mysql_install_db and mysql.server. They should now work the way you expect them to (process command-line arguments consistently). --- scripts/mysql_install_db.sh | 164 +++++++++++++++++++++----------------------- scripts/safe_mysqld.sh | 10 ++- 2 files changed, 89 insertions(+), 85 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7172fc8f77b..efb92bb7f62 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,93 +1,88 @@ #!/bin/sh # Copyright (C) 1997, 1998, 1999 TCX DataKonsult AB & Monty Program KB & Detron HB -# For a more info consult the file COPYRIGHT distributed with this file +# For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, # columns_priv in the mysql database, as well as the func table. # -# All arguments (exept -IN-RPM as a first argument) to this script are -# passed to mysqld +# All unrecognized arguments to this script are passed to mysqld. -ldata=@localstatedir@ -execdir=@libexecdir@ -bindir=@bindir@ -sbindir=@sbindir@ -force=0 IN_RPM=0 +case "$1" in + -IN-RPM) + IN_RPM="$1"; shift + ;; +esac defaults= +case "$1" in + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; +esac + +parse_arguments() { + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi -while [ "x$1" != x ] -do - case "$1" in - -*) eqvalue="`echo $1 |sed 's/[-_a-zA-Z0-9]*=//'`" - case "$1" in - -IN-RPM) IN_RPM=1 - ;; - --force) force=1 - ;; - --no-defaults) defaults="$1"; CONFIG_FILES=/nonexistent - ;; - --defaults-file=*) defaults="$1"; CONFIG_FILES="$eqvalue" - ;; - --basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bin\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; " - ;; - --ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";" - ;; - --user=*) SETVARS="$SETVARS user=\"$eqvalue\";" - ;; - esac - ;; - esac - shift -done - -GetCNF () { - -VARIABLES="basedir bindir datadir sbindir user pid-file log port socket" -# set it not already set -CONFIG_FILES=${CONFIG_FILES:-"/etc/my.cnf ./my.cnf $HOME/.my.cnf"} - -for c in $CONFIG_FILES -do - if [ -f $c ] - then - #echo "Processing $c..." - for v in $VARIABLES - do - # This method assumes last of duplicate $variable entries will be the - # value set ([mysqld]) - # This could easily be rewritten to gather [xxxxx]-specific entries, - # but for now it looks like only the mysqld ones are needed for - # server startup scripts - thevar="" - eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\ - awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'` - - # it would be easier if the my.cnf and variable values were - # all matched, but since they aren't we need to map them here. - case $v in - pid-file) v=pid_file ;; - log) v=log_file ;; - datadir) v=ldata ;; - esac - - # As long as $thevar isn't blank, use it to set or override current - # value - [ "$thevar" != "" ] && eval $v=$thevar - - done - #else - # echo "No $c config file." - fi -done + for arg do + case "$arg" in + --force) force=1 ;; + --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + fi + ;; + esac + done } -# run function to get config values -GetCNF +# Get first arguments from the my.cfg file, groups [mysqld] and +# [mysql_install_db], and then merge with the command line arguments +if test -x ./bin/my_print_defaults +then + print_defaults="./bin/my_print_defaults" +elif test -x @bindir@/my_print_defaults +then + print_defaults="@bindir@/my_print_defaults" +elif test -x @bindir@/mysql_print_defaults +then + print_defaults="@bindir@/mysql_print_defaults" +else + print_defaults="my_print_defaults" +fi -# Override/set with command-line values -eval $SETVARS +args= +ldata= +execdir= +bindir= +basedir= +force=0 +parse_arguments `$print_defaults $defaults mysqld mysql_install_db` +parse_arguments PICK-ARGS-FROM-ARGV "$@" +test -z "$ldata" && ldata=@localstatedir@ +if test -z "$basedir" +then + basedir=@prefix@ + bindir=@bindir@ + execdir=@libexecdir@ +else + bindir="$basedir/bin" + execdir="$basedir/libexec" +fi mdata=$ldata/mysql @@ -151,7 +146,7 @@ c_t="" c_c="" # Check for old tables if test ! -f $mdata/db.frm then - echo "Creating db table" + echo "Preparing db table" # mysqld --bootstrap wants one command/line c_d="$c_d CREATE TABLE db (" @@ -179,7 +174,7 @@ fi if test ! -f $mdata/host.frm then - echo "Creating host table" + echo "Preparing host table" c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) DEFAULT '' NOT NULL," @@ -201,7 +196,7 @@ fi if test ! -f $mdata/user.frm then - echo "Creating user table" + echo "Preparing user table" c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) DEFAULT '' NOT NULL," @@ -237,7 +232,7 @@ fi if test ! -f $mdata/func.frm then - echo "Creating func table" + echo "Preparing func table" c_f="$c_f CREATE TABLE func (" c_f="$c_f name char(64) DEFAULT '' NOT NULL," @@ -251,7 +246,7 @@ fi if test ! -f $mdata/tables_priv.frm then - echo "Creating tables_priv table" + echo "Preparing tables_priv table" c_t="$c_t CREATE TABLE tables_priv (" c_t="$c_t Host char(60) DEFAULT '' NOT NULL," @@ -270,7 +265,7 @@ fi if test ! -f $mdata/columns_priv.frm then - echo "Creating columns_priv table" + echo "Preparing columns_priv table" c_c="$c_c CREATE TABLE columns_priv (" c_c="$c_c Host char(60) DEFAULT '' NOT NULL," @@ -285,8 +280,9 @@ then c_c="$c_c comment='Column privileges';" fi - if $execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=@prefix@ --datadir=$ldata "$@" << END_OF_DATA +echo "Installing all prepared tables" +if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ + --basedir=$basedir --datadir=$ldata $args" << END_OF_DATA use mysql; $c_d $i_d diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 315859530b5..2fa9134b65c 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -118,7 +118,15 @@ then exit 1 fi -test -z "$pid_file" && pid_file=$DATADIR/`@HOSTNAME@`.pid +if test -z "$pid_file" +then + pid_file=$DATADIR/`@HOSTNAME@`.pid +else + case "$pid_file" in + /* ) ;; + * ) pid_file="$DATADIR/$pid_file" ;; + esac +fi test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err export MYSQL_UNIX_PORT -- cgit v1.2.1 From 3b3bdf7fedc2a3594ad91fbe9a76bcc28bf9d3f8 Mon Sep 17 00:00:00 2001 From: "jani@janikt.pp.saunalahti.fi" <> Date: Thu, 7 Dec 2000 03:09:24 +0200 Subject: Added a new client, mysql_multi_mysqld and documentation about it. --- scripts/mysql_multi_mysqld | 606 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 606 insertions(+) create mode 100755 scripts/mysql_multi_mysqld (limited to 'scripts') diff --git a/scripts/mysql_multi_mysqld b/scripts/mysql_multi_mysqld new file mode 100755 index 00000000000..48e72a00aa5 --- /dev/null +++ b/scripts/mysql_multi_mysqld @@ -0,0 +1,606 @@ +#!/usr/bin/perl + +use Getopt::Long; +use POSIX qw(strftime); + +$|=1; +$VER="2.1"; + +$opt_config_file = undef(); +$opt_example = 0; +$opt_help = 0; +$opt_log = "/tmp/mysql_multi_mysqld.log"; +$opt_mysqladmin = "mysqladmin"; +$opt_mysqld = "mysqld"; +$opt_no_log = 0; +$opt_password = undef(); +$opt_tcp_ip = 0; +$opt_user = "root"; +$opt_version = 0; + +my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname); + +$homedir = $ENV{HOME}; +$my_progname = $0; +$my_progname =~ s/.*[\/]//; + +main(); + +#### +#### main sub routine +#### + +sub main +{ + my ($flag_exit); + + if (!defined(my_which(my_print_defaults))) + { + # We can't throw out yet, since --version, --help, or --example may + # have been given + print "WARNING! my_print_defaults command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; + } + my @defops = `my_print_defaults mysql_multi_mysqld`; + chop @defops; + splice @ARGV, 0, 0, @defops; + GetOptions("help","example","version","mysqld=s","mysqladmin=s", + "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") + || die "Wrong option! See $my_progname --help for detailed information!\n"; + + $groupids = $ARGV[1]; + + if ($opt_version) + { + print "$my_progname version $VER by Jani Tolonen\n"; + exit(0); + } + example() if ($opt_example); + if (!defined(($mysqld = my_which($opt_mysqld)))) + { + print "Couldn't find the mysqld binary! Tried: $opt_mysqld\n"; + $flag_exit=1; + } + if (!defined(($mysqladmin = my_which($opt_mysqladmin)))) + { + print "Couldn't find the mysqladmin binary! Tried: $opt_mysqladmin\n"; + $flag_exit=1; + } + usage() if ($opt_help); + if ($flag_exit) + { + print "Error with an option, see $my_progname --help for more info!\n"; + exit(1); + } + if (!defined(my_which(my_print_defaults))) + { + print "ABORT: Can't find command 'my_print_defaults'!\n"; + print "This command is available from the latest MySQL\n"; + print "distribution. Please make sure you have the command\n"; + print "in your PATH.\n"; + exit(1); + } + usage() if (!defined($ARGV[0]) || + ($ARGV[0] ne 'start' && $ARGV[0] ne 'START' && + $ARGV[0] ne 'stop' && $ARGV[0] ne 'STOP' && + $ARGV[0] ne 'report' && $ARGV[0] ne 'REPORT')); + + if (!$opt_no_log) + { + w2log("$my_progname log file version $VER; run: ", + "$opt_log", 1, 0); + } + else + { + print "$my_progname log file version $VER; run: "; + print strftime "%a %b %e %H:%M:%S %Y", localtime; + print "\n"; + } + if ($ARGV[0] eq 'report' || $ARGV[0] eq 'REPORT') + { + report_mysqlds(); + } + elsif ($ARGV[0] eq 'start' || $ARGV[0] eq 'START') + { + start_mysqlds(); + } + else + { + stop_mysqlds(); + } +} + +#### +#### Report living and not running MySQL servers +#### + +sub report_mysqlds +{ + my (@groups, $com, $i, @options, $j, $pec); + + print "Reporting MySQL servers\n"; + if (!$opt_no_log) + { + w2log("\nReporting MySQL servers","$opt_log",0,0); + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $com = "$mysqladmin -u $opt_user -p$opt_password"; + $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; + for ($j = 0; defined($options[$j]); $j++) + { + if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port)(.*)$/)) + { + $com.= " $options[$j]"; + } + } + $com.= " ping >> /dev/null 2>&1"; + system($com); + $pec = $? >> 8; + if ($pec) + { + print "MySQL server from group: $groups[$i] is not running\n"; + if (!$opt_no_log) + { + w2log("MySQL server from group: $groups[$i] is not running", + "$opt_log", 0, 0); + } + } + else + { + print "MySQL server from group: $groups[$i] is running\n"; + if (!$opt_no_log) + { + w2log("MySQL server from group: $groups[$i] is running", + "$opt_log", 0, 0); + } + } + } + if (!$i) + { + print "No groups to be reported (check your GNRs)\n"; + if (!$opt_no_log) + { + w2log("No groups to be reported (check your GNRs)", "$opt_log", 0, 0); + } + } +} + +#### +#### start multiple servers +#### + +sub start_mysqlds() +{ + my (@groups, $com, $i, @options, $j); + + if (!$opt_no_log) + { + w2log("\nStarting MySQL servers\n","$opt_log",0,0); + } + else + { + print "\nStarting MySQL servers\n"; + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $com = "$mysqld"; + for ($j = 0; defined($options[$j]); $j++) + { + $com.= " $options[$j]"; + } + $com.= " >> $opt_log 2>&1" if (!$opt_no_log); + $com.= " &"; + system($com); + } + if (!$i && !$opt_no_log) + { + w2log("No MySQL servers to be started (check your GNRs)", + "$opt_log", 0, 0); + } +} + +#### +#### stop multiple servers +#### + +sub stop_mysqlds() +{ + my (@groups, $com, $i, @options, $j); + + if (!$opt_no_log) + { + w2log("\nStopping MySQL servers\n","$opt_log",0,0); + } + else + { + print "\nStopping MySQL servers\n"; + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $com = "$mysqladmin -u $opt_user -p$opt_password"; + $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; + for ($j = 0; defined($options[$j]); $j++) + { + if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port)(.*)$/)) + { + $com.= " $options[$j]"; + } + } + $com.= " shutdown"; + $com.= " >> $opt_log 2>&1" if (!$opt_no_log); + $com.= " &"; + system($com); + } + if (!$i && !$opt_no_log) + { + w2log("No MySQL servers to be stopped (check your GNRs)", + "$opt_log", 0, 0); + } +} + +#### +#### Find groups. Takes the valid group numbers as an argument, parses +#### them, puts them in the ascending order, removes duplicates and +#### returns the wanted groups accordingly. +#### + +sub find_groups +{ + my ($raw_gids) = @_; + my (@groups, @data, @tmp, $line, $i, $k, @pre_gids, @gids, @tmp2, + $prev_value); + + # Read the lines from the config file to variable 'data' + if (defined($opt_config_file)) + { + open(MY_CNF, "<$opt_config_file") && (@data=) && close(MY_CNF); + } + else + { + if (-f "/etc/my.cnf" && -r "/etc/my.cnf") + { + open(MY_CNF, ") && close(MY_CNF); + } + for ($i = 0; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } + if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") + { + open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); + } + for (; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } + } + chop @data; + # Make a list of the wanted group ids + if (defined($raw_gids)) + { + @pre_gids = split(',', $raw_gids); + } + if (defined($raw_gids)) + { + for ($i = 0, $j = 0; defined($pre_gids[$i]); $i++) + { + if ($pre_gids[$i] =~ m/^(\d+)$/) + { + $gids[$j] = $1; + $j++; + } + elsif ($pre_gids[$i] =~ m/^(\d+)(\-)(\d+)$/) + { + for ($k = $1; $k <= $3; $k++) + { + $gids[$j] = $k; + $j++; + } + } + else + { + print "ABORT: Bad GNR: $pre_gids[$i] See $my_progname --help\n"; + exit(1); + } + } + } + # Sort the list of gids numerically in ascending order + @gids = sort {$a <=> $b} @gids; + # Remove non-positive integers and duplicates + for ($i = 0, $j = 0; defined($gids[$i]); $i++) + { + next if ($gids[$i] <= 0); + if (!$i || $prev_value != $gids[$i]) + { + $tmp2[$j] = $gids[$i]; + $j++; + } + $prev_value = $gids[$i]; + } + @gids = @tmp2; + # Find and return the wanted groups + for ($i = 0, $j = 0; defined($data[$i]); $i++) + { + if ($data[$i] =~ m/^(\s*\[\s*)(mysqld)(\d+)(\s*\]\s*)$/) + { + if (defined($raw_gids)) + { + for ($k = 0; defined($gids[$k]); $k++) + { + if ($gids[$k] == $3) + { + $groups[$j] = $2 . $3; + $j++; + } + } + } + else + { + $groups[$j] = $2 . $3; + $j++; + } + } + } + return @groups; +} + +#### +#### w2log: Write to a logfile. +#### 1.arg: append to the log file (given string, or from a file. if a file, +#### file will be read from $opt_logdir) +#### 2.arg: logfile -name (w2log assumes that the logfile is in $opt_logdir). +#### 3.arg. 0 | 1, if true, print current date to the logfile. 3. arg will +#### be ignored, if 1. arg is a file. +#### 4.arg. 0 | 1, if true, first argument is a file, else a string +#### + +sub w2log +{ + my ($msg, $file, $date_flag, $is_file)= @_; + my (@data); + + open (LOGFILE, ">>$opt_log") + or die "FATAL: w2log: Couldn't open log file: $opt_log\n"; + + if ($is_file) + { + open (FROMFILE, "<$msg") && (@data=) && + close(FROMFILE) + or die "FATAL: w2log: Couldn't open file: $msg\n"; + foreach my $line (@data) + { + print LOGFILE "$line"; + } + } + else + { + print LOGFILE "$msg"; + print LOGFILE strftime "%a %b %e %H:%M:%S %Y", localtime if ($date_flag); + print LOGFILE "\n"; + } + close (LOGFILE); + return; +} + +#### +#### my_which is used, because we can't assume that every system has the +#### which -command. my_which can take only one argument at a time. +#### Return values: requested system command with the first found path, +#### or undefined, if not found. +#### + +sub my_which +{ + my ($command) = @_; + my (@paths, $path); + + return $command if (-f $command && -x $command); + @paths = split(':', $ENV{'PATH'}); + foreach $path (@paths) + { + $path .= "/$command"; + return $path if (-f $path && -x $path); + } + return undef(); +} + + +#### +#### example +#### + +sub example +{ + print < mysql -u root -S /tmp/mysql.sock -proot_password -e +# "GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'multipass'" +# You will have to do the above for each mysqld running in each data +# directory, that you have (just change the socket, -S=...) +# See more detailed information from chapter: +# '6 The MySQL Access Privilege System' from the MySQL manual. +# 2.pid-file is very important, if you are using safe_mysqld to start mysqld +# (e.g. --mysqld=safe_mysqld) Every mysqld should have it's own pid-file. +# The advantage using safe_mysqld instead of mysqld directly here is, that +# safe_mysqld 'guards' every mysqld process and will restart it, if mysqld +# process fails due to signal kill -9, or similar. (Like segmentation fault, +# which MySQL should never do, of course ;) Please note that safe_mysqld +# script may require that you start it from a certain place. If you have +# problems starting, please see the script. Check especially the lines: +# -------------------------------------------------------------------------- +# 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 \ +# -x ./bin/mysqld +# -------------------------------------------------------------------------- +# The above test should be successful, or you may encounter problems. +# 3.Beware of the dangers starting multiple mysqlds in the same data directory. +# Use separate data directories, unless you *KNOW* what you are doing! +# 4.The socket file and the TCP/IP port must be different for every mysqld. +# 5.The first and fifth mysqld was intentionally left out from the example. +# You may have 'gaps' in the config file. This gives you more flexibility. +# The order in which the mysqlds are started or stopped depends on the order +# in which they appear in the config file. +# 6.When you want to refer to a certain group with GNR with this program, +# just use the number in the end of the group name ( [mysqld# <== ) +# 7.You may want to use option '--user' for mysqld, but in order to do this +# you need to be root when you start this script. Having the option +# in the config file doesn't matter; you will just get a warning, if you are +# no the superuser and the mysqld's are started under *your* unix account. +# IMPORTANT: Make sure that the pid-file and the data directory is +# read+write(+execute for the latter one) accessible for *THAT* UNIX user, +# who the specific mysqld process is started as. *DON'T* use the UNIX root +# account for this, unless you *KNOW* what you are doing! +# 8.MOST IMPORTANT: Make sure that you understand the meanings of the options +# that are passed to the mysqlds and why *WOULD YOU WANT* to have separate +# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* +# give you extra performance in a threaded system! It takes too much space +# to describe everything here, please consult the MySQL manual. +# +[mysql_multi_mysqld] +mysqld = /usr/local/bin/safe_mysqld +mysqladmin = /usr/local/bin/mysqladmin +user = multi_admin +password = multipass + +[mysqld2] +socket = /tmp/mysql.sock2 +port = 3307 +pid-file = /usr/local/mysql/var2/hostname.pid2 +datadir = /usr/local/mysql/var2 +language = /usr/local/share/mysql/english +user = john + +[mysqld3] +socket = /tmp/mysql.sock3 +port = 3308 +pid-file = /usr/local/mysql/var3/hostname.pid3 +datadir = /usr/local/mysql/var3 +language = /usr/local/share/mysql/swedish +user = monty + +[mysqld4] +socket = /tmp/mysql.sock4 +port = 3309 +pid-file = /usr/local/mysql/var4/hostname.pid4 +datadir = /usr/local/mysql/var4 +language = /usr/local/share/mysql/estonia +user = tonu + +[mysqld6] +socket = /tmp/mysql.sock6 +port = 3311 +pid-file = /usr/local/mysql/var6/hostname.pid6 +datadir = /usr/local/mysql/var6 +language = /usr/local/share/mysql/japanese +user = jani +EOF + exit(0); +} + +#### +#### usage +#### + +sub usage +{ + print < Date: Thu, 7 Dec 2000 15:57:58 +0200 Subject: Changed name mysql_multi_mysqld to mysqld_multi. --- scripts/Makefile.am | 7 +- scripts/mysql_multi_mysqld | 606 --------------------------------------------- scripts/mysqld_multi.sh | 606 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 611 insertions(+), 608 deletions(-) delete mode 100755 scripts/mysql_multi_mysqld create mode 100755 scripts/mysqld_multi.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index ec1b33fb42b..cced1944d9e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -27,7 +27,8 @@ bin_SCRIPTS = @server_scripts@ \ mysql_convert_table_format \ mysql_find_rows \ mysqlhotcopy \ - mysqldumpslow + mysqldumpslow \ + mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ @@ -42,6 +43,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ + mysqld_multi \ safe_mysqld.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ @@ -63,7 +65,8 @@ CLEANFILES = @server_scripts@ \ mysql_convert_table_format \ mysql_find_rows \ mysqlhotcopy \ - mysqldumpslow + mysqldumpslow \ + mysqld_multi SUPERCLEANFILES = mysqlbug diff --git a/scripts/mysql_multi_mysqld b/scripts/mysql_multi_mysqld deleted file mode 100755 index 48e72a00aa5..00000000000 --- a/scripts/mysql_multi_mysqld +++ /dev/null @@ -1,606 +0,0 @@ -#!/usr/bin/perl - -use Getopt::Long; -use POSIX qw(strftime); - -$|=1; -$VER="2.1"; - -$opt_config_file = undef(); -$opt_example = 0; -$opt_help = 0; -$opt_log = "/tmp/mysql_multi_mysqld.log"; -$opt_mysqladmin = "mysqladmin"; -$opt_mysqld = "mysqld"; -$opt_no_log = 0; -$opt_password = undef(); -$opt_tcp_ip = 0; -$opt_user = "root"; -$opt_version = 0; - -my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname); - -$homedir = $ENV{HOME}; -$my_progname = $0; -$my_progname =~ s/.*[\/]//; - -main(); - -#### -#### main sub routine -#### - -sub main -{ - my ($flag_exit); - - if (!defined(my_which(my_print_defaults))) - { - # We can't throw out yet, since --version, --help, or --example may - # have been given - print "WARNING! my_print_defaults command not found!\n"; - print "Please make sure you have this command available and\n"; - print "in your path. The command is available from the latest\n"; - print "MySQL distribution.\n"; - } - my @defops = `my_print_defaults mysql_multi_mysqld`; - chop @defops; - splice @ARGV, 0, 0, @defops; - GetOptions("help","example","version","mysqld=s","mysqladmin=s", - "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") - || die "Wrong option! See $my_progname --help for detailed information!\n"; - - $groupids = $ARGV[1]; - - if ($opt_version) - { - print "$my_progname version $VER by Jani Tolonen\n"; - exit(0); - } - example() if ($opt_example); - if (!defined(($mysqld = my_which($opt_mysqld)))) - { - print "Couldn't find the mysqld binary! Tried: $opt_mysqld\n"; - $flag_exit=1; - } - if (!defined(($mysqladmin = my_which($opt_mysqladmin)))) - { - print "Couldn't find the mysqladmin binary! Tried: $opt_mysqladmin\n"; - $flag_exit=1; - } - usage() if ($opt_help); - if ($flag_exit) - { - print "Error with an option, see $my_progname --help for more info!\n"; - exit(1); - } - if (!defined(my_which(my_print_defaults))) - { - print "ABORT: Can't find command 'my_print_defaults'!\n"; - print "This command is available from the latest MySQL\n"; - print "distribution. Please make sure you have the command\n"; - print "in your PATH.\n"; - exit(1); - } - usage() if (!defined($ARGV[0]) || - ($ARGV[0] ne 'start' && $ARGV[0] ne 'START' && - $ARGV[0] ne 'stop' && $ARGV[0] ne 'STOP' && - $ARGV[0] ne 'report' && $ARGV[0] ne 'REPORT')); - - if (!$opt_no_log) - { - w2log("$my_progname log file version $VER; run: ", - "$opt_log", 1, 0); - } - else - { - print "$my_progname log file version $VER; run: "; - print strftime "%a %b %e %H:%M:%S %Y", localtime; - print "\n"; - } - if ($ARGV[0] eq 'report' || $ARGV[0] eq 'REPORT') - { - report_mysqlds(); - } - elsif ($ARGV[0] eq 'start' || $ARGV[0] eq 'START') - { - start_mysqlds(); - } - else - { - stop_mysqlds(); - } -} - -#### -#### Report living and not running MySQL servers -#### - -sub report_mysqlds -{ - my (@groups, $com, $i, @options, $j, $pec); - - print "Reporting MySQL servers\n"; - if (!$opt_no_log) - { - w2log("\nReporting MySQL servers","$opt_log",0,0); - } - @groups = &find_groups($groupids); - for ($i = 0; defined($groups[$i]); $i++) - { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; - - $com = "$mysqladmin -u $opt_user -p$opt_password"; - $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; - for ($j = 0; defined($options[$j]); $j++) - { - if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port)(.*)$/)) - { - $com.= " $options[$j]"; - } - } - $com.= " ping >> /dev/null 2>&1"; - system($com); - $pec = $? >> 8; - if ($pec) - { - print "MySQL server from group: $groups[$i] is not running\n"; - if (!$opt_no_log) - { - w2log("MySQL server from group: $groups[$i] is not running", - "$opt_log", 0, 0); - } - } - else - { - print "MySQL server from group: $groups[$i] is running\n"; - if (!$opt_no_log) - { - w2log("MySQL server from group: $groups[$i] is running", - "$opt_log", 0, 0); - } - } - } - if (!$i) - { - print "No groups to be reported (check your GNRs)\n"; - if (!$opt_no_log) - { - w2log("No groups to be reported (check your GNRs)", "$opt_log", 0, 0); - } - } -} - -#### -#### start multiple servers -#### - -sub start_mysqlds() -{ - my (@groups, $com, $i, @options, $j); - - if (!$opt_no_log) - { - w2log("\nStarting MySQL servers\n","$opt_log",0,0); - } - else - { - print "\nStarting MySQL servers\n"; - } - @groups = &find_groups($groupids); - for ($i = 0; defined($groups[$i]); $i++) - { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; - - $com = "$mysqld"; - for ($j = 0; defined($options[$j]); $j++) - { - $com.= " $options[$j]"; - } - $com.= " >> $opt_log 2>&1" if (!$opt_no_log); - $com.= " &"; - system($com); - } - if (!$i && !$opt_no_log) - { - w2log("No MySQL servers to be started (check your GNRs)", - "$opt_log", 0, 0); - } -} - -#### -#### stop multiple servers -#### - -sub stop_mysqlds() -{ - my (@groups, $com, $i, @options, $j); - - if (!$opt_no_log) - { - w2log("\nStopping MySQL servers\n","$opt_log",0,0); - } - else - { - print "\nStopping MySQL servers\n"; - } - @groups = &find_groups($groupids); - for ($i = 0; defined($groups[$i]); $i++) - { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; - - $com = "$mysqladmin -u $opt_user -p$opt_password"; - $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; - for ($j = 0; defined($options[$j]); $j++) - { - if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port)(.*)$/)) - { - $com.= " $options[$j]"; - } - } - $com.= " shutdown"; - $com.= " >> $opt_log 2>&1" if (!$opt_no_log); - $com.= " &"; - system($com); - } - if (!$i && !$opt_no_log) - { - w2log("No MySQL servers to be stopped (check your GNRs)", - "$opt_log", 0, 0); - } -} - -#### -#### Find groups. Takes the valid group numbers as an argument, parses -#### them, puts them in the ascending order, removes duplicates and -#### returns the wanted groups accordingly. -#### - -sub find_groups -{ - my ($raw_gids) = @_; - my (@groups, @data, @tmp, $line, $i, $k, @pre_gids, @gids, @tmp2, - $prev_value); - - # Read the lines from the config file to variable 'data' - if (defined($opt_config_file)) - { - open(MY_CNF, "<$opt_config_file") && (@data=) && close(MY_CNF); - } - else - { - if (-f "/etc/my.cnf" && -r "/etc/my.cnf") - { - open(MY_CNF, ") && close(MY_CNF); - } - for ($i = 0; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") - { - open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); - } - for (; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - } - chop @data; - # Make a list of the wanted group ids - if (defined($raw_gids)) - { - @pre_gids = split(',', $raw_gids); - } - if (defined($raw_gids)) - { - for ($i = 0, $j = 0; defined($pre_gids[$i]); $i++) - { - if ($pre_gids[$i] =~ m/^(\d+)$/) - { - $gids[$j] = $1; - $j++; - } - elsif ($pre_gids[$i] =~ m/^(\d+)(\-)(\d+)$/) - { - for ($k = $1; $k <= $3; $k++) - { - $gids[$j] = $k; - $j++; - } - } - else - { - print "ABORT: Bad GNR: $pre_gids[$i] See $my_progname --help\n"; - exit(1); - } - } - } - # Sort the list of gids numerically in ascending order - @gids = sort {$a <=> $b} @gids; - # Remove non-positive integers and duplicates - for ($i = 0, $j = 0; defined($gids[$i]); $i++) - { - next if ($gids[$i] <= 0); - if (!$i || $prev_value != $gids[$i]) - { - $tmp2[$j] = $gids[$i]; - $j++; - } - $prev_value = $gids[$i]; - } - @gids = @tmp2; - # Find and return the wanted groups - for ($i = 0, $j = 0; defined($data[$i]); $i++) - { - if ($data[$i] =~ m/^(\s*\[\s*)(mysqld)(\d+)(\s*\]\s*)$/) - { - if (defined($raw_gids)) - { - for ($k = 0; defined($gids[$k]); $k++) - { - if ($gids[$k] == $3) - { - $groups[$j] = $2 . $3; - $j++; - } - } - } - else - { - $groups[$j] = $2 . $3; - $j++; - } - } - } - return @groups; -} - -#### -#### w2log: Write to a logfile. -#### 1.arg: append to the log file (given string, or from a file. if a file, -#### file will be read from $opt_logdir) -#### 2.arg: logfile -name (w2log assumes that the logfile is in $opt_logdir). -#### 3.arg. 0 | 1, if true, print current date to the logfile. 3. arg will -#### be ignored, if 1. arg is a file. -#### 4.arg. 0 | 1, if true, first argument is a file, else a string -#### - -sub w2log -{ - my ($msg, $file, $date_flag, $is_file)= @_; - my (@data); - - open (LOGFILE, ">>$opt_log") - or die "FATAL: w2log: Couldn't open log file: $opt_log\n"; - - if ($is_file) - { - open (FROMFILE, "<$msg") && (@data=) && - close(FROMFILE) - or die "FATAL: w2log: Couldn't open file: $msg\n"; - foreach my $line (@data) - { - print LOGFILE "$line"; - } - } - else - { - print LOGFILE "$msg"; - print LOGFILE strftime "%a %b %e %H:%M:%S %Y", localtime if ($date_flag); - print LOGFILE "\n"; - } - close (LOGFILE); - return; -} - -#### -#### my_which is used, because we can't assume that every system has the -#### which -command. my_which can take only one argument at a time. -#### Return values: requested system command with the first found path, -#### or undefined, if not found. -#### - -sub my_which -{ - my ($command) = @_; - my (@paths, $path); - - return $command if (-f $command && -x $command); - @paths = split(':', $ENV{'PATH'}); - foreach $path (@paths) - { - $path .= "/$command"; - return $path if (-f $path && -x $path); - } - return undef(); -} - - -#### -#### example -#### - -sub example -{ - print < mysql -u root -S /tmp/mysql.sock -proot_password -e -# "GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'multipass'" -# You will have to do the above for each mysqld running in each data -# directory, that you have (just change the socket, -S=...) -# See more detailed information from chapter: -# '6 The MySQL Access Privilege System' from the MySQL manual. -# 2.pid-file is very important, if you are using safe_mysqld to start mysqld -# (e.g. --mysqld=safe_mysqld) Every mysqld should have it's own pid-file. -# The advantage using safe_mysqld instead of mysqld directly here is, that -# safe_mysqld 'guards' every mysqld process and will restart it, if mysqld -# process fails due to signal kill -9, or similar. (Like segmentation fault, -# which MySQL should never do, of course ;) Please note that safe_mysqld -# script may require that you start it from a certain place. If you have -# problems starting, please see the script. Check especially the lines: -# -------------------------------------------------------------------------- -# 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 \ -# -x ./bin/mysqld -# -------------------------------------------------------------------------- -# The above test should be successful, or you may encounter problems. -# 3.Beware of the dangers starting multiple mysqlds in the same data directory. -# Use separate data directories, unless you *KNOW* what you are doing! -# 4.The socket file and the TCP/IP port must be different for every mysqld. -# 5.The first and fifth mysqld was intentionally left out from the example. -# You may have 'gaps' in the config file. This gives you more flexibility. -# The order in which the mysqlds are started or stopped depends on the order -# in which they appear in the config file. -# 6.When you want to refer to a certain group with GNR with this program, -# just use the number in the end of the group name ( [mysqld# <== ) -# 7.You may want to use option '--user' for mysqld, but in order to do this -# you need to be root when you start this script. Having the option -# in the config file doesn't matter; you will just get a warning, if you are -# no the superuser and the mysqld's are started under *your* unix account. -# IMPORTANT: Make sure that the pid-file and the data directory is -# read+write(+execute for the latter one) accessible for *THAT* UNIX user, -# who the specific mysqld process is started as. *DON'T* use the UNIX root -# account for this, unless you *KNOW* what you are doing! -# 8.MOST IMPORTANT: Make sure that you understand the meanings of the options -# that are passed to the mysqlds and why *WOULD YOU WANT* to have separate -# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* -# give you extra performance in a threaded system! It takes too much space -# to describe everything here, please consult the MySQL manual. -# -[mysql_multi_mysqld] -mysqld = /usr/local/bin/safe_mysqld -mysqladmin = /usr/local/bin/mysqladmin -user = multi_admin -password = multipass - -[mysqld2] -socket = /tmp/mysql.sock2 -port = 3307 -pid-file = /usr/local/mysql/var2/hostname.pid2 -datadir = /usr/local/mysql/var2 -language = /usr/local/share/mysql/english -user = john - -[mysqld3] -socket = /tmp/mysql.sock3 -port = 3308 -pid-file = /usr/local/mysql/var3/hostname.pid3 -datadir = /usr/local/mysql/var3 -language = /usr/local/share/mysql/swedish -user = monty - -[mysqld4] -socket = /tmp/mysql.sock4 -port = 3309 -pid-file = /usr/local/mysql/var4/hostname.pid4 -datadir = /usr/local/mysql/var4 -language = /usr/local/share/mysql/estonia -user = tonu - -[mysqld6] -socket = /tmp/mysql.sock6 -port = 3311 -pid-file = /usr/local/mysql/var6/hostname.pid6 -datadir = /usr/local/mysql/var6 -language = /usr/local/share/mysql/japanese -user = jani -EOF - exit(0); -} - -#### -#### usage -#### - -sub usage -{ - print <> 8; + if ($pec) + { + print "MySQL server from group: $groups[$i] is not running\n"; + if (!$opt_no_log) + { + w2log("MySQL server from group: $groups[$i] is not running", + "$opt_log", 0, 0); + } + } + else + { + print "MySQL server from group: $groups[$i] is running\n"; + if (!$opt_no_log) + { + w2log("MySQL server from group: $groups[$i] is running", + "$opt_log", 0, 0); + } + } + } + if (!$i) + { + print "No groups to be reported (check your GNRs)\n"; + if (!$opt_no_log) + { + w2log("No groups to be reported (check your GNRs)", "$opt_log", 0, 0); + } + } +} + +#### +#### start multiple servers +#### + +sub start_mysqlds() +{ + my (@groups, $com, $i, @options, $j); + + if (!$opt_no_log) + { + w2log("\nStarting MySQL servers\n","$opt_log",0,0); + } + else + { + print "\nStarting MySQL servers\n"; + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $com = "$mysqld"; + for ($j = 0; defined($options[$j]); $j++) + { + $com.= " $options[$j]"; + } + $com.= " >> $opt_log 2>&1" if (!$opt_no_log); + $com.= " &"; + system($com); + } + if (!$i && !$opt_no_log) + { + w2log("No MySQL servers to be started (check your GNRs)", + "$opt_log", 0, 0); + } +} + +#### +#### stop multiple servers +#### + +sub stop_mysqlds() +{ + my (@groups, $com, $i, @options, $j); + + if (!$opt_no_log) + { + w2log("\nStopping MySQL servers\n","$opt_log",0,0); + } + else + { + print "\nStopping MySQL servers\n"; + } + @groups = &find_groups($groupids); + for ($i = 0; defined($groups[$i]); $i++) + { + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $com = "$mysqladmin -u $opt_user -p$opt_password"; + $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; + for ($j = 0; defined($options[$j]); $j++) + { + if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port)(.*)$/)) + { + $com.= " $options[$j]"; + } + } + $com.= " shutdown"; + $com.= " >> $opt_log 2>&1" if (!$opt_no_log); + $com.= " &"; + system($com); + } + if (!$i && !$opt_no_log) + { + w2log("No MySQL servers to be stopped (check your GNRs)", + "$opt_log", 0, 0); + } +} + +#### +#### Find groups. Takes the valid group numbers as an argument, parses +#### them, puts them in the ascending order, removes duplicates and +#### returns the wanted groups accordingly. +#### + +sub find_groups +{ + my ($raw_gids) = @_; + my (@groups, @data, @tmp, $line, $i, $k, @pre_gids, @gids, @tmp2, + $prev_value); + + # Read the lines from the config file to variable 'data' + if (defined($opt_config_file)) + { + open(MY_CNF, "<$opt_config_file") && (@data=) && close(MY_CNF); + } + else + { + if (-f "/etc/my.cnf" && -r "/etc/my.cnf") + { + open(MY_CNF, ") && close(MY_CNF); + } + for ($i = 0; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } + if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") + { + open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); + } + for (; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } + } + chop @data; + # Make a list of the wanted group ids + if (defined($raw_gids)) + { + @pre_gids = split(',', $raw_gids); + } + if (defined($raw_gids)) + { + for ($i = 0, $j = 0; defined($pre_gids[$i]); $i++) + { + if ($pre_gids[$i] =~ m/^(\d+)$/) + { + $gids[$j] = $1; + $j++; + } + elsif ($pre_gids[$i] =~ m/^(\d+)(\-)(\d+)$/) + { + for ($k = $1; $k <= $3; $k++) + { + $gids[$j] = $k; + $j++; + } + } + else + { + print "ABORT: Bad GNR: $pre_gids[$i] See $my_progname --help\n"; + exit(1); + } + } + } + # Sort the list of gids numerically in ascending order + @gids = sort {$a <=> $b} @gids; + # Remove non-positive integers and duplicates + for ($i = 0, $j = 0; defined($gids[$i]); $i++) + { + next if ($gids[$i] <= 0); + if (!$i || $prev_value != $gids[$i]) + { + $tmp2[$j] = $gids[$i]; + $j++; + } + $prev_value = $gids[$i]; + } + @gids = @tmp2; + # Find and return the wanted groups + for ($i = 0, $j = 0; defined($data[$i]); $i++) + { + if ($data[$i] =~ m/^(\s*\[\s*)(mysqld)(\d+)(\s*\]\s*)$/) + { + if (defined($raw_gids)) + { + for ($k = 0; defined($gids[$k]); $k++) + { + if ($gids[$k] == $3) + { + $groups[$j] = $2 . $3; + $j++; + } + } + } + else + { + $groups[$j] = $2 . $3; + $j++; + } + } + } + return @groups; +} + +#### +#### w2log: Write to a logfile. +#### 1.arg: append to the log file (given string, or from a file. if a file, +#### file will be read from $opt_logdir) +#### 2.arg: logfile -name (w2log assumes that the logfile is in $opt_logdir). +#### 3.arg. 0 | 1, if true, print current date to the logfile. 3. arg will +#### be ignored, if 1. arg is a file. +#### 4.arg. 0 | 1, if true, first argument is a file, else a string +#### + +sub w2log +{ + my ($msg, $file, $date_flag, $is_file)= @_; + my (@data); + + open (LOGFILE, ">>$opt_log") + or die "FATAL: w2log: Couldn't open log file: $opt_log\n"; + + if ($is_file) + { + open (FROMFILE, "<$msg") && (@data=) && + close(FROMFILE) + or die "FATAL: w2log: Couldn't open file: $msg\n"; + foreach my $line (@data) + { + print LOGFILE "$line"; + } + } + else + { + print LOGFILE "$msg"; + print LOGFILE strftime "%a %b %e %H:%M:%S %Y", localtime if ($date_flag); + print LOGFILE "\n"; + } + close (LOGFILE); + return; +} + +#### +#### my_which is used, because we can't assume that every system has the +#### which -command. my_which can take only one argument at a time. +#### Return values: requested system command with the first found path, +#### or undefined, if not found. +#### + +sub my_which +{ + my ($command) = @_; + my (@paths, $path); + + return $command if (-f $command && -x $command); + @paths = split(':', $ENV{'PATH'}); + foreach $path (@paths) + { + $path .= "/$command"; + return $path if (-f $path && -x $path); + } + return undef(); +} + + +#### +#### example +#### + +sub example +{ + print < mysql -u root -S /tmp/mysql.sock -proot_password -e +# "GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'multipass'" +# You will have to do the above for each mysqld running in each data +# directory, that you have (just change the socket, -S=...) +# See more detailed information from chapter: +# '6 The MySQL Access Privilege System' from the MySQL manual. +# 2.pid-file is very important, if you are using safe_mysqld to start mysqld +# (e.g. --mysqld=safe_mysqld) Every mysqld should have it's own pid-file. +# The advantage using safe_mysqld instead of mysqld directly here is, that +# safe_mysqld 'guards' every mysqld process and will restart it, if mysqld +# process fails due to signal kill -9, or similar. (Like segmentation fault, +# which MySQL should never do, of course ;) Please note that safe_mysqld +# script may require that you start it from a certain place. If you have +# problems starting, please see the script. Check especially the lines: +# -------------------------------------------------------------------------- +# 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 \ +# -x ./bin/mysqld +# -------------------------------------------------------------------------- +# The above test should be successful, or you may encounter problems. +# 3.Beware of the dangers starting multiple mysqlds in the same data directory. +# Use separate data directories, unless you *KNOW* what you are doing! +# 4.The socket file and the TCP/IP port must be different for every mysqld. +# 5.The first and fifth mysqld was intentionally left out from the example. +# You may have 'gaps' in the config file. This gives you more flexibility. +# The order in which the mysqlds are started or stopped depends on the order +# in which they appear in the config file. +# 6.When you want to refer to a certain group with GNR with this program, +# just use the number in the end of the group name ( [mysqld# <== ) +# 7.You may want to use option '--user' for mysqld, but in order to do this +# you need to be root when you start this script. Having the option +# in the config file doesn't matter; you will just get a warning, if you are +# no the superuser and the mysqld's are started under *your* unix account. +# IMPORTANT: Make sure that the pid-file and the data directory is +# read+write(+execute for the latter one) accessible for *THAT* UNIX user, +# who the specific mysqld process is started as. *DON'T* use the UNIX root +# account for this, unless you *KNOW* what you are doing! +# 8.MOST IMPORTANT: Make sure that you understand the meanings of the options +# that are passed to the mysqlds and why *WOULD YOU WANT* to have separate +# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* +# give you extra performance in a threaded system! It takes too much space +# to describe everything here, please consult the MySQL manual. +# +[mysqld_multi] +mysqld = /usr/local/bin/safe_mysqld +mysqladmin = /usr/local/bin/mysqladmin +user = multi_admin +password = multipass + +[mysqld2] +socket = /tmp/mysql.sock2 +port = 3307 +pid-file = /usr/local/mysql/var2/hostname.pid2 +datadir = /usr/local/mysql/var2 +language = /usr/local/share/mysql/english +user = john + +[mysqld3] +socket = /tmp/mysql.sock3 +port = 3308 +pid-file = /usr/local/mysql/var3/hostname.pid3 +datadir = /usr/local/mysql/var3 +language = /usr/local/share/mysql/swedish +user = monty + +[mysqld4] +socket = /tmp/mysql.sock4 +port = 3309 +pid-file = /usr/local/mysql/var4/hostname.pid4 +datadir = /usr/local/mysql/var4 +language = /usr/local/share/mysql/estonia +user = tonu + +[mysqld6] +socket = /tmp/mysql.sock6 +port = 3311 +pid-file = /usr/local/mysql/var6/hostname.pid6 +datadir = /usr/local/mysql/var6 +language = /usr/local/share/mysql/japanese +user = jani +EOF + exit(0); +} + +#### +#### usage +#### + +sub usage +{ + print < Date: Thu, 7 Dec 2000 07:54:59 -0700 Subject: fixed up mysql-test - will not push this yet, as more clean up/testing is to follow --- scripts/make_binary_distribution.sh | 44 ++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7fc492439d0..d687a875f73 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -12,21 +12,36 @@ SOURCE=`pwd` # Save temporary distribution here (must be full path) TMP=/tmp -if test $# -gt 0 +if test $# -gt 0 -a x$1 != x"-debug" then TMP=$1 + shift 1 fi +if test x$1 = x"-debug" +then + DEBUG=1 + shift 1 +fi + + #make # This should really be integrated with automake and not duplicate the # installation list. BASE=$TMP/my_dist + +if [ -d $BASE ] ; then + rm -rf $BASE +fi + mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ - $BASE/tests $BASE/scripts $BASE/sql-bench - + $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \ + $BASE/mysql-test/t $BASE/mysql-test/r \ + $BASE/mysql-test/include $BASE/mysql-test/std_data + chmod o-rwx $BASE/data $BASE/data/* for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ @@ -37,8 +52,9 @@ done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ - client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump client/mysqlimport \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport + client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump \ + client/mysqlimport client/mysqltest \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest do cp -p $i $BASE/bin done @@ -49,7 +65,16 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p support-files/* $BASE/support-files cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib -cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $BASE/share/CVS $BASE/share/*/CVS +cp -r -p sql/share/* $BASE/share/mysql +rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD +rm -rf $BASE/share/SCCS $BASE/share/*/SCCS + +cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/scripts +cp -p mysql-test/README $BASE/README +cp -p mysql-test/include/*.inc $BASE/mysql-test/include +cp -p mysql-test/std_data/*.dat $BASE/mysql-test/std_data +cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t +cp -p mysql-test/r/*.result $BASE/mysql-test/r cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh @@ -62,6 +87,8 @@ mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure cp -r -p sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la +rm -rf `find $BASE/sql-bench -name SCCS` +rm -rf `find $BASE/share -name SCCS` # Change the distribution to a long descreptive name NEW_NAME=mysql-$version-$system-$machine @@ -86,6 +113,11 @@ then cd $SOURCE fi +#if we are debugging, do not do tar/gz +if [ x$DEBUG = x1 ] ; then + exit +fi + # This is needed to prefere gnu tar instead of tar because tar can't # always handle long filenames -- cgit v1.2.1 From 157e2880209c3371db8a3c4ee353a6155f0aa87d Mon Sep 17 00:00:00 2001 From: "jani@prima.mysql.fi" <> Date: Fri, 8 Dec 2000 14:35:54 +0200 Subject: Small changes in mysqld_multi. --- scripts/mysqld_multi.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index d96828cee4d..cd8609d9409 100755 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,10 +1,10 @@ -#!@PERL@ +#!/usr/bin/perl use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.1"; +$VER="2.2"; $opt_config_file = undef(); $opt_example = 0; @@ -134,12 +134,13 @@ sub report_mysqlds @options = `$com`; chop @options; - $com = "$mysqladmin -u $opt_user -p$opt_password"; + $com = "$mysqladmin -u $opt_user"; + $com.= defined($opt_password) ? " -p$opt_password" : ""; $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; for ($j = 0; defined($options[$j]); $j++) { - if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port)(.*)$/)) + if ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) { $com.= " $options[$j]"; } @@ -242,12 +243,13 @@ sub stop_mysqlds() @options = `$com`; chop @options; - $com = "$mysqladmin -u $opt_user -p$opt_password"; + $com = "$mysqladmin -u $opt_user"; + $com.= defined($opt_password) ? " -p$opt_password" : ""; $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; for ($j = 0; defined($options[$j]); $j++) { - if ((($options[$j] =~ m/^(\-\-socket)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port)(.*)$/)) + if ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) { $com.= " $options[$j]"; } @@ -461,8 +463,10 @@ sub example # safe_mysqld 'guards' every mysqld process and will restart it, if mysqld # process fails due to signal kill -9, or similar. (Like segmentation fault, # which MySQL should never do, of course ;) Please note that safe_mysqld -# script may require that you start it from a certain place. If you have -# problems starting, please see the script. Check especially the lines: +# script may require that you start it from a certain place. This means that +# you may have to CD to a certain directory, before you start the +# mysqld_multi. If you have problems starting, please see the script. +# Check especially the lines: # -------------------------------------------------------------------------- # MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) @@ -482,16 +486,15 @@ sub example # 7.You may want to use option '--user' for mysqld, but in order to do this # you need to be root when you start this script. Having the option # in the config file doesn't matter; you will just get a warning, if you are -# no the superuser and the mysqld's are started under *your* unix account. -# IMPORTANT: Make sure that the pid-file and the data directory is +# not the superuser and the mysqlds are started under *your* unix account. +# IMPORTANT: Make sure that the pid-file and the data directory are # read+write(+execute for the latter one) accessible for *THAT* UNIX user, # who the specific mysqld process is started as. *DON'T* use the UNIX root # account for this, unless you *KNOW* what you are doing! # 8.MOST IMPORTANT: Make sure that you understand the meanings of the options # that are passed to the mysqlds and why *WOULD YOU WANT* to have separate # mysqld processes. Starting multiple mysqlds in one data directory *WON'T* -# give you extra performance in a threaded system! It takes too much space -# to describe everything here, please consult the MySQL manual. +# give you extra performance in a threaded system! # [mysqld_multi] mysqld = /usr/local/bin/safe_mysqld -- cgit v1.2.1 From 7617d198a4b6147a2f09b0749ad7ebedb76227b4 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 8 Dec 2000 17:04:57 +0200 Subject: Lots of fixes for BDB tables Change DROP TABLE to first drop the data, then the .frm file --- scripts/mysqlhotcopy.sh | 141 +++++++++++++++++++++++++++--------------------- 1 file changed, 81 insertions(+), 60 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 735fbdcf2aa..c8c62a88ccb 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -37,10 +37,12 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file my $VERSION = "1.9"; -my $opt_tmpdir= $main::env{TMPDIR}; +my $opt_tmpdir= $main::ENV{TMPDIR}; my $OPTIONS = <<"_OPTIONS"; +$0 Ver $VERSION + Usage: $0 db_name [new_db_name | directory] -?, --help display this helpscreen and exit @@ -115,6 +117,8 @@ GetOptions( \%opt, my @db_desc = (); my $tgt_name = undef; +usage("") if ($opt{help}); + if ( $opt{regexp} || $opt{suffix} || @ARGV > 2 ) { $tgt_name = pop @ARGV unless ( exists $opt{suffix} ); @db_desc = map { s{^([^\.]+)\./(.+)/$}{$1}; { 'src' => $_, 't_regex' => ( $2 ? $2 : '.*' ) } } @ARGV; @@ -133,10 +137,9 @@ else { } } -my $mysqld_help; my %mysqld_vars; my $start_time = time; -my $opt_tmpdir= $opt{tempdir} ? $opt{tmpdir} : $main::env{TMPDIR}; +my $opt_tmpdir= $opt{tmpdir} ? $opt{tmpdir} : $main::ENV{TMPDIR}; $0 = $1 if $0 =~ m:/([^/]+)$:; $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; @@ -310,15 +313,19 @@ print Dumper( \@db_desc ) if ( $opt{debug} ); die "No tables to hot-copy" unless ( length $hc_locks ); -# --- create target directories --- +# --- create target directories if we are using 'cp' --- my @existing = (); -foreach my $rdb ( @db_desc ) { + +if ($opt{method} =~ /^cp\b/) +{ + foreach my $rdb ( @db_desc ) { push @existing, $rdb->{target} if ( -d $rdb->{target} ); -} + } -die "Can't hotcopy to '", join( "','", @existing ), "' because already exist and --allowold option not given.\n" - if ( @existing && !$opt{allowold} ); + die "Can't hotcopy to '", join( "','", @existing ), "' because already exist and --allowold option not given.\n" + if ( @existing && !$opt{allowold} ); +} retire_directory( @existing ) if ( @existing ); @@ -385,54 +392,11 @@ foreach my $rdb ( @db_desc ) push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); - @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{index}}; + @files = @{$rdb->{index}}; if ($rdb->{index}) { - # - # Copy only the header of the index file - # - - my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; - foreach my $file ($rdb->{index}) - { - my $from="$datadir/$rdb->{src}/$file"; - my $to="$rdb->{target}/$file"; - my $buff; - open(INPUT, $from) || die "Can't open file $from: $!\n"; - my $length=read INPUT, $buff, 2048; - die "Can't read index header from $from\n" if ($length <= 1024); - close INPUT; - - if ( $opt{dryrun} ) - { - print '$opt{method}-header $from $to\n'; - } - elsif ($opt{method} eq 'cp') - { - !open(OUTPUT,$to) || die "Can\'t create file $to: $!\n"; - if (write(OUTPUT,$buff) != length($buff)) - { - die "Error when writing data to $to: $!\n"; - } - close OUTPUT || die "Error on close of $to: $!\n"; - } - elsif ($opt{method} eq 'scp') - { - my $tmp=$tmpfile; - open(OUTPUT,"$tmp") || die "Can\'t create file $tmp: $!\n"; - if (write(OUTPUT,$buff) != length($buff)) - { - die "Error when writing data to $tmp: $!\n"; - } - close OUTPUT || die "Error on close of $tmp: $!\n"; - safe_system('scp $tmp $to'); - } - else - { - die "Can't use unsupported method '$opt{method}'\n"; - } - } - unlink "$opt_tmpdir/mysqlhotcopy$$"; + copy_index($opt{method}, \@files, + "$datadir/$rdb->{src}", $rdb->{target} ); } if ( $opt{checkpoint} ) { @@ -534,9 +498,62 @@ sub copy_files { safe_system (@cmd); } +# +# Copy only the header of the index file +# + +sub copy_index +{ + my ($method, $files, $source, $target) = @_; + my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; + + print "Copying indices for ".@$files." files...\n" unless $opt{quiet}; + foreach my $file (@$files) + { + my $from="$source/$file"; + my $to="$target/$file"; + my $buff; + open(INPUT, "<$from") || die "Can't open file $from: $!\n"; + my $length=read INPUT, $buff, 2048; + die "Can't read index header from $from\n" if ($length < 1024); + close INPUT; + + if ( $opt{dryrun} ) + { + print "$opt{method}-header $from $to\n"; + } + elsif ($opt{method} eq 'cp') + { + open(OUTPUT,">$to") || die "Can\'t create file $to: $!\n"; + if (syswrite(OUTPUT,$buff) != length($buff)) + { + die "Error when writing data to $to: $!\n"; + } + close OUTPUT || die "Error on close of $to: $!\n"; + } + elsif ($opt{method} eq 'scp') + { + my $tmp=$tmpfile; + open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n"; + if (syswrite(OUTPUT,$buff) != length($buff)) + { + die "Error when writing data to $tmp: $!\n"; + } + close OUTPUT || die "Error on close of $tmp: $!\n"; + safe_system("scp $tmp $to"); + } + else + { + die "Can't use unsupported method '$opt{method}'\n"; + } + } + unlink "$tmpfile" if ($opt{method} eq 'scp'); +} + + sub safe_system { - my @cmd=shift; + my @cmd= @_; if ( $opt{dryrun} ) { @@ -546,7 +563,7 @@ sub safe_system ## for some reason system fails but backticks works ok for scp... print "Executing '@cmd'\n" if $opt{debug}; - my $cp_status = system @cmd; + 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 @@ -680,7 +697,9 @@ UNIX domain socket to use when connecting to local server =item --noindices -don't include index files in copy +Don\'t include index files in copy. Only up to the first 2048 bytes +are copied; You can restore the indexes with isamchk -r or myisamchk -r +on the backup. =item --method=# @@ -689,9 +708,10 @@ method for copy (only "cp" currently supported). Alpha support for will vary with your ability to understand how scp works. 'man scp' and 'man ssh' are your friends. -The destination directory _must exist_ on the target machine using -the scp method. Liberal use of the --debug option will help you figure -out what's really going on when you do an scp. +The destination directory _must exist_ on the target machine using the +scp method. --keepold and --allowold are meeningless with scp. +Liberal use of the --debug option will help you figure out what\'s +really going on when you do an scp. Note that using scp will lock your tables for a _long_ time unless your network connection is _fast_. If this is unacceptable to you, @@ -755,3 +775,4 @@ Ralph Corderoy - added synonyms for commands Scott Wiersdorf - added table regex and scp support Monty - working --noindex (copy only first 2048 bytes of index file) + Fixes for --method=scp -- cgit v1.2.1 From 9de654911fe6a5dd0bac38480157b756154f30f3 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Fri, 8 Dec 2000 19:12:12 +0100 Subject: mysqldump.c typo fixed mysqldumpslow.sh | first line should be #!@PERL@ mysqld_multi.sh | not #@perl@ or #!/usr/bin/perl --- scripts/mysqld_multi.sh | 24 ++++++++++++------------ scripts/mysqldumpslow.sh | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) mode change 100755 => 100644 scripts/mysqld_multi.sh mode change 100755 => 100644 scripts/mysqldumpslow.sh (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh old mode 100755 new mode 100644 index cd8609d9409..634f71b41d3 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!@PERL@ use Getopt::Long; use POSIX qw(strftime); @@ -82,11 +82,11 @@ sub main print "in your PATH.\n"; exit(1); } - usage() if (!defined($ARGV[0]) || + usage() if (!defined($ARGV[0]) || ($ARGV[0] ne 'start' && $ARGV[0] ne 'START' && $ARGV[0] ne 'stop' && $ARGV[0] ne 'STOP' && $ARGV[0] ne 'report' && $ARGV[0] ne 'REPORT')); - + if (!$opt_no_log) { w2log("$my_progname log file version $VER; run: ", @@ -213,7 +213,7 @@ sub start_mysqlds() } if (!$i && !$opt_no_log) { - w2log("No MySQL servers to be started (check your GNRs)", + w2log("No MySQL servers to be started (check your GNRs)", "$opt_log", 0, 0); } } @@ -261,7 +261,7 @@ sub stop_mysqlds() } if (!$i && !$opt_no_log) { - w2log("No MySQL servers to be stopped (check your GNRs)", + w2log("No MySQL servers to be stopped (check your GNRs)", "$opt_log", 0, 0); } } @@ -373,7 +373,7 @@ sub find_groups } #### -#### w2log: Write to a logfile. +#### w2log: Write to a logfile. #### 1.arg: append to the log file (given string, or from a file. if a file, #### file will be read from $opt_logdir) #### 2.arg: logfile -name (w2log assumes that the logfile is in $opt_logdir). @@ -392,8 +392,8 @@ sub w2log if ($is_file) { - open (FROMFILE, "<$msg") && (@data=) && - close(FROMFILE) + open (FROMFILE, "<$msg") && (@data=) && + close(FROMFILE) or die "FATAL: w2log: Couldn't open file: $msg\n"; foreach my $line (@data) { @@ -401,7 +401,7 @@ sub w2log } } else - { + { print LOGFILE "$msg"; print LOGFILE strftime "%a %b %e %H:%M:%S %Y", localtime if ($date_flag); print LOGFILE "\n"; @@ -443,13 +443,13 @@ sub example # This is an example of a my.cnf file on behalf of $my_progname. # This file should probably be in your home dir (~/.my.cnf) or /etc/my.cnf # Version $VER by Jani Tolonen -# NOTES: +# NOTES: # 1.Make sure that the MySQL user, who is stopping the mysqld services (e.g # using the mysqladmin) have the same password and username for all the # data directories accessed (to the 'mysql' database) And make sure that # the user has the 'Shutdown_priv' privilege! If you have many data- # directories and many different 'mysql' databases with different passwords -# for the MySQL 'root' user, you may want to create a common 'multi_admin' +# for the MySQL 'root' user, you may want to create a common 'multi_admin' # user for each using the same password (see below). Example how to do it: # shell> mysql -u root -S /tmp/mysql.sock -proot_password -e # "GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'multipass'" @@ -493,7 +493,7 @@ sub example # account for this, unless you *KNOW* what you are doing! # 8.MOST IMPORTANT: Make sure that you understand the meanings of the options # that are passed to the mysqlds and why *WOULD YOU WANT* to have separate -# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* +# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* # give you extra performance in a threaded system! # [mysqld_multi] diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh old mode 100755 new mode 100644 index c2c88005c80..b0e63dd73c1 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -1,4 +1,4 @@ -#@perl@ +#!@PERL@ # mysqldumpslow - parse and summarize the MySQL slow query log use strict; -- cgit v1.2.1 From 8502addd5f3651bd4efddf7b08c39e1d4d8ca264 Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Wed, 13 Dec 2000 12:42:59 -0700 Subject: mysql-test/Makefile.am fixed typo scripts/make_binary_distribution.sh added .MRG and .frm files --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d687a875f73..9c79ecea735 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -72,7 +72,8 @@ rm -rf $BASE/share/SCCS $BASE/share/*/SCCS cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/scripts cp -p mysql-test/README $BASE/README cp -p mysql-test/include/*.inc $BASE/mysql-test/include -cp -p mysql-test/std_data/*.dat $BASE/mysql-test/std_data +cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.MRG $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t cp -p mysql-test/r/*.result $BASE/mysql-test/r -- cgit v1.2.1 From 5cce198b6959a910925bf90c5abfb2275bff1891 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 16 Dec 2000 23:41:45 +0200 Subject: Fixed error when copying mysqld_multi Fixes for mysql-test Fixed race condition in SHOW LOGS --- scripts/Makefile.am | 2 +- scripts/make_binary_distribution.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index cced1944d9e..5b3347081c4 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -43,7 +43,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ - mysqld_multi \ + mysqld_multi.sh \ safe_mysqld.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 9c79ecea735..0065fdc6208 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -69,11 +69,11 @@ cp -r -p sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD rm -rf $BASE/share/SCCS $BASE/share/*/SCCS -cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/scripts -cp -p mysql-test/README $BASE/README +cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ +cp -p mysql-test/README $BASE/mysql-test/README cp -p mysql-test/include/*.inc $BASE/mysql-test/include cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ - mysql-test/std_data/*.MRG $BASE/mysql-test/std_data + mysql-test/std_data/*.MRG $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t cp -p mysql-test/r/*.result $BASE/mysql-test/r -- cgit v1.2.1 From 155823ad5118be2fe50d9ef705bc5d627b7333b0 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Mon, 18 Dec 2000 16:09:19 +0200 Subject: Lots of new benchmark runs Remember filename for temporary files created with mkstemp Fixed wrongly allocated BDB share structure Cleanups for SunPRO --- scripts/mysqld_multi.sh | 31 ++++++++++++++++--------------- scripts/safe_mysqld.sh | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 634f71b41d3..8d22129d850 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -11,7 +11,7 @@ $opt_example = 0; $opt_help = 0; $opt_log = "/tmp/mysqld_multi.log"; $opt_mysqladmin = "mysqladmin"; -$opt_mysqld = "mysqld"; +$opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; $opt_password = undef(); $opt_tcp_ip = 0; @@ -497,41 +497,42 @@ sub example # give you extra performance in a threaded system! # [mysqld_multi] -mysqld = /usr/local/bin/safe_mysqld -mysqladmin = /usr/local/bin/mysqladmin +mysqld = @bindir@/safe_mysqld +mysqladmin = @bindir@/mysqladmin user = multi_admin password = multipass [mysqld2] socket = /tmp/mysql.sock2 port = 3307 -pid-file = /usr/local/mysql/var2/hostname.pid2 -datadir = /usr/local/mysql/var2 -language = /usr/local/share/mysql/english +pid-file = @localstatedir@2/hostname.pid2 +datadir = @localstatedir@2 +language = @datadir@/mysql/english user = john [mysqld3] socket = /tmp/mysql.sock3 port = 3308 -pid-file = /usr/local/mysql/var3/hostname.pid3 -datadir = /usr/local/mysql/var3 -language = /usr/local/share/mysql/swedish +pid-file = @localstatedir@3/hostname.pid3 +datadir = @localstatedir@3 +language = @datadir@/mysql/swedish user = monty [mysqld4] socket = /tmp/mysql.sock4 port = 3309 -pid-file = /usr/local/mysql/var4/hostname.pid4 -datadir = /usr/local/mysql/var4 -language = /usr/local/share/mysql/estonia +pid-file = @localstatedir@4/hostname.pid4 +datadir = @localstatedir@4 +language = @datadir@/mysql/estonia user = tonu + [mysqld6] socket = /tmp/mysql.sock6 port = 3311 -pid-file = /usr/local/mysql/var6/hostname.pid6 -datadir = /usr/local/mysql/var6 -language = /usr/local/share/mysql/japanese +pid-file = @localstatedir@6/hostname.pid6 +datadir = @localstatedir@6 +language = @datadir@/mysql/japanese user = jani EOF exit(0); diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 2fa9134b65c..f1efcb292e7 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -247,5 +247,5 @@ do echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log done -echo "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log +echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log echo "" | tee -a $err_log -- cgit v1.2.1 From b590fa2567f3a4c1f0055618fb4d06e1af7ae85b Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sun, 24 Dec 2000 15:19:00 +0200 Subject: New benchmark test Fixed bug in REPLACE with BDB tables Prepare for write lock on read for BDB Inform the handler when we want to use IGNORE / REPLACE New manual pages --- scripts/mysqlaccess.sh | 6 ++++-- scripts/safe_mysqld.sh | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index dfc88ecad98..355eb53d2b5 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -8,7 +8,7 @@ use Fcntl; BEGIN { # **************************** # static information... - $VERSION = "2.05, 17 Feb 2000"; + $VERSION = "2.06, 20 Dec 2000"; $0 =~ m%/([^/]+)$%o; $script = $1; $script = 'MySQLAccess' unless $script; @@ -302,6 +302,8 @@ Release Notes: 2.05: (2000-02-17) Monty Moved the log file from /tmp to ~ + 2.06: Don't print '+++USING FULL WHERE CLAUSE+++' + _RELEASE $TODO = <<_TODO; @@ -1468,7 +1470,7 @@ sub Sort_table { # server version 3.21 has a full where clause :-) if ($MySQLaccess::Host::SERVER >= '3.21') { -print "+++USING FULL WHERE CLAUSE+++\n"; + # print "+++USING FULL WHERE CLAUSE+++\n"; $start = "SELECT *,UCASE(host) as ucase_host FROM $tbl WHERE "; $end = ' ORDER BY ' . join(',', @order) . ";\n"; } diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index f1efcb292e7..9325cee4f33 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -46,7 +46,9 @@ parse_arguments() { # safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + # QQ The --open-files should be removed --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; + --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; *) -- cgit v1.2.1 From 60677ffd2cceb0c8154ff73c8c17cc080f37bda4 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Thu, 28 Dec 2000 19:25:41 +0200 Subject: Cleanup of tests Fixed bug with ALTER TABLE on HEAP tables --- scripts/mysqld_multi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 8d22129d850..1adaa458271 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -10,7 +10,7 @@ $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; $opt_log = "/tmp/mysqld_multi.log"; -$opt_mysqladmin = "mysqladmin"; +$opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; $opt_password = undef(); -- cgit v1.2.1 From 07b1f0dccdf7f58dd79448e293eff85383f450e1 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 29 Dec 2000 16:06:10 +0200 Subject: Fixed --no-defaults in mysqltest --- scripts/safe_mysqld.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 9325cee4f33..11d17f822ee 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -51,6 +51,7 @@ parse_arguments() { --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; + --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; *) if test -n "$pick_args" then @@ -87,6 +88,7 @@ fi MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} user=@MYSQLD_USER@ +MYSQLD=mysqld # these rely on $DATADIR by default, so we'll set them later on pid_file= @@ -111,9 +113,9 @@ args= parse_arguments `$print_defaults $defaults mysqld safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" -if test ! -x $ledir/mysqld +if test ! -x $ledir/$MYSQLD then - echo "The file $ledir/mysqld doesn't exist or is not executable" + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/safe_mysqld". @@ -195,7 +197,7 @@ fi # $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 -echo "Starting mysqld daemon with databases from $DATADIR" +echo "Starting $MYSQLD daemon with databases from $DATADIR" # Does this work on all systems? #if type ulimit | grep "shell builtin" > /dev/null @@ -209,9 +211,9 @@ do rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test -z "$args" then - $NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 + $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 else - eval "$NOHUP_NICENESS $ledir/mysqld $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" + eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" fi if test ! -f $pid_file # This is removed if normal shutdown then @@ -225,12 +227,12 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld` + numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep $ledir/mysqld | grep -v "grep" | tail -1` + PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` for T in $PROC do break @@ -238,7 +240,7 @@ do # echo "TEST $I - $T **" if kill -9 $T then - echo "mysqld process hanging, pid $T - killed" | tee -a $err_log + echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log else break fi -- cgit v1.2.1 From 4de5ac3327a9368d0a90ae4ff9ad5c272e421ce8 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sun, 31 Dec 2000 11:38:44 +0200 Subject: Fixed new bug in BDB tables --- scripts/safe_mysqld.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 11d17f822ee..0265dcdeeb9 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -149,8 +149,10 @@ then fi fi +USER="" if test -w / then + USER_OPTION="--user=$user" # If we are root, change the err log to the right user. touch $err_log; chown $user $err_log if test -n "$open_files" @@ -211,9 +213,9 @@ do rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test -z "$args" then - $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 + $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 else - eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" + eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" fi if test ! -f $pid_file # This is removed if normal shutdown then -- cgit v1.2.1 From e9c2f7d4393075d16da0ae18a9576bebcb1e0dda Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 2 Jan 2001 14:29:47 +0200 Subject: Fixes to get mysql-test included in the distributions --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0065fdc6208..3203a7f0fa0 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -75,7 +75,7 @@ cp -p mysql-test/include/*.inc $BASE/mysql-test/include cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MRG $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t -cp -p mysql-test/r/*.result $BASE/mysql-test/r +cp -p mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -- cgit v1.2.1 From ffd05cad96a30c007134ef0da1fb3ace428a99fb Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Tue, 2 Jan 2001 17:52:42 +0200 Subject: Add missing files in binary distribution --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3203a7f0fa0..88e82b306d4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -76,6 +76,7 @@ cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MRG $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t cp -p mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r +cp -p mysql-test/README* mysql-test/mysql-test-run mysql-test/create-test-result mysql-test/install_test_db mysql-test/mysql-test-run $BASE/mysql-test cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -- cgit v1.2.1 From ac0ceaf28e35ca50dfa606d3fd7ebb8e6e6e0085 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Wed, 3 Jan 2001 00:13:19 +0200 Subject: Fix for replication when binary log goes over 2G Split update_of_key into separate tests Updated make_binary_distribution to generate symbol file for mysqld --- scripts/make_binary_distribution.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 88e82b306d4..48057b43a76 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -52,8 +52,8 @@ done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ - client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump \ - client/mysqlimport client/mysqltest \ + client/mysql sql/mysqld sql/mysqld.sym.gz client/mysqlshow \ + client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest do cp -p $i $BASE/bin @@ -70,13 +70,13 @@ rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD rm -rf $BASE/share/SCCS $BASE/share/*/SCCS cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ +cp -p mysql-test/create-test-result $BASE/mysql-test cp -p mysql-test/README $BASE/mysql-test/README cp -p mysql-test/include/*.inc $BASE/mysql-test/include cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MRG $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t cp -p mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r -cp -p mysql-test/README* mysql-test/mysql-test-run mysql-test/create-test-result mysql-test/install_test_db mysql-test/mysql-test-run $BASE/mysql-test cp -p scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -- cgit v1.2.1 From 6d0e529042f175d4a0522235239f33e8eca41cfb Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Mon, 8 Jan 2001 00:04:30 +0200 Subject: Fixed bug when having many binary log files Fixed bug when deleting keys with possible NULL values many changes to mysqltest --- scripts/make_binary_distribution.sh | 33 +++++++++++++++++++++++---------- scripts/mysql_install_db.sh | 2 +- scripts/safe_mysqld.sh | 2 +- 3 files changed, 25 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 48057b43a76..14c4b616dec 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -18,6 +18,14 @@ then shift 1 fi +# Get optional suffix for distribution +SUFFIX="" +if test $# -gt 0 -a x$1 != x"-debug" +then + SUFFIX=$1 + shift 1 +fi + if test x$1 = x"-debug" then DEBUG=1 @@ -33,7 +41,7 @@ fi BASE=$TMP/my_dist if [ -d $BASE ] ; then - rm -rf $BASE + rm -r -f $BASE fi mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ @@ -56,7 +64,10 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest do - cp -p $i $BASE/bin + if [ -f $i ] + then + cp -p $i $BASE/bin + fi done cp -p config.h include/* $BASE/include @@ -67,10 +78,8 @@ cp -p support-files/* $BASE/support-files cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib cp -r -p sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD -rm -rf $BASE/share/SCCS $BASE/share/*/SCCS cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ -cp -p mysql-test/create-test-result $BASE/mysql-test cp -p mysql-test/README $BASE/mysql-test/README cp -p mysql-test/include/*.inc $BASE/mysql-test/include cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ @@ -89,13 +98,17 @@ mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure cp -r -p sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la -rm -rf `find $BASE/sql-bench -name SCCS` -rm -rf `find $BASE/share -name SCCS` -# Change the distribution to a long descreptive name -NEW_NAME=mysql-$version-$system-$machine +# Clean up if we did this from a bk tree +if [ -d $BASE/sql-bench/SCCS ] ; then + find $BASE/share -name SCCS -print | xargs rm -r -f + find $BASE/sql-bench -name SCCS -print | xargs rm -r -f +fi + +# Change the distribution to a long descriptive name +NEW_NAME=mysql-$version-$system-$machine$SUFFIX BASE2=$TMP/$NEW_NAME -rm -rf $BASE2 +rm -r -f $BASE2 mv $BASE $BASE2 BASE=$BASE2 # @@ -160,6 +173,6 @@ cd $SOURCE echo "Compressing archive" gzip -9 $NEW_NAME.tar echo "Removing temporary directory" -rm -rf $BASE +rm -r -f $BASE echo "$NEW_NAME.tar.gz created" diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index efb92bb7f62..068fc4a384a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,7 +10,7 @@ IN_RPM=0 case "$1" in -IN-RPM) - IN_RPM="$1"; shift + IN_RPM="1"; shift ;; esac defaults= diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 0265dcdeeb9..fc89f0c7848 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -110,7 +110,7 @@ else fi args= -parse_arguments `$print_defaults $defaults mysqld safe_mysqld` +parse_arguments `$print_defaults $defaults mysqld server safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" if test ! -x $ledir/$MYSQLD -- cgit v1.2.1 From 9c80d5cb70d530d63690b53a42554b57a3e513b4 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 12 Jan 2001 13:52:32 +0200 Subject: Patches for NetBSD/macppc Fixed bug in LEFT JOIN Added bdb_log_buffer_size --- scripts/mysqlhotcopy.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index c8c62a88ccb..bf857c67cea 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!@PERL@ -w use strict; use Getopt::Long; @@ -36,8 +36,9 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.9"; -my $opt_tmpdir= $main::ENV{TMPDIR}; +my $VERSION = "1.10"; + +my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; my $OPTIONS = <<"_OPTIONS"; @@ -74,7 +75,7 @@ sub usage { } my %opt = ( - user => getpwuid($>), + user => scalar getpwuid($>), noindices => 0, allowold => 0, # for safety keepold => 0, @@ -139,7 +140,7 @@ else { my %mysqld_vars; my $start_time = time; -my $opt_tmpdir= $opt{tmpdir} ? $opt{tmpdir} : $main::ENV{TMPDIR}; +$opt_tmpdir= $opt{tmpdir} if $opt{tmpdir}; $0 = $1 if $0 =~ m:/([^/]+)$:; $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; @@ -235,16 +236,17 @@ foreach my $rdb ( @db_desc ) { or die "Cannot open dir '$db_dir': $!"; my %db_files; - map { ( /(.+)\.\w+$/ ? { $db_files{$_} = $1 } : () ) } readdir(DBDIR); + map { ( /(.+)\.\w+$/ ? ( $db_files{$_} = $1 ) : () ) } readdir(DBDIR); unless( keys %db_files ) { warn "'$db' is an empty database\n"; } closedir( DBDIR ); ## filter (out) files specified in t_regex - my @db_files = sort ( $negated + my @db_files = ( $negated ? grep { $db_files{$_} !~ $t_regex } keys %db_files : grep { $db_files{$_} =~ $t_regex } keys %db_files ); + @db_files = sort @db_files; my @index_files=(); ## remove indices unless we're told to keep them @@ -776,3 +778,5 @@ Scott Wiersdorf - added table regex and scp support Monty - working --noindex (copy only first 2048 bytes of index file) Fixes for --method=scp + +Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. -- cgit v1.2.1 From 08d36171a9e535fac9d33e7cbb9a2770a72bfd0b Mon Sep 17 00:00:00 2001 From: "tim@cane.mysql.fi" <> Date: Fri, 19 Jan 2001 02:46:13 +0200 Subject: Add --with-server-suffix (MYSQL_SERVER_SUFFIX). --- scripts/Makefile.am | 1 + scripts/mysqlbug.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5b3347081c4..45fbe275476 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -96,6 +96,7 @@ SUFFIXES = .sh -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''VERSION''@!@VERSION@!' \ + -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \ -e 's!@''HOSTNAME''@!@HOSTNAME@!' \ diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 77744777c1c..bd5cb497e59 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -4,7 +4,7 @@ echo "Finding system information for a MySQL bug report" -VERSION="@VERSION@" +VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" COMPILATION_COMMENT="@COMPILATION_COMMENT@" BUGmysql="mysql@lists.mysql.com" # This is set by configure -- cgit v1.2.1 From 038fe2fc5c8b9f3f41782e8194b37850095b4e5c Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 19 Jan 2001 04:57:29 +0200 Subject: Added MYSQL_SERVER_SUFFIX to mysqld Fixed bug in TRIM changed strnmov -> strmake --- scripts/make_binary_distribution.sh | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 14c4b616dec..3f8e497e511 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -38,7 +38,7 @@ fi # This should really be integrated with automake and not duplicate the # installation list. -BASE=$TMP/my_dist +BASE=$TMP/my_dist$SUFFIX if [ -d $BASE ] ; then rm -r -f $BASE @@ -59,10 +59,28 @@ do done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ - extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ - client/mysql sql/mysqld sql/mysqld.sym.gz client/mysqlshow \ - client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest + extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk \ + myisam/myisampack sql/mysqld sql/mysqlbinlog \ + client/mysql sql/mysqld client/mysqlshow \ + client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ + client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest +do + if [ -f $i ] + then + cp -p $i $BASE/bin + strip $BASE/bin + fi +done + +for i in sql/mysqld.sym.gz + if [ -f $i ] + then + cp -p $i $BASE/bin + fi +done + +for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib do if [ -f $i ] then @@ -75,7 +93,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p support-files/* $BASE/support-files -cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib + cp -r -p sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD @@ -106,7 +124,7 @@ if [ -d $BASE/sql-bench/SCCS ] ; then fi # Change the distribution to a long descriptive name -NEW_NAME=mysql-$version-$system-$machine$SUFFIX +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX BASE2=$TMP/$NEW_NAME rm -r -f $BASE2 mv $BASE $BASE2 -- cgit v1.2.1 From b69ac0037fd4e65954ec686e55259725cc7122ab Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sun, 21 Jan 2001 21:57:30 +0200 Subject: Fix new bugs in make_binary_distribution --- scripts/make_binary_distribution.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3f8e497e511..a63c985913b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -10,9 +10,17 @@ version=@VERSION@ export machine system version SOURCE=`pwd` +# Debug option must come first +DEBUG=0 +if test x$1 = x"--debug" +then + DEBUG=1 + shift 1 +fi + # Save temporary distribution here (must be full path) TMP=/tmp -if test $# -gt 0 -a x$1 != x"-debug" +if test $# -gt 0 then TMP=$1 shift 1 @@ -20,18 +28,12 @@ fi # Get optional suffix for distribution SUFFIX="" -if test $# -gt 0 -a x$1 != x"-debug" +if test $# -gt 0 then SUFFIX=$1 shift 1 fi -if test x$1 = x"-debug" -then - DEBUG=1 - shift 1 -fi - #make @@ -69,11 +71,12 @@ do if [ -f $i ] then cp -p $i $BASE/bin - strip $BASE/bin fi done +strip $BASE/bin/* for i in sql/mysqld.sym.gz +do if [ -f $i ] then cp -p $i $BASE/bin @@ -100,8 +103,7 @@ rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ cp -p mysql-test/README $BASE/mysql-test/README cp -p mysql-test/include/*.inc $BASE/mysql-test/include -cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ - mysql-test/std_data/*.MRG $BASE/mysql-test/std_data +cp -p mysql-test/std_data/*.dat $BASE/mysql-test/std_data cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t cp -p mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r -- cgit v1.2.1 From 8a9b1e9248aee8150abab64e1aa300328f377fbf Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Mon, 22 Jan 2001 01:36:33 +0200 Subject: Fixed type in make_binary_distribution.sh Don't convert field names in mysql_list_fields --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a63c985913b..e07662d8102 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -87,7 +87,7 @@ for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmy do if [ -f $i ] then - cp -p $i $BASE/bin + cp -p $i $BASE/lib fi done -- cgit v1.2.1 From 9d120741d2be8cd86801503d6a26bcdc8d55fb5f Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Fri, 2 Feb 2001 03:47:06 +0200 Subject: Portability fixes Changed TRUNCATE table_name -> TRUNCATE TABLE table_name --- scripts/make_binary_distribution.sh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e07662d8102..030d8b5c0d6 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -9,6 +9,7 @@ system=@SYSTEM_TYPE@ version=@VERSION@ export machine system version SOURCE=`pwd` +CP="cp -p" # Debug option must come first DEBUG=0 @@ -57,7 +58,7 @@ chmod o-rwx $BASE/data $BASE/data/* for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ Docs/manual.html Docs/manual.txt Docs/manual_toc.html do - cp -p $i $BASE + $CP $i $BASE done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ @@ -70,7 +71,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ do if [ -f $i ] then - cp -p $i $BASE/bin + $CP $i $BASE/bin fi done strip $BASE/bin/* @@ -79,7 +80,7 @@ for i in sql/mysqld.sym.gz do if [ -f $i ] then - cp -p $i $BASE/bin + $CP $i $BASE/bin fi done @@ -87,27 +88,27 @@ for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmy do if [ -f $i ] then - cp -p $i $BASE/lib + $CP $i $BASE/lib fi done -cp -p config.h include/* $BASE/include +$CP config.h include/* $BASE/include rm $BASE/include/Makefile*; rm $BASE/include/*.in -cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests -cp -p support-files/* $BASE/support-files +$CP tests/*.res tests/*.tst tests/*.pl $BASE/tests +$CP support-files/* $BASE/support-files -cp -r -p sql/share/* $BASE/share/mysql +$CP -r sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD -cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ -cp -p mysql-test/README $BASE/mysql-test/README -cp -p mysql-test/include/*.inc $BASE/mysql-test/include -cp -p mysql-test/std_data/*.dat $BASE/mysql-test/std_data -cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t -cp -p mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ +$CP mysql-test/README $BASE/mysql-test/README +$CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/std_data/*.dat $BASE/mysql-test/std_data +$CP mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t +$CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r -cp -p scripts/* $BASE/bin +$CP scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db @@ -116,7 +117,7 @@ $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure -cp -r -p sql-bench/* $BASE/sql-bench +$CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la # Clean up if we did this from a bk tree @@ -143,7 +144,7 @@ then then print "Warning: Couldn't find libgcc.a!" else - cp -p $gcclib libmygcc.a + $CP $gcclib libmygcc.a fi cd $SOURCE fi -- cgit v1.2.1 From 728b63e0de8b992e29b00cc100e183e6f9011643 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 3 Feb 2001 18:00:29 +0200 Subject: Workaround for bug in thread library in Unixware 7 Fixed bug in GROUP BY on ELT() Added SEQUENCE() to UDF examples --- scripts/mysql_install_db.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 068fc4a384a..4e2bb2f0b2e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -150,9 +150,9 @@ then # mysqld --bootstrap wants one command/line c_d="$c_d CREATE TABLE db (" - c_d="$c_d Host char(60) DEFAULT '' NOT NULL," - c_d="$c_d Db char(64) DEFAULT '' NOT NULL," - c_d="$c_d User char(16) DEFAULT '' NOT NULL," + c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," + c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," + c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," @@ -177,8 +177,8 @@ then echo "Preparing host table" c_h="$c_h CREATE TABLE host (" - c_h="$c_h Host char(60) DEFAULT '' NOT NULL," - c_h="$c_h Db char(64) DEFAULT '' NOT NULL," + c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," + c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," @@ -199,9 +199,9 @@ then echo "Preparing user table" c_u="$c_u CREATE TABLE user (" - c_u="$c_u Host char(60) DEFAULT '' NOT NULL," - c_u="$c_u User char(16) DEFAULT '' NOT NULL," - c_u="$c_u Password char(16) DEFAULT '' NOT NULL," + c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," + c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," + c_u="$c_u Password char(16) binary DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," @@ -235,7 +235,7 @@ then echo "Preparing func table" c_f="$c_f CREATE TABLE func (" - c_f="$c_f name char(64) DEFAULT '' NOT NULL," + c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," c_f="$c_f dl char(128) DEFAULT '' NOT NULL," c_f="$c_f type enum ('function','aggregate') NOT NULL," @@ -249,10 +249,10 @@ then echo "Preparing tables_priv table" c_t="$c_t CREATE TABLE tables_priv (" - c_t="$c_t Host char(60) DEFAULT '' NOT NULL," - c_t="$c_t Db char(64) DEFAULT '' NOT NULL," - c_t="$c_t User char(16) DEFAULT '' NOT NULL," - c_t="$c_t Table_name char(60) DEFAULT '' NOT NULL," + c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," + c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," + c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," + c_t="$c_t Table_name char(60) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," @@ -268,11 +268,11 @@ then echo "Preparing columns_priv table" c_c="$c_c CREATE TABLE columns_priv (" - c_c="$c_c Host char(60) DEFAULT '' NOT NULL," - c_c="$c_c Db char(64) DEFAULT '' NOT NULL," - c_c="$c_c User char(16) DEFAULT '' NOT NULL," - c_c="$c_c Table_name char(64) DEFAULT '' NOT NULL," - c_c="$c_c Column_name char(64) DEFAULT '' NOT NULL," + c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," + c_c="$c_c Db char(64) binary DEFAULT '' NOT NULL," + c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," + c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," + c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Timestamp timestamp(14)," c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" -- cgit v1.2.1 From c533308a158795f91247e9fe3c7304fa5e7d2b3c Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 17 Feb 2001 14:19:19 +0200 Subject: Added Innobase to source distribution --- scripts/mysql_install_db.sh | 2 +- scripts/safe_mysqld.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 4e2bb2f0b2e..3603e76b3d7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -322,7 +322,7 @@ then echo "able to use the new GRANT command!" fi echo - if test -z "$IN_RPM" + if test "$IN_RPM" -eq 0 then echo "You can start the MySQL demon with:" echo "cd @prefix@ ; $bindir/safe_mysqld &" diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index fc89f0c7848..7120587f1de 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -149,7 +149,7 @@ then fi fi -USER="" +USER_OPTION="" if test -w / then USER_OPTION="--user=$user" -- cgit v1.2.1 From ece13efde985355d0eb1df8875eabe3fd75cf007 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.com" <> Date: Sat, 17 Feb 2001 19:04:33 +0200 Subject: Write UNION() for MERGE tables --- scripts/safe_mysqld.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 7120587f1de..6d215ec3d16 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -72,6 +72,10 @@ then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is DATADIR=$MY_BASEDIR_VERSION/data + if test -z "defaults" + then + defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" + fi # Check if this is a 'moved install directory' elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld -- cgit v1.2.1 From db56853b6fc218444861823a39a303793dbf85c2 Mon Sep 17 00:00:00 2001 From: "jcole@tetra.spaceapes.com" <> Date: Sun, 18 Feb 2001 15:29:52 -0600 Subject: s/Demon/Daemon/g; --- scripts/mysql_install_db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 3603e76b3d7..97a105c78f3 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -324,10 +324,10 @@ then echo if test "$IN_RPM" -eq 0 then - echo "You can start the MySQL demon with:" + echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/safe_mysqld &" echo - echo "You can test the MySQL demon with the benchmarks in the 'sql-bench' directory:" + echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" echo "cd sql-bench ; run-all-tests" echo fi @@ -342,7 +342,7 @@ else echo "Installation of grant tables failed!" echo echo "Examine the logs in $ldata for more information." - echo "You can also try to start the mysqld demon with:" + echo "You can also try to start the mysqld daemon with:" echo "$execdir/mysqld --skip-grant &" echo "You can use the command line tool" echo "$bindir/mysql to connect to the mysql" -- cgit v1.2.1 From 5ccbbd83f29b1057cfbe869259c4cb009b89a9d2 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Sat, 3 Mar 2001 03:03:12 +0200 Subject: Fixes for innobase usage Fixed bug when using TEXT columns with BDB tables Allow LOAD DATA INFILE to use numbers with ENUM and SET columns --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 97a105c78f3..98e31cfe1ef 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -282,7 +282,7 @@ fi echo "Installing all prepared tables" if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata $args" << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innobase --skip-gemeni --skip-bdb $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From 32d403f087116419d52b021963a5a4b13dda95a4 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Thu, 8 Mar 2001 21:49:15 +0200 Subject: Fixed bug in INSERT DELAYED when INSERT generated an error --- scripts/mysqldumpslow.sh | 162 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 112 insertions(+), 50 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index b0e63dd73c1..02b5d5cd0cd 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -1,6 +1,9 @@ #!@PERL@ # mysqldumpslow - parse and summarize the MySQL slow query log +# Original version by Tim Bunce, sometime in 2000. +# Further changes by Tim Bunce, 8th March 2001. + use strict; use Getopt::Long; @@ -8,69 +11,128 @@ use Getopt::Long; # at, al, and ar are the corresponding averages my %opt = ( - s => 'at', - h => '*', + s => 'at', + h => '*', ); GetOptions(\%opt, - 'v+', # verbose - 'd+', # debug - 's=s', # what to sort by (t, at, l, al, r, ar etc) - 'a!', # don't abstract all numbers to N and strings to 'S' - 'g=s', # grep: only consider stmts that include this string - 'h=s', # hostname of db server (can be wildcard) + 'v+', # verbose + 'd+', # debug + 's=s', # what to sort by (t, at, l, al, r, ar etc) + 'r!', # reverse the sort order (largest last instead of first) + 't=i', # just show the top n queries + 'a!', # don't abstract all numbers to N and strings to 'S' + 'n=i', # abstract numbers with at least n digits within names + 'g=s', # grep: only consider stmts that include this string + 'h=s', # hostname of db server for *-slow.log filename (can be wildcard) + 'i=s', # name of server instance (if using mysql.server startup script) + 'l!', # don't subtract lock time from total time ) or die "Bad option"; -my %stmt; - -my $datadir = "/var/lib/mysql"; # XXX should fetch dynamically -@ARGV = <$datadir/$opt{h}-slow.log>; - -$/ = "\n#"; # read entire statements using paragraph mode -while (<>) { - print "[$_]\n" if $opt{v}; - s/^#// unless %stmt; - - s/\s*Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; - my ($t, $l, $r) = ($1, $2, $3); - s/^use \w+;\n//; # not consistently added - s/^SET timestamp=\d+;\n//; - - s/^[ ]*\n//mg; # delete blank lines - s/^[ ]*/ /mg; # normalize leading whitespace - s/\s*;\s*(#\s*)?$//; # remove traing semicolon(+newline-hash) - - next if $opt{g} and !m/$opt{g}/i; - - unless ($opt{a}) { - s/\b\d+\b/N/g; - s/\b0x[0-9A-Fa-f]+\b/N/g; - s/'.*?'/'S'/g; - s/".*?"/"S"/g; - } +unless (@ARGV) { + my $defaults = `my_print_defaults mysqld`; + my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] + or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; + warn "basedir=$basedir\n" if $opt{v}; + + my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + if (!$datadir or $opt{i}) { + # determine the datadir from the instances section of /etc/my.cnf, if any + my $instances = `my_print_defaults instances`; + die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" + unless $instances; + my @instances = ($instances =~ m/^--(\w+)-/mg); + die "No -i 'instance_name' specified to select among known instances: @instances.\n" + unless $opt{i}; + die "Instance '$opt{i}' is unknown (known instances: @instances)\n" + unless grep { $_ eq $opt{i} } @instances; + $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] + or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; + warn "datadir=$datadir\n" if $opt{v}; + } + + @ARGV = <$datadir/$opt{h}-slow.log>; + die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV; +} - $stmt{$_}->{c} += 1; - $stmt{$_}->{t} += $t; - $stmt{$_}->{l} += $l; - $stmt{$_}->{r} += $r; +warn "\nReading mysql slow query log from @ARGV\n"; - warn "[$_]" if $opt{d}; +my @pending; +my %stmt; +$/ = ";\n#"; # read entire statements using paragraph mode +while ( defined($_ = shift @pending) or defined($_ = <>) ) { + warn "[[$_]]\n" if $opt{d}; # show raw paragraph being read + + my @chunks = split /^\/.*Version.*started with[\000-\377]*?Time.*Id.*Command.*Argument.*\n/m; + if (@chunks > 1) { + unshift @pending, map { length($_) ? $_ : () } @chunks; + warn "<<".join(">>\n<<",@chunks).">>" if $opt{d}; + next; + } + + s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//; + my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('',''); + + s/^# Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; + my ($t, $l, $r) = ($1, $2, $3); + $t -= $l unless $opt{l}; + + # remove fluff that mysqld writes to log when it (re)starts: + s!^/.*Version.*started with:.*\n!!mg; + s!^Tcp port: \d+ Unix socket: \S+\n!!mg; + s!^Time.*Id.*Command.*Argument.*\n!!mg; + + s/^use \w+;\n//; # not consistently added + s/^SET timestamp=\d+;\n//; + + s/^[ ]*\n//mg; # delete blank lines + s/^[ ]*/ /mg; # normalize leading whitespace + s/\s*;\s*(#\s*)?$//; # remove trailing semicolon(+newline-hash) + + next if $opt{g} and !m/$opt{g}/io; + + unless ($opt{a}) { + s/\b\d+\b/N/g; + s/\b0x[0-9A-Fa-f]+\b/N/g; + s/'.*?'/'S'/g; + s/".*?"/"S"/g; + # -n=8: turn log_20001231 into log_NNNNNNNN + s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; + # abbreviate massive "in (...)" statements and similar + s!(([NS],){100,})!sprintf("$2,{repeated %d times}",length($1)/2)!eg; + } + + my $s = $stmt{$_} ||= { users=>{}, hosts=>{} }; + $s->{c} += 1; + $s->{t} += $t; + $s->{l} += $l; + $s->{r} += $r; + $s->{users}->{$user}++ if $user; + $s->{hosts}->{$host}++ if $host; + + warn "{{$_}}\n\n" if $opt{d}; # show processed statement string } foreach (keys %stmt) { - my $v = $stmt{$_} || die; - my ($c, $t, $l, $r) = @{ $v }{qw(c t l r)}; - $v->{at} = $t / $c; - $v->{al} = $l / $c; - $v->{ar} = $r / $c; + my $v = $stmt{$_} || die; + my ($c, $t, $l, $r) = @{ $v }{qw(c t l r)}; + $v->{at} = $t / $c; + $v->{al} = $l / $c; + $v->{ar} = $r / $c; } -my @sorted = sort { $stmt{$a}->{$opt{s}} <=> $stmt{$b}->{$opt{s}} } keys %stmt; +my @sorted = sort { $stmt{$b}->{$opt{s}} <=> $stmt{$a}->{$opt{s}} } keys %stmt; +@sorted = @sorted[0 .. $opt{t}-1] if $opt{t}; +@sorted = reverse @sorted if $opt{r}; foreach (@sorted) { - my $v = $stmt{$_} || die; - my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)}; - printf "Count: %d Time: %.2f (%d) Lock_time: %.2f (%d) Rows_sent: %.1f (%d) \n%s\n\n", - $c, $at,$t, $al,$l, $ar,$r, $_; + my $v = $stmt{$_} || die; + my ($c, $t,$at, $l,$al, $r,$ar) = @{ $v }{qw(c t at l al r ar)}; + my @users = keys %{$v->{users}}; + my $user = (@users==1) ? $users[0] : sprintf "%dusers",scalar @users; + my @hosts = keys %{$v->{hosts}}; + my $host = (@hosts==1) ? $hosts[0] : sprintf "%dhosts",scalar @hosts; + printf "Count: %d Time=%.2fs (%ds) Lock=%.2fs (%ds) Rows=%.1f (%d), $user\@$host\n%s\n\n", + $c, $at,$t, $al,$l, $ar,$r, $_; } -- cgit v1.2.1 From 267c8760cb33208e2c1d772340c2aaf234806c45 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Fri, 9 Mar 2001 03:38:18 +0200 Subject: Fixed wrong option in mysql_install_db Added delayed_user for delayed_threads Don't use record cache when doing deletes --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 98e31cfe1ef..25a429f764a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -282,7 +282,7 @@ fi echo "Installing all prepared tables" if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innobase --skip-gemeni --skip-bdb $args" << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innobase --skip-gemini --skip-bdb $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From 6f9a73a1bae03ccf3e26371b453e31feb72fd2da Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Wed, 21 Mar 2001 01:02:22 +0200 Subject: Added isolation levels Added SELECT .. FOR UPDATE and SELECT .. IN SHARE MODE --- scripts/mysqlhotcopy.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index bf857c67cea..346ceb55d73 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -36,7 +36,7 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.10"; +my $VERSION = "1.11"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -65,6 +65,8 @@ Usage: $0 db_name [new_db_name | directory] --suffix=# suffix for names of copied databases --checkpoint=# insert checkpoint entry into specified db.table --flushlog flush logs once all tables are locked + --resetmaster reset the binlog once all tables are locked + --resetslave reset the master.info once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) Try 'perldoc $0 for more complete documentation' @@ -100,6 +102,8 @@ GetOptions( \%opt, "suffix=s", "checkpoint=s", "flushlog", + "resetmaster", + "resetslave", "tmpdir|t=s", "dryrun|n", ) or usage("Invalid option"); @@ -369,6 +373,8 @@ if ( $opt{dryrun} ) { print "LOCK TABLES $hc_locks\n"; print "FLUSH TABLES /*!32323 $hc_tables */\n"; print "FLUSH LOGS\n" if ( $opt{flushlog} ); + print "RESET MASTER\n" if ( $opt{resetmaster} ); + print "RESET SLAVE\n" if ( $opt{resetslave} ); } else { my $start = time; @@ -381,6 +387,8 @@ else { $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); + $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); + $dbh->do( "RESET SLAVE" ) if ( $opt{resetslave} ); } my @failed = (); @@ -658,6 +666,18 @@ of keeping the backup directory after the copy successfully completes. Rotate the log files by executing "FLUSH LOGS" after all tables are locked, and before they are copied. +=item --resetmaster + +Reset the bin-log by executing "RESET MASTER" after all tables are +locked, and before they are copied. Usefull if you are recovering a +slave in a replication setup. + +=item --resetslave + +Reset the master.info by executing "RESET SLAVE" after all tables are +locked, and before they are copied. Usefull if you are recovering a +server in a mutual replication setup. + =item --regexp pattern Copy all databases with names matching the pattern @@ -742,6 +762,7 @@ Study the code inside this script and only rely on it if I believe that it does the right thing for you. Patches adding bug fixes, documentation and new features are welcome. +Please send these to internals@mysql.com. =head1 TO DO @@ -780,3 +801,6 @@ Monty - working --noindex (copy only first 2048 bytes of index file) Fixes for --method=scp Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. + +Emil S. Hansen - Added resetslave and resetmaster. + -- cgit v1.2.1 From 3c48448042457edca9c7559d9a6bed24485ddc86 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Wed, 21 Mar 2001 20:13:46 +0200 Subject: Split setup_fields to setup_tables and setup_fields Fixed problem with UPDATE TABLE when keys wheren't always used. --- scripts/mysql_install_db.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 25a429f764a..3dbf7c50ad3 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -79,9 +79,12 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ -else +elif test -d "$basedir/libexec" bindir="$basedir/bin" execdir="$basedir/libexec" +else + bindir="$basedir/bin" + execdir="$basedir/bin" fi mdata=$ldata/mysql -- cgit v1.2.1 From dab74107abc54ba9687b41f4ff2b3e3b45a07c10 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Mon, 26 Mar 2001 16:49:11 +0300 Subject: Fix a crash in Innobase with tables with many columns and a range query Removed all Attic directories. --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 3dbf7c50ad3..22516345512 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -80,6 +80,7 @@ then bindir=@bindir@ execdir=@libexecdir@ elif test -d "$basedir/libexec" +then bindir="$basedir/bin" execdir="$basedir/libexec" else -- cgit v1.2.1 From 7f21a7a6daff97675749db987b12a080bb4c3799 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Mon, 9 Apr 2001 21:08:56 +0300 Subject: Fixed INSERT DELAYED with Innobase Fix for shutdown on NT Fixed bug when using wrong dates from blob field. --- scripts/mysql_convert_table_format.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index 69eede94786..6b9a75228d3 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -8,10 +8,12 @@ use Getopt::Long; $opt_help=$opt_version=$opt_verbose=$opt_force=0; $opt_user=$opt_database=$opt_password=undef; $opt_host="localhost"; +$opt_socket=""; $opt_type="MYISAM"; +$opt_port=0; $exit_status=0; -GetOptions("force","help","host=s","password=s","user=s","type=s","verbose","version") || +GetOptions("force","help","host=s","password=s","user=s","type=s","verbose","version","socket=s", "port=i") || usage(0); usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version); $opt_database=shift(@ARGV); @@ -22,7 +24,17 @@ if (uc($opt_type) eq "HEAP") exit(1); } -$dbh = DBI->connect("DBI:mysql:$opt_database:$opt_host", +$connect_opt=""; +if ($opt_port) +{ + $connect_opt.= ";port=$opt_port"; +} +if (length($opt_socket)) +{ + $connect_opt.=";mysql_socket=$opt_socket"; +} + +$dbh = DBI->connect("DBI:mysql:$opt_database:${opt_host}$connect_opt", $opt_user, $opt_password, { PrintError => 0}) @@ -96,6 +108,12 @@ Conversion of a MySQL tables to other table types. --password='password' Password for the current user. +--port=port + TCP/IP port to connect to if host is not "localhost". + +--socket='/path/to/socket' + Socket to connect with. + --type='table-type' Converts tables to the given table type (Default: $opt_type) MySQL 3.23 supports at least the BDB, ISAM and MYISAM types. -- cgit v1.2.1 From 8700c02daee78ef2550436e03f566f2fede1e781 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Fri, 13 Apr 2001 12:25:12 +0300 Subject: Changed Innobase to Innodb Deleted a lot of old benchmark runs --- scripts/mysql_install_db.sh | 2 +- scripts/mysqlhotcopy.sh | 37 +++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 22516345512..aec9286fd9e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -286,7 +286,7 @@ fi echo "Installing all prepared tables" if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innobase --skip-gemini --skip-bdb $args" << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innodb --skip-gemini --skip-bdb $args" << END_OF_DATA use mysql; $c_d $i_d diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 346ceb55d73..da8c6fced53 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -9,7 +9,7 @@ use DBI; =head1 NAME -mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases +mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases and tables =head1 SYNOPSIS @@ -36,7 +36,7 @@ WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.11"; +my $VERSION = "1.12"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -44,7 +44,7 @@ my $OPTIONS = <<"_OPTIONS"; $0 Ver $VERSION -Usage: $0 db_name [new_db_name | directory] +Usage: $0 db_name[./table_regex/] [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user @@ -52,9 +52,9 @@ Usage: $0 db_name [new_db_name | directory] -P, --port=# port to use when connecting to local server -S, --socket=# socket to use when connecting to local server - --allowold don't abort if target already exists (rename it _old) - --keepold don't delete previous (now renamed) target when done - --noindices don't include full index files in copy + --allowold don\'t abort if target already exists (rename it _old) + --keepold don\'t delete previous (now renamed) target when done + --noindices don\'t include full index files in copy --method=# method for copy (only "cp" currently supported) -q, --quiet be silent except for errors @@ -69,7 +69,7 @@ Usage: $0 db_name [new_db_name | directory] --resetslave reset the master.info once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) - Try 'perldoc $0 for more complete documentation' + Try \'perldoc $0 for more complete documentation\' _OPTIONS sub usage { @@ -186,19 +186,21 @@ $datadir =~ s:/$::; # --- get target path --- my ($tgt_dirname, $to_other_database); $to_other_database=0; -if ($tgt_name =~ m:^\w+$: && @db_desc <= 1) +if (defined($tgt_name) && $tgt_name =~ m:^\w+$: && @db_desc <= 1) { $tgt_dirname = "$datadir/$tgt_name"; $to_other_database=1; } -elsif ($tgt_name =~ m:/: || $tgt_name eq '.') { +elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) { $tgt_dirname = $tgt_name; } elsif ( $opt{suffix} ) { - print "copy suffix $opt{suffix}\n" unless $opt{quiet}; + print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; } -else { - die "Target '$tgt_name' doesn't look like a database name or directory path.\n"; +else +{ + $tgt_name="" if (!defined($tgt_name)); + die "Target '$tgt_name' doesn't look like a database name or directory path.\n"; } # --- resolve database names from regexp --- @@ -277,7 +279,7 @@ foreach my $rdb ( @db_desc ) { my @targets = (); -if (length $tgt_name ) { +if (defined($tgt_name) && length $tgt_name ) { # explicit destination directory specified # GNU `cp -r` error message @@ -329,8 +331,11 @@ if ($opt{method} =~ /^cp\b/) push @existing, $rdb->{target} if ( -d $rdb->{target} ); } - die "Can't hotcopy to '", join( "','", @existing ), "' because already exist and --allowold option not given.\n" - if ( @existing && !$opt{allowold} ); + if ( @existing && !$opt{allowold} ) + { + $dbh->disconnect(); + die "Can't hotcopy to '", join( "','", @existing ), "' because directory\nalready exist and the --allowold option was not given.\n" + } } retire_directory( @existing ) if ( @existing ); @@ -778,7 +783,7 @@ not copied by the previous subsets. newdb is either another not existing database or a full path to a directory where we can create a directory 'db' -Add option to lock each table in turn for people who don't need +Add option to lock each table in turn for people who don\'t need cross-table integrity. Add option to FLUSH STATUS just before UNLOCK TABLES. -- cgit v1.2.1 From b897f84d74ef1d6a057837f8ba850826a2f5d3c2 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Fri, 13 Apr 2001 16:21:38 +0300 Subject: Changes to get mysqld-max to compile --- scripts/safe_mysqld.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 6d215ec3d16..cc06d20668f 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -52,6 +52,7 @@ parse_arguments() { --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; + --mysqld-version=*) MYSQLD=mysqld-`echo "$arg" | sed -e "s;--mysqld-version=;;"` ;; *) if test -n "$pick_args" then @@ -92,7 +93,14 @@ fi MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} user=@MYSQLD_USER@ -MYSQLD=mysqld + +# Use the mysqld-max binary by default if the user doesn't specify a binary +if test -x $ledir/mysqld-max +then + MYSQLD=mysqld-max +else + MYSQLD=mysqld +fi # these rely on $DATADIR by default, so we'll set them later on pid_file= -- cgit v1.2.1 From bc7731c0c767611f21225d3855ee4b447beebeb7 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Fri, 13 Apr 2001 22:09:33 +0300 Subject: Changed -O6 to -O3 Portability fix for Innodb --- scripts/safe_mysqld.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index cc06d20668f..6c006e96768 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -52,7 +52,15 @@ parse_arguments() { --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; - --mysqld-version=*) MYSQLD=mysqld-`echo "$arg" | sed -e "s;--mysqld-version=;;"` ;; + --mysqld-version=*) + tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` + if test -n "$tmp" + then + MYSQLD="mysqld-$tmp" + else + MYSQLD="mysqld" + fi + ;; *) if test -n "$pick_args" then @@ -73,7 +81,7 @@ then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is DATADIR=$MY_BASEDIR_VERSION/data - if test -z "defaults" + if test -z "$defaults" then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi -- cgit v1.2.1 From 4edafca6a3fc8bcbe8d84d2365124b02fa343378 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Tue, 17 Apr 2001 14:02:28 +0300 Subject: Fixed that -ldl is not used for clients Fixed rpl000001 to handle the most common mysql-test-run ports. --- scripts/mysql_install_db.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index aec9286fd9e..ee126a87b56 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -79,14 +79,17 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ -elif test -d "$basedir/libexec" -then +else bindir="$basedir/bin" +if test -x "$basedir/libexec/mysqld" +then execdir="$basedir/libexec" +elif test -x "@libexecdir@/mysqld" + execdir="@libexecdir@" else - bindir="$basedir/bin" execdir="$basedir/bin" fi +fi mdata=$ldata/mysql -- cgit v1.2.1 From a6ee05e8d639e4cf54fccc26d1842d9afa7cb992 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Tue, 17 Apr 2001 18:15:30 +0300 Subject: Fixed typo in mysql_install_db --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index ee126a87b56..f7324668bd2 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -85,6 +85,7 @@ if test -x "$basedir/libexec/mysqld" then execdir="$basedir/libexec" elif test -x "@libexecdir@/mysqld" +then execdir="@libexecdir@" else execdir="$basedir/bin" -- cgit v1.2.1 From ad7fa1c94050a7ec38c7f18589426b92080004ed Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Wed, 18 Apr 2001 02:53:21 +0300 Subject: Don't force conf_to_src to be static an all systems Removed unpredictable test from rpl000001.test --- scripts/mysql_zap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index b94bbb80ca7..312d15e34d6 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -36,7 +36,7 @@ while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) { { $opt_a = 1; } - elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I") + elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I" || $ARGV[0] eq "--help") { &usage; } @@ -107,7 +107,7 @@ EOF sub usage { print < Date: Wed, 18 Apr 2001 18:01:56 -0600 Subject: distribution did not include *.sh files in mysql-test/t --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 030d8b5c0d6..7dc5c90ea25 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -105,7 +105,7 @@ $CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ $CP mysql-test/README $BASE/mysql-test/README $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t +$CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r $CP scripts/* $BASE/bin -- cgit v1.2.1 From 714560cbe9f5735016f503403577ccee63e40f12 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Sun, 22 Apr 2001 12:11:01 +0300 Subject: Fix for release --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7dc5c90ea25..1216b231d6b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -104,7 +104,7 @@ rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ $CP mysql-test/README $BASE/mysql-test/README $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r -- cgit v1.2.1 From 21e7c668ff8bea797ede22c3ce03f6f186685c35 Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Wed, 25 Apr 2001 22:44:27 +0300 Subject: Portability fixes for Ia64 and Sgi compiler DROP DATABASE in mysqladmin asks for confirmation (again) Added examined_rows to slow query log SHOW CREATE for TEMPORARY table --- scripts/make_binary_distribution.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1216b231d6b..84dac59018b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -62,9 +62,10 @@ do done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ - extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk \ + extra/my_print_defaults extra/resolve_stack_dump \ + isam/isamchk isam/pack_isam myisam/myisamchk \ myisam/myisampack sql/mysqld sql/mysqlbinlog \ - client/mysql sql/mysqld client/mysqlshow \ + client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest -- cgit v1.2.1 From f6a36e948deedb701c8cc7352341e51c404db76d Mon Sep 17 00:00:00 2001 From: "monty@donna.mysql.fi" <> Date: Sat, 5 May 2001 09:41:47 +0300 Subject: Added LOAD DATA CONCURRENT --- scripts/mysqlhotcopy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index da8c6fced53..1c26bf8e2d6 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -30,7 +30,7 @@ mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases and tab mysqlhotcopy --method='scp -Bq -i /usr/home/foo/.ssh/identity' --user=root --password=secretpassword \ db_1./^nice_table/ user@some.system.dom:~/path/to/new_directory -WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome. +WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. =cut -- cgit v1.2.1 From 38c035c09852dd4895177aafe6d73ac8c16919d6 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Mon, 28 May 2001 02:45:19 +0300 Subject: Fixed portability bug in my_config.sh Added print of --use-symbolic-links in mysqld --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 09f81c70a1f..ed344f4b1e3 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -45,7 +45,7 @@ EOF exit 1 } -if ! test $# -gt 0; then usage; fi +if test $# -le 0; then usage; fi while test $# -gt 0; do case $1 in -- cgit v1.2.1 From 2b5d60504b6fecd5c91272899f30b4bbb4bf1244 Mon Sep 17 00:00:00 2001 From: "jani@janikt.pp.saunalahti.fi" <> Date: Tue, 29 May 2001 20:03:58 +0300 Subject: Fixed a few typos. --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 6c006e96768..6eda1740ad6 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -114,7 +114,7 @@ fi pid_file= err_log= -# Get first arguments from the my.cfg file, groups [mysqld] and [safe_mysqld] +# Get first arguments from the my.cnf file, groups [mysqld] and [safe_mysqld] # and then merge with the command line arguments if test -x ./bin/my_print_defaults then -- cgit v1.2.1 From ad71ff7659fdfc4f88cf0af770bcf7ded22b8641 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 12 Jun 2001 11:59:14 +0300 Subject: Added --verbose option to mysqlshow Fixes for making distribution --- scripts/make_binary_distribution.sh | 55 +++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 84dac59018b..40c48188346 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -11,30 +11,29 @@ export machine system version SOURCE=`pwd` CP="cp -p" -# Debug option must come first +STRIP=1 DEBUG=0 -if test x$1 = x"--debug" -then - DEBUG=1 - shift 1 -fi - -# Save temporary distribution here (must be full path) +SILENT=0 TMP=/tmp -if test $# -gt 0 -then - TMP=$1 - shift 1 -fi - -# Get optional suffix for distribution SUFFIX="" -if test $# -gt 0 -then - SUFFIX=$1 - shift 1 -fi +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=;;"` ;; + --no-strip) STRIP=0 ;; + --silent) SILENT=1 ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" #make @@ -68,14 +67,18 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest + client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ + client/.libs/mysqlcheck do if [ -f $i ] then $CP $i $BASE/bin fi done -strip $BASE/bin/* + +if [ x$STRIP = x1 ] ; then + strip $BASE/bin/* +fi for i in sql/mysqld.sym.gz do @@ -190,7 +193,13 @@ fi echo "Using $tar to create archive" cd $TMP -$tar cvf $SOURCE/$NEW_NAME.tar $NEW_NAME + +OPT=cvf +if [ x$SILENT = x1 ] ; then + OPT=cf +fi + +$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME cd $SOURCE echo "Compressing archive" gzip -9 $NEW_NAME.tar -- cgit v1.2.1 From 897b37b506ab72078c1ffd013a3e4600eb0eba02 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 28 Jun 2001 10:49:16 +0300 Subject: Changed safe_mysqld -> mysqld_safe Added some alias to SHOW commands Prepare for dynamic changing of MySQL variables --- scripts/Makefile.am | 2 +- scripts/make_binary_distribution.sh | 2 +- scripts/mysql_install_db.sh | 2 +- scripts/mysqld_multi.sh | 16 +-- scripts/mysqld_safe-watch.sh | 150 +++++++++++++++++++ scripts/mysqld_safe.sh | 277 ++++++++++++++++++++++++++++++++++++ scripts/safe_mysqld-watch.sh | 150 ------------------- scripts/safe_mysqld.sh | 277 ------------------------------------ 8 files changed, 438 insertions(+), 438 deletions(-) create mode 100644 scripts/mysqld_safe-watch.sh create mode 100644 scripts/mysqld_safe.sh delete mode 100644 scripts/safe_mysqld-watch.sh delete mode 100644 scripts/safe_mysqld.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 45fbe275476..d2cca98ce63 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -44,7 +44,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ mysqld_multi.sh \ - safe_mysqld.sh + mysqld_safe.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 40c48188346..1848123fd8e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -117,7 +117,7 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server -$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld +$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f7324668bd2..7e232692ba1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -333,7 +333,7 @@ then if test "$IN_RPM" -eq 0 then echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/safe_mysqld &" + echo "cd @prefix@ ; $bindir/mysqld_safe &" echo echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" echo "cd sql-bench ; run-all-tests" diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 1adaa458271..656894f0e37 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -457,12 +457,12 @@ sub example # directory, that you have (just change the socket, -S=...) # See more detailed information from chapter: # '6 The MySQL Access Privilege System' from the MySQL manual. -# 2.pid-file is very important, if you are using safe_mysqld to start mysqld -# (e.g. --mysqld=safe_mysqld) Every mysqld should have it's own pid-file. -# The advantage using safe_mysqld instead of mysqld directly here is, that -# safe_mysqld 'guards' every mysqld process and will restart it, if mysqld +# 2.pid-file is very important, if you are using mysqld_safe to start mysqld +# (e.g. --mysqld=mysqld_safe) Every mysqld should have it's own pid-file. +# The advantage using mysqld_safe instead of mysqld directly here is, that +# mysqld_safe 'guards' every mysqld process and will restart it, if mysqld # process fails due to signal kill -9, or similar. (Like segmentation fault, -# which MySQL should never do, of course ;) Please note that safe_mysqld +# which MySQL should never do, of course ;) Please note that mysqld_safe # script may require that you start it from a certain place. This means that # you may have to CD to a certain directory, before you start the # mysqld_multi. If you have problems starting, please see the script. @@ -497,7 +497,7 @@ sub example # give you extra performance in a threaded system! # [mysqld_multi] -mysqld = @bindir@/safe_mysqld +mysqld = @bindir@/mysqld_safe mysqladmin = @bindir@/mysqladmin user = multi_admin password = multipass @@ -591,9 +591,9 @@ Options: Using: $opt_log --mysqladmin=... mysqladmin binary to be used for a server shutdown. Using: $mysqladmin ---mysqld=... mysqld binary to be used. Note that you can give safe_mysqld +--mysqld=... mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just - make sure you have mysqld in your PATH or fix safe_mysqld. + make sure you have mysqld in your PATH or fix mysqld_safe. Using: $mysqld --no-log Print to stdout instead of the log file. By default the log file is turned on. diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh new file mode 100644 index 00000000000..c59b3b2614d --- /dev/null +++ b/scripts/mysqld_safe-watch.sh @@ -0,0 +1,150 @@ +#!/bin/sh +# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB +# This file is public domain and comes with NO WARRANTY of any kind +# +# scripts to start the MySQL demon and restart it if it dies unexpectedly +# +# This should be executed in the MySQL base directory if you are using a +# binary installation that has other paths than you are using. +# +# mysql.server works by first doing a cd to the base directory and from there +# executing mysqld_safe + +# Check if we are starting this relative (for the binary release) +if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./bin/mysqld +then + MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is + DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are +# Check if this is a 'moved install directory' +elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./libexec/mysqld +then + MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is + DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are +else + MY_BASEDIR_VERSION=/usr/local/mysql + DATADIR=/usr/local/mysql/var + ledir=/usr/local/mysql/libexec +fi + +hostname=`@HOSTNAME@` +pidfile=$DATADIR/$hostname.pid +log=$DATADIR/$hostname.log +err=$DATADIR/$hostname.err +lockfile=$DATADIR/$hostname.lock + +# +# If there exists an old pid file, check if the demon is already running +# Note: The switches to 'ps' may depend on your operating system + +if test -f $pidfile +then + PID=`cat $pidfile` + if /bin/kill -0 $PID + then + if /bin/ps -p $PID | grep mysqld > /dev/null + then # The pid contains a mysqld process + echo "A mysqld process already exists" + echo "A mysqld process already exists at " `date` >> $log + exit 1; + fi + fi + rm -f $pidfile + if test -f $pidfile + then + echo "Fatal error: Can't remove the pid file: $pidfile" + echo "Fatal error: Can't remove the pid file: $pidfile at " `date` >> $log + echo "Please remove it manually and start $0 again" + echo "mysqld demon not started" + exit 1; + fi +fi + +echo "Starting mysqld demon with databases from $DATADIR" + +#Default communication ports +#MYSQL_TCP_PORT=3306 +if test -z "$MYSQL_UNIX_PORT" +then + MYSQL_UNIX_PORT="/tmp/mysql.sock" + export MYSQL_UNIX_PORT +fi +#export MYSQL_TCP_PORT + +# Does this work on all systems? +#if type ulimit | grep "shell builtin" > /dev/null +#then +# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems +#fi + +echo "mysqld started on " `date` >> $log +bin/zap -f $lockfile < /dev/null > /dev/null 2>&1 +rm -f $lockfile +$MY_BASEDIR_VERSION/bin/watchdog_mysqld $lockfile $pidfile $MY_BASEDIR_VERSION/bin $DATADIR 3 10 >> $err 2>&1 & +restart_pid=$! + +while true +do + rm -f $MYSQL_UNIX_PORT $pidfile # Some extra safety + lockfile -1 -r10 $lockfile >/dev/null 2>&1 + if test "$#" -eq 0 + then + nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ + --skip-locking >> $err 2>&1 & + else + nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ + --skip-locking "$@" >> $err 2>&1 & + fi + pid=$! + rm -f $lockfile + wait $pid; + + lockfile -1 -r10 $lockfile >/dev/null 2>&1 + rm -f $lockfile + if test ! -f $pidfile # This is removed if normal shutdown + then + break; + fi + if true + then + # Test if one proces was hanging. + # This is only a fix for Linux (running as base 3 mysqld processes) + # but should work for the rest of the servers. + # The only thing is ps x => redhat 5 gives warnings when using ps -x. + # kill -9 is used or the proces won't react on the kill. + numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld` + echo -e "\nNumber of processes running now: $numofproces" | tee -a $log + I=1 + while test "$I" -le "$numofproces" + do + PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1` + for T in $PROC + do + break + done + # echo "TEST $I - $T **" + if kill -9 $T + then + echo "mysqld proces hanging, pid $T - killed" | tee -a $log + else + break + fi + I=`expr $I + 1` + done + fi + echo "mysqld restarted" | tee -a $log + # Check all tables and repair any wrong tables. + $MY_BASEDIR_VERSION/bin/isamchk -sf $DATADIR/*/*.ISM >> $err 2>&1 +done +if test $restart_pid -gt 0 +then + kill $restart_pid > /dev/null 2>&1 + sleep 1; + kill -9 $restart_pid > /dev/null 2>&1 +fi + +echo -n "mysqld ended on " `date` >> $log +echo "mysqld demon ended" diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh new file mode 100644 index 00000000000..ac33c9ad1f2 --- /dev/null +++ b/scripts/mysqld_safe.sh @@ -0,0 +1,277 @@ +#!/bin/sh +# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB +# This file is public domain and comes with NO WARRANTY of any kind +# +# scripts to start the MySQL daemon and restart it if it dies unexpectedly +# +# This should be executed in the MySQL base directory if you are using a +# binary installation that has other paths than you are using. +# +# mysql.server works by first doing a cd to the base directory and from there +# executing mysqld_safe + +trap '' 1 2 3 15 # we shouldn't let anyone kill us + +defaults= +case "$1" in + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; +esac + +parse_arguments() { + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg do + case "$arg" in + # these get passed explicitly to mysqld + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; + --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; + --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + + # these two might have been set in a [mysqld_safe] section of my.cnf + # they get passed via environment variables to mysqld_safe + --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; + + # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! + --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; + --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + # QQ The --open-files should be removed + --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; + --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; + --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; + --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; + --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; + --mysqld-version=*) + tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` + if test -n "$tmp" + then + MYSQLD="mysqld-$tmp" + else + MYSQLD="mysqld" + fi + ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + fi + ;; + esac + 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 \ + -x ./bin/mysqld +then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + DATADIR=$MY_BASEDIR_VERSION/data + if test -z "$defaults" + then + defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" + fi +# Check if this is a 'moved install directory' +elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ + -x ./libexec/mysqld +then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is + DATADIR=$MY_BASEDIR_VERSION/var +else + MY_BASEDIR_VERSION=@prefix@ + DATADIR=@localstatedir@ + ledir=@libexecdir@ +fi + +MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} +MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} +user=@MYSQLD_USER@ + +# Use the mysqld-max binary by default if the user doesn't specify a binary +if test -x $ledir/mysqld-max +then + MYSQLD=mysqld-max +else + MYSQLD=mysqld +fi + +# these rely on $DATADIR by default, so we'll set them later on +pid_file= +err_log= + +# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] +# and then merge with the command line arguments +if test -x ./bin/my_print_defaults +then + print_defaults="./bin/my_print_defaults" +elif test -x @bindir@/my_print_defaults +then + print_defaults="@bindir@/my_print_defaults" +elif test -x @bindir@/mysql_print_defaults +then + print_defaults="@bindir@/mysql_print_defaults" +else + print_defaults="my_print_defaults" +fi + +args= +parse_arguments `$print_defaults $defaults mysqld server mysqld_safe safe_mysqld` +parse_arguments PICK-ARGS-FROM-ARGV "$@" + +if test ! -x $ledir/$MYSQLD +then + echo "The file $ledir/$MYSQLD doesn't exist or is not executable" + echo "Please do a cd to the mysql installation directory and restart" + echo "this script from there as follows:" + echo "./bin/mysqld_safe". + exit 1 +fi + +if test -z "$pid_file" +then + pid_file=$DATADIR/`@HOSTNAME@`.pid +else + case "$pid_file" in + /* ) ;; + * ) pid_file="$DATADIR/$pid_file" ;; + esac +fi +test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err + +export MYSQL_UNIX_PORT +export MYSQL_TCP_PORT + + +NOHUP_NICENESS="nohup" +if test -w / +then + NOHUP_NICENESS=`nohup nice 2>&1` + if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 + then + NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + else + NOHUP_NICENESS="nohup" + fi +fi + +USER_OPTION="" +if test -w / +then + USER_OPTION="--user=$user" + # If we are root, change the err log to the right user. + touch $err_log; chown $user $err_log + if test -n "$open_files" + then + ulimit -n $open_files + fi + if test -n "$core_file_size" + then + ulimit -c $core_file_size + fi +fi + +# +# If there exists an old pid file, check if the daemon is already running +# Note: The switches to 'ps' may depend on your operating system +if test -f $pid_file +then + PID=`cat $pid_file` + if @CHECK_PID@ + then + if @FIND_PROC@ + then # The pid contains a mysqld process + echo "A mysqld process already exists" + echo "A mysqld process already exists at " `date` >> $err_log + exit 1 + fi + fi + rm -f $pid_file + if test -f $pid_file + then + echo "Fatal error: Can't remove the pid file: $pid_file" + echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log + echo "Please remove it manually and start $0 again" + echo "mysqld daemon not started" + exit 1 + fi +fi + +# +# Uncomment the following lines if you want all tables to be automaticly +# checked and repaired at start +# +# 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 + +echo "Starting $MYSQLD daemon with databases from $DATADIR" + +# Does this work on all systems? +#if type ulimit | grep "shell builtin" > /dev/null +#then +# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems +#fi + +echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log +while true +do + rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety + if test -z "$args" + then + $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 + else + eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" + fi + if test ! -f $pid_file # This is removed if normal shutdown + then + break + fi + + if @IS_LINUX@ + then + # Test if one process was hanging. + # This is only a fix for Linux (running as base 3 mysqld processes) + # but should work for the rest of the servers. + # The only thing is ps x => redhat 5 gives warnings when using ps -x. + # kill -9 is used or the process won't react on the kill. + numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` + echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log + I=1 + while test "$I" -le "$numofproces" + do + PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` + for T in $PROC + do + break + done + # echo "TEST $I - $T **" + if kill -9 $T + then + echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log + else + break + fi + I=`expr $I + 1` + done + fi + + echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log +done + +echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log +echo "" | tee -a $err_log diff --git a/scripts/safe_mysqld-watch.sh b/scripts/safe_mysqld-watch.sh deleted file mode 100644 index 30f95fd7a86..00000000000 --- a/scripts/safe_mysqld-watch.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB -# This file is public domain and comes with NO WARRANTY of any kind -# -# scripts to start the MySQL demon and restart it if it dies unexpectedly -# -# This should be executed in the MySQL base directory if you are using a -# binary installation that has other paths than you are using. -# -# mysql.server works by first doing a cd to the base directory and from there -# executing safe_mysqld - -# Check if we are starting this relative (for the binary release) -if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./bin/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is - DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are - ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are -# Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is - DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are -else - MY_BASEDIR_VERSION=/usr/local/mysql - DATADIR=/usr/local/mysql/var - ledir=/usr/local/mysql/libexec -fi - -hostname=`@HOSTNAME@` -pidfile=$DATADIR/$hostname.pid -log=$DATADIR/$hostname.log -err=$DATADIR/$hostname.err -lockfile=$DATADIR/$hostname.lock - -# -# If there exists an old pid file, check if the demon is already running -# Note: The switches to 'ps' may depend on your operating system - -if test -f $pidfile -then - PID=`cat $pidfile` - if /bin/kill -0 $PID - then - if /bin/ps -p $PID | grep mysqld > /dev/null - then # The pid contains a mysqld process - echo "A mysqld process already exists" - echo "A mysqld process already exists at " `date` >> $log - exit 1; - fi - fi - rm -f $pidfile - if test -f $pidfile - then - echo "Fatal error: Can't remove the pid file: $pidfile" - echo "Fatal error: Can't remove the pid file: $pidfile at " `date` >> $log - echo "Please remove it manually and start $0 again" - echo "mysqld demon not started" - exit 1; - fi -fi - -echo "Starting mysqld demon with databases from $DATADIR" - -#Default communication ports -#MYSQL_TCP_PORT=3306 -if test -z "$MYSQL_UNIX_PORT" -then - MYSQL_UNIX_PORT="/tmp/mysql.sock" - export MYSQL_UNIX_PORT -fi -#export MYSQL_TCP_PORT - -# Does this work on all systems? -#if type ulimit | grep "shell builtin" > /dev/null -#then -# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems -#fi - -echo "mysqld started on " `date` >> $log -bin/zap -f $lockfile < /dev/null > /dev/null 2>&1 -rm -f $lockfile -$MY_BASEDIR_VERSION/bin/watchdog_mysqld $lockfile $pidfile $MY_BASEDIR_VERSION/bin $DATADIR 3 10 >> $err 2>&1 & -restart_pid=$! - -while true -do - rm -f $MYSQL_UNIX_PORT $pidfile # Some extra safety - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - if test "$#" -eq 0 - then - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking >> $err 2>&1 & - else - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking "$@" >> $err 2>&1 & - fi - pid=$! - rm -f $lockfile - wait $pid; - - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - rm -f $lockfile - if test ! -f $pidfile # This is removed if normal shutdown - then - break; - fi - if true - then - # Test if one proces was hanging. - # This is only a fix for Linux (running as base 3 mysqld processes) - # but should work for the rest of the servers. - # The only thing is ps x => redhat 5 gives warnings when using ps -x. - # kill -9 is used or the proces won't react on the kill. - numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld` - echo -e "\nNumber of processes running now: $numofproces" | tee -a $log - I=1 - while test "$I" -le "$numofproces" - do - PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1` - for T in $PROC - do - break - done - # echo "TEST $I - $T **" - if kill -9 $T - then - echo "mysqld proces hanging, pid $T - killed" | tee -a $log - else - break - fi - I=`expr $I + 1` - done - fi - echo "mysqld restarted" | tee -a $log - # Check all tables and repair any wrong tables. - $MY_BASEDIR_VERSION/bin/isamchk -sf $DATADIR/*/*.ISM >> $err 2>&1 -done -if test $restart_pid -gt 0 -then - kill $restart_pid > /dev/null 2>&1 - sleep 1; - kill -9 $restart_pid > /dev/null 2>&1 -fi - -echo -n "mysqld ended on " `date` >> $log -echo "mysqld demon ended" diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh deleted file mode 100644 index 6eda1740ad6..00000000000 --- a/scripts/safe_mysqld.sh +++ /dev/null @@ -1,277 +0,0 @@ -#!/bin/sh -# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB -# This file is public domain and comes with NO WARRANTY of any kind -# -# scripts to start the MySQL daemon and restart it if it dies unexpectedly -# -# This should be executed in the MySQL base directory if you are using a -# binary installation that has other paths than you are using. -# -# mysql.server works by first doing a cd to the base directory and from there -# executing safe_mysqld - -trap '' 1 2 3 15 # we shouldn't let anyone kill us - -defaults= -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac - -parse_arguments() { - # We only need to pass arguments through to the server if we don't - # handle them here. So, we collect unrecognized options (passed on - # the command line) into the args variable. - pick_args= - if test "$1" = PICK-ARGS-FROM-ARGV - then - pick_args=1 - shift - fi - - for arg do - case "$arg" in - # these get passed explicitly to mysqld - --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; - --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; - --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; - - # these two might have been set in a [safe_mysqld] section of my.cnf - # they get passed via environment variables to safe_mysqld - --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; - - # safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! - --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; - # QQ The --open-files should be removed - --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; - --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; - --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; - --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; - --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; - --mysqld-version=*) - tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` - if test -n "$tmp" - then - MYSQLD="mysqld-$tmp" - else - MYSQLD="mysqld" - fi - ;; - *) - if test -n "$pick_args" - then - # This sed command makes sure that any special chars are quoted, - # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` - fi - ;; - esac - 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 \ - -x ./bin/mysqld -then - MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are - ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is - DATADIR=$MY_BASEDIR_VERSION/data - if test -z "$defaults" - then - defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" - fi -# Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld -then - MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is - DATADIR=$MY_BASEDIR_VERSION/var -else - MY_BASEDIR_VERSION=@prefix@ - DATADIR=@localstatedir@ - ledir=@libexecdir@ -fi - -MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} -MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} -user=@MYSQLD_USER@ - -# Use the mysqld-max binary by default if the user doesn't specify a binary -if test -x $ledir/mysqld-max -then - MYSQLD=mysqld-max -else - MYSQLD=mysqld -fi - -# these rely on $DATADIR by default, so we'll set them later on -pid_file= -err_log= - -# Get first arguments from the my.cnf file, groups [mysqld] and [safe_mysqld] -# and then merge with the command line arguments -if test -x ./bin/my_print_defaults -then - print_defaults="./bin/my_print_defaults" -elif test -x @bindir@/my_print_defaults -then - print_defaults="@bindir@/my_print_defaults" -elif test -x @bindir@/mysql_print_defaults -then - print_defaults="@bindir@/mysql_print_defaults" -else - print_defaults="my_print_defaults" -fi - -args= -parse_arguments `$print_defaults $defaults mysqld server safe_mysqld` -parse_arguments PICK-ARGS-FROM-ARGV "$@" - -if test ! -x $ledir/$MYSQLD -then - echo "The file $ledir/$MYSQLD doesn't exist or is not executable" - echo "Please do a cd to the mysql installation directory and restart" - echo "this script from there as follows:" - echo "./bin/safe_mysqld". - exit 1 -fi - -if test -z "$pid_file" -then - pid_file=$DATADIR/`@HOSTNAME@`.pid -else - case "$pid_file" in - /* ) ;; - * ) pid_file="$DATADIR/$pid_file" ;; - esac -fi -test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err - -export MYSQL_UNIX_PORT -export MYSQL_TCP_PORT - - -NOHUP_NICENESS="nohup" -if test -w / -then - NOHUP_NICENESS=`nohup nice 2>&1` - if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 - then - NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" - else - NOHUP_NICENESS="nohup" - fi -fi - -USER_OPTION="" -if test -w / -then - USER_OPTION="--user=$user" - # If we are root, change the err log to the right user. - touch $err_log; chown $user $err_log - if test -n "$open_files" - then - ulimit -n $open_files - fi - if test -n "$core_file_size" - then - ulimit -c $core_file_size - fi -fi - -# -# If there exists an old pid file, check if the daemon is already running -# Note: The switches to 'ps' may depend on your operating system -if test -f $pid_file -then - PID=`cat $pid_file` - if @CHECK_PID@ - then - if @FIND_PROC@ - then # The pid contains a mysqld process - echo "A mysqld process already exists" - echo "A mysqld process already exists at " `date` >> $err_log - exit 1 - fi - fi - rm -f $pid_file - if test -f $pid_file - then - echo "Fatal error: Can't remove the pid file: $pid_file" - echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log - echo "Please remove it manually and start $0 again" - echo "mysqld daemon not started" - exit 1 - fi -fi - -# -# Uncomment the following lines if you want all tables to be automaticly -# checked and repaired at start -# -# 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 - -echo "Starting $MYSQLD daemon with databases from $DATADIR" - -# Does this work on all systems? -#if type ulimit | grep "shell builtin" > /dev/null -#then -# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems -#fi - -echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log -while true -do - rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety - if test -z "$args" - then - $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 - else - eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" - fi - if test ! -f $pid_file # This is removed if normal shutdown - then - break - fi - - if @IS_LINUX@ - then - # Test if one process was hanging. - # This is only a fix for Linux (running as base 3 mysqld processes) - # but should work for the rest of the servers. - # The only thing is ps x => redhat 5 gives warnings when using ps -x. - # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` - echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log - I=1 - while test "$I" -le "$numofproces" - do - PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` - for T in $PROC - do - break - done - # echo "TEST $I - $T **" - if kill -9 $T - then - echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log - else - break - fi - I=`expr $I + 1` - done - fi - - echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log -done - -echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log -echo "" | tee -a $err_log -- cgit v1.2.1 From 103d87ce2a8a117c50543a2663e1dfe06714994b Mon Sep 17 00:00:00 2001 From: "tim@white.box" <> Date: Tue, 24 Jul 2001 14:09:33 -0400 Subject: Code cleanup in safe_mysqld. Fix --core-file-size so that the argument is parsed correctly. --- scripts/safe_mysqld.sh | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 6eda1740ad6..59d7dcc5cfc 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -23,37 +23,32 @@ parse_arguments() { # We only need to pass arguments through to the server if we don't # handle them here. So, we collect unrecognized options (passed on # the command line) into the args variable. - pick_args= - if test "$1" = PICK-ARGS-FROM-ARGV - then - pick_args=1 - shift - fi + pick_args=$1; shift for arg do case "$arg" in # these get passed explicitly to mysqld - --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; - --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; - --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; # these two might have been set in a [safe_mysqld] section of my.cnf # they get passed via environment variables to safe_mysqld - --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; + --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; - # safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! - --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; + # safe_mysqld-specific options + --ledir=*) ledir=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --err-log=*) err_log=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; # QQ The --open-files should be removed - --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; - --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; - --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; - --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; - --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; + --open-files=*) open_files=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --timezone=*) TZ=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; export TZ; ;; + --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --mysqld-version=*) - tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` + tmp=`echo "$arg" | sed -e "s;--[^=]*=;;"` if test -n "$tmp" then MYSQLD="mysqld-$tmp" @@ -62,7 +57,7 @@ parse_arguments() { fi ;; *) - if test -n "$pick_args" + if test $pick_args -eq 1 then # This sed command makes sure that any special chars are quoted, # so the arg gets passed exactly to the server. @@ -130,8 +125,8 @@ else fi args= -parse_arguments `$print_defaults $defaults mysqld server safe_mysqld` -parse_arguments PICK-ARGS-FROM-ARGV "$@" +parse_arguments 0 `$print_defaults $defaults mysqld server safe_mysqld` +parse_arguments 1 "$@" if test ! -x $ledir/$MYSQLD then -- cgit v1.2.1 From 768deddcbf3900ad8f4679810dfd6de71553cff2 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Sat, 28 Jul 2001 13:29:20 +0300 Subject: Updated LOCK TABLES manual section Applied patch for mysqlhotcopy Fixed open-files-size option in safe_mysqld --- scripts/mysqlhotcopy.sh | 47 ++++++++++++++++++++++++++++++++++------------- scripts/safe_mysqld.sh | 4 +--- 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 1c26bf8e2d6..71359fa5612 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; eval { $dbh->do( "use $db" ); }; die "Database '$db' not accessible: $@" if ( $@ ); - my @dbh_tables = $dbh->func( '_ListTables' ); + my @dbh_tables = $dbh->tables(); ## generate regex for tables/files - my $t_regex = $rdb->{t_regex}; ## assign temporary regex - my $negated = $t_regex =~ tr/~//d; ## remove and count negation operator: we don't allow ~ in table names - $t_regex = qr/$t_regex/; ## make regex string from user regex - - ## filter (out) tables specified in t_regex - print "Filtering tables with '$t_regex'\n" if $opt{debug}; - @dbh_tables = ( $negated - ? grep { $_ !~ $t_regex } @dbh_tables - : grep { $_ =~ $t_regex } @dbh_tables ); + my $t_regex; + my $negated; + if ($rdb->{t_regex}) { + $t_regex = $rdb->{t_regex}; ## assign temporary regex + $negated = $t_regex =~ tr/~//d; ## remove and count + ## negation operator: we + ## don't allow ~ in table + ## names + + $t_regex = qr/$t_regex/; ## make regex string from + ## user regex + + ## filter (out) tables specified in t_regex + print "Filtering tables with '$t_regex'\n" if $opt{debug}; + @dbh_tables = ( $negated + ? grep { $_ !~ $t_regex } @dbh_tables + : grep { $_ =~ $t_regex } @dbh_tables ); + } ## get list of files to copy my $db_dir = "$datadir/$db"; @@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) { closedir( DBDIR ); ## filter (out) files specified in t_regex - my @db_files = ( $negated - ? grep { $db_files{$_} !~ $t_regex } keys %db_files - : grep { $db_files{$_} =~ $t_regex } keys %db_files ); + my @db_files; + if ($rdb->{t_regex}) { + @db_files = ($negated + ? grep { $db_files{$_} !~ $t_regex } keys %db_files + : grep { $db_files{$_} =~ $t_regex } keys %db_files ); + } + else { + @db_files = keys %db_files; + } + @db_files = sort @db_files; + my @index_files=(); ## remove indices unless we're told to keep them @@ -809,3 +826,7 @@ Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. Emil S. Hansen - Added resetslave and resetmaster. +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). + diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 6eda1740ad6..a9ffddab453 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -46,10 +46,8 @@ parse_arguments() { # safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; - # QQ The --open-files should be removed - --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; - --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; + --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; --mysqld-version=*) -- cgit v1.2.1 From 79131084c8367f85bb9be83d0cf8fd76526ed30f Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Sat, 11 Aug 2001 01:42:34 +0300 Subject: Fixed handling of strings in mysqldumpslow --- scripts/mysqldumpslow.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 02b5d5cd0cd..856c8a09b5e 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -3,6 +3,7 @@ # Original version by Tim Bunce, sometime in 2000. # Further changes by Tim Bunce, 8th March 2001. +# Handling of strings with \ and double '' by Monty 11 Aug 2001. use strict; use Getopt::Long; @@ -95,8 +96,8 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { unless ($opt{a}) { s/\b\d+\b/N/g; s/\b0x[0-9A-Fa-f]+\b/N/g; - s/'.*?'/'S'/g; - s/".*?"/"S"/g; + s/'([^\\\']|\\.|\'\')+'/'S'/g; + s/"([^\\\"]|\\.|\"\")+"/"S"/g; # -n=8: turn log_20001231 into log_NNNNNNNN s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; # abbreviate massive "in (...)" statements and similar -- cgit v1.2.1 From 7f8f1bd9797e64c700112bf658cea3fa87e129ad Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Sun, 2 Sep 2001 20:42:07 +0300 Subject: Fix to not running mysqld as root by default --- scripts/safe_mysqld.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 59d7dcc5cfc..e7418819604 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -31,7 +31,7 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; # these two might have been set in a [safe_mysqld] section of my.cnf # they get passed via environment variables to safe_mysqld @@ -108,6 +108,7 @@ fi # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= +SET_USER=0 # Get first arguments from the my.cnf file, groups [mysqld] and [safe_mysqld] # and then merge with the command line arguments @@ -167,7 +168,10 @@ fi USER_OPTION="" if test -w / then - USER_OPTION="--user=$user" + if test "$user" != "root" -o $SET_USER = 1 + then + USER_OPTION="--user=$user" + fi # If we are root, change the err log to the right user. touch $err_log; chown $user $err_log if test -n "$open_files" -- cgit v1.2.1 From 56cc14ab4c7cd43bbf4e39539f4c21a3d9e46808 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Mon, 17 Sep 2001 23:43:53 +0300 Subject: Added unique error for DEADLOCK Include missing man pages into binary distribution --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 40c48188346..0974ac4b368 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -50,7 +50,7 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \ $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/man chmod o-rwx $BASE/data $BASE/data/* @@ -101,6 +101,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests $CP support-files/* $BASE/support-files +$CP man/*.? $BASE/man $CP -r sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD -- cgit v1.2.1 From 99b58a5aa9ae729d95b00650b8360820bafe3887 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Thu, 27 Sep 2001 21:35:35 +0300 Subject: Cleaned up udf_example.cc and mysql_fix_privilege_tables --- scripts/mysql_fix_privilege_tables.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 8e9ef509d66..86312fdab52 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -3,8 +3,8 @@ echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" echo "mysql.func table to MySQL 3.22.14 and above." echo "" -echo "This is needed if you want to use the new GRANT functions or" -echo "want to use the more secure passwords." +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23" echo "" echo "If you get Access denied errors, you should run this script again" echo "and give the MySQL root user password as a argument!" @@ -15,13 +15,12 @@ host="localhost" # Fix old password format, add File_priv and func table echo "" echo "If your tables are already up to date or partially up to date you will" -echo "get some warnings about 'Duplicated column name' or" -echo "'Table 'func' already exists'. You can safely ignore these!" +echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Sun, 30 Sep 2001 10:46:20 +0800 Subject: SSL compiles and works as far as can see. Continue testing.. --- scripts/mysql_install_db.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7e232692ba1..f064e6ca0ca 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -224,18 +224,22 @@ then c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u ssl_type enum('NONE','ANY','X509', 'SPECIFIED') DEFAULT 'NONE' NOT NULL," + c_u="$c_u ssl_cipher BLOB NULL," + c_u="$c_u x509_issuer BLOB NULL," + c_u="$c_u x509_subject BLOB NULL," c_u="$c_u PRIMARY KEY Host (Host,User)" c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); + REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); - INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N'); - INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N');" + INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL); + INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL);" fi if test ! -f $mdata/func.frm -- cgit v1.2.1 From 880026ccf667bf6e6adbd6cfa0abcf4268d68e4c Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 2 Oct 2001 05:53:00 +0300 Subject: Cleaned up SSL documentation Fixes for embedded server Made key_cache more configurable Fixed that one can change key blocksize in MyISAM A lot of optimizations to make MyISAM slightly faster --- scripts/mysql_fix_privilege_tables.sh | 19 +++++++++++++++++++ scripts/mysql_install_db.sh | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 86312fdab52..7226840b475 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -56,6 +56,13 @@ END_OF_DATA echo "" fi +echo "Adding columns needed by GRANT .. REQUIRE (openssl)" +echo "You can ignore any Duplicate column errors" +@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql < Date: Thu, 4 Oct 2001 02:44:18 +0300 Subject: Fixed some build problems. Fix that compressed packets and normal packets looks indentical before calling net_real_write() (Needed for query cache) Optimize IS NULL handling --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b97d8f204db..35be819cd2e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -88,7 +88,7 @@ do fi done -for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib +for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a libmysqld/libmysqld.a do if [ -f $i ] then -- cgit v1.2.1 From e80123501939a6e19dcc33efa837c15f5ca60641 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 4 Oct 2001 21:52:41 +0300 Subject: New script: explain_log.sh Portability fixes. Handle cleanup when we get an error before the message file is read. Fix bug in multi-table delete --- scripts/explain_log.sh | 383 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 383 insertions(+) create mode 100644 scripts/explain_log.sh (limited to 'scripts') diff --git a/scripts/explain_log.sh b/scripts/explain_log.sh new file mode 100644 index 00000000000..d7f6bb97b40 --- /dev/null +++ b/scripts/explain_log.sh @@ -0,0 +1,383 @@ +#!@PERL@ -w +use strict; +use DBI; + +use Getopt::Long; +$Getopt::Long::ignorecase=0; + +print "explain_log provided by http://www.mobile.de\n"; +print "=========== ================================\n"; + +my $Param={}; + +$Param->{host}=''; +$Param->{user}=''; +$Param->{password}=''; +$Param->{PrintError}=0; + +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}, + )) { + ShowOptions(); +} +else { + $Param->{UpdateCount} = 0; + $Param->{SelectCount} = 0; + $Param->{IdxUseCount} = 0; + $Param->{LineCount} = 0; + + $Param->{Init} = 0; + $Param->{Field} = 0; + $Param->{Refresh} = 0; + $Param->{QueryCount} = 0; + $Param->{Statistics} =0; + + $Param->{Query} = undef; + $Param->{ALL} = undef ; + $Param->{Comment} = undef ; + + @{$Param->{Rows}} = (qw|possible_keys key type|); + + if ($Param->{ViewDate}) { + $Param->{View} = 0; + } + else { + $Param->{View} = 1; + } + + #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}); + if (DBI::err()) { + print "Error: " . DBI::errstr() . "\n"; + } + else { + $Param->{Start} = time; + while() { + $Param->{LineCount} ++ ; + + if ($Param->{ViewDate} ) { + if (m/^(\d{6})\s+\d{1,2}:\d\d:\d\d\s.*$/) { # get date + #print "# $1 #\n"; + if ($1 == $Param->{ViewDate}) { + $Param->{View} = 1; + } + else { + $Param->{View} = 0; + } + } + } + if ($Param->{View} ) { + #print "->>>$_"; + + if (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) + #print "C-$1--$2--$3------\n"; + RunQuery($Param); + if (defined $3) { + $Param->{CID}->{$2} = $3 ; + #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+$/i) { # get connection ID($2) and database($3) + #print "\n <<<<<<<<<<<<<<<<<<----------------------------<<<<<<<<<<<<<<<< \n"; + #print "Connect \n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Change user .*\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) + #print "C-$1--$2--$3------\n"; + RunQuery($Param); + if (defined $3) { + $Param->{CID}->{$2} = $3 ; + #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Quit\s+$/i) { # remove connection ID($2) and querystring + #print "Q-$1--$2--------\n"; + RunQuery($Param); + delete $Param->{CID}->{$2} ; + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(select.+)$/i) { # get connection ID($2) and querystring + #print "S1-$1--$2--$3------\n"; + RunQuery($Param); + unless ($Param->{CID}->{$2}) { + #print "Error: No Database for Handle: $2 found\n"; + } + else { + $Param->{DB}=$Param->{CID}->{$2}; + + my $s = "$3"; + $s =~ s/from\s/from $Param->{DB}./i; + $Param->{Query}="EXPLAIN $s"; + + #$s =~ m/from\s+(\w+[.]\w+)/i; + #$Param->{tab} =$1; + #print "-- $Param->{tab} -- $s --\n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(update.+)$/i) { # get connection ID($2) and querystring + #print "S2--$1--$2--$3------\n"; + RunQuery($Param); + unless ($Param->{CID}->{$2}) { + #print "Error: No Database for Handle: $2 found\n"; + } + else { + $Param->{DB}=$Param->{CID}->{$2}; + + my $ud = $3; + $ud =~ m/^update\s+(\w+).+(where.+)$/i; + $Param->{Query} ="EXPLAIN SELECT * FROM $1 $2"; + $Param->{Query} =~ s/from\s/from $Param->{DB}./i; + + #$Param->{Query} =~ m/from\s+(\w+[.]\w+)/i; + #$Param->{tab} =$1; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Statistics\s+(.*)$/i) { # get connection ID($2) and info? + $Param->{Statistics} ++; + #print "Statistics--$1--$2--$3------\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(.+)$/i) { # get connection ID($2) + $Param->{QueryCount} ++; + #print "Query-NULL $3\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Refresh\s+(.+)$/i) { # get connection ID($2) + $Param->{Refresh} ++; + #print "Refresh\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Init\s+(.+)$/i) { # get connection ID($2) + $Param->{Init} ++; + #print "Init $3\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Field\s+(.+)$/i) { # get connection ID($2) + $Param->{Field} ++; + #print "Field $3\n"; + RunQuery($Param); + } + + elsif (m/^\s+(.+)$/ ) { # command could be some lines ... + #print "multi-lined ($1)\n"; + my ($A)=$1; + chomp $A; + $Param->{Query} .= " $1"; + #print "multi-lined ($1)<<$Param->{Query}>>\n"; + } + + + } + + } + + $Param->{dbh}->disconnect(); + + if (1 == 0) { + print "\nunclosed handles----------------------------------------\n"; + my $count=0; + foreach (sort keys %{$Param->{CID}}) { + print "$count | $_ : $Param->{CID}->{$_} \n"; + $count ++; + } + } + + print "\nIndex usage ------------------------------------\n"; + foreach my $t (sort keys %{$Param->{Data}}) { + print "\nTable\t$t: ---\n"; + foreach my $k (sort keys %{$Param->{Data}->{$t}}) { + print " count\t$k:\n"; + my %h = %{$Param->{Data}->{$t}->{$k}}; + foreach (sort {$h{$a} <=> $h{$b}} keys %h) { + print " $Param->{Data}->{$t}->{$k}->{$_}\t$_\n"; + } + } + } + + $Param->{AllCount}=0; + print "\nQueries causing table scans -------------------\n\n"; + foreach (@{$Param->{ALL}}) { + $Param->{AllCount} ++; + print "$_\n"; + } + print "Sum: $Param->{AllCount} table scans\n"; + + print "\nSummary ---------------------------------------\n\n"; + print "Select: \t$Param->{SelectCount} queries\n"; + print "Update: \t$Param->{UpdateCount} queries\n"; + print "\n"; + + print "Init: \t$Param->{Init} times\n"; + print "Field: \t$Param->{Field} times\n"; + print "Refresh: \t$Param->{Refresh} times\n"; + print "Query: \t$Param->{QueryCount} times\n"; + print "Statistics:\t$Param->{Statistics} times\n"; + print "\n"; + + print "Logfile: \t$Param->{LineCount} lines\n"; + print "Started: \t".localtime($Param->{Start})."\n"; + print "Finished: \t".localtime(time)."\n"; + + } +} + + +########################################################################### +# +# +# +sub RunQuery { + my $Param = shift ; + + if (defined $Param->{Query}) { + if (defined $Param->{DB} ) { + + $Param->{Query} =~ m/from\s+(\w+[.]\w+|\w+)/i; + $Param->{tab} =$1; + #print "||$Param->{tab} -- $Param->{Query}\n"; + + my $sth=$Param->{dbh}->prepare("USE $Param->{DB}"); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + $sth->execute(); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + $sth->finish(); + + $sth=$Param->{dbh}->prepare($Param->{Query}); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + #print "$Param->{Query}\n"; + $sth->execute(); + if (DBI::err()) { + if ($Param->{PrintError}) {print "[$Param->{LineCount}]<<$Param->{Query}>>\n";} + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + my $row = undef; + while ($row = $sth->fetchrow_hashref()) { + $Param->{SelectCount} ++; + + if (defined $row->{Comment}) { + push (@{$Param->{Comment}}, "$row->{Comment}; $_; $Param->{DB}; $Param->{Query}"); + } + foreach (@{$Param->{Rows}}) { + if (defined $row->{$_}) { + #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { + if ($row->{type} eq 'ALL') { + push (@{$Param->{ALL}}, "$row->{$_} $_ $Param->{DB} $Param->{Query}"); + #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; + } + $Param->{IdxUseCount} ++; + $Param->{Data}->{$Param->{tab}}->{$_}->{$row->{$_}} ++; + } + } + } + } + } + } + } + $sth->finish(); + } + $Param->{Query} = undef ; + } +} + +########################################################################### +# +# +# +sub ShowOptions { + print <, http://www.mobile.de + +=head1 RECRUITING + +If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de +and send me an email with your resume (you must be speaking German!). + +=head1 SEE ALSO + +mysql documentation + +=cut -- cgit v1.2.1 From 88aff4bf851e8f0d67cc7cd860d445e0fb234717 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Mon, 8 Oct 2001 04:58:07 +0300 Subject: Updated manual about embedded version. Speed up column-completion in 'mysql' Don't use ISAM if HAVE_ISAM is not defined A lot of fixes for the embedded version. All libraries are now included in libmysqld.a Changed arguments to convert_dirname() to make it more general. Renamed files in the 'merge' directory to all use a common prefix. Don't compile both assembler and C functions on x86 --- scripts/Makefile.am | 4 + scripts/mysql_config.sh | 13 +- scripts/mysql_explain_log.sh | 383 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 395 insertions(+), 5 deletions(-) create mode 100644 scripts/mysql_explain_log.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d2cca98ce63..c83a7e2315f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -28,6 +28,7 @@ bin_SCRIPTS = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ + mysql_explain_log \ mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ @@ -43,6 +44,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ + mysql_explain_log.sh \ mysqld_multi.sh \ mysqld_safe.sh @@ -95,6 +97,8 @@ SUFFIXES = .sh -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''LIBS''@!@LIBS@!' \ + -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ed344f4b1e3..b2a09173760 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -31,16 +31,18 @@ client_libs='@CLIENT_LIBS@' libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" cflags="-I'$pkgincludedir'" +embedded_libs="$ldflags -L'$pkglibdir' -lmysqld @LIBS@ @innodb_system_libs@" usage () { cat <{host}=''; +$Param->{user}=''; +$Param->{password}=''; +$Param->{PrintError}=0; + +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}, + )) { + ShowOptions(); +} +else { + $Param->{UpdateCount} = 0; + $Param->{SelectCount} = 0; + $Param->{IdxUseCount} = 0; + $Param->{LineCount} = 0; + + $Param->{Init} = 0; + $Param->{Field} = 0; + $Param->{Refresh} = 0; + $Param->{QueryCount} = 0; + $Param->{Statistics} =0; + + $Param->{Query} = undef; + $Param->{ALL} = undef ; + $Param->{Comment} = undef ; + + @{$Param->{Rows}} = (qw|possible_keys key type|); + + if ($Param->{ViewDate}) { + $Param->{View} = 0; + } + else { + $Param->{View} = 1; + } + + #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}); + if (DBI::err()) { + print "Error: " . DBI::errstr() . "\n"; + } + else { + $Param->{Start} = time; + while() { + $Param->{LineCount} ++ ; + + if ($Param->{ViewDate} ) { + if (m/^(\d{6})\s+\d{1,2}:\d\d:\d\d\s.*$/) { # get date + #print "# $1 #\n"; + if ($1 == $Param->{ViewDate}) { + $Param->{View} = 1; + } + else { + $Param->{View} = 0; + } + } + } + if ($Param->{View} ) { + #print "->>>$_"; + + if (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) + #print "C-$1--$2--$3------\n"; + RunQuery($Param); + if (defined $3) { + $Param->{CID}->{$2} = $3 ; + #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+$/i) { # get connection ID($2) and database($3) + #print "\n <<<<<<<<<<<<<<<<<<----------------------------<<<<<<<<<<<<<<<< \n"; + #print "Connect \n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Change user .*\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) + #print "C-$1--$2--$3------\n"; + RunQuery($Param); + if (defined $3) { + $Param->{CID}->{$2} = $3 ; + #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Quit\s+$/i) { # remove connection ID($2) and querystring + #print "Q-$1--$2--------\n"; + RunQuery($Param); + delete $Param->{CID}->{$2} ; + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(select.+)$/i) { # get connection ID($2) and querystring + #print "S1-$1--$2--$3------\n"; + RunQuery($Param); + unless ($Param->{CID}->{$2}) { + #print "Error: No Database for Handle: $2 found\n"; + } + else { + $Param->{DB}=$Param->{CID}->{$2}; + + my $s = "$3"; + $s =~ s/from\s/from $Param->{DB}./i; + $Param->{Query}="EXPLAIN $s"; + + #$s =~ m/from\s+(\w+[.]\w+)/i; + #$Param->{tab} =$1; + #print "-- $Param->{tab} -- $s --\n"; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(update.+)$/i) { # get connection ID($2) and querystring + #print "S2--$1--$2--$3------\n"; + RunQuery($Param); + unless ($Param->{CID}->{$2}) { + #print "Error: No Database for Handle: $2 found\n"; + } + else { + $Param->{DB}=$Param->{CID}->{$2}; + + my $ud = $3; + $ud =~ m/^update\s+(\w+).+(where.+)$/i; + $Param->{Query} ="EXPLAIN SELECT * FROM $1 $2"; + $Param->{Query} =~ s/from\s/from $Param->{DB}./i; + + #$Param->{Query} =~ m/from\s+(\w+[.]\w+)/i; + #$Param->{tab} =$1; + } + } + + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Statistics\s+(.*)$/i) { # get connection ID($2) and info? + $Param->{Statistics} ++; + #print "Statistics--$1--$2--$3------\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(.+)$/i) { # get connection ID($2) + $Param->{QueryCount} ++; + #print "Query-NULL $3\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Refresh\s+(.+)$/i) { # get connection ID($2) + $Param->{Refresh} ++; + #print "Refresh\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Init\s+(.+)$/i) { # get connection ID($2) + $Param->{Init} ++; + #print "Init $3\n"; + RunQuery($Param); + } + elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Field\s+(.+)$/i) { # get connection ID($2) + $Param->{Field} ++; + #print "Field $3\n"; + RunQuery($Param); + } + + elsif (m/^\s+(.+)$/ ) { # command could be some lines ... + #print "multi-lined ($1)\n"; + my ($A)=$1; + chomp $A; + $Param->{Query} .= " $1"; + #print "multi-lined ($1)<<$Param->{Query}>>\n"; + } + + + } + + } + + $Param->{dbh}->disconnect(); + + if (1 == 0) { + print "\nunclosed handles----------------------------------------\n"; + my $count=0; + foreach (sort keys %{$Param->{CID}}) { + print "$count | $_ : $Param->{CID}->{$_} \n"; + $count ++; + } + } + + print "\nIndex usage ------------------------------------\n"; + foreach my $t (sort keys %{$Param->{Data}}) { + print "\nTable\t$t: ---\n"; + foreach my $k (sort keys %{$Param->{Data}->{$t}}) { + print " count\t$k:\n"; + my %h = %{$Param->{Data}->{$t}->{$k}}; + foreach (sort {$h{$a} <=> $h{$b}} keys %h) { + print " $Param->{Data}->{$t}->{$k}->{$_}\t$_\n"; + } + } + } + + $Param->{AllCount}=0; + print "\nQueries causing table scans -------------------\n\n"; + foreach (@{$Param->{ALL}}) { + $Param->{AllCount} ++; + print "$_\n"; + } + print "Sum: $Param->{AllCount} table scans\n"; + + print "\nSummary ---------------------------------------\n\n"; + print "Select: \t$Param->{SelectCount} queries\n"; + print "Update: \t$Param->{UpdateCount} queries\n"; + print "\n"; + + print "Init: \t$Param->{Init} times\n"; + print "Field: \t$Param->{Field} times\n"; + print "Refresh: \t$Param->{Refresh} times\n"; + print "Query: \t$Param->{QueryCount} times\n"; + print "Statistics:\t$Param->{Statistics} times\n"; + print "\n"; + + print "Logfile: \t$Param->{LineCount} lines\n"; + print "Started: \t".localtime($Param->{Start})."\n"; + print "Finished: \t".localtime(time)."\n"; + + } +} + + +########################################################################### +# +# +# +sub RunQuery { + my $Param = shift ; + + if (defined $Param->{Query}) { + if (defined $Param->{DB} ) { + + $Param->{Query} =~ m/from\s+(\w+[.]\w+|\w+)/i; + $Param->{tab} =$1; + #print "||$Param->{tab} -- $Param->{Query}\n"; + + my $sth=$Param->{dbh}->prepare("USE $Param->{DB}"); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + $sth->execute(); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + $sth->finish(); + + $sth=$Param->{dbh}->prepare($Param->{Query}); + if (DBI::err()) { + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + #print "$Param->{Query}\n"; + $sth->execute(); + if (DBI::err()) { + if ($Param->{PrintError}) {print "[$Param->{LineCount}]<<$Param->{Query}>>\n";} + if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} + } + else { + my $row = undef; + while ($row = $sth->fetchrow_hashref()) { + $Param->{SelectCount} ++; + + if (defined $row->{Comment}) { + push (@{$Param->{Comment}}, "$row->{Comment}; $_; $Param->{DB}; $Param->{Query}"); + } + foreach (@{$Param->{Rows}}) { + if (defined $row->{$_}) { + #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { + if ($row->{type} eq 'ALL') { + push (@{$Param->{ALL}}, "$row->{$_} $_ $Param->{DB} $Param->{Query}"); + #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; + } + $Param->{IdxUseCount} ++; + $Param->{Data}->{$Param->{tab}}->{$_}->{$row->{$_}} ++; + } + } + } + } + } + } + } + $sth->finish(); + } + $Param->{Query} = undef ; + } +} + +########################################################################### +# +# +# +sub ShowOptions { + print <, http://www.mobile.de + +=head1 RECRUITING + +If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de +and send me an email with your resume (you must be speaking German!). + +=head1 SEE ALSO + +mysql documentation + +=cut -- cgit v1.2.1 From 196f620e9024b12e33125c4be03c867b0fabbfcc Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Mon, 8 Oct 2001 23:20:19 +0300 Subject: Portability fixes + a couple of bug fixes introduced by last push. --- scripts/explain_log.sh | 2 +- scripts/mysql_install_db.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/explain_log.sh b/scripts/explain_log.sh index d7f6bb97b40..c4a4ef21568 100644 --- a/scripts/explain_log.sh +++ b/scripts/explain_log.sh @@ -279,7 +279,7 @@ sub RunQuery { if (defined $row->{$_}) { #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { if ($row->{type} eq 'ALL') { - push (@{$Param->{ALL}}, "$row->{$_} $_ $Param->{DB} $Param->{Query}"); + push (@{$Param->{ALL}}, "$Param->{Query}"); #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; } $Param->{IdxUseCount} ++; diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9b0cfd4eb66..c99126cdf53 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -232,14 +232,14 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE',NULL,NULL,NULL); + REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); - INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL); - INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE',NULL,NULL,NULL);" + INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','',''); + INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','');" fi if test ! -f $mdata/func.frm -- cgit v1.2.1 From 06e719b7ccc1198df209ffa56eadf8d77f6a9ff8 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 10 Oct 2001 02:50:28 +0300 Subject: Remved Gemini code. --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c99126cdf53..0da457582f1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -294,7 +294,7 @@ fi echo "Installing all prepared tables" if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-gemini --skip-bdb $args" << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From 6265dfccda684865f201e66c305960cffbfdd659 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 10 Oct 2001 23:44:07 +0300 Subject: Always build thread safe client libraries in the distributed build Add mysqlmanager to binary distribution. --- scripts/make_binary_distribution.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 35be819cd2e..c002179a393 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -66,9 +66,10 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ myisam/myisampack sql/mysqld sql/mysqlbinlog \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ + tools/mysqlmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ - client/.libs/mysqlcheck + client/.libs/mysqlcheck tools/.libs/mysqlmanager do if [ -f $i ] then @@ -88,7 +89,7 @@ do fi done -for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a libmysqld/libmysqld.a +for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a do if [ -f $i ] then -- cgit v1.2.1 From 075a0fbde0a068f970473555edfa785592e61291 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 11 Oct 2001 04:25:00 +0300 Subject: Portability fixes Fixed bug with long log-filenames in Innobase. --- scripts/make_binary_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c002179a393..24dee288706 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -66,10 +66,12 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ myisam/myisampack sql/mysqld sql/mysqlbinlog \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ - tools/mysqlmanager \ + client/mysqlmanagerc client/mysqlmanager-pwgen tools/mysqlmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ - client/.libs/mysqlcheck tools/.libs/mysqlmanager + client/.libs/mysqlcheck \ + client/.libs/mysqlmanagerc client/libs/mysqlmanager-pwgen \ + tools/.libs/mysqlmanager do if [ -f $i ] then -- cgit v1.2.1 From 6afbeb4cf4797f8843acf2ee3572476cea67cc73 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 11 Oct 2001 22:02:16 +0300 Subject: Cleanups --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 24dee288706..b743e228a0f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -70,7 +70,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ client/.libs/mysqlcheck \ - client/.libs/mysqlmanagerc client/libs/mysqlmanager-pwgen \ + client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \ tools/.libs/mysqlmanager do if [ -f $i ] -- cgit v1.2.1 From d83b557f4a65e636d48218fdd9d89f27a9cda002 Mon Sep 17 00:00:00 2001 From: "tim@black.box" <> Date: Mon, 22 Oct 2001 11:22:55 -0400 Subject: Fix the NOHUP_NICENESS test in mysqld_safe. --- scripts/mysqld_safe.sh | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index c6df7400c75..5504d929ede 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -159,15 +159,48 @@ export MYSQL_TCP_PORT NOHUP_NICENESS="nohup" -if test -w / + +# Using nice with no args to get the niceness level is GNU-specific. +# This check could be extended for other operating systems (e.g., +# BSD could use "nohup sh -c 'ps -o nice -p $$' | tail -1"). +# But, it also seems that GNU nohup is the only one which messes +# with the priority, so this is okay. +if nohup nice > /dev/null 2>&1 then - NOHUP_NICENESS=`nohup nice 2>&1` - if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 - then - NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" - else - NOHUP_NICENESS="nohup" - fi + normal_niceness=`nice` + nohup_niceness=`nohup nice` + + numeric_nice_values=1 + for val in $normal_niceness $nohup_niceness + do + case "$val" in + -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | \ + [0-9] | [0-9][0-9] | [0-9][0-9][0-9] ) + ;; + * ) + numeric_nice_values=0 ;; + esac + done + + if test $numeric_nice_values -eq 1 + then + nice_value_diff=`expr $nohup_niceness - $normal_niceness` + if test $? -eq 0 && test $nice_value_diff -gt 0 && \ + 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" + fi + fi +else + if nohup echo testing > /dev/null 2>&1 + then + : + else + # nohup doesn't work on this system + NOHUP_NICENESS="" + fi fi USER_OPTION="" -- cgit v1.2.1 From 4157d12df50c5fa1a759c078ddfd803338eab87d Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 7 Nov 2001 00:08:57 +0200 Subject: Added missing mysqlbinlog to binary distributions. Applied patch to mysqlhotcopy --- scripts/make_binary_distribution.sh | 2 +- scripts/mysqlhotcopy.sh | 111 ++++++++++++++++++++++++++++++++---- 2 files changed, 102 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0974ac4b368..c49ea91a4fc 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -63,7 +63,7 @@ done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ extra/my_print_defaults extra/resolve_stack_dump \ isam/isamchk isam/pack_isam myisam/myisamchk \ - myisam/myisampack sql/mysqld sql/mysqlbinlog \ + myisam/myisampack sql/mysqld client/mysqlbinlog \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 71359fa5612..655e5a2a52b 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -6,6 +6,7 @@ use Data::Dumper; use File::Basename; use File::Path; use DBI; +use Sys::Hostname; =head1 NAME @@ -36,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.12"; +my $VERSION = "1.13"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -68,6 +69,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] --resetmaster reset the binlog once all tables are locked --resetslave reset the master.info once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) + --record_log_pos=# record slave and master status in specified db.table Try \'perldoc $0 for more complete documentation\' _OPTIONS @@ -101,6 +103,7 @@ GetOptions( \%opt, "regexp=s", "suffix=s", "checkpoint=s", + "record_log_pos=s", "flushlog", "resetmaster", "resetslave", @@ -117,6 +120,7 @@ GetOptions( \%opt, # 'target' - destination directory of the copy # 'tables' - array-ref to list of tables in the db # 'files' - array-ref to list of files to be copied +# 'index' - array-ref to list of indexes to be copied # my @db_desc = (); @@ -172,6 +176,16 @@ if ( $opt{checkpoint} ) { if ( $@ ); } +# --- check that log_pos table exists if specified --- +if ( $opt{record_log_pos} ) { + eval { $dbh->do( qq{ select host, time_stamp, log_file, log_pos, master_host, master_log_file, master_log_pos + from $opt{record_log_pos} where 1 != 1} ); + }; + + die "Error accessing log_pos table ($opt{record_log_pos}): $@" + if ( $@ ); +} + # --- get variables from database --- my $sth_vars = $dbh->prepare("show variables like 'datadir'"); $sth_vars->execute; @@ -294,8 +308,6 @@ foreach my $rdb ( @db_desc ) { # --- resolve targets for copies --- -my @targets = (); - if (defined($tgt_name) && length $tgt_name ) { # explicit destination directory specified @@ -382,11 +394,12 @@ foreach my $rdb ( @db_desc ) { # read lock all the tables we'll be copying # in order to get a consistent snapshot of the database -if ( $opt{checkpoint} ) { - # convert existing READ lock on checkpoint table into WRITE lock - unless ( $hc_locks =~ s/$opt{checkpoint}\s+READ/$opt{checkpoint} WRITE/ ) { - $hc_locks .= ", $opt{checkpoint} WRITE"; - } +if ( $opt{checkpoint} || $opt{record_log_pos} ) { + # convert existing READ lock on checkpoint and/or log_pos table into WRITE lock + foreach my $table ( grep { defined } ( $opt{checkpoint}, $opt{record_log_pos} ) ) { + $hc_locks .= ", $table WRITE" + unless ( $hc_locks =~ s/$table\s+READ/$table WRITE/ ); + } } my $hc_started = time; # count from time lock is granted @@ -411,6 +424,11 @@ else { $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); $dbh->do( "RESET SLAVE" ) if ( $opt{resetslave} ); + + if ( $opt{record_log_pos} ) { + record_log_pos( $dbh, $opt{record_log_pos} ); + $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + } } my @failed = (); @@ -473,6 +491,12 @@ if ( @failed ) { # delete any @targets # rename _old copy back to original + my @targets = (); + foreach my $rdb ( @db_desc ) { + push @targets, $rdb->{target} if ( -d $rdb->{target} ); + } + print "Deleting @targets \n" if $opt{debug}; + print "Deleting @targets \n" if $opt{debug}; rmtree([@targets]); if (@existing) { @@ -603,7 +627,6 @@ sub safe_system } } - sub retire_directory { my ( @dir ) = @_; @@ -625,6 +648,40 @@ sub retire_directory { } } +sub record_log_pos { + my ( $dbh, $table_name ) = @_; + + eval { + my ($file,$position) = get_row( $dbh, "show master status" ); + die "master status is undefined" if !defined $file || !defined $position; + + my ($master_host, undef, undef, undef, $log_file, $log_pos ) + = get_row( $dbh, "show slave status" ); + + my $hostname = hostname(); + + $dbh->do( qq{ replace into $table_name + set host=?, log_file=?, log_pos=?, + master_host=?, master_log_file=?, master_log_pos=? }, + undef, + $hostname, $file, $position, + $master_host, $log_file, $log_pos ); + + }; + + if ( $@ ) { + warn "Failed to store master position: $@\n"; + } +} + +sub get_row { + my ( $dbh, $sql ) = @_; + + my $sth = $dbh->prepare($sql); + $sth->execute; + return $sth->fetchrow_array(); +} + __END__ =head1 DESCRIPTION @@ -659,6 +716,38 @@ The checkpoint-table must contain at least the following fields: =back +=item --record_log_pos log-pos-table + +Just before the database files are copied, update the record in the +log-pos-table from the values returned from "show master status" and +"show slave status". The master status values are stored in the +log_file and log_pos columns, and establish the position in the binary +logs that any slaves of this host should adopt if initialised from +this dump. The slave status values are stored in master_host, +master_log_file, and master_log_pos, and these are useful if the host +performing the dump is a slave and other sibling slaves are to be +initialised from this dump. + +The name of the log-pos table should be supplied in database.table format. +A sample log-pos table definition: + +=over 4 + +CREATE TABLE log_pos ( + host varchar(60) NOT null, + time_stamp timestamp(14) NOT NULL, + log_file varchar(32) default NULL, + log_pos int(11) default NULL, + master_host varchar(60) NULL, + master_log_file varchar(32) NULL, + master_log_pos int NULL, + + PRIMARY KEY (host) +); + +=back + + =item --suffix suffix Each database is copied back into the originating datadir under @@ -784,7 +873,7 @@ Study the code inside this script and only rely on it if I believe that it does the right thing for you. Patches adding bug fixes, documentation and new features are welcome. -Please send these to internals@mysql.com. +Please send these to internals@lists.mysql.com. =head1 TO DO @@ -814,6 +903,8 @@ Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. Tim Bunce Martin Waite - added checkpoint, flushlog, regexp and dryrun options + Fixed cleanup of targets when hotcopy fails. + Added --record_log_pos. Ralph Corderoy - added synonyms for commands -- cgit v1.2.1 From e4bdf26066324b76942b1e92d2118a70591f447d Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 28 Nov 2001 02:24:22 +0200 Subject: Small safety fix --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c49ea91a4fc..99eb9e42967 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -68,7 +68,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ - client/.libs/mysqlcheck + client/.libs/mysqlcheck client/.libs/mysqlbinlog do if [ -f $i ] then -- cgit v1.2.1 From 2f91f2360aba9ad0911af22de3a807837973d31c Mon Sep 17 00:00:00 2001 From: "sasha@mysql.sashanet.com" <> Date: Sat, 1 Dec 2001 19:37:30 -0700 Subject: get correct paths in mysql_config even if the user moves basedir --- scripts/mysql_config.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ed344f4b1e3..05cc8632363 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -18,11 +18,50 @@ # This script reports various configuration settings that may be needed # when using the MySQL client library. +which () +{ + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + for file + do + for dir in $PATH + do + if test -f $dir/$file + then + echo "$dir/$file" + continue 2 + fi + done + echo "which: no $file in ($PATH)" + exit 1 + done + IFS="$save_ifs" +} + +fix_path () +{ + eval path=\$"$1" + if [ ! -f "$path" ] ; + then + eval "$1"=$basedir/$2 + fi +} + +abs_path=`expr \( substr $0 1 1 \) = '/'` +if [ "x$abs_path" = "x1" ] ; then + me=$0 +else + me=`which mysql_config` +fi + +basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` + ldata='@localstatedir@' execdir='@libexecdir@' bindir='@bindir@' pkglibdir='@pkglibdir@' +fix_path pkglibdir lib/mysql pkgincludedir='@pkgincludedir@' +fix_path pkgincludedir include/mysql version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' -- cgit v1.2.1 From 90004e340b82413d0058b9eaebb4d776938aa00f Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 5 Dec 2001 23:15:05 +0200 Subject: Fixed bug in LEFT JOIN --- scripts/mysqlhotcopy.sh | 96 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 655e5a2a52b..caf2615fe7a 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.13"; +my $VERSION = "1.14"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -120,6 +120,7 @@ GetOptions( \%opt, # 'target' - destination directory of the copy # 'tables' - array-ref to list of tables in the db # 'files' - array-ref to list of files to be copied +# (RAID files look like 'nn/name.MYD') # 'index' - array-ref to list of indexes to be copied # @@ -265,11 +266,23 @@ foreach my $rdb ( @db_desc ) { or die "Cannot open dir '$db_dir': $!"; my %db_files; - map { ( /(.+)\.\w+$/ ? ( $db_files{$_} = $1 ) : () ) } readdir(DBDIR); + my @raid_dir = (); + + while ( defined( my $name = readdir DBDIR ) ) { + if ( $name =~ /^\d\d$/ && -d "$db_dir/$name" ) { + push @raid_dir, $name; + } + else { + $db_files{$name} = $1 if ( $name =~ /(.+)\.\w+$/ ); + } + } + closedir( DBDIR ); + + scan_raid_dir( \%db_files, $db_dir, @raid_dir ); + unless( keys %db_files ) { warn "'$db' is an empty database\n"; } - closedir( DBDIR ); ## filter (out) files specified in t_regex my @db_files; @@ -297,6 +310,8 @@ foreach my $rdb ( @db_desc ) { my @hc_tables = map { "$db.$_" } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; + $rdb->{raid_dirs} = [ get_raid_dirs( $rdb->{files} ) ]; + $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; $hc_tables .= ", " if ( length $hc_tables && @hc_tables ); @@ -370,17 +385,20 @@ if ($opt{method} =~ /^cp\b/) retire_directory( @existing ) if ( @existing ); foreach my $rdb ( @db_desc ) { - my $tgt_dirpath = $rdb->{target}; - if ( $opt{dryrun} ) { - print "mkdir $tgt_dirpath, 0750\n"; - } - elsif ($opt{method} =~ /^scp\b/) { - ## assume it's there? - ## ... - } - else { - mkdir($tgt_dirpath, 0750) - or die "Can't create '$tgt_dirpath': $!\n"; + foreach my $td ( '', @{$rdb->{raid_dirs}} ) { + + my $tgt_dirpath = "$rdb->{target}/$td"; + if ( $opt{dryrun} ) { + print "mkdir $tgt_dirpath, 0750\n"; + } + elsif ($opt{method} =~ /^scp\b/) { + ## assume it's there? + ## ... + } + else { + mkdir($tgt_dirpath, 0750) + or die "Can't create '$tgt_dirpath': $!\n"; + } } } @@ -438,7 +456,7 @@ foreach my $rdb ( @db_desc ) my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; next unless @files; - eval { copy_files($opt{method}, \@files, $rdb->{target} ); }; + eval { copy_files($opt{method}, \@files, $rdb->{target}, $rdb->{raid_dirs} ); }; push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); @@ -531,27 +549,33 @@ exit 0; # --- sub copy_files { - my ($method, $files, $target) = @_; + my ($method, $files, $target, $raid_dirs) = @_; my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; if ($method =~ /^s?cp\b/) { # cp or scp with optional flags - @cmd = ($method); + my @cp = ($method); # add option to preserve mod time etc of copied files # not critical, but nice to have - push @cmd, "-p" if $^O =~ m/^(solaris|linux|freebsd)$/; + push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd)$/; # add recursive option for scp - push @cmd, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; + push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; + + my @non_raid = grep { $_ !~ m:\d\d/: } @$files; # add files to copy and the destination directory - push @cmd, @$files, $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 ); + } } else { die "Can't use unsupported method '$method'\n"; } - safe_system (@cmd); } # @@ -682,6 +706,35 @@ sub get_row { return $sth->fetchrow_array(); } +sub scan_raid_dir { + my ( $r_db_files, $data_dir, @raid_dir ) = @_; + + local(*RAID_DIR); + + foreach my $rd ( @raid_dir ) { + + opendir(RAID_DIR, "$data_dir/$rd" ) + or die "Cannot open dir '$data_dir/$rd': $!"; + + while ( defined( my $name = readdir RAID_DIR ) ) { + $r_db_files->{"$rd/$name"} = $1 if ( $name =~ /(.+)\.\w+$/ ); + } + closedir( RAID_DIR ); + } +} + +sub get_raid_dirs { + my ( $r_files ) = @_; + + my %dirs = (); + foreach my $f ( @$r_files ) { + if ( $f =~ m:^(\d\d)/: ) { + $dirs{$1} = 1; + } + } + return sort keys %dirs; +} + __END__ =head1 DESCRIPTION @@ -905,6 +958,7 @@ Tim Bunce Martin Waite - added checkpoint, flushlog, regexp and dryrun options Fixed cleanup of targets when hotcopy fails. Added --record_log_pos. + RAID tables are now copied (don't know if this works over scp). Ralph Corderoy - added synonyms for commands -- cgit v1.2.1 From 0f71e337b32c3388070f96160234df86eae964f8 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 5 Dec 2001 23:56:56 +0200 Subject: Small changes to mysql_config.sh --- scripts/mysql_config.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 05cc8632363..af11957576b 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -37,20 +37,32 @@ which () IFS="$save_ifs" } +# +# If we can find the given directory relatively to where mysql_config is +# we should use this instead of the incompiled one. +# This is to ensure that this script also works with the binary MySQL +# version + fix_path () { - eval path=\$"$1" - if [ ! -f "$path" ] ; - then - eval "$1"=$basedir/$2 - fi + var=$1 + shift + for filename + do + path=$basedir/$filename + if [ -d "$path" ] ; + then + eval "$var"=$path + return + fi + done } abs_path=`expr \( substr $0 1 1 \) = '/'` if [ "x$abs_path" = "x1" ] ; then me=$0 else - me=`which mysql_config` + me=`which $0` fi basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` @@ -59,9 +71,9 @@ ldata='@localstatedir@' execdir='@libexecdir@' bindir='@bindir@' pkglibdir='@pkglibdir@' -fix_path pkglibdir lib/mysql +fix_path pkglibdir lib/mysql lib pkgincludedir='@pkgincludedir@' -fix_path pkgincludedir include/mysql +fix_path pkgincludedir include/mysql include version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' -- cgit v1.2.1 From 4dbd9e061c35d79e96079b05408dd584c09f2c15 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Mon, 17 Dec 2001 03:02:58 +0200 Subject: Lots of portability fixes. Fixed shutdown on HPUX. Fixed bug in query cache. --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0da457582f1..bf577a6cc5c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -321,8 +321,8 @@ then fi echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "This is done with:" - echo "$bindir/mysqladmin -u root -p password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname -p password 'new-password'" + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." # # Print message about upgrading unless we have created a new db table. -- cgit v1.2.1 From 22204dc90bd38bae669440c45c0d04a51fe79a39 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Wed, 19 Dec 2001 16:15:31 +0000 Subject: mysql_fix_extensions added --- scripts/Makefile.am | 3 +++ scripts/mysql_fix_extensions.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 scripts/mysql_fix_extensions.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index c83a7e2315f..7ac554cda1d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -20,6 +20,7 @@ bin_SCRIPTS = @server_scripts@ \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ + mysql_fix_extensions \ mysql_setpermission \ mysql_zap \ mysqlaccess \ @@ -35,6 +36,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ + mysql_fix_extensions.sh \ mysql_install_db.sh \ mysql_setpermission.sh \ mysql_zap.sh \ @@ -61,6 +63,7 @@ CLEANFILES = @server_scripts@ \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ + mysql_fix_extensions \ mysql_setpermission \ mysql_zap \ mysqlaccess \ diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh new file mode 100644 index 00000000000..92aefda3f77 --- /dev/null +++ b/scripts/mysql_fix_extensions.sh @@ -0,0 +1,16 @@ +#!@PERL@ +# This is a utility for MySQL. It is not needed by any standard part +# of MySQL. + +# Usage: mysql_fix_extentions datadir +# does not work with RAID, with InnoDB or BDB tables +# makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase +# useful when datafiles are copied from windows + +die "Usage: $0 datadir\n" unless -d $ARGV[0]; + +for $a (<$ARGV[0]/*/*.*>) { $_=$a; + s/\.frm$/.frm/i; + s/\.(is[md]|my[id])$/\U$&/; + rename ($a, $_) || warn "Cannot rename $a => $_ : $!"; +} -- cgit v1.2.1 From ffb356ad54dc658b2f8c3d2dd27f38ce34c14646 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Mon, 24 Dec 2001 14:55:47 +0000 Subject: mysql_fix_extensions.sh: typo fixed --- scripts/mysql_fix_extensions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh index 92aefda3f77..fbc72406f5e 100644 --- a/scripts/mysql_fix_extensions.sh +++ b/scripts/mysql_fix_extensions.sh @@ -11,6 +11,6 @@ die "Usage: $0 datadir\n" unless -d $ARGV[0]; for $a (<$ARGV[0]/*/*.*>) { $_=$a; s/\.frm$/.frm/i; - s/\.(is[md]|my[id])$/\U$&/; + s/\.(is[md]|my[id])$/\U$&/i; rename ($a, $_) || warn "Cannot rename $a => $_ : $!"; } -- cgit v1.2.1 From 038db406c15f3ebe90639218a447d98467749796 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Wed, 26 Dec 2001 16:49:10 +0200 Subject: This is a large push. Included are : * multi-table updates * new paid feature for limiting number of queries per hour for users * optional syntax for multi-table deletes * optimization for SQL_CALC_FOUND_ROWS * a small addition for CREATE .. SELECT that will be of future use I know that all this will require many additions to documentation, which I have not done, but I am at Arjen's disposal to help him document all this. --- scripts/mysql_install_db.sh | 15 +++++++++------ scripts/mysql_new_fix_privilege_tables.sh | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 scripts/mysql_new_fix_privilege_tables.sh (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0da457582f1..3f4292b3fd7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -228,18 +228,21 @@ then c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," c_u="$c_u x509_subject BLOB NOT NULL," + c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u PRIMARY KEY Host (Host,User)" c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0); - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','',''); + REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','',''); - INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','');" + INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','',0,0,0);" fi if test ! -f $mdata/func.frm diff --git a/scripts/mysql_new_fix_privilege_tables.sh b/scripts/mysql_new_fix_privilege_tables.sh new file mode 100644 index 00000000000..71c6de4ffd1 --- /dev/null +++ b/scripts/mysql_new_fix_privilege_tables.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" +echo "mysql.func table to MySQL 3.22.14 and above." +echo "" +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23" +echo "" +echo "If you get Access denied errors, you should run this script again" +echo "and give the MySQL root user password as a argument!" + +root_password="$1" +host="localhost" + +# Fix old password format, add File_priv and func table +echo "" +echo "If your tables are already up to date or partially up to date you will" +echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" + +@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Thu, 27 Dec 2001 18:32:24 +0000 Subject: `escaping` to mysqlhotcopy --- scripts/mysqlhotcopy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index caf2615fe7a..063ff8be750 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -307,7 +307,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} ) ]; -- cgit v1.2.1 From 89fa5f13d9d26f5232c3068ab67878a02804b91a Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Fri, 18 Jan 2002 00:43:50 +0200 Subject: Fixed bug when making a range join based on information from a const table. --- scripts/mysql_config.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index af11957576b..9320efdd2a1 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -58,12 +58,16 @@ fix_path () done } -abs_path=`expr \( substr $0 1 1 \) = '/'` -if [ "x$abs_path" = "x1" ] ; then - me=$0 -else - me=`which $0` -fi +get_full_path () +{ + case $1 in + /*) echo "$1";; + ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/./;/;' ;; + *) which $1 ;; + esac +} + +me=`get_full_path $0` basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` @@ -81,6 +85,7 @@ ldflags='@LDFLAGS@' client_libs='@CLIENT_LIBS@' libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" +libs=`echo $libs | sed -e 's; +;;'` cflags="-I'$pkgincludedir'" usage () { -- cgit v1.2.1 From b9d3a55238c02baf8f4b088530e924934ecbf74c Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Sat, 26 Jan 2002 01:19:47 +0200 Subject: Update needed for SuSE 7.3 Update for autoconf 2.52 --- scripts/Makefile.am | 2 +- scripts/mysql_new_fix_privilege_tables.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7ac554cda1d..1c3b8083347 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -76,7 +76,7 @@ CLEANFILES = @server_scripts@ \ SUPERCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug -mysqlbug: ${top_builddir}/config.status ${top_builddir}/config.cache mysqlbug.sh +mysqlbug: ${top_builddir}/config.status mysqlbug.sh SUFFIXES = .sh diff --git a/scripts/mysql_new_fix_privilege_tables.sh b/scripts/mysql_new_fix_privilege_tables.sh index 71c6de4ffd1..ce10ed0b412 100644 --- a/scripts/mysql_new_fix_privilege_tables.sh +++ b/scripts/mysql_new_fix_privilege_tables.sh @@ -17,8 +17,9 @@ echo "" echo "If your tables are already up to date or partially up to date you will" echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" +# Add fields that can be used to limit number of questions and connections +# for some users. + @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Thu, 7 Feb 2002 21:34:35 +0200 Subject: Update to autoconf 2.52 Fix of InnoDB variables in SHOW VARIABLES Fix for ALTER TABLE and InnoDB --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 45fbe275476..18957b6422d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -71,7 +71,7 @@ CLEANFILES = @server_scripts@ \ SUPERCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug -mysqlbug: ${top_builddir}/config.status ${top_builddir}/config.cache mysqlbug.sh +mysqlbug: ${top_builddir}/config.status mysqlbug.sh SUFFIXES = .sh -- cgit v1.2.1 From 49f8b5849a2250baaedaa1a7056cded16f408eaa Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Mon, 4 Mar 2002 23:16:43 +0200 Subject: Support for running different versions of mysqld with mysqld_multi --- scripts/mysqld_multi.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 656894f0e37..83d12239472 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.2"; +$VER="2.3"; $opt_config_file = undef(); $opt_example = 0; @@ -183,7 +183,7 @@ sub report_mysqlds sub start_mysqlds() { - my (@groups, $com, $i, @options, $j); + my (@groups, $com, $tmp, $i, @options, $j); if (!$opt_no_log) { @@ -202,11 +202,20 @@ sub start_mysqlds() @options = `$com`; chop @options; - $com = "$mysqld"; - for ($j = 0; defined($options[$j]); $j++) + $com= "$mysqld"; + for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { - $com.= " $options[$j]"; + if ("--mysqld=" eq substr($options[$j], 0, 9)) + { + $options[$j]=~ s/\-\-mysqld\=//; + $com= $options[$j]; + } + else + { + $tmp.= " $options[$j]"; + } } + $com.= $tmp; $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; system($com); @@ -595,6 +604,11 @@ Options: to this option also. The options are passed to mysqld. Just make sure you have mysqld in your PATH or fix mysqld_safe. Using: $mysqld + Please note: Since mysqld_multi version 2.3 you can also + give this option in groups [mysqld#]! This will be + recognized as a special option and will not be passed + to the mysqld. This will allow one to start different + mysqld versions with mysqld_multi. --no-log Print to stdout instead of the log file. By default the log file is turned on. --password=... Password for user for mysqladmin. -- cgit v1.2.1 From 539718ba25d93af7364d73ee1e8d909dc303643a Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Tue, 5 Mar 2002 15:46:30 +0200 Subject: Update scripts for new POSIX spec Fix for --enable-local-infile Portability fix for bison --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index e7418819604..3494e3d707e 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -253,7 +253,7 @@ do I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` + PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'` for T in $PROC do break -- cgit v1.2.1 From 668d09cc5c4e0c9e7c180f2dfb521244f325cf3f Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Wed, 6 Mar 2002 18:36:31 +0200 Subject: Fixed bug in DATE_FORMAT when used with GROUP BY --- scripts/mysqlhotcopy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index caf2615fe7a..b0fee84c332 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.14"; +my $VERSION = "1.15"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -562,7 +562,7 @@ 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\d/: } @$files; + my @non_raid = grep { ! m:/\d{2}/[^/]+$: } @$files; # add files to copy and the destination directory safe_system( @cp, @non_raid, $target ); -- cgit v1.2.1 From a01775c5ebf9d6a8386621f01408514f82bab1da Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 12 Mar 2002 11:38:22 +0200 Subject: 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 --- scripts/mysqlhotcopy.sh | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index b0fee84c332..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. -- cgit v1.2.1 From 8eadb024dcf60ad16c9d9246a9f8cdfeeaa501e9 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 12 Mar 2002 11:52:41 +0200 Subject: Fixed mysqldumpslow for new dump format. Fix for HEAP tables with many rows deleted. Add '' arround database names in SHOW GRANT --- scripts/mysqldumpslow.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 856c8a09b5e..e8f73c25b55 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -75,7 +75,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//; my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('',''); - s/^# Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; + s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; my ($t, $l, $r) = ($1, $2, $3); $t -= $l unless $opt{l}; @@ -96,8 +96,12 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { unless ($opt{a}) { s/\b\d+\b/N/g; s/\b0x[0-9A-Fa-f]+\b/N/g; - s/'([^\\\']|\\.|\'\')+'/'S'/g; - s/"([^\\\"]|\\.|\"\")+"/"S"/g; + s/''/'S'/g; + s/""/"S"/g; + s/(\\')//g; + s/(\\")//g; + s/'[^']+'/'S'/g; + s/"[^"]+"/"S"/g; # -n=8: turn log_20001231 into log_NNNNNNNN s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; # abbreviate massive "in (...)" statements and similar -- cgit v1.2.1 From 133651d62682e4b736d9cd5c51064dcf53cda671 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 26 Mar 2002 11:54:05 +0200 Subject: Fixed myslqdumpslow for new log format. --- scripts/mysqldumpslow.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 856c8a09b5e..e8f73c25b55 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -75,7 +75,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//; my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('',''); - s/^# Time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; + s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; my ($t, $l, $r) = ($1, $2, $3); $t -= $l unless $opt{l}; @@ -96,8 +96,12 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { unless ($opt{a}) { s/\b\d+\b/N/g; s/\b0x[0-9A-Fa-f]+\b/N/g; - s/'([^\\\']|\\.|\'\')+'/'S'/g; - s/"([^\\\"]|\\.|\"\")+"/"S"/g; + s/''/'S'/g; + s/""/"S"/g; + s/(\\')//g; + s/(\\")//g; + s/'[^']+'/'S'/g; + s/"[^"]+"/"S"/g; # -n=8: turn log_20001231 into log_NNNNNNNN s/([a-z_]+)(\d{$opt{n},})/$1.('N' x length($2))/ieg if $opt{n}; # abbreviate massive "in (...)" statements and similar -- cgit v1.2.1 From e1288e07ac54d38390619c4f71c1c17be6eac9d0 Mon Sep 17 00:00:00 2001 From: "arjen@fred.bitbike.com" <> Date: Thu, 16 May 2002 10:13:42 +1000 Subject: mysql_fix_extensions.sh tool copied from 4.0 tree (referenced in manual). --- scripts/mysql_fix_extensions.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/mysql_fix_extensions.sh (limited to 'scripts') diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh new file mode 100644 index 00000000000..fbc72406f5e --- /dev/null +++ b/scripts/mysql_fix_extensions.sh @@ -0,0 +1,16 @@ +#!@PERL@ +# This is a utility for MySQL. It is not needed by any standard part +# of MySQL. + +# Usage: mysql_fix_extentions datadir +# does not work with RAID, with InnoDB or BDB tables +# makes .frm lowercase and .MYI/MYD/ISM/ISD uppercase +# useful when datafiles are copied from windows + +die "Usage: $0 datadir\n" unless -d $ARGV[0]; + +for $a (<$ARGV[0]/*/*.*>) { $_=$a; + s/\.frm$/.frm/i; + s/\.(is[md]|my[id])$/\U$&/i; + rename ($a, $_) || warn "Cannot rename $a => $_ : $!"; +} -- cgit v1.2.1 From 1d6f0fecb8e5969419c4c1f53fabdd22d2a09de4 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Sat, 8 Jun 2002 17:39:11 +0300 Subject: Small fix for the instructional message --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f7324668bd2..850432fecc7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -317,8 +317,8 @@ then fi echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "This is done with:" - echo "$bindir/mysqladmin -u root -p password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname -p password 'new-password'" + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." # # Print message about upgrading unless we have created a new db table. -- cgit v1.2.1 From f1a975963b40567448afdfdc29a0e3d28d7d7e45 Mon Sep 17 00:00:00 2001 From: "jcole@mugatu.spaceapes.com" <> Date: Sat, 8 Jun 2002 23:10:42 -0500 Subject: Added mysql_secure_installation --- scripts/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1c3b8083347..913e62050fa 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -22,6 +22,7 @@ bin_SCRIPTS = @server_scripts@ \ mysql_fix_privilege_tables \ mysql_fix_extensions \ mysql_setpermission \ + mysql_secure_installation \ mysql_zap \ mysqlaccess \ mysqlbug \ @@ -39,6 +40,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_fix_extensions.sh \ mysql_install_db.sh \ mysql_setpermission.sh \ + mysql_secure_installation.sh \ mysql_zap.sh \ mysqlaccess.sh \ mysqlbug.sh \ @@ -65,6 +67,7 @@ CLEANFILES = @server_scripts@ \ mysql_fix_privilege_tables \ mysql_fix_extensions \ mysql_setpermission \ + mysql_secure_installation \ mysql_zap \ mysqlaccess \ mysql_convert_table_format \ -- cgit v1.2.1 From 70c05507dbd4fd8a7bcb23a9e8993d2e3f4bd340 Mon Sep 17 00:00:00 2001 From: "jcole@mugatu.spaceapes.com" <> Date: Sat, 8 Jun 2002 23:12:39 -0500 Subject: Oops, missed the actual file. Added mysql_secure_installation --- scripts/mysql_secure_installation.sh | 308 +++++++++++++++++++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 scripts/mysql_secure_installation.sh (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh new file mode 100644 index 00000000000..d6392c57731 --- /dev/null +++ b/scripts/mysql_secure_installation.sh @@ -0,0 +1,308 @@ +#!/bin/sh + +# Copyright (C) 2002 MySQL AB and Jeremy Cole +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +config=".my.cnf.$$" +command=".mysql.$$" + +trap "interrupt" 2 + +rootpass="" + +prepare() { + touch $config $command + chmod 600 $config $command +} + +do_query() { + echo $1 >$command + mysql --defaults-file=$config <$command + return $? +} + +make_config() { + echo "# mysql_secure_installation config file" >$config + echo "[mysql]" >>$config + echo "user=root" >>$config + echo "password=$rootpass" >>$config +} + +get_root_password() { + status=1 + while [ $status -eq 1 ]; do + stty -echo + echo -n "Enter current password for root (enter for none): " + read password + echo + stty echo + if [ "x$password" = "x" ]; then + hadpass=0 + else + hadpass=1 + fi + rootpass=$password + make_config + do_query "" + status=$? + done + echo "OK, successfully used password, moving on..." + echo +} + +set_root_password() { + stty -echo + echo -n "New password: " + read password1 + echo + echo -n "Re-enter new password: " + read password2 + echo + stty echo + + if [ "$password1" != "$password2" ]; then + echo "Sorry, passwords do not match." + echo + return 1 + fi + + if [ "$password1" = "" ]; then + echo "Sorry, you can't use an empty password here." + echo + return 1 + fi + + do_query "SET PASSWORD FOR root=PASSWORD('$password1');" + if [ $? -eq 0 ]; then + echo "Password updated successfully!" + echo + rootpass=$password1 + make_config + else + echo "Password update failed!" + exit 1 + fi + + return 0 +} + +remove_anonymous_users() { + do_query "DELETE FROM mysql.user WHERE User='';" + if [ $? -eq 0 ]; then + echo " ... Success!" + else + echo " ... Failed!" + exit 1 + fi + + return 0 +} + +remove_remote_root() { + do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" + if [ $? -eq 0 ]; then + echo " ... Success!" + else + echo " ... Failed!" + fi +} + +remove_test_database() { + echo " - Dropping test database..." + do_query "DROP DATABASE test;" + if [ $? -eq 0 ]; then + echo " ... Success!" + else + echo " ... Failed! Not critical, keep moving..." + fi + + echo " - Removing privileges on test database..." + do_query "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" + if [ $? -eq 0 ]; then + echo " ... Success!" + else + echo " ... Failed! Not critical, keep moving..." + fi + + return 0 +} + +reload_privilege_tables() { + do_query "FLUSH PRIVILEGES;" + if [ $? -eq 0 ]; then + echo " ... Success!" + else + echo " ... Failed!" + fi + + return 0 +} + +interrupt() { + echo + echo "Aborting!" + echo + cleanup + stty echo + exit 1 +} + +cleanup() { + echo "Cleaning up..." + rm -f $config $command +} + + +# The actual script starts here + +prepare + +echo +echo +echo +echo +echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL" +echo " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!" +echo +echo + +echo "In order to log into MySQL to secure it, we'll need the current" +echo "password for the root user. If you've just installed MySQL, and" +echo "you haven't set the root password yet, the password will be blank," +echo "so you should just press enter here." +echo + +get_root_password + + +# +# Set the root password +# + +echo "Setting the root password ensures that nobody can log into the MySQL" +echo "root user without the proper authorisation." +echo + +if [ $hadpass -eq 0 ]; then + echo -n "Set root password? [Y/n] " +else + echo "You already have a root password set, so you can safely answer 'n'." + echo + echo -n "Change the root password? [Y/n] " +fi + +read reply +if [ "$reply" = "n" ]; then + echo " ... skipping." +else + status=1 + while [ $status -eq 1 ]; do + set_root_password + status=$? + done +fi +echo + + +# +# Remove anonymous users +# + +echo "By default, a MySQL installation has an anonymous user, allowing anyone" +echo "to log into MySQL without having to have a user account created for" +echo "them. This is intended only for testing, and to make the installation" +echo "go a bit smoother. You should remove them before moving into a" +echo "production environment." +echo + +echo -n "Remove anonymous users? [Y/n] " + +read reply +if [ "$reply" = "n" ]; then + echo " ... skipping." +else + remove_anonymous_users +fi +echo + + +# +# Disallow remote root login +# + +echo "Normally, root should only be allowed to connect from 'localhost'. This" +echo "ensures that someone cannot guess at the root password from the network." +echo + +echo -n "Disallow root login remotely? [Y/n] " +read reply +if [ "$reply" = "n" ]; then + echo " ... skipping." +else + remove_remote_root +fi +echo + + +# +# Remove test database +# + +echo "By default, MySQL comes with a database named 'test' that anyone can" +echo "access. This is also intended only for testing, and should be removed" +echo "before moving into a production environment." +echo + +echo -n "Remove test database and access to it? [Y/n] " +read reply +if [ "$reply" = "n" ]; then + echo " ... skipping." +else + remove_test_database +fi +echo + + +# +# Reload privilege tables +# + +echo "Reloading the privilege tables will ensure that all changes made so far" +echo "will take effect immediately." +echo + +echo -n "Reload privilege tables now? [Y/n] " +read reply +if [ "$reply" = "n" ]; then + echo " ... skipping." +else + reload_privilege_tables +fi +echo + +cleanup + +echo +echo +echo +echo "All done! If you've completed all of the above steps, your MySQL" +echo "installation should now be secure." +echo +echo "Thanks for using MySQL!" +echo +echo + + -- cgit v1.2.1 From b8421d34ec13d626bb29a2f39021e226bf9ff74e Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Wed, 12 Jun 2002 15:04:18 +0300 Subject: Added the following new privleges: SHOW DATABASES CREATE TEMPORARY TABLE LOCK TABLES REPLICATION SLAVE & REPLICATION CLIENT SUPER EXECUTE All scripts & documentation is updated for this change. Added better error messages for global privileges --- scripts/mysql_fix_privilege_tables.sh | 70 ++++++++++++++++++++++++++----- scripts/mysql_install_db.sh | 25 +++++++---- scripts/mysql_new_fix_privilege_tables.sh | 25 ----------- 3 files changed, 75 insertions(+), 45 deletions(-) delete mode 100644 scripts/mysql_new_fix_privilege_tables.sh (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 7226840b475..ead0350093a 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -12,6 +12,17 @@ echo "and give the MySQL root user password as a argument!" root_password="$1" host="localhost" +echo "Converting all privilege tables to MyISAM format" +@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < columns_priv.Column_priv" -echo "You can ignore any errors from this" +echo "You can ignore any Unknown column errors from this" @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Sun, 16 Jun 2002 17:06:12 +0300 Subject: Cleanup of checking of user resources Added missing checking of no_keyread --- scripts/mysql_fix_privilege_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index ead0350093a..7fc18aa1e2f 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -151,7 +151,7 @@ add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, add Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, add Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, -add Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv +add Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; END_OF_DATA if test $? -eq "0" @@ -160,7 +160,7 @@ then echo "" echo "Updating new privileges in MySQL 4.0.2 from old ones" @bindir@/mysql --user=root --password="$root_password" --host="$host" mysql < Date: Thu, 27 Jun 2002 11:27:04 +0300 Subject: Removed mysql_ssl_clear() Added statistics information for alarms (for bug tracking) Don't store "incomplete" in the xxx.cfg file if we are not using --restart. (Crash-me) Enlarged STACK_BUF_ALLOC becasue of failed crash-me test Aded new script mysql_tableinfo to make a system directory. --- scripts/Makefile.am | 2 + scripts/mysql_tableinfo.sh | 478 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 480 insertions(+) create mode 100644 scripts/mysql_tableinfo.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 913e62050fa..1469f3f2f2d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -31,6 +31,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysql_explain_log \ + mysql_tableinfo \ mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ @@ -50,6 +51,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqldumpslow.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ + mysql_tableinfo.sh \ mysqld_safe.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh new file mode 100644 index 00000000000..bfe9be377c7 --- /dev/null +++ b/scripts/mysql_tableinfo.sh @@ -0,0 +1,478 @@ +#!@PERL@ -w + +use strict; +use Getopt::Long; +use DBI; + +=head1 NAME + +mysql_tableinfo - creates and populates information tables with +the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), +SHOW COLUMNS and SHOW INDEX. + +This is version 1.0. + +=head1 SYNOPSIS + + mysql_tableinfo [OPTIONS] database_to_write [database_like_wild] [table_like_wild] + + Do not backquote (``) database_to_write, + and do not quote ('') database_like_wild or table_like_wild + + Examples: + + mysql_tableinfo info + + mysql_tableinfo info this_db + + mysql_tableinfo info %a% b% + + mysql_tableinfo info --clear-only + + mysql_tableinfo info --col --idx --table-status + +=cut + +# Documentation continued at end of file + + +sub usage { + die @_,"\nExecute 'perldoc $0' for documentation\n"; +} + +my %opt = ( + 'user' => scalar getpwuid($>), + 'host' => "localhost", + 'prefix' => "", #to avoid 'use of uninitialized value...' +); +Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P +GetOptions( \%opt, + "help", + "user|u=s", + "password|p=s", + "host|h=s", + "port|P=s", + "socket|S=s", + "tbl-status", + "col", + "idx", + "clear", + "clear-only", + "prefix=s", + "quiet|q", +) or usage("Invalid option"); + +if ($opt{help}) {usage();} + +my ($db_to_write,$db_like_wild,$tbl_like_wild); +if (@ARGV==0) +{ + usage("Not enough arguments"); +} +$db_to_write="`$ARGV[0]`"; shift @ARGV; +$db_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; +$tbl_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; +if (@ARGV>0) { usage("Too many arguments"); } + +my $info_db="`".$opt{'prefix'}."db`"; +my $info_tbl="`".$opt{'prefix'}."tbl". + (($opt{'tbl-status'})?"_status":"")."`"; +my $info_col="`".$opt{'prefix'}."col`"; +my $info_idx="`".$opt{'prefix'}."idx`"; + + +# --- connect to the database --- + +my $dsn = ";host=$opt{'host'}"; +$dsn .= ";port=$opt{port}" if $opt{port}; +$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; + +my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=perl", + $opt{user}, $opt{password}, +{ + RaiseError => 1, + PrintError => 0, + AutoCommit => 1, +}); + +$db_like_wild=$dbh->quote($db_like_wild); +$tbl_like_wild=$dbh->quote($tbl_like_wild); + +#Ask + +if (!$opt{'quiet'}) +{ + print "\n!! This program is doing to do:\n\n"; + print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); + print "**DELETE** FROM ... WHERE `Database LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild +**INSERT** INTO ... + +on the following tables :\n"; + my $i; + foreach $i (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) + { + print(" $db_to_write.$i\n"); + } + print "\nContinue (you can skip this confirmation step with --quiet) ? (y|n) [n]"; + my $answer=; + unless ($answer =~ /^\s*y\s*$/i) + { + print "Nothing done!\n";exit; + } +} + +if ($opt{'clear'} or $opt{'clear-only'}) +{ +#do not drop the $db_to_write database ! + my $i; + foreach $i (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) + { + $dbh->do("DROP TABLE IF EXISTS $db_to_write.$i"); + } + if ($opt{'clear-only'}) + { + print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); + exit(); + } +} + + +my %sth; +my %extra_col_desc; +my %row; +my %done_create_table; + +#create the $db_to_write database +$dbh->do("CREATE DATABASE IF NOT EXISTS $db_to_write"); +$dbh->do("USE $db_to_write"); + +#get databases +$sth{db}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); +$sth{db}->execute; + +#create $info_db which will receive info about databases. +#Ensure that the first column to be called "Database" (as SHOW DATABASES LIKE +#returns a varying +#column name (of the form "Database (%...)") which is not suitable) +$extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`"); +#we'll remember the type of the `Database` column (as returned by +#SHOW DATABASES), which we will need when creating the next tables. + +#clear out-of-date info from this table +$dbh->do("DELETE FROM $info_db WHERE `Database` LIKE $db_like_wild"); + + +while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases +{ + +#insert the database name + $dbh->do("INSERT INTO $info_db VALUES(" + .join_quote(@{$row{db}}).")"); + +#for each database, get tables + + $sth{tbl}=$dbh->prepare("SHOW TABLE" + .( ($opt{'tbl-status'}) ? + " STATUS" + : "S" ) + ." from `${$row{db}}[0]` LIKE $tbl_like_wild"); + $sth{tbl}->execute; + unless ($done_create_table{$info_tbl}) + +#tables must be created only once, and out-of-date info must be +#cleared once + { + $done_create_table{$info_tbl}=1; + $extra_col_desc{table}= + do_create_table("tbl",$info_tbl, +#add an extra column (database name) at the left +#and ensure that the table name will be called "Table" +#(this is unncessesary with +#SHOW TABLE STATUS, but necessary with SHOW TABLES (which returns a column +#named "Tables_in_...")) + "`Database` ".$extra_col_desc{db},"`Table`"); + $dbh->do("DELETE FROM $info_tbl WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); + } + + while (@{$row{tbl}}=$sth{tbl}->fetchrow_array) + { + $dbh->do("INSERT INTO $info_tbl VALUES(" + .$dbh->quote(${$row{db}}[0]).",".join_quote(@{$row{tbl}}).")"); + +#for each table, get columns... + + if ($opt{'col'}) + { + $sth{col}=$dbh->prepare("SHOW COLUMNS FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); + $sth{col}->execute; + unless ($done_create_table{$info_col}) + { + $done_create_table{$info_col}=1; + do_create_table("col",$info_col, + "`Database` ".$extra_col_desc{db}."," + ."`Table` ".$extra_col_desc{table}."," + ."`Seq_in_table` BIGINT(3)"); +#We need to add a sequence number (1 for the first column of the table, +#2 for the second etc) so that users are able to retrieve columns in order +#if they want. This is not needed for INDEX +#(where there is already Seq_in_index) + $dbh->do("DELETE FROM $info_col WHERE `Database` + LIKE $db_like_wild + AND `Table` LIKE $tbl_like_wild"); + } + my $col_number=0; + while (@{$row{col}}=$sth{col}->fetchrow_array) + { + $dbh->do("INSERT INTO $info_col VALUES(" + .$dbh->quote(${$row{db}}[0])."," + .$dbh->quote(${$row{tbl}}[0])."," + .++$col_number."," + .join_quote(@{$row{col}}).")"); + } + } + +#and get index. + + if ($opt{'idx'}) + { + $sth{idx}=$dbh->prepare("SHOW INDEX FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); + $sth{idx}->execute; + unless ($done_create_table{$info_idx}) + { + $done_create_table{$info_idx}=1; + do_create_table("idx",$info_idx, + "`Database` ".$extra_col_desc{db}); + $dbh->do("DELETE FROM $info_idx WHERE `Database` + LIKE $db_like_wild + AND `Table` LIKE $tbl_like_wild"); + } + while (@{$row{idx}}=$sth{idx}->fetchrow_array) + { + $dbh->do("INSERT INTO $info_idx VALUES(" + .$dbh->quote(${$row{db}}[0])."," + .join_quote(@{$row{idx}}).")"); + } + } + } +} + +print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); +exit; + +sub join_quote +{ + my (@list)=@_; my $i; + foreach $i (@list) { $i=$dbh->quote($i); } + return (join ',',@list); +} + +sub do_create_table +{ + my ($sth_key,$target_tbl,$extra_col_desc,$first_col_name)=@_; + my $create_table_query=$extra_col_desc; + my ($i,$type,$first_col_desc,$col_desc); + + for ($i=0;$i<$sth{$sth_key}->{NUM_OF_FIELDS};$i++) + { + if ($create_table_query) { $create_table_query.=", "; } + $type=$sth{$sth_key}->{mysql_type_name}->[$i]; + $col_desc=$type; + if ($type =~ /char|int/i) + { + $col_desc.="($sth{$sth_key}->{PRECISION}->[$i])"; + } + elsif ($type =~ /decimal|numeric/i) #(never seen that) + { + $col_desc.= + "($sth{$sth_key}->{PRECISION}->[$i],$sth{$sth_key}->{SCALE}->[$i])"; + } + elsif ($type !~ /date/i) #date and datetime are OK, + #no precision or scale for them + { + warn "unexpected column type '$type' +(neither 'char','int','decimal|numeric') +when creating $target_tbl, hope table creation will go OK\n"; + } + if ($i==0) {$first_col_desc=$col_desc}; + $create_table_query.= + ( ($i==0 and $first_col_name) ? + "$first_col_name " :"`$sth{$sth_key}->{NAME}->[$i]` " ) + .$col_desc; + } +if ($create_table_query) +{ + $dbh->do("CREATE TABLE IF NOT EXISTS $target_tbl ($create_table_query)"); +} +return $first_col_desc; +} + +__END__ + + +=head1 DESCRIPTION + +mysql_tableinfo asks a MySQL server information about its +databases, tables, table columns and index, and stores this +in tables called `db`, `tbl` (or `tbl_status`), `col`, `idx` +(with an optional prefix specified with --prefix). +After that, you can query these information tables, for example +to build your admin scripts with SQL queries, like + +SELECT CONCAT("CHECK TABLE ",`database`,".",`table`," EXTENDED;") +FROM info.tbl WHERE ... ; + +as people usually do with some other RDBMS +(note: to increase the speed of your queries on the info tables, +you may add some index on them). + +The database_like_wild and table_like_wild instructs the program +to gather information only about databases and tables +whose names match these patterns. If the info +tables already exist, their rows matching the patterns are simply +deleted and replaced by the new ones. That is, +old rows not matching the patterns are not touched. +If the database_like_wild and table_like_wild arguments +are not specified on the command-line they default to "%". + +The program : + +- does CREATE DATABASE IF NOT EXISTS database_to_write +where database_to_write is the database name specified on the command-line. + +- does CREATE TABLE IF NOT EXISTS database_to_write.`db` + +- fills database_to_write.`db` with the output of +SHOW DATABASES LIKE database_like_wild + +- does CREATE TABLE IF NOT EXISTS database_to_write.`tbl` +(respectively database_to_write.`tbl_status` +if the --tbl-status option is on) + +- for every found database, +fills database_to_write.`tbl` (respectively database_to_write.`tbl_status`) +with the output of +SHOW TABLES FROM found_db LIKE table_like_wild +(respectively SHOW TABLE STATUS FROM found_db LIKE table_like_wild) + +- if the --col option is on, + * does CREATE TABLE IF NOT EXISTS database_to_write.`col` + * for every found table, + fills database_to_write.`col` with the output of + SHOW COLUMNS FROM found_tbl FROM found_db + +- if the --idx option is on, + * does CREATE TABLE IF NOT EXISTS database_to_write.`idx` + * for every found table, + fills database_to_write.`idx` with the output of + SHOW INDEX FROM found_tbl FROM found_db + +Some options may modify this general scheme (see below). + +As mentioned, the contents of the info tables are the output of +SHOW commands. In fact the contents are slightly more complete : + +- the `tbl` (or `tbl_status`) info table + has an extra column which contains the database name, + +- the `col` info table + has an extra column which contains the table name, + and an extra column which contains, for each described column, + the number of this column in the table owning it (this extra column + is called `Seq_in_table`). `Seq_in_table` makes it possible for you + to retrieve your columns in sorted order, when you are querying + the `col` table. + +- the `index` info table + has an extra column which contains the database name. + +Caution: info tables contain certain columns (e.g. +Database, Table, Null...) whose names, as they are MySQL reserved words, +need to be backquoted (`...`) when used in SQL statements. + +=head1 OPTIONS + +=over 4 + +=item --clear + +Does DROP TABLE on the info tables (only those that the program is +going to fill, for example if you do not use --col it won't drop +the `col` table) and processes normally. Does not drop database_to_write. + +=item --clear-only + +Same as --clear but exits after the DROPs. + +=item --col + +Adds columns information (into table `col`). + +=item --idx + +Adds index information (into table `idx`). + +=item --prefix prefix + +The info tables are named from the concatenation of prefix and, +respectively, db, tbl (or tbl_status), col, idx. Do not quote ('') +or backquote (``) prefix. + +=item -q, --quiet + +Does not warn you about what the script is going to do (DROP TABLE etc) +and does not ask for a confirmation before starting. + +=item --tbl-status + +Instead of using SHOW TABLES, uses SHOW TABLE STATUS +(much more complete information, but slower). + +=item --help + +Display helpscreen and exit + +=item -u, --user=# + +user for database login if not current user. Give a user +who has sufficient privileges (CREATE, ...). + +=item -p, --password=# + +password to use when connecting to server + +=item -h, --host=# + +host to connect to + +=item -P, --port=# + +port to use when connecting to server + +=item -S, --socket=# + +UNIX domain socket to use when connecting to server + +=head1 WARRANTY + +This software is free and comes without warranty of any kind. You +should never trust backup software without studying the code yourself. +Study the code inside this script and only rely on it if I believe +that it does the right thing for you. + +Patches adding bug fixes, documentation and new features are welcome. + +=head1 TO DO + +Use extended inserts to be faster (for servers with many databases +or tables). But to do that, must care about net-buffer-length. + +=head1 AUTHOR + +2002-06-18 Guilhem Bichot (guilhem.bichot@mines-paris.org) + +And all the authors of mysqlhotcopy, which served as a model for +the structure of the program. -- cgit v1.2.1 From 8b898167e41a58f5742213db9c068011e7aece49 Mon Sep 17 00:00:00 2001 From: "arjen@fred.bitbike.com" <> Date: Sun, 14 Jul 2002 14:49:44 +1000 Subject: Little typo fix in script text. --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 7fc18aa1e2f..a492066235b 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -140,7 +140,7 @@ echo "" # Change the user table to MySQL 4.0 format # -echo "Adding new fields used by MySQL 4.02 to the privilege tables" +echo "Adding new fields used by MySQL 4.0.2 to the privilege tables" echo "You can ignore any Duplicate column errors" @bindir@/mysql --user=root --password="$root_password" --host="$host" mysql < Date: Sat, 3 Aug 2002 19:02:05 +0300 Subject: Two small patches proposed by Paul DuBois --- scripts/mysqlhotcopy.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 45f1f1ed24a..707b4fc481c 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -156,6 +156,7 @@ $opt{allowold} = 1 if $opt{keepold}; # --- connect to the database --- my $dsn = ";host=localhost"; +$dsn = ";host=127.0.0.1" if $opt{port}; # use TCP/IP if port was given $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; -- cgit v1.2.1 From de7b601d11daf76fa65e976af72ce63c5cd34a3c Mon Sep 17 00:00:00 2001 From: "salle@geopard.online.bg" <> Date: Sat, 3 Aug 2002 19:48:45 +0300 Subject: Two small patches proposed by Paul DuBois --- scripts/mysqlhotcopy.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 45f1f1ed24a..707b4fc481c 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -156,6 +156,7 @@ $opt{allowold} = 1 if $opt{keepold}; # --- connect to the database --- my $dsn = ";host=localhost"; +$dsn = ";host=127.0.0.1" if $opt{port}; # use TCP/IP if port was given $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; -- cgit v1.2.1 From 7a9e780a7731a5778368a3ee3a93fc3eca0eefe4 Mon Sep 17 00:00:00 2001 From: "jani@hynda.(none)" <> Date: Mon, 5 Aug 2002 19:06:48 +0300 Subject: Made documentation better in mysqld_multi --help --- scripts/mysqld_multi.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 83d12239472..1366a9ea713 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -605,10 +605,11 @@ Options: make sure you have mysqld in your PATH or fix mysqld_safe. Using: $mysqld Please note: Since mysqld_multi version 2.3 you can also - give this option in groups [mysqld#]! This will be - recognized as a special option and will not be passed - to the mysqld. This will allow one to start different - mysqld versions with mysqld_multi. + give this option inside groups [mysqld#] in ~/.my.cnf, + where '#' stands for an integer (number) of the group in + question. This will be recognized as a special option and + will not be passed to the mysqld. This will allow one to + start different mysqld versions with mysqld_multi. --no-log Print to stdout instead of the log file. By default the log file is turned on. --password=... Password for user for mysqladmin. -- cgit v1.2.1 From 4e5b087172c16cfd697c351357c2c965dbdf9f75 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Tue, 6 Aug 2002 16:12:52 +0300 Subject: Better error messages for mysql-test-run Added option --host to mysqlhotcopy --- scripts/mysqlhotcopy.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 707b4fc481c..1aad5c95c25 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -50,7 +50,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user -p, --password=# password to use when connecting to server - -P, --port=# port to use when connecting to local server + -h, --host=# Hostname for local server when connecting over TCP/IP + -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server --allowold don\'t abort if target already exists (rename it _old) @@ -155,8 +156,8 @@ $opt{quiet} = 0 if $opt{debug}; $opt{allowold} = 1 if $opt{keepold}; # --- connect to the database --- -my $dsn = ";host=localhost"; -$dsn = ";host=127.0.0.1" if $opt{port}; # use TCP/IP if port was given +my $dsn; +$dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost"); $dsn .= ";port=$opt{port}" if $opt{port}; $dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; @@ -891,9 +892,15 @@ user for database login if not current user password to use when connecting to server +=item -h, -h, --host=# + +Hostname for local server when connecting over TCP/IP. By specifying this +different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection. + =item -P, --port=# -port to use when connecting to local server +port to use when connecting to MySQL server with TCP/IP. This is only used +when using the --host option. =item -S, --socket=# -- cgit v1.2.1 From 8832927d5c843084664e4ec861f5ebb82d424ed8 Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Thu, 8 Aug 2002 20:49:06 +0300 Subject: Added nety_retry_count as a changeable variable Make safe_mysqld a symlink to mysqld_safe in binary distribution Fixed problem with CTRL-C when using mysqld --bootstrap --- scripts/make_binary_distribution.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 44dc9d44322..6e66a0b977c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -123,6 +123,10 @@ $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe +# Make safe_mysqld a symlink to mysqld_safe for backwards portability +# To be removed in MySQL 4.1 +(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) + mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure $CP -r sql-bench/* $BASE/sql-bench -- cgit v1.2.1 From 37cedc9a43270a59f3df9cc2aa81945158096367 Mon Sep 17 00:00:00 2001 From: "bar@bar.mysql.r18.ru" <> Date: Wed, 14 Aug 2002 13:05:38 +0500 Subject: Fix --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 6a31db9a2b3..3cc5b3a5016 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -112,7 +112,7 @@ while test $# -gt 0; do --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; - --embedded-libs | --embedded | libmysqld-libs) echo "$embedded_libs" ;; + --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; *) usage ;; esac -- cgit v1.2.1 From c7499a1039d89af3df63620841cafe4cdc034f0c Mon Sep 17 00:00:00 2001 From: "monty@hundin.mysql.fi" <> Date: Fri, 23 Aug 2002 02:48:52 +0300 Subject: Portabilityfix in mysqladmin.c Fix when using --localstatedir Cleaned up mysql.server --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6e66a0b977c..2617a7971dc 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -120,7 +120,7 @@ $CP scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db -$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server +$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe # Make safe_mysqld a symlink to mysqld_safe for backwards portability @@ -128,7 +128,7 @@ $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) mv $BASE/support-files/binary-configure $BASE/configure -chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure +chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la -- cgit v1.2.1 From 04723cf74d49e8daaf35ced5bf1048685fa337e1 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Sat, 24 Aug 2002 05:44:16 +0300 Subject: Give better error from reconnect() Fixed hang in start_slave_threads() when thread dies quickly. --- scripts/mysql_zap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index 312d15e34d6..f485d164282 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -12,7 +12,7 @@ $opt_f= 0; $opt_t= 0; $opt_a = ""; -$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; +$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin'; $LINUX = $^O eq 'linux'; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; -- cgit v1.2.1 From c85c33a5c1f56263053f5f372d4526cf9962cf94 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Mon, 16 Sep 2002 15:55:19 +0300 Subject: Added CREATE TEMPORARY TABLES and LOCK TABLES to db and host tables Fixed bug in SELECT ... ORDER BY ... LIMIT Fixed bug in ALTER TABLE and RENAME TABLE with --lower-case-table-names Fixed hang when using --with-openssl --- scripts/mysql_fix_privilege_tables.sh | 15 ++++++++++++++- scripts/mysql_install_db.sh | 8 ++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index a492066235b..74e00e2c75a 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -137,7 +137,7 @@ EOF echo "" # -# Change the user table to MySQL 4.0 format +# Change the user,db and host tables to MySQL 4.0 format # echo "Adding new fields used by MySQL 4.0.2 to the privilege tables" @@ -174,3 +174,16 @@ add max_questions int(11) NOT NULL AFTER x509_subject, add max_updates int(11) unsigned NOT NULL AFTER max_questions, add max_connections int(11) unsigned NOT NULL AFTER max_updates; END_OF_DATA + +# +# Add Create_tmp_table_priv and Lock_tables_priv to db and host +# + +@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql < Date: Tue, 17 Sep 2002 23:46:53 +0300 Subject: fixed so that --ssl and --skip-ssl works with the MySQL clients. Fixed core dump bug when sending wrong string to AES_DECRYPT() --- scripts/explain_log.sh | 383 ------------------------------------------- scripts/mysql_explain_log.sh | 2 +- 2 files changed, 1 insertion(+), 384 deletions(-) delete mode 100644 scripts/explain_log.sh (limited to 'scripts') diff --git a/scripts/explain_log.sh b/scripts/explain_log.sh deleted file mode 100644 index c4a4ef21568..00000000000 --- a/scripts/explain_log.sh +++ /dev/null @@ -1,383 +0,0 @@ -#!@PERL@ -w -use strict; -use DBI; - -use Getopt::Long; -$Getopt::Long::ignorecase=0; - -print "explain_log provided by http://www.mobile.de\n"; -print "=========== ================================\n"; - -my $Param={}; - -$Param->{host}=''; -$Param->{user}=''; -$Param->{password}=''; -$Param->{PrintError}=0; - -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}, - )) { - ShowOptions(); -} -else { - $Param->{UpdateCount} = 0; - $Param->{SelectCount} = 0; - $Param->{IdxUseCount} = 0; - $Param->{LineCount} = 0; - - $Param->{Init} = 0; - $Param->{Field} = 0; - $Param->{Refresh} = 0; - $Param->{QueryCount} = 0; - $Param->{Statistics} =0; - - $Param->{Query} = undef; - $Param->{ALL} = undef ; - $Param->{Comment} = undef ; - - @{$Param->{Rows}} = (qw|possible_keys key type|); - - if ($Param->{ViewDate}) { - $Param->{View} = 0; - } - else { - $Param->{View} = 1; - } - - #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}); - if (DBI::err()) { - print "Error: " . DBI::errstr() . "\n"; - } - else { - $Param->{Start} = time; - while() { - $Param->{LineCount} ++ ; - - if ($Param->{ViewDate} ) { - if (m/^(\d{6})\s+\d{1,2}:\d\d:\d\d\s.*$/) { # get date - #print "# $1 #\n"; - if ($1 == $Param->{ViewDate}) { - $Param->{View} = 1; - } - else { - $Param->{View} = 0; - } - } - } - if ($Param->{View} ) { - #print "->>>$_"; - - if (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+$/i) { # get connection ID($2) and database($3) - #print "\n <<<<<<<<<<<<<<<<<<----------------------------<<<<<<<<<<<<<<<< \n"; - #print "Connect \n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Change user .*\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Quit\s+$/i) { # remove connection ID($2) and querystring - #print "Q-$1--$2--------\n"; - RunQuery($Param); - delete $Param->{CID}->{$2} ; - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(select.+)$/i) { # get connection ID($2) and querystring - #print "S1-$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $s = "$3"; - $s =~ s/from\s/from $Param->{DB}./i; - $Param->{Query}="EXPLAIN $s"; - - #$s =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - #print "-- $Param->{tab} -- $s --\n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(update.+)$/i) { # get connection ID($2) and querystring - #print "S2--$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $ud = $3; - $ud =~ m/^update\s+(\w+).+(where.+)$/i; - $Param->{Query} ="EXPLAIN SELECT * FROM $1 $2"; - $Param->{Query} =~ s/from\s/from $Param->{DB}./i; - - #$Param->{Query} =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Statistics\s+(.*)$/i) { # get connection ID($2) and info? - $Param->{Statistics} ++; - #print "Statistics--$1--$2--$3------\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(.+)$/i) { # get connection ID($2) - $Param->{QueryCount} ++; - #print "Query-NULL $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Refresh\s+(.+)$/i) { # get connection ID($2) - $Param->{Refresh} ++; - #print "Refresh\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Init\s+(.+)$/i) { # get connection ID($2) - $Param->{Init} ++; - #print "Init $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Field\s+(.+)$/i) { # get connection ID($2) - $Param->{Field} ++; - #print "Field $3\n"; - RunQuery($Param); - } - - elsif (m/^\s+(.+)$/ ) { # command could be some lines ... - #print "multi-lined ($1)\n"; - my ($A)=$1; - chomp $A; - $Param->{Query} .= " $1"; - #print "multi-lined ($1)<<$Param->{Query}>>\n"; - } - - - } - - } - - $Param->{dbh}->disconnect(); - - if (1 == 0) { - print "\nunclosed handles----------------------------------------\n"; - my $count=0; - foreach (sort keys %{$Param->{CID}}) { - print "$count | $_ : $Param->{CID}->{$_} \n"; - $count ++; - } - } - - print "\nIndex usage ------------------------------------\n"; - foreach my $t (sort keys %{$Param->{Data}}) { - print "\nTable\t$t: ---\n"; - foreach my $k (sort keys %{$Param->{Data}->{$t}}) { - print " count\t$k:\n"; - my %h = %{$Param->{Data}->{$t}->{$k}}; - foreach (sort {$h{$a} <=> $h{$b}} keys %h) { - print " $Param->{Data}->{$t}->{$k}->{$_}\t$_\n"; - } - } - } - - $Param->{AllCount}=0; - print "\nQueries causing table scans -------------------\n\n"; - foreach (@{$Param->{ALL}}) { - $Param->{AllCount} ++; - print "$_\n"; - } - print "Sum: $Param->{AllCount} table scans\n"; - - print "\nSummary ---------------------------------------\n\n"; - print "Select: \t$Param->{SelectCount} queries\n"; - print "Update: \t$Param->{UpdateCount} queries\n"; - print "\n"; - - print "Init: \t$Param->{Init} times\n"; - print "Field: \t$Param->{Field} times\n"; - print "Refresh: \t$Param->{Refresh} times\n"; - print "Query: \t$Param->{QueryCount} times\n"; - print "Statistics:\t$Param->{Statistics} times\n"; - print "\n"; - - print "Logfile: \t$Param->{LineCount} lines\n"; - print "Started: \t".localtime($Param->{Start})."\n"; - print "Finished: \t".localtime(time)."\n"; - - } -} - - -########################################################################### -# -# -# -sub RunQuery { - my $Param = shift ; - - if (defined $Param->{Query}) { - if (defined $Param->{DB} ) { - - $Param->{Query} =~ m/from\s+(\w+[.]\w+|\w+)/i; - $Param->{tab} =$1; - #print "||$Param->{tab} -- $Param->{Query}\n"; - - my $sth=$Param->{dbh}->prepare("USE $Param->{DB}"); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->finish(); - - $sth=$Param->{dbh}->prepare($Param->{Query}); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - #print "$Param->{Query}\n"; - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "[$Param->{LineCount}]<<$Param->{Query}>>\n";} - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - my $row = undef; - while ($row = $sth->fetchrow_hashref()) { - $Param->{SelectCount} ++; - - if (defined $row->{Comment}) { - push (@{$Param->{Comment}}, "$row->{Comment}; $_; $Param->{DB}; $Param->{Query}"); - } - foreach (@{$Param->{Rows}}) { - if (defined $row->{$_}) { - #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { - if ($row->{type} eq 'ALL') { - push (@{$Param->{ALL}}, "$Param->{Query}"); - #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; - } - $Param->{IdxUseCount} ++; - $Param->{Data}->{$Param->{tab}}->{$_}->{$row->{$_}} ++; - } - } - } - } - } - } - } - $sth->finish(); - } - $Param->{Query} = undef ; - } -} - -########################################################################### -# -# -# -sub ShowOptions { - print <, http://www.mobile.de - -=head1 RECRUITING - -If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de -and send me an email with your resume (you must be speaking German!). - -=head1 SEE ALSO - -mysql documentation - -=cut diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index d7f6bb97b40..c4a4ef21568 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -279,7 +279,7 @@ sub RunQuery { if (defined $row->{$_}) { #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { if ($row->{type} eq 'ALL') { - push (@{$Param->{ALL}}, "$row->{$_} $_ $Param->{DB} $Param->{Query}"); + push (@{$Param->{ALL}}, "$Param->{Query}"); #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; } $Param->{IdxUseCount} ++; -- cgit v1.2.1 From 9c123d0c0b8637a91a1af87e93cc0b2428f3e9a7 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Sun, 22 Sep 2002 18:02:39 +0300 Subject: Don't give the anonymous user create temp table or lock tables privileges. SET PASSWORD=... closed connection on error. --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 74e00e2c75a..247e3399b8b 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -160,7 +160,7 @@ then echo "" echo "Updating new privileges in MySQL 4.0.2 from old ones" @bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <""; END_OF_DATA echo "" fi -- cgit v1.2.1 From bf5b57ad2b6ccb016b1d2d5d360262755b511598 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 2 Oct 2002 12:56:16 +0200 Subject: - small modification to scripts/make_binary_distribution.sh (add the up-to-date BK changelog instead of sql/ChangeLog, add LICENSE if available) --- scripts/make_binary_distribution.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2617a7971dc..e5d7f20c6df 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,10 +54,13 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ chmod o-rwx $BASE/data $BASE/data/* -for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - Docs/manual.html Docs/manual.txt Docs/manual_toc.html +for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + LICENSE Docs/manual.html Docs/manual.txt Docs/manual_toc.html do - $CP $i $BASE + if [ -f $i ] + then + $CP $i $BASE + fi done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ -- cgit v1.2.1 From a15eafd0a0fbf5a150ae6fef3cf677aac08f0a8e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 2 Oct 2002 13:06:04 +0200 Subject: - Small fix for support-files/mysql.spec.sh - Updated scripts/make_binary_distribution.sh to include the correct ChangeLog and the LICENSE file for non-GPL builds --- scripts/make_binary_distribution.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 99eb9e42967..c67de656600 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,10 +54,13 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ chmod o-rwx $BASE/data $BASE/data/* -for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - Docs/manual.html Docs/manual.txt Docs/manual_toc.html +for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + LICENSE Docs/manual.html Docs/manual.txt Docs/manual_toc.html do - $CP $i $BASE + if [ -f $i ] + then + $CP $i $BASE + fi done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ -- cgit v1.2.1 From d2ef2ec9c8e4a678cba395f3523d73d39c72f27e Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Sat, 5 Oct 2002 15:45:24 +0300 Subject: a small fix for some shells --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e6ecbf6f729..840b937519a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -307,8 +307,8 @@ do done fi - echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log + echo "`date +'%y%m%d %H:%M:%S' mysqld restarted" | tee -a $err_log done -echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log +echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log echo "" | tee -a $err_log -- cgit v1.2.1 From 57815006c73cdc9b09704819c1841ab28c7ee064 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Sat, 5 Oct 2002 15:57:18 +0300 Subject: Small fix in mysqld_safe for some shells --- scripts/safe_mysqld.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 3494e3d707e..177a809ff36 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -269,8 +269,8 @@ do done fi - echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log + echo "`date +'%y%m%d %H:%M:%S' mysqld restarted" | tee -a $err_log done -echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log +echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log echo "" | tee -a $err_log -- cgit v1.2.1 From 690cba1a6fd8d084ae3880de55bd0d11d4e49c41 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Mon, 7 Oct 2002 15:07:45 +0300 Subject: fix for a small typo in the last push --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 177a809ff36..2b625dbdfa3 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -269,7 +269,7 @@ do done fi - echo "`date +'%y%m%d %H:%M:%S' mysqld restarted" | tee -a $err_log + echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log done echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log -- cgit v1.2.1 From c3bda04595401d0a9870417befdc4ae4bd52ceb2 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Mon, 7 Oct 2002 15:17:41 +0300 Subject: a fix for the typo in the last push --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 840b937519a..9dea2eb3935 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -307,7 +307,7 @@ do done fi - echo "`date +'%y%m%d %H:%M:%S' mysqld restarted" | tee -a $err_log + echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log done echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log -- cgit v1.2.1 From bae4af8a4f41a78c5628bcf7b9cf2cc6752849ff Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 8 Oct 2002 17:58:43 +0300 Subject: Fixed missing table_list->name -> table_list->alias convert --- scripts/mysqlhotcopy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 1aad5c95c25..d808ffdcaef 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.16"; +my $VERSION = "1.17"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -388,6 +388,8 @@ foreach my $rdb ( @db_desc ) { foreach my $td ( '', @{$rdb->{raid_dirs}} ) { my $tgt_dirpath = "$rdb->{target}/$td"; + # Remove trailing slashes (needed for Mac OS X) + substr($tgt_dirpath, 1) =~ s|/+$||; if ( $opt{dryrun} ) { print "mkdir $tgt_dirpath, 0750\n"; } @@ -1001,3 +1003,5 @@ 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. + +Paul DuBois - Remove end '/' from directory names -- cgit v1.2.1 From d8f843a779f5959a405d6378143804f4f5f4743c Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Sun, 13 Oct 2002 16:26:28 +0200 Subject: - Tagged ChangeSet 1.1224 as "mysql-3.23.53" - bumped up version number to 3.23.54 in configure.in - replaced Docs/LICENSE with Docs/MySQLEULA.txt and modified scripts/make_binary_distribution.sh and Build-tools/mysql-copyright* accordingly. --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c67de656600..bde77713d63 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -55,7 +55,7 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ chmod o-rwx $BASE/data $BASE/data/* for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - LICENSE Docs/manual.html Docs/manual.txt Docs/manual_toc.html + MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html do if [ -f $i ] then -- cgit v1.2.1 From 79ab39ec945caffe0458322ff8e8f0c71ac4b785 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Sun, 13 Oct 2002 16:57:33 +0200 Subject: - replaced Docs/LICENSE with Docs/MySQLEULA.txt - Updated scripts/make_binary_distribution and scripts/mysql-copyright* accordingly --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e5d7f20c6df..9d25943bb52 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -55,7 +55,7 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ chmod o-rwx $BASE/data $BASE/data/* for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - LICENSE Docs/manual.html Docs/manual.txt Docs/manual_toc.html + MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html do if [ -f $i ] then -- cgit v1.2.1 From f11f48a1445407b2f3ab0902f0dccbbc5562a6c8 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Thu, 17 Oct 2002 19:34:02 +0300 Subject: Fixed three bugs in mysqlcheck and changed documentation for mysqld_multi --- scripts/mysqld_multi.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 1366a9ea713..b868006ee40 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.3"; +$VER="2.4"; $opt_config_file = undef(); $opt_example = 0; @@ -508,8 +508,8 @@ sub example [mysqld_multi] mysqld = @bindir@/mysqld_safe mysqladmin = @bindir@/mysqladmin -user = multi_admin -password = multipass +user = root +password = your_password [mysqld2] socket = /tmp/mysql.sock2 -- cgit v1.2.1 From 689bf26c861990627bd9f9de3c3f0c84c7a8612d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 18 Oct 2002 19:43:06 +0200 Subject: - fixed typo in scripts/mysql_convert_table_format.sh --- scripts/mysql_convert_table_format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index 6b9a75228d3..c1955e632fb 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -64,7 +64,7 @@ foreach $table (@ARGV) { if (uc($row->[1]) eq uc($opt_type)) { - print "$table is alread of type $opt_type; Ignored\n"; + print "$table is already of type $opt_type; Ignored\n"; next; } } -- cgit v1.2.1 From 5459505bba0bb30ca36ab427b40ad9236075f84d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 21 Oct 2002 14:51:57 +0200 Subject: - added "darwin" to the list of systems that are known to support the -p option for cp and the -r option for scp (thank to Paul DuBois for the patch) - fixed a typo --- scripts/mysqlhotcopy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index d808ffdcaef..bc23c0e5d95 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -559,15 +559,15 @@ sub copy_files { 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)$/; + push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/; # add recursive option for scp - push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; + push @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'" ); + safe_system( @cp, @non_raid, "'$target'" ); foreach my $rd ( @$raid_dirs ) { my @raid = map { "'$_'" } grep { m:$rd/: } @$files; -- cgit v1.2.1 From 9adf688be6bf5b73d39b58086c7756979d7053b1 Mon Sep 17 00:00:00 2001 From: "vva@genie.(none)" <> Date: Mon, 28 Oct 2002 17:44:19 +0400 Subject: add help command on server side --- scripts/Makefile.am | 14 ++- scripts/fill_func_tables.sh | 234 ++++++++++++++++++++++++++++++++++++++++++++ scripts/mysql_install_db.sh | 7 +- 3 files changed, 250 insertions(+), 5 deletions(-) create mode 100644 scripts/fill_func_tables.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1469f3f2f2d..72c869f3f64 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -52,11 +52,13 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ - mysqld_safe.sh + mysqld_safe.sh \ + fill_func_tables.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug + mysqlbug \ + fill_func_tables.sql pkgdata_DATA = make_binary_distribution @@ -76,7 +78,8 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysqld_multi + mysqld_multi \ + fill_func_tables.sql SUPERCLEANFILES = mysqlbug @@ -127,3 +130,8 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% + +all: fill_func_tables.sql + +fill_func_tables.sql: fill_func_tables ../Docs/manual.texi + ./fill_func_tables < ../Docs/manual.texi > fill_func_tables.sql \ No newline at end of file diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh new file mode 100644 index 00000000000..9831e68df27 --- /dev/null +++ b/scripts/fill_func_tables.sh @@ -0,0 +1,234 @@ +#!@PERL@ +# fill_func_tables - parse ../Docs/manual.texi + +# Original version by vva + +my $cat_name= ""; +my $func_name= ""; +my $text= ""; +my $example= ""; + +local $mode= ""; + +sub prepare_name +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + + $a =~ s/\@table \@code/ /g; + + $a =~ s/\(\)//g; + + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; + $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; + $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; + + return $a; +} + +sub prepare_text +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@itemx/ /g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + $a =~ s/\@table \@code/ /g; + + return $a; +} + +sub prepare_example +{ + my ($a)= @_; + + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + return $a; +} + +sub flush_all +{ + my ($mode) = @_; + + if ($mode eq ""){return;} + + $func_name= prepare_name($func_name); + $text= prepare_text($text); + $example= prepare_example($example); + + if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ + print "INSERT INTO function (name,description,example) VALUES ("; + print "'$func_name',"; + print "'$text',"; + print "'$example'"; + print ");\n"; + print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + } + + $func_name= ""; + $text= ""; + $example= ""; + $mode= ""; +} + +sub new_category +{ + my ($category)= @_; + + $category= prepare_text($category); + + print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; + print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; +} + +print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +print "CREATE DATABASE mysql_help;\n"; + +print "USE mysql_help;\n"; + +print "DROP TABLE IF EXISTS function;\n"; +print "CREATE TABLE function ("; +print " func_id int unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " description text not null,"; +print " example text not null,"; +print " min_args tinyint not null,"; +print " max_args tinyint,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (func_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category_name;\n"; +print "CREATE TABLE function_category_name ("; +print " cat_id smallint unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (cat_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category;\n"; +print "CREATE TABLE function_category ("; +print " cat_id smallint unsigned not null references function_category_name,"; +print " func_id int unsigned not null references function,"; +print " primary key (cat_id, func_id)"; +print ") type=myisam;\n\n"; + +print "DELETE FROM function_category_name;\n"; +print "DELETE FROM function_category;\n"; +print "DELETE FROM function;\n"; +print "SELECT \@cur_category:=null;\n\n"; + +my $in_section_6_3= 0; + +for(<>) +{ + if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && + !$in_section_6_3){ + $in_section_6_3= 1; + next; + } + + if ($_=~/\@section/ && $in_section_6_3){ + $in_section_6_3= 0; + next; + } + + if (!$in_section_6_3) { next; } + + my $c_name= ""; + + ($c_name)=m|\@c for_mysql_help,(.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsubsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($f_name)=m|\@findex (.+?)$|; + if (!($f_name eq "")){ + flush_all($mode); + ($func_name)= ($f_name); + $mode= "text"; + next; + } + + if ($_=~/\@example/ && ($mode eq "text")){ + $mode= "example"; + next; + } + + if ($_=~/\@end example/ && ($mode eq "example")){ + flush_all($mode); + next; + } + + if ($mode eq "text") { $text .= $_; } + if ($mode eq "example") { $example .= $_; } +} + + +print "DELETE function_category_name "; +print "FROM function_category_name "; +print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; +print "WHERE function_category.cat_id is null;" + diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 2f27f5d7c1a..4822e816a12 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -307,8 +307,8 @@ then fi echo "Installing all prepared tables" -if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA +if ( + cat << END_OF_DATA use mysql; $c_d $i_d @@ -325,6 +325,9 @@ $i_f $c_t $c_c END_OF_DATA + cat fill_func_tables.sql +) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ + --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then echo "" if test "$IN_RPM" -eq 0 -- cgit v1.2.1 From 5343d4c96993e31a3377be07e9c97aee27784461 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 29 Oct 2002 22:56:30 +0200 Subject: Added --skip-safemalloc to mysqltest Added bug fix from 3.23 for AIX 4.3.3 and gcc 3.x Small change in EXCHANGE output Propagate open-files-limit from mysqld_safe -> mysqld Fixed speed bug in GROUP BY Added quotes around database name in CREATE DATABASE db_name (for binary log) --- scripts/mysqld_safe.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 9dea2eb3935..f51eff6585f 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -215,6 +215,7 @@ then if test -n "$open_files" then ulimit -n $open_files + args="open-files-limit=$open_files $args" fi if test -n "$core_file_size" then -- cgit v1.2.1 From a2bdf9265f3a0874f8d58bec690da4af07bca4cb Mon Sep 17 00:00:00 2001 From: "monty@butch." <> Date: Thu, 7 Nov 2002 03:54:00 +0200 Subject: Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes. --- scripts/Makefile.am | 1 + scripts/mysqlbug.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1469f3f2f2d..7ecd00f5b39 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -101,6 +101,7 @@ SUFFIXES = .sh -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ -e 's!@''PERL''@!@PERL@!' \ + -e 's!@''ASFLAGS''@!@SAVE_ASFLAGS@!'\ -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\ -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index bd5cb497e59..8dbc931b7f6 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -8,7 +8,7 @@ VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" COMPILATION_COMMENT="@COMPILATION_COMMENT@" BUGmysql="mysql@lists.mysql.com" # This is set by configure -COMP_ENV_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@'" +COMP_ENV_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" CONFIGURE_LINE="@CONF_COMMAND@" LIBC_INFO="" -- cgit v1.2.1 From d7a0000711af2b168e7a7ecf4dac840b4df2eacb Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Fri, 8 Nov 2002 22:45:31 +0100 Subject: fixed test for "root", on some installations / is mounted read-only --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f51eff6585f..2cc11bb0979 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -204,7 +204,7 @@ else fi USER_OPTION="" -if test -w / +if test "x$USER" = "xroot" then if test "$user" != "root" -o $SET_USER = 1 then -- cgit v1.2.1 From 876f3f4d308739805a0a1ac71c32c9dc3060a948 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Mon, 11 Nov 2002 15:57:35 +0200 Subject: Fixed that NULL and 0 returns 0 instead of NULL This is coded to not cause a speed impact on top level AND expressions where we don't care if an AND expression returns 0 or NULL --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 2cc11bb0979..96d3437f96d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -204,7 +204,7 @@ else fi USER_OPTION="" -if test "x$USER" = "xroot" +if test -w / -o "$USER" = "root" then if test "$user" != "root" -o $SET_USER = 1 then -- cgit v1.2.1 From cacd611a0c3436d748e6fd96e53dba41dafc6b3b Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Tue, 12 Nov 2002 11:39:52 +0200 Subject: Fixed a problem with reading some innodb options that may contain semicolin. --- scripts/mysqld_multi.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index b868006ee40..3165a01362c 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.4"; +$VER="2.5"; $opt_config_file = undef(); $opt_example = 0; @@ -212,6 +212,7 @@ sub start_mysqlds() } else { + $options[$j]=~ s/;/\\;/g; $tmp.= " $options[$j]"; } } -- cgit v1.2.1 From 042ac3fb6757ef2fa3f6c95f1265a8c5cba6d884 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 15 Nov 2002 01:57:56 +0100 Subject: - Fixed some minor bugs/typos --- scripts/mysqlhotcopy.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index bc23c0e5d95..b8d4a0a9a38 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -90,6 +90,7 @@ my %opt = ( Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P GetOptions( \%opt, "help", + "host|h=s", "user|u=s", "password|p=s", "port|P=s", -- cgit v1.2.1 From d882391975129b57f4f800f902cc580abd46c03b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 22 Nov 2002 18:26:45 +0100 Subject: scripts/safe_mysqld.sh - fix setting of niceness level support-files/mysql.server.sh - applied some fixes from 4.0 mysql.server script - fix my.cnf parsing --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 2b625dbdfa3..2272443c972 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -159,7 +159,7 @@ then NOHUP_NICENESS=`nohup nice 2>&1` if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 then - NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + NOHUP_NICENESS="nice -n $NOHUP_NICENESS nohup" else NOHUP_NICENESS="nohup" fi -- cgit v1.2.1 From 35ccfd0b4271336049e06e130fbfa1086ba51945 Mon Sep 17 00:00:00 2001 From: "peter@mysql.com" <> Date: Sun, 24 Nov 2002 17:07:53 +0300 Subject: SCRUM: Main change for Secure connection handling. Still needs some more coding. Commit done for merge with newer version of code. --- scripts/mysql_fix_privilege_tables.sh | 1 + scripts/mysql_install_db.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 247e3399b8b..a65aca3c1fc 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -170,6 +170,7 @@ fi @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Sun, 24 Nov 2002 16:20:41 +0200 Subject: Rewrote nice handling to make more portable --- scripts/safe_mysqld.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 2272443c972..96568bd5d19 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -157,9 +157,14 @@ NOHUP_NICENESS="nohup" if test -w / then NOHUP_NICENESS=`nohup nice 2>&1` - if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 - then - NOHUP_NICENESS="nice -n $NOHUP_NICENESS nohup" + if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 + then + if $NOHUP_NICENESS -gt 0 + then + $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + else + NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup" + fi else NOHUP_NICENESS="nohup" fi -- cgit v1.2.1 From a24258375a59e37d728dffae05235c59d283a6ab Mon Sep 17 00:00:00 2001 From: "peter@mysql.com" <> Date: Sat, 30 Nov 2002 20:58:53 +0300 Subject: SCRUM: Montymise code fix mysql_change_user() for old clients --- scripts/mysql_fix_privilege_tables.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index a65aca3c1fc..3ed295170ad 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -170,12 +170,20 @@ fi @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Tue, 10 Dec 2002 14:25:23 +0100 Subject: - make sure to replace HOSTNAME in mysql.server when packing up the binary distribution (this will still be broken for 3.23.54) - make sure that mysql.server in the binary distribution is executable, too --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index bde77713d63..d8d34229b70 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -120,11 +120,11 @@ $CP scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db -$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server +$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/safe_mysqld mv $BASE/support-files/binary-configure $BASE/configure -chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure +chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la -- cgit v1.2.1 From 2423780823751c53e470fed399d69ef8dcf1a3af Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 11 Dec 2002 19:37:09 +0100 Subject: - moved manual pages from "man" to "man/man1" for the binary distribution --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 9d25943bb52..c2b1a0cb2b3 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -50,7 +50,7 @@ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \ $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/man + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/man $BASE/man/man1 chmod o-rwx $BASE/data $BASE/data/* @@ -107,7 +107,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests $CP support-files/* $BASE/support-files -$CP man/*.? $BASE/man +$CP man/*.1 $BASE/man/man1 $CP -r sql/share/* $BASE/share/mysql rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD -- cgit v1.2.1 From bfd15dd6cabfb720ad71627fd2b2d0978cb7aa3e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 13 Dec 2002 09:56:02 +0100 Subject: - added missing "test" to $NOHUP_NICENESS test (thanks to Nick Gaugler for spotting and reporting this) --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 96568bd5d19..c2b6b8cd8b7 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -159,7 +159,7 @@ then NOHUP_NICENESS=`nohup nice 2>&1` if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 then - if $NOHUP_NICENESS -gt 0 + if test $NOHUP_NICENESS -gt 0 then $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else -- cgit v1.2.1 From a7ac8973a1ec4cf0480b5d2b2b896331e499618d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 13 Dec 2002 13:47:25 +0100 Subject: - fixed another typo in NOHUP_NICENESS testing --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index c2b6b8cd8b7..67a38e49e01 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -161,7 +161,7 @@ then then if test $NOHUP_NICENESS -gt 0 then - $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup" fi -- cgit v1.2.1 From 113b9240d1226c3934890144abfa9682cb4d8b8e Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Fri, 13 Dec 2002 18:25:36 +0100 Subject: Added collection of called procedures in a list. Fixed eval bug; now conditions with local variables work in WHILE et al. Made mysql_install_db.sh create proc table. --- scripts/mysql_install_db.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5e139dc652b..6029ac2518a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -306,6 +306,18 @@ then c_c="$c_c comment='Column privileges';" fi +if test ! -f $mdata/proc.frm +then + echo "Preparing proc table" + + c_p="$c_p CREATE TABLE proc (" + c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p body blob DEFAULT '' NOT NULL," + c_p="$c_p PRIMARY KEY (name)" + c_p="$c_p )" + c_p="$c_p comment='Stored Procedures';" +fi + echo "Installing all prepared tables" if ( cat << END_OF_DATA @@ -324,6 +336,7 @@ $i_f $c_t $c_c +$c_p END_OF_DATA cat fill_func_tables.sql ) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ -- cgit v1.2.1 From b5aa9ae0c768c92321e99939f5533bcce8382366 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Fri, 20 Dec 2002 14:58:27 +0200 Subject: Changed thd variables max_join_size and select_limit to type ha_rows. This fixed some optimization problems when using -DBIG_TABLES Portabilty fixes for OpenUnix and HPUX Added C and C++ version numbers to mysqlbug --- scripts/Makefile.am | 2 ++ scripts/mysqlbug.sh | 2 ++ 2 files changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7ecd00f5b39..8f17d8519b8 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -100,6 +100,8 @@ SUFFIXES = .sh -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ + -e 's!@''CC_VERSION''@!@CC_VERSION@!'\ + -e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\ -e 's!@''PERL''@!@PERL@!' \ -e 's!@''ASFLAGS''@!@SAVE_ASFLAGS@!'\ -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\ diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 8dbc931b7f6..49ac08d0013 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -231,6 +231,8 @@ ${ORGANIZATION- $ORGANIZATION_C} >Class: $CLASS_C >Release: mysql-${VERSION} ($COMPILATION_COMMENT) `test -n "$MYSQL_SERVER" && echo ">Server: $MYSQL_SERVER"` +>C compiler: @CC_VERSION@ +>C++ compiler: @CXX_VERSION@ >Environment: $ENVIRONMENT_C `test -n "$SYSTEM" && echo "System: $SYSTEM"` -- cgit v1.2.1 From c0ed25283f29498f2cfd4dd3fa7cabd5558e5a4d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 23 Dec 2002 14:36:40 +0100 Subject: - Applied various patches provided by Christian Hammers (MySQL maintainer for the Debian project) to fix some architecture-specific problems and some bugs --- scripts/mysql_fix_privilege_tables.sh | 29 ++++++++++++++++++----------- scripts/mysqlaccess.sh | 2 +- scripts/safe_mysqld.sh | 2 ++ 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 86312fdab52..1677eaf5f32 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,23 +1,30 @@ #!/bin/sh echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" -echo "mysql.func table to MySQL 3.22.14 and above." +echo "mysql.func tables to MySQL 3.22.14 and above." echo "" echo "This is needed if you want to use the new GRANT functions," -echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23" +echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" echo "" -echo "If you get Access denied errors, you should run this script again" -echo "and give the MySQL root user password as a argument!" +echo "If you get 'Access denied' errors, you should run this script again" +echo "and give the MySQL root user password as an argument!" -root_password="$1" host="localhost" +user="root" + +if test -z $1 ; then + cmd="@bindir@/mysql -f --user=$user --host=$host mysql" +else + root_password="$1" + cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql" +fi # Fix old password format, add File_priv and func table echo "" echo "If your tables are already up to date or partially up to date you will" echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" -@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < columns_priv.Column_priv" echo "You can ignore any errors from this" -@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql < Date: Thu, 9 Jan 2003 15:22:38 +0200 Subject: A small fix for the type in the script --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 96d3437f96d..211cc8ceced 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -49,7 +49,7 @@ parse_arguments() { # QQ The --open-files should be removed --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; - --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; + --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; --mysqld-version=*) -- cgit v1.2.1 From 0021a71aeee81c6035412727c86ef7bd68100cbe Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 23 Jan 2003 20:07:19 +0100 Subject: - merge relevant Do-compile changes from 4.0 tree - use "gnutar" on Mac OS X to build the binary distribution --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d8d34229b70..2e25cc9bdc4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -189,7 +189,7 @@ which_1 () # Create the result tar file # -tar=`which_1 gtar` +tar=`which_1 gnutar gtar` if test "$?" = "1" -o "$tar" = "" then tar=tar -- cgit v1.2.1 From 1ecf9d5098f46a62073c0751650a38563769b60e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 24 Jan 2003 16:10:21 +0100 Subject: - added mysql_waitpid to the MySQL-client RPM and binary distributions - renamed MySQL.rpm to MySQL-server.rpm --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c2b1a0cb2b3..29549e084f0 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -64,7 +64,7 @@ do done for i in extra/comp_err extra/replace extra/perror extra/resolveip \ - extra/my_print_defaults extra/resolve_stack_dump \ + extra/my_print_defaults extra/mysql_waitpid extra/resolve_stack_dump \ isam/isamchk isam/pack_isam myisam/myisamchk \ myisam/myisampack sql/mysqld client/mysqlbinlog \ client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ -- cgit v1.2.1 From 689578a0997f54c590bcf4791e30710602851bc4 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 28 Jan 2003 08:38:28 +0200 Subject: Fixes for Netware Call pthread_mutex_destroy() on not used mutex. Changed comments in .h and .c files from // -> /* */ Added detection of mutex on which one didn't call pthread_mutex_destroy() Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression" Added optimisation for ORDER BY NULL --- scripts/make_binary_distribution.sh | 140 ++++++++++++++++++++++++++---------- 1 file changed, 102 insertions(+), 38 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b7fa94d493c..c4285e7c632 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -46,16 +46,37 @@ if [ -d $BASE ] ; then rm -r -f $BASE fi +BS="" +EXTRA_BIN_FILES="" +BASE_SYSTEM="any" +MYSQL_SHARE=$BASE/share/mysql + +case $system in + *netware*) + BASE_SYSTEM="netware" + BS=".nlm" + MYSQL_SHARE=$BASE/share + EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ + netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ + netware/mysqlhotcopy.nlm netware/libmysql.nlm" + ;; +esac + + mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ - $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ - $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \ - $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/man $BASE/man/man1 - + $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ + $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ + $BASE/mysql-test/include $BASE/mysql-test/std_data + +if [ $BASE_SYSTEM != "netware" ] ; then + mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1 +fi + chmod o-rwx $BASE/data $BASE/data/* for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html + MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ + LICENSE.doc README.NW Docs/mysqlbug.txt do if [ -f $i ] then @@ -63,18 +84,23 @@ do fi done -for i in extra/comp_err extra/replace extra/perror extra/resolveip \ - extra/my_print_defaults extra/resolve_stack_dump \ - isam/isamchk isam/pack_isam myisam/myisamchk \ - myisam/myisampack sql/mysqld client/mysqlbinlog \ - client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \ - client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ - client/mysqlmanagerc client/mysqlmanager-pwgen tools/mysqlmanager \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \ - client/.libs/mysqlcheck client/.libs/mysqlbinlog \ - client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \ - tools/.libs/mysqlmanager +for i in extra/comp_err$BS extra/replace$BS extra/perror$BS \ + extra/resolveip$BS extra/my_print_defaults$BS \ + extra/resolve_stack_dump$BS \ + isam/isamchk$BS isam/pack_isam$BS \ + myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ + sql/mysqld$BS \ + client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqldump$BS client/mysqlimport$BS \ + client/mysqltest$BS client/mysqlcheck$BS \ + client/mysqlbinlog$BS client/mysqlmanagerc$BS \ + client/mysqlmanager-pwgen$BS tools/mysqlmanager$BS \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ + client/.libs/mysqldump client/.libs/mysqlimport \ + client/.libs/mysqltest client/.libs/mysqlcheck \ + client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ + client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + $EXTRA_BIN_FILES do if [ -f $i ] then @@ -86,6 +112,7 @@ if [ x$STRIP = x1 ] ; then strip $BASE/bin/* fi +# Copy not binary files for i in sql/mysqld.sym.gz do if [ -f $i ] @@ -94,7 +121,11 @@ do fi done -for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a +if [ $BASE_SYSTEM = "netware" ] ; then + $CP -r netware/scripts/* $BASE/scripts +fi + +for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp do if [ -f $i ] then @@ -102,39 +133,72 @@ do fi done +# convert the libs to .lib for NetWare +if [ $BASE_SYSTEM = "netware" ] ; then + for i in $BASE/lib/*.a + do + libname=`basename $i .a` + $MV $i $BASE/lib/$libname.lib + done +fi + $CP config.h include/* $BASE/include -rm $BASE/include/Makefile*; rm $BASE/include/*.in +rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h +if [ $BASE_SYSTEM != "netware" ] ; then + rm -f $BASE/include/config-netware.h +fi -$CP tests/*.res tests/*.tst tests/*.pl $BASE/tests +if [ -d tests ] ; then + $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests +fi +if [ -d man ] ; then + $CP man/*.1 $BASE/man/man1 +fi $CP support-files/* $BASE/support-files -$CP man/*.1 $BASE/man/man1 -$CP -r sql/share/* $BASE/share/mysql -rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD +if [ $BASE_SYSTEM == "netware" ] ; then + rm -f $BASE/support-files/magic \ + $BASE/support-files/mysql.server \ + $BASE/support-files/mysql*.spec \ + $BASE/support-files/mysql-log-rotate \ + $BASE/support-files/binary-configure +fi + +$CP -r sql/share/* $MYSQL_SHARE +rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD + +for i in mysql-test/mysql-test-run mysql-test/install_test_db \ + mysql-test/README \ + netware/mysql_test_run.nlm netware/install_test_db.ncf +do + if [ -f $i ] + then + $CP $i $BASE/mysql-test + fi +done -$CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ -$CP mysql-test/README $BASE/mysql-test/README $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r + +if [ $BASE_SYSTEM != "netware" ] ; then + $CP scripts/* $BASE/bin + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server + $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe + mv $BASE/support-files/binary-configure $BASE/configure + chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure + $CP -r sql-bench/* $BASE/sql-bench + rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la +fi -$CP scripts/* $BASE/bin rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db -$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server -$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe - # Make safe_mysqld a symlink to mysqld_safe for backwards portability # To be removed in MySQL 4.1 (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -mv $BASE/support-files/binary-configure $BASE/configure -chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure -$CP -r sql-bench/* $BASE/sql-bench -rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la - # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/share -name SCCS -print | xargs rm -r -f -- cgit v1.2.1 From 3d289137408af20fb18a0606ee562ded1bb984d9 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 28 Jan 2003 20:56:35 +0200 Subject: Only write to the error log if --log-error is specified and --console is not specified (On Windows --log-error is enabled by default) --- scripts/mysqld_safe.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index b68c6f56015..0e9f4de09fe 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -47,8 +47,10 @@ parse_arguments() { # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; + # err-log should be removed in 5.0 --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; - # QQ The --open-files should be removed + --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; + # QQ The --open-files should be removed in 5.0 --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; -- cgit v1.2.1 From cf25397e0eab2e43cb1e7cba183890b6f93edb1d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 29 Jan 2003 09:22:20 +0100 Subject: - fixed typo for better portability (many shells don't support the "==" operator) --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 840ba222302..0773ccc679c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -156,7 +156,7 @@ if [ -d man ] ; then fi $CP support-files/* $BASE/support-files -if [ $BASE_SYSTEM == "netware" ] ; then +if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/support-files/magic \ $BASE/support-files/mysql.server \ $BASE/support-files/mysql*.spec \ -- cgit v1.2.1 From 02dd3852b68ce13bba0dc2131f27ff51d2c9ae29 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 3 Feb 2003 12:20:24 +0100 Subject: - renamed scripts/fill_func_tables.sh to scripts/fill_help_tables and updated all relevant files to honor this change (as discussed with vva) - added some more comments to the fill_help_tables script - minor cleanups --- scripts/Makefile.am | 21 ++-- scripts/fill_func_tables.sh | 234 ----------------------------------------- scripts/fill_help_tables.sh | 246 ++++++++++++++++++++++++++++++++++++++++++++ scripts/mysql_install_db.sh | 2 +- 4 files changed, 258 insertions(+), 245 deletions(-) delete mode 100644 scripts/fill_func_tables.sh create mode 100644 scripts/fill_help_tables.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 2c74c8e46a6..458097499c9 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -20,7 +20,7 @@ bin_SCRIPTS = @server_scripts@ \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ - mysql_fix_extensions \ + mysql_fix_extensions \ mysql_setpermission \ mysql_secure_installation \ mysql_zap \ @@ -38,7 +38,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ - mysql_fix_extensions.sh \ + mysql_fix_extensions.sh \ mysql_install_db.sh \ mysql_setpermission.sh \ mysql_secure_installation.sh \ @@ -48,17 +48,17 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_convert_table_format.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ - mysqldumpslow.sh \ + mysqldumpslow.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ mysqld_safe.sh \ - fill_func_tables.sh + fill_help_tables.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ - fill_func_tables.sql + fill_help_tables.sql pkgdata_DATA = make_binary_distribution @@ -69,7 +69,7 @@ CLEANFILES = @server_scripts@ \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ - mysql_fix_extensions \ + mysql_fix_extensions \ mysql_setpermission \ mysql_secure_installation \ mysql_zap \ @@ -79,7 +79,8 @@ CLEANFILES = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysqld_multi \ - fill_func_tables.sql + fill_help_tables \ + fill_help_tables.sql SUPERCLEANFILES = mysqlbug @@ -134,7 +135,7 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_func_tables.sql +all: fill_help_tables.sql -fill_func_tables.sql: fill_func_tables ../Docs/manual.texi - ./fill_func_tables < ../Docs/manual.texi > fill_func_tables.sql \ No newline at end of file +fill_help_tables.sql: fill_help_tables ../Docs/manual.texi + ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh deleted file mode 100644 index 9831e68df27..00000000000 --- a/scripts/fill_func_tables.sh +++ /dev/null @@ -1,234 +0,0 @@ -#!@PERL@ -# fill_func_tables - parse ../Docs/manual.texi - -# Original version by vva - -my $cat_name= ""; -my $func_name= ""; -my $text= ""; -my $example= ""; - -local $mode= ""; - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - - $a =~ s/\(\)//g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - return $a; -} - -sub prepare_text -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - return $a; -} - -sub flush_all -{ - my ($mode) = @_; - - if ($mode eq ""){return;} - - $func_name= prepare_name($func_name); - $text= prepare_text($text); - $example= prepare_example($example); - - if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO function (name,description,example) VALUES ("; - print "'$func_name',"; - print "'$text',"; - print "'$example'"; - print ");\n"; - print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; - } - - $func_name= ""; - $text= ""; - $example= ""; - $mode= ""; -} - -sub new_category -{ - my ($category)= @_; - - $category= prepare_text($category); - - print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; - print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; -} - -print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -print "CREATE DATABASE mysql_help;\n"; - -print "USE mysql_help;\n"; - -print "DROP TABLE IF EXISTS function;\n"; -print "CREATE TABLE function ("; -print " func_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " description text not null,"; -print " example text not null,"; -print " min_args tinyint not null,"; -print " max_args tinyint,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (func_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category_name;\n"; -print "CREATE TABLE function_category_name ("; -print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (cat_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category;\n"; -print "CREATE TABLE function_category ("; -print " cat_id smallint unsigned not null references function_category_name,"; -print " func_id int unsigned not null references function,"; -print " primary key (cat_id, func_id)"; -print ") type=myisam;\n\n"; - -print "DELETE FROM function_category_name;\n"; -print "DELETE FROM function_category;\n"; -print "DELETE FROM function;\n"; -print "SELECT \@cur_category:=null;\n\n"; - -my $in_section_6_3= 0; - -for(<>) -{ - if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && - !$in_section_6_3){ - $in_section_6_3= 1; - next; - } - - if ($_=~/\@section/ && $in_section_6_3){ - $in_section_6_3= 0; - next; - } - - if (!$in_section_6_3) { next; } - - my $c_name= ""; - - ($c_name)=m|\@c for_mysql_help,(.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsubsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($f_name)=m|\@findex (.+?)$|; - if (!($f_name eq "")){ - flush_all($mode); - ($func_name)= ($f_name); - $mode= "text"; - next; - } - - if ($_=~/\@example/ && ($mode eq "text")){ - $mode= "example"; - next; - } - - if ($_=~/\@end example/ && ($mode eq "example")){ - flush_all($mode); - next; - } - - if ($mode eq "text") { $text .= $_; } - if ($mode eq "example") { $example .= $_; } -} - - -print "DELETE function_category_name "; -print "FROM function_category_name "; -print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; -print "WHERE function_category.cat_id is null;" - diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh new file mode 100644 index 00000000000..f6b16a3b434 --- /dev/null +++ b/scripts/fill_help_tables.sh @@ -0,0 +1,246 @@ +#!@PERL@ +# +# Usage: fill_help_tables +# Example: ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql +# +# This script generates the SQL statements required by mysql_install_db to +# fill up the tables for the server-side online function help, which can be +# invoked with "help " from the MySQL client. +# +# Please note, that you first need to update Docs/manual.texi with the +# manual file from the separate "mysqldoc" BitKeeper-Tree! The manual.texi +# included in the source tree is just an empty stub file - the full manual +# is now maintained in a separate tree. +# +# Original version by Victor Vagin +# + +my $cat_name= ""; +my $func_name= ""; +my $text= ""; +my $example= ""; + +local $mode= ""; + +sub prepare_name +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + + $a =~ s/\@table \@code/ /g; + + $a =~ s/\(\)//g; + + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; + $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; + $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; + + return $a; +} + +sub prepare_text +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@itemx/ /g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + $a =~ s/\@table \@code/ /g; + + return $a; +} + +sub prepare_example +{ + my ($a)= @_; + + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + return $a; +} + +sub flush_all +{ + my ($mode) = @_; + + if ($mode eq ""){return;} + + $func_name= prepare_name($func_name); + $text= prepare_text($text); + $example= prepare_example($example); + + if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ + print "INSERT INTO function (name,description,example) VALUES ("; + print "'$func_name',"; + print "'$text',"; + print "'$example'"; + print ");\n"; + print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + } + + $func_name= ""; + $text= ""; + $example= ""; + $mode= ""; +} + +sub new_category +{ + my ($category)= @_; + + $category= prepare_text($category); + + print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; + print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; +} + +print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +print "CREATE DATABASE mysql_help;\n"; + +print "USE mysql_help;\n"; + +print "DROP TABLE IF EXISTS function;\n"; +print "CREATE TABLE function ("; +print " func_id int unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " description text not null,"; +print " example text not null,"; +print " min_args tinyint not null,"; +print " max_args tinyint,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (func_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category_name;\n"; +print "CREATE TABLE function_category_name ("; +print " cat_id smallint unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (cat_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category;\n"; +print "CREATE TABLE function_category ("; +print " cat_id smallint unsigned not null references function_category_name,"; +print " func_id int unsigned not null references function,"; +print " primary key (cat_id, func_id)"; +print ") type=myisam;\n\n"; + +print "DELETE FROM function_category_name;\n"; +print "DELETE FROM function_category;\n"; +print "DELETE FROM function;\n"; +print "SELECT \@cur_category:=null;\n\n"; + +my $in_section_6_3= 0; + +for(<>) +{ + if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && + !$in_section_6_3){ + $in_section_6_3= 1; + next; + } + + if ($_=~/\@section/ && $in_section_6_3){ + $in_section_6_3= 0; + next; + } + + if (!$in_section_6_3) { next; } + + my $c_name= ""; + + ($c_name)=m|\@c for_mysql_help,(.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsubsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($f_name)=m|\@findex (.+?)$|; + if (!($f_name eq "")){ + flush_all($mode); + ($func_name)= ($f_name); + $mode= "text"; + next; + } + + if ($_=~/\@example/ && ($mode eq "text")){ + $mode= "example"; + next; + } + + if ($_=~/\@end example/ && ($mode eq "example")){ + flush_all($mode); + next; + } + + if ($mode eq "text") { $text .= $_; } + if ($mode eq "example") { $example .= $_; } +} + + +print "DELETE function_category_name "; +print "FROM function_category_name "; +print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; +print "WHERE function_category.cat_id is null;" + diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5e139dc652b..862cffb0cb7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -325,7 +325,7 @@ $i_f $c_t $c_c END_OF_DATA - cat fill_func_tables.sql + cat fill_help_tables.sql ) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then -- cgit v1.2.1 From 1454f356405301cb6e562aea050b5d8ab0f0bac6 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 5 Feb 2003 11:49:51 +0100 Subject: - Yves mail address does not seem to be valid anymore - changed mail address to report bugs to bugs@mysql.com (thanks to Christian Hammers for pointing this out) - please merge this into all other trees! --- scripts/mysqlaccess.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 824dba7b65a..699e74834e3 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2414,7 +2414,7 @@ sub Print_Header { sub Print_Footer { if ($MySQLaccess::CMD) { #command-line mode print "\n" - ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be\n"; + ."BUGs can be reported by email to bugs\@mysql.com\n"; } if ($MySQLaccess::CGI) { #CGI-BIN mode if ($MySQLaccess::Param{'brief'}) { @@ -2422,7 +2422,7 @@ sub Print_Footer { } print "
\n" ."
\n" - ."BUGs can be reported by email to Yves.Carlier\@rug.ac.be
\n" + ."BUGs can be reported by email to bugs\@mysql.com
\n" # ."Don't forget to mention the version $VERSION!
\n" ."
\n" ."\n" -- cgit v1.2.1 From ff15b200f99a01e5c0aa650862f44e2f8b2f3574 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 5 Feb 2003 12:22:28 +0100 Subject: - added word of warning about providing the password as cleartext using the --password parameter (better add it to my.cnf instead) (Thanks to Christian Hammers for the suggestion) --- scripts/mysqlhotcopy.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index b8d4a0a9a38..1a694247461 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -49,8 +49,9 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -?, --help display this helpscreen and exit -u, --user=# user for database login if not current user - -p, --password=# password to use when connecting to server - -h, --host=# Hostname for local server when connecting over TCP/IP + -p, --password=# password to use when connecting to server (if not set + in my.cnf, which is recommended) + -h, --host=# Hostname for local server when connecting over TCP/IP -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server @@ -893,7 +894,11 @@ user for database login if not current user =item -p, --password=# -password to use when connecting to server +password to use when connecting to the server. Note that you are strongly +encouraged *not* to use this option as every user would be able to see the +password in the process list. Instead use the '[mysqlhotcopy]' section in +one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf. +(See the chapter 'my.cnf Option Files' in the manual) =item -h, -h, --host=# -- cgit v1.2.1 From 381ab77b84ab4ccdb55f1a201cf6d9221b726181 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 12 Feb 2003 19:53:19 +0200 Subject: Fixed a bug in mysqld_safe, when it earlier could have removed a socket from another, still living MySQL server. --- scripts/mysqld_safe.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 0e9f4de09fe..49c5b0f51b7 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -272,7 +272,6 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR" echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do - rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test -z "$args" then $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 @@ -311,7 +310,7 @@ do I=`expr $I + 1` done fi - + rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log done -- cgit v1.2.1 From 7b1ed961577e85f1b75757a6090ab8b2f4f60764 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 12 Feb 2003 19:53:30 +0200 Subject: Fixed a bug in mysqld_safe, when it earlier could have removed a socket from another, still living MySQL server. --- scripts/mysqld_safe.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index febc7b8e595..e937789e6ef 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -270,7 +270,6 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR" echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do - rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test -z "$args" then $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 @@ -309,7 +308,7 @@ do I=`expr $I + 1` done fi - + rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log done -- cgit v1.2.1 From e327393e9d2f8df0e2239464bb96a3eafd9de03b Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Wed, 12 Feb 2003 21:55:37 +0200 Subject: Fixed a lot of wrong memory references as reported by valgrind Portability fixes Added new client function: mysql_get_server_version() New server help code (From Victor Vagin) Fixed wrong usage of binary() Disabled RTREE usage for now. --- scripts/fill_help_tables.sh | 67 ++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 37 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index f6b16a3b434..da6b8ec80ef 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -111,12 +111,12 @@ sub flush_all $example= prepare_example($example); if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO function (name,description,example) VALUES ("; + print "INSERT INTO help_topic (name,description,example) VALUES ("; print "'$func_name',"; print "'$text',"; print "'$example'"; print ");\n"; - print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + print "INSERT INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; } $func_name= ""; @@ -131,50 +131,43 @@ sub new_category $category= prepare_text($category); - print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; - print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; + print "INSERT INTO help_category (name) VALUES (\'$category\');\n"; + print "SET \@cur_category=LAST_INSERT_ID();\n"; } -print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -print "CREATE DATABASE mysql_help;\n"; +#print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +#print "CREATE DATABASE mysql_help;\n"; -print "USE mysql_help;\n"; +print "USE mysql;\n"; -print "DROP TABLE IF EXISTS function;\n"; -print "CREATE TABLE function ("; -print " func_id int unsigned not null auto_increment,"; +print "DROP TABLE IF EXISTS help_topic;\n"; +print "CREATE TABLE help_topic ("; +print " help_topic_id int unsigned not null auto_increment,"; print " name varchar(64) not null,"; -print " url varchar(128) not null,"; print " description text not null,"; print " example text not null,"; -print " min_args tinyint not null,"; -print " max_args tinyint,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (func_id)"; +print " url varchar(128) not null,"; +print " primary key (help_topic_id),"; +print " uniuqe index(name)"; print ") type=myisam;\n\n"; -print "DROP TABLE IF EXISTS function_category_name;\n"; -print "CREATE TABLE function_category_name ("; -print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (cat_id)"; +print "DROP TABLE IF EXISTS help_category;\n"; +print "CREATE TABLE help_category ("; +print " help_category_id smallint unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " primary key (help_category_id),"; +print " unique index (name)"; print ") type=myisam;\n\n"; -print "DROP TABLE IF EXISTS function_category;\n"; -print "CREATE TABLE function_category ("; -print " cat_id smallint unsigned not null references function_category_name,"; -print " func_id int unsigned not null references function,"; -print " primary key (cat_id, func_id)"; +print "DROP TABLE IF EXISTS help_relation;\n"; +print "CREATE TABLE help_relation ("; +print" help_topic_id int unsigned not null references help_topic,"; +print" help_category_id smallint unsigned not null references help_category,"; +print" primary key (help_category_id, help_topic_id),"; print ") type=myisam;\n\n"; -print "DELETE FROM function_category_name;\n"; -print "DELETE FROM function_category;\n"; -print "DELETE FROM function;\n"; -print "SELECT \@cur_category:=null;\n\n"; +print "SET \@cur_category=null;\n\n"; my $in_section_6_3= 0; @@ -239,8 +232,8 @@ for(<>) } -print "DELETE function_category_name "; -print "FROM function_category_name "; -print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; -print "WHERE function_category.cat_id is null;" +print "DELETE help_category "; +print "FROM help_category "; +print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id "; +print "WHERE help_relation.help_category_id is null;" -- cgit v1.2.1 From 1172215ba9d264d359a5c30727172b902752ce54 Mon Sep 17 00:00:00 2001 From: "bar@bar.mysql.r18.ru" <> Date: Thu, 13 Feb 2003 10:42:18 +0400 Subject: fill_help_tables.sh: Typo fix , --- scripts/fill_help_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index da6b8ec80ef..52dfa018d6e 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -148,7 +148,7 @@ print " description text not null,"; print " example text not null,"; print " url varchar(128) not null,"; print " primary key (help_topic_id),"; -print " uniuqe index(name)"; +print " unique index(name)"; print ") type=myisam;\n\n"; print "DROP TABLE IF EXISTS help_category;\n"; -- cgit v1.2.1 From 5acf83802d2098a5be9848f4cadafa68709391ea Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Thu, 13 Feb 2003 17:56:01 +0200 Subject: fix a bug in derived tables UNION's bug fixes and code clean-up --- scripts/fill_func_tables.sh | 234 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100755 scripts/fill_func_tables.sh (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh new file mode 100755 index 00000000000..459afee2fe1 --- /dev/null +++ b/scripts/fill_func_tables.sh @@ -0,0 +1,234 @@ +#!/usr/bin/perl +# fill_func_tables - parse ../Docs/manual.texi + +# Original version by vva + +my $cat_name= ""; +my $func_name= ""; +my $text= ""; +my $example= ""; + +local $mode= ""; + +sub prepare_name +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + + $a =~ s/\@table \@code/ /g; + + $a =~ s/\(\)//g; + + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; + $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; + $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; + + return $a; +} + +sub prepare_text +{ + my ($a)= @_; + + $a =~ s/(\@itemize \@bullet)/ /g; + $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@end multitable)/ /g; + $a =~ s/(\@end table)/ /g; + $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; + $a =~ s/(\@node(.*?)\n)/ /g; + $a =~ s/(\@tab)/\t/g; + $a =~ s/\@itemx/ /g; + $a =~ s/\@item/ /g; + $a =~ s/\@code\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; + $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; + $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + $a =~ s/\@table \@code/ /g; + + return $a; +} + +sub prepare_example +{ + my ($a)= @_; + + $a =~ s/\'/\'\'/g; + $a =~ s/\\/\\\\/g; + $a =~ s/\`/\`\`/g; + $a =~ s/(\n*?)$//g; + $a =~ s/\n/\\n/g; + + return $a; +} + +sub flush_all +{ + my ($mode) = @_; + + if ($mode eq ""){return;} + + $func_name= prepare_name($func_name); + $text= prepare_text($text); + $example= prepare_example($example); + + if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ + print "INSERT INTO function (name,description,example) VALUES ("; + print "'$func_name',"; + print "'$text',"; + print "'$example'"; + print ");\n"; + print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + } + + $func_name= ""; + $text= ""; + $example= ""; + $mode= ""; +} + +sub new_category +{ + my ($category)= @_; + + $category= prepare_text($category); + + print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; + print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; +} + +print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +print "CREATE DATABASE mysql_help;\n"; + +print "USE mysql_help;\n"; + +print "DROP TABLE IF EXISTS function;\n"; +print "CREATE TABLE function ("; +print " func_id int unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " description text not null,"; +print " example text not null,"; +print " min_args tinyint not null,"; +print " max_args tinyint,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (func_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category_name;\n"; +print "CREATE TABLE function_category_name ("; +print " cat_id smallint unsigned not null auto_increment,"; +print " name varchar(64) not null,"; +print " url varchar(128) not null,"; +print " date_created datetime not null,"; +print " last_modified timestamp not null,"; +print " primary key (cat_id)"; +print ") type=myisam;\n\n"; + +print "DROP TABLE IF EXISTS function_category;\n"; +print "CREATE TABLE function_category ("; +print " cat_id smallint unsigned not null references function_category_name,"; +print " func_id int unsigned not null references function,"; +print " primary key (cat_id, func_id)"; +print ") type=myisam;\n\n"; + +print "DELETE FROM function_category_name;\n"; +print "DELETE FROM function_category;\n"; +print "DELETE FROM function;\n"; +print "SELECT \@cur_category:=null;\n\n"; + +my $in_section_6_3= 0; + +for(<>) +{ + if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && + !$in_section_6_3){ + $in_section_6_3= 1; + next; + } + + if ($_=~/\@section/ && $in_section_6_3){ + $in_section_6_3= 0; + next; + } + + if (!$in_section_6_3) { next; } + + my $c_name= ""; + + ($c_name)=m|\@c for_mysql_help,(.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsubsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($c_name)=m|\@subsection (.+?)$|; + if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ + ($cat_name)= $c_name; + new_category($cat_name); + next; + } + + ($f_name)=m|\@findex (.+?)$|; + if (!($f_name eq "")){ + flush_all($mode); + ($func_name)= ($f_name); + $mode= "text"; + next; + } + + if ($_=~/\@example/ && ($mode eq "text")){ + $mode= "example"; + next; + } + + if ($_=~/\@end example/ && ($mode eq "example")){ + flush_all($mode); + next; + } + + if ($mode eq "text") { $text .= $_; } + if ($mode eq "example") { $example .= $_; } +} + + +print "DELETE function_category_name "; +print "FROM function_category_name "; +print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; +print "WHERE function_category.cat_id is null;" + -- cgit v1.2.1 From a533db746bdb074f96d472f1a2eaf4cc292b7e9c Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Sun, 16 Feb 2003 22:50:00 +0200 Subject: Patch for novell Reverted wrong patch for mysqld_safe.sh --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 49c5b0f51b7..3ccf5301503 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -272,6 +272,7 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR" echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do + rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety if test -z "$args" then $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 @@ -310,7 +311,6 @@ do I=`expr $I + 1` done fi - rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log done -- cgit v1.2.1 From 6051b2f9988f1e317be41e49c64718cc610c1260 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Mon, 17 Feb 2003 02:14:37 +0200 Subject: Fixed multi-table-delete for InnoDB tables Novell patches --- scripts/make_binary_distribution.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0773ccc679c..1bdf5b86fdf 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -10,6 +10,7 @@ version=@VERSION@ export machine system version SOURCE=`pwd` CP="cp -p" +MV="mv" STRIP=1 DEBUG=0 @@ -58,7 +59,7 @@ case $system in MYSQL_SHARE=$BASE/share EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ - netware/mysqlhotcopy.nlm netware/libmysql.nlm" + netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql" ;; esac @@ -122,7 +123,7 @@ do done if [ $BASE_SYSTEM = "netware" ] ; then - $CP -r netware/scripts/* $BASE/scripts + $CP -r netware/*.pl $BASE/scripts fi for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp @@ -148,12 +149,15 @@ if [ $BASE_SYSTEM != "netware" ] ; then rm -f $BASE/include/config-netware.h fi -if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests -fi -if [ -d man ] ; then - $CP man/*.1 $BASE/man/man1 +if [ $BASE_SYSTEM != "netware" ] ; then + if [ -d tests ] ; then + $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests + fi + if [ -d man ] ; then + $CP man/*.1 $BASE/man/man1 + fi fi + $CP support-files/* $BASE/support-files if [ $BASE_SYSTEM = "netware" ] ; then -- cgit v1.2.1 From af9a92cf37efcd9d5cee65e56fd6aa52228c4281 Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Thu, 20 Feb 2003 14:05:58 -0800 Subject: Initial script to create a windows src distribution package --- scripts/Makefile.am | 4 +- scripts/make_win_src_distribution.sh | 360 +++++++++++++++++++++++++++++++++++ 2 files changed, 363 insertions(+), 1 deletion(-) create mode 100755 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 458097499c9..3b4d19b7eed 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -35,6 +35,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ + make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ @@ -66,6 +67,7 @@ pkgdata_DATA = make_binary_distribution # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ + make_win_src_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ @@ -135,7 +137,7 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_help_tables.sql +all: fill_help_tables.sql make_win_src_distribution fill_help_tables.sql: fill_help_tables ../Docs/manual.texi ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh new file mode 100755 index 00000000000..da6592bd630 --- /dev/null +++ b/scripts/make_win_src_distribution.sh @@ -0,0 +1,360 @@ +#!/bin/sh + +# +# Script to create a Windows src package +# + +version=@VERSION@ +export version +SOURCE=`pwd` +CP="cp -p" + +DEBUG=0 +SILENT=0 +TMP=/tmp +SUFFIX="" +OUTTAR=0 + +SRCDIR=$SOURCE +DSTDIR=$TMP + +# +# This script must run from MySQL top directory +# + +if [ ! -f scripts/make_win_src_distribution.sh ]; then + echo "ERROR : You must run this script from the MySQL top-level directory" + exit 1 +fi + +# +# 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 " --silent Do not list verbosely files processed" + echo " --tar Create a tar.gz package instead of .zip" + echo " --help Show this help message" + + exit 1 +} + +# +# 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=;;"` ;; + --silent) SILENT=1 ;; + --tar) OUTTAR=1 ;; + --help) show_usage ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" + +# +# Currently return an error if --tar is not used +# + +if [ x$OUTTAR = x0 ] && [ x$DEBUG = x0 ] +then + echo "ERROR: The default .zip doesn't yet work on Windows, as it can't load" + echo " the workspace files due to LF->CR+LF issues, instead use --tar" + echo " to create a .tar.gz package " + echo "" + show_usage; + exit 1 +fi + +# +# Create a tmp dest directory to copy files +# + +BASE=$TMP/my_win_dist$SUFFIX + +if [ -d $BASE ] ; then + rm -r -f $BASE +fi + +$CP -r $SOURCE/VC++Files $BASE + +( +find $BASE -name *.dsw -and -not -path \*SCCS\* -print +find $BASE -name *.dsp -and -not -path \*SCCS\* -print +)|( +while read v +do + sed 's/$'"/`echo -e \\\r`/" $v > $v.tmp + rm $v + mv $v.tmp $v +done +) + +# move all error message files to root directory +$CP -r $SOURCE/sql/share $BASE/ + +# +# Clean up if we did this from a bk tree +# + +if [ -d $BASE/SCCS ] +then + find $BASE/ -name SCCS -print | xargs rm -r -f + rm -rf "$BASE/InstallShield/Script Files/SCCS" +fi + + +mkdir $BASE/Docs $BASE/extra $BASE/include + + +# +# Copy directory files +# + +copy_dir_files() { + + for arg do + + cd $SOURCE/$arg/ + ( + ls -A1|grep \\.[ch]$ + ls -A1|grep \\.ih$ + ls -A1|grep \\.i$ + ls -A1|grep \\.ic$ + ls -A1|grep \\.asm$ + ls -A1|grep README + ls -A1|grep INSTALL + ls -A1|grep LICENSE + )|( + while read v + do + $CP $SOURCE/$arg/$v $BASE/$arg/$v + done + ) + + cd $SOURCE/$arg/ + ( + ls -A1|grep \\.cc$|sed 's/.cc$//g')|( + while read v + do + $CP $SOURCE/$arg/$v.cc $BASE/$arg/$v.cpp + 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/ + ( + ls -l |grep "^d"|awk '{print($9)}' - + )|( + while read dir_name + do + if [ x$dir_name != x"SCCS" ] + then + if [ ! -d $BASE/$basedir/$dir_name ]; then + mkdir $BASE/$basedir/$dir_name + fi + copy_dir_files $basedir/$dir_name + fi + done + ) + done +} + +# +# Input directories to be copied +# + +copy_dir_files 'bdb' +copy_dir_files 'bdb/build_win32' +copy_dir_files 'client' +copy_dir_files 'dbug' +copy_dir_files 'extra' +copy_dir_files 'heap' +copy_dir_files 'include' +copy_dir_files 'innobase' +copy_dir_files 'isam' +copy_dir_files 'libmysql' +copy_dir_files 'libmysqld' +copy_dir_files 'merge' +copy_dir_files 'myisam' +copy_dir_files 'myisammrg' +copy_dir_files 'mysys' +copy_dir_files 'regex' +copy_dir_files 'sql' +copy_dir_files 'strings' +copy_dir_files 'vio' +copy_dir_files 'zlib' + +# +# Input directories to be copied recursively +# + +copy_dir_dirs 'bdb' +copy_dir_dirs 'innobase' + +# create dummy innobase configure header +if [ -f $BASE/innobase/ib_config.h ] +then + rm -f $BASE/innobase/ib_config.h + touch $BASE/innobase/ib_config.h +fi + +# +# Copy miscellaneous files +# + +$CP $SOURCE/myisam/myisampack.c $BASE/myisampack/ +$CP $SOURCE/client/mysqlbinlog.cc $BASE/mysqlbinlog/mysqlbinlog.cpp +$CP $SOURCE/isam/pack_isam.c $BASE/pack_isam/pack_isam.c + +cd $SOURCE +for i in COPYING ChangeLog README \ + INSTALL-SOURCE INSTALL-WIN \ + INSTALL-SOURCE-WIN \ + Docs/manual_toc.html Docs/manual.html \ + Docs/mysqld_error.txt Docs/INSTALL-BINARY + +do + if [ -f $i ] + then + $CP $i $BASE/$i + fi +done + +# +# TODO: Initialize the initial data directory +# + + +# +# Specify the distribution package name and copy it +# + +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX-win-src +BASE2=$TMP/$NEW_NAME +rm -r -f $BASE2 +mv $BASE $BASE2 +BASE=$BASE2 + +# +# If debugging, don't create a zip/tar/gz +# + +if [ x$DEBUG = x1 ] ; 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 file +# + +if [ x$OUTTAR = x1 ]; then + ZIPFILE1=gnutar + ZIPFILE2=gtar + OPT=cvf + EXT=".tar" + NEED_COMPRESS=1 + if [ x$SILENT = x1 ] ; then + OPT=cf + fi +else + ZIPFILE1=zip + ZIPFILE2="" + OPT="-lvr" + EXT=".zip" + NEED_COMPRESS=0 + if [ x$SILENT = x1 ] ; then + OPT="-lr" + fi +fi + +tar=`which_1 $ZIPFILE1 $ZIPFILE2` +if test "$?" = "1" -o "$tar" = "" +then + tar=tar +fi + +echo "Using $tar to create archive" +cd $TMP + +$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_NAME +cd $SOURCE + +if [ x$NEED_COMPRESS = x1 ] +then + echo "Compressing archive" + gzip -9 $NEW_NAME$EXT + EXT=".tar.gz" +fi + +echo "Removing temporary directory" +rm -r -f $BASE + +echo "$NEW_NAME$EXT created successfully !!" + +# +# End of script +# + + + -- cgit v1.2.1 From d8c75ec8aa867ec002c543e7931d54fd7144fd46 Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Fri, 21 Feb 2003 17:37:05 +0100 Subject: Most of the groundwork for sprint task 729 (implement FUNCTIONs). Expanded the mysql.proc table, reworked the find/create/drop functions completely, added new functions for FUNCTIONs (lotta functions here :), got rid of some unnecessary use of Item_strings while at it. Extended the parser correspondingly, and fiddled around a bit to make SP FUNCTIONs coexist with UDFs. Can now CREATE and DROP FUNCTIONs. Invoking yet to come... --- scripts/mysql_install_db.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 8ff5653d299..b7dc3fce194 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -312,8 +312,9 @@ then c_p="$c_p CREATE TABLE proc (" c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p type enum('function','procedure') NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL," - c_p="$c_p PRIMARY KEY (name)" + c_p="$c_p PRIMARY KEY (name,type)" c_p="$c_p )" c_p="$c_p comment='Stored Procedures';" fi -- cgit v1.2.1 From 7dc6d7bd193169fed5183c35e3c36ddc5683622c Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Mon, 24 Feb 2003 16:57:54 +0200 Subject: Applied a patch which fixes a quoting problem with mysql_hot_copy when --checkpoint or --record-log-pos was used. --- scripts/mysqlhotcopy.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 1a694247461..ec76aa479f3 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.17"; +my $VERSION = "1.18"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -173,6 +173,7 @@ my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", # --- check that checkpoint table exists if specified --- if ( $opt{checkpoint} ) { + $opt{checkpoint} = quote_names( $opt{checkpoint} ); eval { $dbh->do( qq{ select time_stamp, src, dest, msg from $opt{checkpoint} where 1 != 1} ); }; @@ -183,6 +184,8 @@ if ( $opt{checkpoint} ) { # --- check that log_pos table exists if specified --- if ( $opt{record_log_pos} ) { + $opt{record_log_pos} = quote_names( $opt{record_log_pos} ); + eval { $dbh->do( qq{ select host, time_stamp, log_file, log_pos, master_host, master_log_file, master_log_pos from $opt{record_log_pos} where 1 != 1} ); }; @@ -309,7 +312,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 { quote_names("$db.$_") } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; $rdb->{raid_dirs} = [ get_raid_dirs( $rdb->{files} ) ]; @@ -569,7 +572,7 @@ sub copy_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'" ) if (@non_raid); foreach my $rd ( @$raid_dirs ) { my @raid = map { "'$_'" } grep { m:$rd/: } @$files; @@ -758,6 +761,16 @@ sub get_list_of_tables { return @dbh_tables; } +sub quote_names { + my ( $name ) = @_; + # given a db.table name, add quotes + + my ($db, $table, @cruft) = split( /\./, $name ); + die "Invalid db.table name '$name'" if (@cruft || !defined $db || !defined $table ); + + return "`$db`.`$table`"; +} + __END__ =head1 DESCRIPTION -- cgit v1.2.1 From e6c575dacc5e5df7e0ffa727bb45056cea3d4441 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Wed, 26 Feb 2003 00:04:13 +0200 Subject: change 'slave-master-info.opt' to .slave-mi to avoid problems with long filenames on some OS --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2e25cc9bdc4..801f9fb2e05 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -113,7 +113,7 @@ $CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/ $CP mysql-test/README $BASE/mysql-test/README $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r $CP scripts/* $BASE/bin -- cgit v1.2.1 From 64f0e4289d4d003fde9de69c1975ff6d186c60ba Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Sun, 2 Mar 2003 14:05:51 -0800 Subject: Fix for the windows src distribution script - SCRUM: -- To take care of .zip and .tar -- Initialization of 'data' directory without any host dependancy data -- Incorporate all changes from Monty --- scripts/make_win_src_distribution.sh | 274 +++++++++++++++++++---------------- scripts/mysql_install_db.sh | 26 +++- 2 files changed, 169 insertions(+), 131 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index da6592bd630..17df384522d 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -15,17 +15,38 @@ TMP=/tmp SUFFIX="" OUTTAR=0 -SRCDIR=$SOURCE -DSTDIR=$TMP - # # This script must run from MySQL top directory # -if [ ! -f scripts/make_win_src_distribution.sh ]; then +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 + + +# +# Assign the tmp directory if it was set from the environment variables +# + +for i in $TMPDIR $TEMPDIR $TEMP +do + if [ $i ]; then + TMP=$i + break + fi +done + # # Usage of the script @@ -42,7 +63,7 @@ show_usage() { echo " --tar Create a tar.gz package instead of .zip" echo " --help Show this help message" - exit 1 + exit 0 } # @@ -68,20 +89,6 @@ parse_arguments() { parse_arguments "$@" -# -# Currently return an error if --tar is not used -# - -if [ x$OUTTAR = x0 ] && [ x$DEBUG = x0 ] -then - echo "ERROR: The default .zip doesn't yet work on Windows, as it can't load" - echo " the workspace files due to LF->CR+LF issues, instead use --tar" - echo " to create a .tar.gz package " - echo "" - show_usage; - exit 1 -fi - # # Create a tmp dest directory to copy files # @@ -89,24 +96,36 @@ fi BASE=$TMP/my_win_dist$SUFFIX if [ -d $BASE ] ; then + if [ x$DEBUG = x1 ]; then + echo "Destination directory '$BASE' already exists, deleting it" + fi rm -r -f $BASE fi $CP -r $SOURCE/VC++Files $BASE ( -find $BASE -name *.dsw -and -not -path \*SCCS\* -print -find $BASE -name *.dsp -and -not -path \*SCCS\* -print +find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( while read v do - sed 's/$'"/`echo -e \\\r`/" $v > $v.tmp - rm $v - mv $v.tmp $v + if [ x$DEBUG = x1 ]; then + echo "Replacing LF -> CRLF from '$v'" + fi + + # ^M -> type CTRL V + CTRL M + cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp + rm $v + mv $v.tmp $v + + # awk '!/r\r$/ {print $0"\r"} /r\r$/ {print $0}' $v > $v done ) -# move all error message files to root directory +# +# Move all error message files to root directory +# + $CP -r $SOURCE/sql/share $BASE/ # @@ -118,9 +137,8 @@ then find $BASE/ -name SCCS -print | xargs rm -r -f rm -rf "$BASE/InstallShield/Script Files/SCCS" fi - -mkdir $BASE/Docs $BASE/extra $BASE/include +mkdir $BASE/Docs $BASE/extra $BASE/include # @@ -130,32 +148,26 @@ mkdir $BASE/Docs $BASE/extra $BASE/include copy_dir_files() { for arg do - - cd $SOURCE/$arg/ - ( - ls -A1|grep \\.[ch]$ - ls -A1|grep \\.ih$ - ls -A1|grep \\.i$ - ls -A1|grep \\.ic$ - ls -A1|grep \\.asm$ - ls -A1|grep README - ls -A1|grep INSTALL - ls -A1|grep LICENSE - )|( - while read v - do - $CP $SOURCE/$arg/$v $BASE/$arg/$v - done - ) - + if [ x$DEBUG = x1 ]; then + echo "Copying files from directory '$arg'" + fi cd $SOURCE/$arg/ - ( - ls -A1|grep \\.cc$|sed 's/.cc$//g')|( - while read v - do - $CP $SOURCE/$arg/$v.cc $BASE/$arg/$v.cpp - done - ) + for i in *.c *.h *.ih *.i *.ic *.asm \ + 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 } @@ -169,27 +181,21 @@ copy_dir_dirs() { basedir=$arg - if [ ! -d $BASE/$arg ]; then + if [ ! -d $BASE/$arg ]; then mkdir $BASE/$arg - fi - + fi copy_dir_files $arg - cd $SOURCE/$arg/ - ( - ls -l |grep "^d"|awk '{print($9)}' - - )|( - while read dir_name - do - if [ x$dir_name != x"SCCS" ] - then - if [ ! -d $BASE/$basedir/$dir_name ]; then - mkdir $BASE/$basedir/$dir_name - fi - copy_dir_files $basedir/$dir_name + cd $SOURCE/$arg/ + for i in * + do + if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then + if [ ! -d $BASE/$basedir/$i ]; then + mkdir $BASE/$basedir/$i fi - done - ) + copy_dir_files $basedir/$i + fi + done done } @@ -197,49 +203,37 @@ copy_dir_dirs() { # Input directories to be copied # -copy_dir_files 'bdb' -copy_dir_files 'bdb/build_win32' -copy_dir_files 'client' -copy_dir_files 'dbug' -copy_dir_files 'extra' -copy_dir_files 'heap' -copy_dir_files 'include' -copy_dir_files 'innobase' -copy_dir_files 'isam' -copy_dir_files 'libmysql' -copy_dir_files 'libmysqld' -copy_dir_files 'merge' -copy_dir_files 'myisam' -copy_dir_files 'myisammrg' -copy_dir_files 'mysys' -copy_dir_files 'regex' -copy_dir_files 'sql' -copy_dir_files 'strings' -copy_dir_files 'vio' -copy_dir_files 'zlib' +for i in client dbug extra heap include isam \ + libmysql libmysqld merge myisam \ + myisammrg mysys regex sql strings \ + vio zlib +do + copy_dir_files $i +done # # Input directories to be copied recursively # -copy_dir_dirs 'bdb' -copy_dir_dirs 'innobase' +for i in bdb innobase +do + copy_dir_dirs $i +done -# create dummy innobase configure header -if [ -f $BASE/innobase/ib_config.h ] -then +# +# Create dummy innobase configure header +# + +if [ -f $BASE/innobase/ib_config.h ]; then rm -f $BASE/innobase/ib_config.h - touch $BASE/innobase/ib_config.h fi +touch $BASE/innobase/ib_config.h + # # Copy miscellaneous files # -$CP $SOURCE/myisam/myisampack.c $BASE/myisampack/ -$CP $SOURCE/client/mysqlbinlog.cc $BASE/mysqlbinlog/mysqlbinlog.cpp -$CP $SOURCE/isam/pack_isam.c $BASE/pack_isam/pack_isam.c - cd $SOURCE for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ @@ -248,16 +242,26 @@ for i in COPYING ChangeLog README \ Docs/mysqld_error.txt Docs/INSTALL-BINARY do + if [ x$DEBUG = x1 ]; then + echo "Copying file '$i'" + fi if [ -f $i ] then - $CP $i $BASE/$i + $CP $i $BASE/$i fi done # -# TODO: Initialize the initial data directory +# Initialize the initial data directory # +if [ -f scripts/mysql_install_db ]; then + if [ x$DEBUG = x1 ]; then + echo "Initializing the 'data' directory" + fi + scripts/mysql_install_db -WINDOWS --datadir=$BASE/data +fi + # # Specify the distribution package name and copy it @@ -305,36 +309,56 @@ which_1 () } # -# Create the result zip file +# Create the result zip/tar file # +set_tarzip_options() +{ + for arg + do + if [ x$arg = x"tar" ]; then + ZIPFILE1=gnutar + ZIPFILE2=gtar + OPT=cvf + EXT=".tar" + NEED_COMPRESS=1 + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + else + ZIPFILE1=zip + ZIPFILE2="" + OPT="-vr" + EXT=".zip" + NEED_COMPRESS=0 + if [ x$SILENT = x1 ] ; then + OPT="-r" + fi + fi + done +} + if [ x$OUTTAR = x1 ]; then - ZIPFILE1=gnutar - ZIPFILE2=gtar - OPT=cvf - EXT=".tar" - NEED_COMPRESS=1 - if [ x$SILENT = x1 ] ; then - OPT=cf - fi + set_tarzip_options 'tar' else - ZIPFILE1=zip - ZIPFILE2="" - OPT="-lvr" - EXT=".zip" - NEED_COMPRESS=0 - if [ x$SILENT = x1 ] ; then - OPT="-lr" - fi + set_tarzip_options 'zip' fi tar=`which_1 $ZIPFILE1 $ZIPFILE2` if test "$?" = "1" -o "$tar" = "" then tar=tar + set_tarzip_options 'tar' +fi + +# +# Create the archive +# + +if [ xDEBUG = x1 ]; then + echo "Using $tar to create archive" fi -echo "Using $tar to create archive" cd $TMP $tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_NAME @@ -342,19 +366,21 @@ cd $SOURCE if [ x$NEED_COMPRESS = x1 ] then - echo "Compressing archive" + if [ xDEBUG = x1 ]; then + echo "Compressing archive" + fi gzip -9 $NEW_NAME$EXT - EXT=".tar.gz" + EXT="$EXT.gz" fi -echo "Removing temporary directory" +if [ xDEBUG = x1 ]; then + echo "Removing temporary directory" +fi rm -r -f $BASE echo "$NEW_NAME$EXT created successfully !!" -# # End of script -# diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 862cffb0cb7..f108eb8b7dc 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -13,6 +13,12 @@ case "$1" in IN_RPM="1"; shift ;; esac +windows=0 +case "$1" in + -WINDOWS) + windows="1"; shift + ;; +esac defaults= case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) @@ -94,7 +100,7 @@ fi mdata=$ldata/mysql -if test ! -x $execdir/mysqld +if test "$windows" -eq 0 -a ! -x $execdir/mysqld then if test "$IN_RPM" -eq 1 then @@ -110,7 +116,7 @@ fi hostname=`@HOSTNAME@` # Install this too in the user table # Check if hostname is valid -if test "$IN_RPM" -eq 0 -a $force -eq 0 +if test "$windows" -eq 0 -a "$IN_RPM" -eq 0 -a $force -eq 0 then resolved=`$bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] @@ -134,7 +140,7 @@ then fi # Create database directories mysql & test -if test "$IN_RPM" -eq 0 +if test "$IN_RPM" -eq 0 || "$windows" -eq 0 then if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi @@ -247,13 +253,19 @@ then c_u="$c_u comment='Users and global privileges';" i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + + INSERT INTO user (host,user) values ('localhost','');" + + if test "$windows" -eq 0 + then + i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" + fi fi if test ! -f $mdata/func.frm @@ -330,7 +342,7 @@ END_OF_DATA --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then echo "" - if test "$IN_RPM" -eq 0 + if test "$IN_RPM" -eq 0 || "$windows" -eq 0 then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -351,7 +363,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" -eq 0 + if test "$IN_RPM" -eq 0 -a "$windows" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" -- cgit v1.2.1 From 137bdcec5a258d80f6cc44ca84e7e4568f787867 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com[greg]" <> Date: Tue, 4 Mar 2003 10:34:32 -0500 Subject: novell41.patch --- scripts/make_binary_distribution.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 78eb1343f47..874896c33b4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -64,16 +64,17 @@ case $system in esac -mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ +mkdir $BASE $BASE/bin \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1 -fi + mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ + $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test -chmod o-rwx $BASE/data $BASE/data/* + chmod o-rwx $BASE/data $BASE/data/* +fi for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ -- cgit v1.2.1 From 905ce89dc53596303dd9cbf31b24002e49b5cbab Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 4 Mar 2003 18:18:05 +0100 Subject: - added missing file mysql-test/std_data/des_key_file to source and binary distribution to fix a test failure in test "func_encrypt" --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 78eb1343f47..f0113ee1780 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -183,6 +183,7 @@ done $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r -- cgit v1.2.1 From 26f9bee733ce8d42cdbd3dbfda8ce05343749523 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 4 Mar 2003 22:24:00 +0100 Subject: - added missing file mysql-test/std_data/des_key_file to source and binary distribution to fix a test failure in test "func_encrypt" --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 874896c33b4..2fff531c4c8 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -184,6 +184,7 @@ done $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r -- cgit v1.2.1 From dff8f6327214aed48b4361e48aa7d3c7dfa5ff08 Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Fri, 7 Mar 2003 10:16:23 -0800 Subject: Change -IN_RPM -> --rpm and -WINDOWS -> --windows from mysql_install_db --- scripts/make_win_src_distribution.sh | 123 ++++++++++++++++++----------------- scripts/mysql_install_db.sh | 18 ++--- 2 files changed, 72 insertions(+), 69 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 17df384522d..9a787080c3e 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -11,7 +11,6 @@ CP="cp -p" DEBUG=0 SILENT=0 -TMP=/tmp SUFFIX="" OUTTAR=0 @@ -34,33 +33,33 @@ if [ ! -f sql/sql_yacc.cc ]; then exit 1 fi - # -# Assign the tmp directory if it was set from the environment variables +# Debug print of the status # -for i in $TMPDIR $TEMPDIR $TEMP -do - if [ $i ]; then - TMP=$i - break - fi -done +print_debug() +{ + for statement + do + if [ "$DEBUG" = "1" ] ; then + echo $statement + fi + done +} - # # Usage of the script # -show_usage() { - +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 " --silent Do not list verbosely files processed" - echo " --tar Create a tar.gz package instead of .zip" + echo " --tar Create tar.gz package instead of .zip" echo " --help Show this help message" exit 0 @@ -89,6 +88,22 @@ parse_arguments() { 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 # @@ -96,30 +111,23 @@ parse_arguments "$@" BASE=$TMP/my_win_dist$SUFFIX if [ -d $BASE ] ; then - if [ x$DEBUG = x1 ]; then - echo "Destination directory '$BASE' already exists, deleting it" - fi + 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 - if [ x$DEBUG = x1 ]; then - echo "Replacing LF -> CRLF from '$v'" - fi - - # ^M -> type CTRL V + CTRL M - cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp - rm $v - mv $v.tmp $v + while read v + do + print_debug "Replacing LF -> CRLF from '$v'" - # awk '!/r\r$/ {print $0"\r"} /r\r$/ {print $0}' $v > $v -done + # ^M -> type CTRL V + CTRL M + cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp + rm $v + mv $v.tmp $v + done ) # @@ -127,6 +135,9 @@ done # $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 @@ -135,7 +146,7 @@ $CP -r $SOURCE/sql/share $BASE/ if [ -d $BASE/SCCS ] then find $BASE/ -name SCCS -print | xargs rm -r -f - rm -rf "$BASE/InstallShield/Script Files/SCCS" + rm -r -f "$BASE/InstallShield/Script Files/SCCS" fi mkdir $BASE/Docs $BASE/extra $BASE/include @@ -148,9 +159,7 @@ mkdir $BASE/Docs $BASE/extra $BASE/include copy_dir_files() { for arg do - if [ x$DEBUG = x1 ]; then - echo "Copying files from directory '$arg'" - fi + print_debug "Copying files from directory '$arg'" cd $SOURCE/$arg/ for i in *.c *.h *.ih *.i *.ic *.asm \ README INSTALL* LICENSE @@ -183,7 +192,8 @@ copy_dir_dirs() { if [ ! -d $BASE/$arg ]; then mkdir $BASE/$arg - fi + fi + copy_dir_files $arg cd $SOURCE/$arg/ @@ -242,9 +252,7 @@ for i in COPYING ChangeLog README \ Docs/mysqld_error.txt Docs/INSTALL-BINARY do - if [ x$DEBUG = x1 ]; then - echo "Copying file '$i'" - fi + print_debug "Copying file '$i'" if [ -f $i ] then $CP $i $BASE/$i @@ -256,10 +264,8 @@ done # if [ -f scripts/mysql_install_db ]; then - if [ x$DEBUG = x1 ]; then - echo "Initializing the 'data' directory" - fi - scripts/mysql_install_db -WINDOWS --datadir=$BASE/data + print_debug "Initializing the 'data' directory" + scripts/mysql_install_db --windows --datadir=$BASE/data fi @@ -267,8 +273,10 @@ fi # Specify the distribution package name and copy it # -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX-win-src -BASE2=$TMP/$NEW_NAME +NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX +NEW_NAME=$NEW_DIR_NAME-win-src + +BASE2=$TMP/$NEW_DIR_NAME rm -r -f $BASE2 mv $BASE $BASE2 BASE=$BASE2 @@ -277,7 +285,7 @@ BASE=$BASE2 # If debugging, don't create a zip/tar/gz # -if [ x$DEBUG = x1 ] ; then +if [ "$DEBUG" = "1" ] ; then echo "Please check the distribution files from $BASE" echo "Exiting (without creating the package).." exit @@ -316,13 +324,13 @@ set_tarzip_options() { for arg do - if [ x$arg = x"tar" ]; then + if [ "$arg" = "tar" ]; then ZIPFILE1=gnutar ZIPFILE2=gtar OPT=cvf EXT=".tar" NEED_COMPRESS=1 - if [ x$SILENT = x1 ] ; then + if [ "$SILENT" = "1" ] ; then OPT=cf fi else @@ -331,14 +339,14 @@ set_tarzip_options() OPT="-vr" EXT=".zip" NEED_COMPRESS=0 - if [ x$SILENT = x1 ] ; then + if [ "$SILENT" = "1" ] ; then OPT="-r" fi fi done } -if [ x$OUTTAR = x1 ]; then +if [ "$OUTTAR" = "1" ]; then set_tarzip_options 'tar' else set_tarzip_options 'zip' @@ -347,6 +355,7 @@ 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 @@ -355,27 +364,21 @@ fi # Create the archive # -if [ xDEBUG = x1 ]; then - echo "Using $tar to create archive" -fi +print_debug "Using $tar to create archive" cd $TMP -$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_NAME +$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME cd $SOURCE -if [ x$NEED_COMPRESS = x1 ] +if [ "$NEED_COMPRESS" = "1" ] then - if [ xDEBUG = x1 ]; then - echo "Compressing archive" - fi + print_debug "Compressing archive" gzip -9 $NEW_NAME$EXT EXT="$EXT.gz" fi -if [ xDEBUG = x1 ]; then - echo "Removing temporary directory" -fi +print_debug "Removing temporary directory" rm -r -f $BASE echo "$NEW_NAME$EXT created successfully !!" diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f108eb8b7dc..7249a095195 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -7,15 +7,15 @@ # # All unrecognized arguments to this script are passed to mysqld. -IN_RPM=0 +in_rpm=0 case "$1" in - -IN-RPM) - IN_RPM="1"; shift + --rpm) + in_rpm="1"; shift ;; esac windows=0 case "$1" in - -WINDOWS) + --windows) windows="1"; shift ;; esac @@ -102,7 +102,7 @@ mdata=$ldata/mysql if test "$windows" -eq 0 -a ! -x $execdir/mysqld then - if test "$IN_RPM" -eq 1 + if test "$in_rpm" -eq 1 then echo "FATAL ERROR $execdir/mysqld not found!" exit 1 @@ -116,7 +116,7 @@ fi hostname=`@HOSTNAME@` # Install this too in the user table # Check if hostname is valid -if test "$windows" -eq 0 -a "$IN_RPM" -eq 0 -a $force -eq 0 +if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a $force -eq 0 then resolved=`$bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] @@ -140,7 +140,7 @@ then fi # Create database directories mysql & test -if test "$IN_RPM" -eq 0 || "$windows" -eq 0 +if test "$in_rpm" -eq 0 || "$windows" -eq 0 then if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi @@ -342,7 +342,7 @@ END_OF_DATA --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then echo "" - if test "$IN_RPM" -eq 0 || "$windows" -eq 0 + if test "$in_rpm" -eq 0 || "$windows" -eq 0 then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -363,7 +363,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" -eq 0 -a "$windows" -eq 0 + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" -- cgit v1.2.1 From c231b747e3d5bea9bf636528bf5491dd29ebab8e Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Mon, 10 Mar 2003 12:24:22 +0200 Subject: Don't allow multiple --user options to mysqld (First one is used) --- scripts/safe_mysqld.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index c1b231eb001..a8ca3537cb3 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -33,8 +33,12 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; - + --user=*) + if [ $SET_USER == 0 ] + then + user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 + fi + ;; # these two might have been set in a [safe_mysqld] section of my.cnf # they get passed via environment variables to safe_mysqld --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; -- cgit v1.2.1 From b69e0f48bee5ec65fe6d069120c579c41b5c0cc2 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 11 Mar 2003 18:54:57 +0100 Subject: - made test for multiple --user options more sh-compatible --- scripts/safe_mysqld.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index a8ca3537cb3..6b7e16c57b0 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -34,8 +34,8 @@ parse_arguments() { --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--[^=]*=;;"` ;; --user=*) - if [ $SET_USER == 0 ] - then + if test $SET_USER -eq 0 + then user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 fi ;; -- cgit v1.2.1 From 7092bbe8a40970ca6d8f1f98e977e4207a4c3904 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Fri, 14 Mar 2003 16:07:15 +0100 Subject: Small fixes in mysql_tableinfo. It's only code tiny changes, does not modify the output of the script. --- scripts/mysql_tableinfo.sh | 114 ++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 58 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh index bfe9be377c7..f5083a776c6 100644 --- a/scripts/mysql_tableinfo.sh +++ b/scripts/mysql_tableinfo.sh @@ -10,7 +10,7 @@ mysql_tableinfo - creates and populates information tables with the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), SHOW COLUMNS and SHOW INDEX. -This is version 1.0. +This is version 1.1. =head1 SYNOPSIS @@ -62,7 +62,7 @@ GetOptions( \%opt, "quiet|q", ) or usage("Invalid option"); -if ($opt{help}) {usage();} +if ($opt{'help'}) {usage();} my ($db_to_write,$db_like_wild,$tbl_like_wild); if (@ARGV==0) @@ -74,6 +74,8 @@ $db_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; $tbl_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; if (@ARGV>0) { usage("Too many arguments"); } +$0 = $1 if $0 =~ m:/([^/]+)$:; + my $info_db="`".$opt{'prefix'}."db`"; my $info_tbl="`".$opt{'prefix'}."tbl". (($opt{'tbl-status'})?"_status":"")."`"; @@ -84,11 +86,11 @@ my $info_idx="`".$opt{'prefix'}."idx`"; # --- connect to the database --- my $dsn = ";host=$opt{'host'}"; -$dsn .= ";port=$opt{port}" if $opt{port}; -$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; +$dsn .= ";port=$opt{'port'}" if $opt{'port'}; +$dsn .= ";mysql_socket=$opt{'socket'}" if $opt{'socket'}; my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=perl", - $opt{user}, $opt{password}, + $opt{'user'}, $opt{'password'}, { RaiseError => 1, PrintError => 0, @@ -104,20 +106,19 @@ if (!$opt{'quiet'}) { print "\n!! This program is doing to do:\n\n"; print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); - print "**DELETE** FROM ... WHERE `Database LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild + print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild **INSERT** INTO ... on the following tables :\n"; - my $i; - foreach $i (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) + + foreach (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) { - print(" $db_to_write.$i\n"); + print(" $db_to_write.$_\n"); } print "\nContinue (you can skip this confirmation step with --quiet) ? (y|n) [n]"; - my $answer=; - unless ($answer =~ /^\s*y\s*$/i) + if ( !~ /^\s*y\s*$/i) { print "Nothing done!\n";exit; } @@ -126,17 +127,16 @@ on the following tables :\n"; if ($opt{'clear'} or $opt{'clear-only'}) { #do not drop the $db_to_write database ! - my $i; - foreach $i (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) + foreach (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) { - $dbh->do("DROP TABLE IF EXISTS $db_to_write.$i"); + $dbh->do("DROP TABLE IF EXISTS $db_to_write.$_"); } if ($opt{'clear-only'}) { print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); - exit(); + exit; } } @@ -151,14 +151,14 @@ $dbh->do("CREATE DATABASE IF NOT EXISTS $db_to_write"); $dbh->do("USE $db_to_write"); #get databases -$sth{db}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); -$sth{db}->execute; +$sth{'db'}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); +$sth{'db'}->execute; #create $info_db which will receive info about databases. #Ensure that the first column to be called "Database" (as SHOW DATABASES LIKE #returns a varying #column name (of the form "Database (%...)") which is not suitable) -$extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`"); +$extra_col_desc{'db'}=do_create_table("db",$info_db,undef,"`Database`"); #we'll remember the type of the `Database` column (as returned by #SHOW DATABASES), which we will need when creating the next tables. @@ -166,55 +166,56 @@ $extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`"); $dbh->do("DELETE FROM $info_db WHERE `Database` LIKE $db_like_wild"); -while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases +while ($row{'db'}=$sth{'db'}->fetchrow_arrayref) #go through all databases { #insert the database name $dbh->do("INSERT INTO $info_db VALUES(" - .join_quote(@{$row{db}}).")"); + .join(',' , ( map $dbh->quote($_), @{$row{'db'}} ) ).")" ); #for each database, get tables - $sth{tbl}=$dbh->prepare("SHOW TABLE" + $sth{'tbl'}=$dbh->prepare("SHOW TABLE" .( ($opt{'tbl-status'}) ? " STATUS" : "S" ) - ." from `${$row{db}}[0]` LIKE $tbl_like_wild"); - $sth{tbl}->execute; + ." from `$row{'db'}->[0]` LIKE $tbl_like_wild"); + $sth{'tbl'}->execute; unless ($done_create_table{$info_tbl}) #tables must be created only once, and out-of-date info must be #cleared once { $done_create_table{$info_tbl}=1; - $extra_col_desc{table}= + $extra_col_desc{'tbl'}= do_create_table("tbl",$info_tbl, #add an extra column (database name) at the left #and ensure that the table name will be called "Table" #(this is unncessesary with #SHOW TABLE STATUS, but necessary with SHOW TABLES (which returns a column #named "Tables_in_...")) - "`Database` ".$extra_col_desc{db},"`Table`"); + "`Database` ".$extra_col_desc{'db'},"`Table`"); $dbh->do("DELETE FROM $info_tbl WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); } - while (@{$row{tbl}}=$sth{tbl}->fetchrow_array) + while ($row{'tbl'}=$sth{'tbl'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_tbl VALUES(" - .$dbh->quote(${$row{db}}[0]).",".join_quote(@{$row{tbl}}).")"); + .$dbh->quote($row{'db'}->[0])."," + .join(',' , ( map $dbh->quote($_), @{$row{'tbl'}} ) ).")"); #for each table, get columns... if ($opt{'col'}) { - $sth{col}=$dbh->prepare("SHOW COLUMNS FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); - $sth{col}->execute; + $sth{'col'}=$dbh->prepare("SHOW COLUMNS FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); + $sth{'col'}->execute; unless ($done_create_table{$info_col}) { $done_create_table{$info_col}=1; do_create_table("col",$info_col, - "`Database` ".$extra_col_desc{db}."," - ."`Table` ".$extra_col_desc{table}."," + "`Database` ".$extra_col_desc{'db'}."," + ."`Table` ".$extra_col_desc{'tbl'}."," ."`Seq_in_table` BIGINT(3)"); #We need to add a sequence number (1 for the first column of the table, #2 for the second etc) so that users are able to retrieve columns in order @@ -225,13 +226,13 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases AND `Table` LIKE $tbl_like_wild"); } my $col_number=0; - while (@{$row{col}}=$sth{col}->fetchrow_array) + while ($row{'col'}=$sth{'col'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_col VALUES(" - .$dbh->quote(${$row{db}}[0])."," - .$dbh->quote(${$row{tbl}}[0])."," + .$dbh->quote($row{'db'}->[0])."," + .$dbh->quote($row{'tbl'}->[0])."," .++$col_number."," - .join_quote(@{$row{col}}).")"); + .join(',' , ( map $dbh->quote($_), @{$row{'col'}} ) ).")"); } } @@ -239,22 +240,22 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases if ($opt{'idx'}) { - $sth{idx}=$dbh->prepare("SHOW INDEX FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); - $sth{idx}->execute; + $sth{'idx'}=$dbh->prepare("SHOW INDEX FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); + $sth{'idx'}->execute; unless ($done_create_table{$info_idx}) { $done_create_table{$info_idx}=1; do_create_table("idx",$info_idx, - "`Database` ".$extra_col_desc{db}); + "`Database` ".$extra_col_desc{'db'}); $dbh->do("DELETE FROM $info_idx WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); } - while (@{$row{idx}}=$sth{idx}->fetchrow_array) + while ($row{'idx'}=$sth{'idx'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_idx VALUES(" - .$dbh->quote(${$row{db}}[0])."," - .join_quote(@{$row{idx}}).")"); + .$dbh->quote($row{'db'}->[0])."," + .join(',' , ( map $dbh->quote($_), @{$row{'idx'}} ) ).")"); } } } @@ -263,37 +264,30 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); exit; -sub join_quote -{ - my (@list)=@_; my $i; - foreach $i (@list) { $i=$dbh->quote($i); } - return (join ',',@list); -} sub do_create_table { my ($sth_key,$target_tbl,$extra_col_desc,$first_col_name)=@_; my $create_table_query=$extra_col_desc; - my ($i,$type,$first_col_desc,$col_desc); + my ($i,$first_col_desc,$col_desc); for ($i=0;$i<$sth{$sth_key}->{NUM_OF_FIELDS};$i++) { if ($create_table_query) { $create_table_query.=", "; } - $type=$sth{$sth_key}->{mysql_type_name}->[$i]; - $col_desc=$type; - if ($type =~ /char|int/i) + $col_desc=$sth{$sth_key}->{mysql_type_name}->[$i]; + if ($col_desc =~ /char|int/i) { $col_desc.="($sth{$sth_key}->{PRECISION}->[$i])"; } - elsif ($type =~ /decimal|numeric/i) #(never seen that) + elsif ($col_desc =~ /decimal|numeric/i) #(never seen that) { $col_desc.= "($sth{$sth_key}->{PRECISION}->[$i],$sth{$sth_key}->{SCALE}->[$i])"; } - elsif ($type !~ /date/i) #date and datetime are OK, + elsif ($col_desc !~ /date/i) #date and datetime are OK, #no precision or scale for them { - warn "unexpected column type '$type' + warn "unexpected column type '$col_desc' (neither 'char','int','decimal|numeric') when creating $target_tbl, hope table creation will go OK\n"; } @@ -393,6 +387,10 @@ Caution: info tables contain certain columns (e.g. Database, Table, Null...) whose names, as they are MySQL reserved words, need to be backquoted (`...`) when used in SQL statements. +Caution: as information fetching and info tables filling happen at the +same time, info tables may contain inaccurate information about +themselves. + =head1 OPTIONS =over 4 -- cgit v1.2.1 From 112dfa59000eed2e53d43097949ec384d3d37320 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Fri, 21 Mar 2003 18:53:55 +0200 Subject: Fixes for fill_help_tables.sql --- scripts/Makefile.am | 19 ++++++---- scripts/fill_help_tables.sh | 9 ++--- scripts/make_binary_distribution.sh | 5 ++- scripts/mysql_install_db.sh | 75 +++++++++++++++++++++++++++---------- 4 files changed, 75 insertions(+), 33 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3b4d19b7eed..88f561e0e6d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -58,10 +58,9 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug \ - fill_help_tables.sql + mysqlbug -pkgdata_DATA = make_binary_distribution +pkgdata_DATA = fill_help_tables.sql # mysqlbug should be distributed built so that people can report build # failures with it. @@ -81,8 +80,8 @@ CLEANFILES = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysqld_multi \ - fill_help_tables \ - fill_help_tables.sql + fill_help_tables \ + fill_help_tables.sql SUPERCLEANFILES = mysqlbug @@ -103,6 +102,7 @@ SUFFIXES = .sh -e 's!@''libexecdir''@!$(libexecdir)!g' \ -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ + -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ @@ -137,7 +137,12 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_help_tables.sql make_win_src_distribution +all: fill_help_tables.sql make_win_src_distribution make_binary_distribution + +# The following rule is here to ensure that build will continue +# even if we don't have perl installed. In this case the help tables +# will be empty fill_help_tables.sql: fill_help_tables ../Docs/manual.texi - ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql + -./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql + echo "" >> fill_help_tables.sql diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 52dfa018d6e..e21b0ff2bb0 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -111,12 +111,12 @@ sub flush_all $example= prepare_example($example); if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO help_topic (name,description,example) VALUES ("; + print "INSERT IGNORE INTO help_topic (name,description,example) VALUES ("; print "'$func_name',"; print "'$text',"; print "'$example'"; print ");\n"; - print "INSERT INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + print "INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; } $func_name= ""; @@ -131,11 +131,11 @@ sub new_category $category= prepare_text($category); - print "INSERT INTO help_category (name) VALUES (\'$category\');\n"; + print "INSERT IGNORE INTO help_category (name) VALUES (\'$category\');\n"; print "SET \@cur_category=LAST_INSERT_ID();\n"; } -#print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +#print "INSERT IGNORE INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; #print "CREATE DATABASE mysql_help;\n"; print "USE mysql;\n"; @@ -236,4 +236,3 @@ print "DELETE help_category "; print "FROM help_category "; print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id "; print "WHERE help_relation.help_category_id is null;" - diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2fff531c4c8..5ed76cefdb4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -160,6 +160,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi $CP support-files/* $BASE/support-files +$CP scripts/fill_help_tables.sql $BASE/support-files if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/support-files/magic \ @@ -183,14 +184,14 @@ do done $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then $CP scripts/* $BASE/bin - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7249a095195..1a969895f7f 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002 MySQL AB +# Copyright (C) 2002-2003 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, @@ -43,6 +43,7 @@ parse_arguments() { --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --verbose) verbose=1 ;; *) if test -n "$pick_args" then @@ -76,6 +77,8 @@ execdir= bindir= basedir= force=0 +verbose=0 +fill_help_tables="" parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -85,17 +88,37 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ + pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" -if test -x "$basedir/libexec/mysqld" -then - execdir="$basedir/libexec" -elif test -x "@libexecdir@/mysqld" + if test -x "$basedir/libexec/mysqld" + then + execdir="$basedir/libexec" + elif test -x "@libexecdir@/mysqld" + then + execdir="@libexecdir@" + else + execdir="$basedir/bin" + fi + + # find fill_help_tables.sh + for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then + pkgdatadir=$i + fi + done +fi + +if test -f $pkgdatadir/fill_help_tables.sql then - execdir="@libexecdir@" + fill_help_tables=$pkgdatadir/fill_help_tables.sql else - execdir="$basedir/bin" -fi + if test $verbose -eq 1 + then + echo "Could not find help file 'fill_help_tables.sql'". + fi fi mdata=$ldata/mysql @@ -160,8 +183,9 @@ c_t="" c_c="" # Check for old tables if test ! -f $mdata/db.frm then - echo "Preparing db table" - + if test $verbose -eq 1 ; then + echo "Preparing db table" + fi # mysqld --bootstrap wants one command/line c_d="$c_d CREATE TABLE db (" c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," @@ -190,7 +214,9 @@ fi if test ! -f $mdata/host.frm then - echo "Preparing host table" + if test $verbose -eq 1 ; then + echo "Preparing host table" + fi c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," @@ -214,7 +240,9 @@ fi if test ! -f $mdata/user.frm then - echo "Preparing user table" + if test $verbose -eq 1 ; then + echo "Preparing user table" + fi c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," @@ -256,7 +284,8 @@ then REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user (host,user) values ('localhost','');" + INSERT INTO user (host,user) values ('localhost',''); +" if test "$windows" -eq 0 then @@ -270,7 +299,9 @@ fi if test ! -f $mdata/func.frm then - echo "Preparing func table" + if test $verbose -eq 1 ; then + echo "Preparing func table" + fi c_f="$c_f CREATE TABLE func (" c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," @@ -284,7 +315,9 @@ fi if test ! -f $mdata/tables_priv.frm then - echo "Preparing tables_priv table" + if test $verbose -eq 1 ; then + echo "Preparing tables_priv table" + fi c_t="$c_t CREATE TABLE tables_priv (" c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," @@ -303,7 +336,9 @@ fi if test ! -f $mdata/columns_priv.frm then - echo "Preparing columns_priv table" + if test $verbose -eq 1 ; then + echo "Preparing columns_priv table" + fi c_c="$c_c CREATE TABLE columns_priv (" c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," @@ -318,7 +353,7 @@ then c_c="$c_c comment='Column privileges';" fi -echo "Installing all prepared tables" +echo "Installing privilege tables" if ( cat << END_OF_DATA use mysql; @@ -337,7 +372,10 @@ $i_f $c_t $c_c END_OF_DATA - cat fill_help_tables.sql + if test -n "$fill_help_tables" + then + cat $fill_help_tables + fi ) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then @@ -377,7 +415,6 @@ then echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" echo "Support MySQL by buying support/licenses at https://order.mysql.com" - echo exit 0 else echo "Installation of grant tables failed!" -- cgit v1.2.1 From 67985efed5369bf88987781754931ee162e1d2f3 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Fri, 21 Mar 2003 16:45:39 -0500 Subject: Post-4.0.12 changes from Novell: mostly NetWare-related code changes to utilize new LibC --- scripts/make_binary_distribution.sh | 82 ++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 28 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f0113ee1780..58328a5be3d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -47,33 +47,29 @@ if [ -d $BASE ] ; then rm -r -f $BASE fi -BS="" -EXTRA_BIN_FILES="" BASE_SYSTEM="any" MYSQL_SHARE=$BASE/share/mysql +BIN_FILES="" case $system in *netware*) BASE_SYSTEM="netware" - BS=".nlm" MYSQL_SHARE=$BASE/share - EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ - netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql" ;; esac -mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ +mkdir $BASE $BASE/bin \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1 -fi + mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ + $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test -chmod o-rwx $BASE/data $BASE/data/* + chmod o-rwx $BASE/data $BASE/data/* +fi for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ @@ -85,23 +81,47 @@ do fi done -for i in extra/comp_err$BS extra/replace$BS extra/perror$BS \ - extra/resolveip$BS extra/my_print_defaults$BS \ - extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - isam/isamchk$BS isam/pack_isam$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - sql/mysqld$BS \ - client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ - client/mysqldump$BS client/mysqlimport$BS \ - client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS client/mysqlmanagerc$BS \ - client/mysqlmanager-pwgen$BS tools/mysqlmanager$BS \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ - client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ - $EXTRA_BIN_FILES +if [ $BASE_SYSTEM = "netware" ] ; then + + BIN_FILES="\ + extra/comp_err.nlm extra/replace.nlm extra/perror.nlm \ + extra/resolveip.nlm extra/my_print_defaults.nlm \ + isam/isamchk.nlm isam/pack_isam.nlm \ + myisam/myisamchk.nlm myisam/myisampack.nlm myisam/myisamlog.nlm \ + sql/mysqld.nlm \ + client/mysql.nlm client/mysqlshow.nlm client/mysqladmin.nlm \ + client/mysqldump.nlm client/mysqlimport.nlm \ + client/mysqltest.nlm client/mysqlcheck.nlm \ + client/mysqlbinlog.nlm + netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ + netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ + netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql \ + "; + +else + + BIN_FILES="\ + extra/comp_err extra/replace extra/perror \ + extra/resolveip extra/my_print_defaults \ + extra/resolve_stack_dump extra/mysql_waitpid \ + isam/isamchk isam/pack_isam \ + myisam/myisamchk myisam/myisampack myisam/myisamlog \ + sql/mysqld \ + client/mysql client/mysqlshow client/mysqladmin \ + client/mysqldump client/mysqlimport \ + client/mysqltest client/mysqlcheck \ + client/mysqlbinlog client/mysqlmanagerc \ + client/mysqlmanager-pwgen tools/mysqlmanager \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ + client/.libs/mysqldump client/.libs/mysqlimport \ + client/.libs/mysqltest client/.libs/mysqlcheck \ + client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ + client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + "; + +fi + +for i in $BIN_FILES do if [ -f $i ] then @@ -126,7 +146,13 @@ if [ $BASE_SYSTEM = "netware" ] ; then $CP -r netware/*.pl $BASE/scripts fi -for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp +for i in \ + libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \ + libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \ + libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ + mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ + libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ + libmysqld/libmysqld.a netware/libmysql.imp do if [ -f $i ] then -- cgit v1.2.1 From 9aeb60210fbf4b45ac89bfc6e8ced3eb67312a75 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Thu, 27 Mar 2003 18:13:37 -0500 Subject: Improve make_binary_distribution from Novell code at Monty's request --- scripts/make_binary_distribution.sh | 55 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 58328a5be3d..73aa95a1100 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -47,13 +47,15 @@ if [ -d $BASE ] ; then rm -r -f $BASE fi +BS="" +BIN_FILES="" BASE_SYSTEM="any" MYSQL_SHARE=$BASE/share/mysql -BIN_FILES="" case $system in *netware*) BASE_SYSTEM="netware" + BS=".nlm" MYSQL_SHARE=$BASE/share ;; esac @@ -81,36 +83,30 @@ do fi done +# Non platform-specific bin dir files: +BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ + extra/resolveip$BS extra/my_print_defaults$BS \ + extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ + isam/isamchk$BS isam/pack_isam$BS \ + myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ + sql/mysqld$BS \ + client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqldump$BS client/mysqlimport$BS \ + client/mysqltest$BS client/mysqlcheck$BS \ + client/mysqlbinlog$BS +"; + +# Platform-specific bin dir files: if [ $BASE_SYSTEM = "netware" ] ; then - - BIN_FILES="\ - extra/comp_err.nlm extra/replace.nlm extra/perror.nlm \ - extra/resolveip.nlm extra/my_print_defaults.nlm \ - isam/isamchk.nlm isam/pack_isam.nlm \ - myisam/myisamchk.nlm myisam/myisampack.nlm myisam/myisamlog.nlm \ - sql/mysqld.nlm \ - client/mysql.nlm client/mysqlshow.nlm client/mysqladmin.nlm \ - client/mysqldump.nlm client/mysqlimport.nlm \ - client/mysqltest.nlm client/mysqlcheck.nlm \ - client/mysqlbinlog.nlm - netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ - netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql \ - "; - + BIN_FILES="$BIN_FILES \ + netware/mysqld_safe$BS netware/mysql_install_db$BS \ + netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql + "; else - - BIN_FILES="\ - extra/comp_err extra/replace extra/perror \ - extra/resolveip extra/my_print_defaults \ - extra/resolve_stack_dump extra/mysql_waitpid \ - isam/isamchk isam/pack_isam \ - myisam/myisamchk myisam/myisampack myisam/myisamlog \ - sql/mysqld \ - client/mysql client/mysqlshow client/mysqladmin \ - client/mysqldump client/mysqlimport \ - client/mysqltest client/mysqlcheck \ - client/mysqlbinlog client/mysqlmanagerc \ + # For all other platforms: + BIN_FILES="$BIN_FILES \ + client/mysqlmanagerc \ client/mysqlmanager-pwgen tools/mysqlmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport \ @@ -118,7 +114,6 @@ else client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ "; - fi for i in $BIN_FILES -- cgit v1.2.1 From 080b73ee188b7528cfbcb04cbe9d76a794031136 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Fri, 28 Mar 2003 14:24:32 -0500 Subject: Manual merge of Novell's changes for NetWare platform from 4.0, 4.1 patches --- scripts/make_binary_distribution.sh | 56 +++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 5ed76cefdb4..52ea32c6d70 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -48,7 +48,7 @@ if [ -d $BASE ] ; then fi BS="" -EXTRA_BIN_FILES="" +BIN_FILES="" BASE_SYSTEM="any" MYSQL_SHARE=$BASE/share/mysql @@ -57,9 +57,6 @@ case $system in BASE_SYSTEM="netware" BS=".nlm" MYSQL_SHARE=$BASE/share - EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \ - netware/mysqlhotcopy.nlm netware/libmysql.nlm netware/init_secure_db.sql" ;; esac @@ -86,23 +83,40 @@ do fi done -for i in extra/comp_err$BS extra/replace$BS extra/perror$BS \ - extra/resolveip$BS extra/my_print_defaults$BS \ - extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - isam/isamchk$BS isam/pack_isam$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - sql/mysqld$BS \ - client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ - client/mysqldump$BS client/mysqlimport$BS \ - client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS client/mysqlmanagerc$BS \ - client/mysqlmanager-pwgen$BS tools/mysqlmanager$BS \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ - client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ - $EXTRA_BIN_FILES +# Non platform-specific bin dir files: +BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ + extra/resolveip$BS extra/my_print_defaults$BS \ + extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ + isam/isamchk$BS isam/pack_isam$BS \ + myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ + sql/mysqld$BS \ + client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqldump$BS client/mysqlimport$BS \ + client/mysqltest$BS client/mysqlcheck$BS \ + client/mysqlbinlog$BS +"; + +# Platform-specific bin dir files: +if [ $BASE_SYSTEM = "netware" ] ; then + BIN_FILES="$BIN_FILES \ + netware/mysqld_safe$BS netware/mysql_install_db$BS \ + netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql + "; +else + # For all other platforms: + BIN_FILES="$BIN_FILES \ + client/mysqlmanagerc \ + client/mysqlmanager-pwgen tools/mysqlmanager \ + client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ + client/.libs/mysqldump client/.libs/mysqlimport \ + client/.libs/mysqltest client/.libs/mysqlcheck \ + client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ + client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + "; +fi + +for i in $BIN_FILES do if [ -f $i ] then -- cgit v1.2.1 From ef39d2a669cdfee1802eed0eb2ae87ba429ef7e3 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 9 Apr 2003 21:19:53 +0200 Subject: - applied patch from provided by Christian Hammers from Debian to be able to run the script even if mysqld is not up and running on upgrade --- scripts/mysql_fix_privilege_tables.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 09259779855..526b7ac91b3 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,14 +1,5 @@ #!/bin/sh -echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" -echo "mysql.func tables to MySQL 3.22.14 and above." -echo "" -echo "This is needed if you want to use the new GRANT functions," -echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" -echo "" -echo "If you get 'Access denied' errors, you should run this script again" -echo "and give the MySQL root user password as an argument!" - root_password="$1" host="localhost" user="root" @@ -20,6 +11,21 @@ else cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql" fi +# Debian addition +if [ "$1" = "--sql-only" ]; then + root_password="" + cmd="/usr/share/mysql/echo_stderr" +fi + +echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" +echo "mysql.func tables to MySQL 3.22.14 and above." +echo "" +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" +echo "" +echo "If you get 'Access denied' errors, you should run this script again" +echo "and give the MySQL root user password as an argument!" + echo "Converting all privilege tables to MyISAM format" $cmd < Date: Tue, 15 Apr 2003 16:11:37 +0200 Subject: - added missing dashes to parameter "open-files-limit" in mysqld_safe (bug #264) --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 094b1fbfcd3..e400c27b84c 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -224,7 +224,7 @@ then if test -n "$open_files" then ulimit -n $open_files - args="open-files-limit=$open_files $args" + args="--open-files-limit=$open_files $args" fi if test -n "$core_file_size" then -- cgit v1.2.1 From 077d7e81c8490c7ce9ac014a4cffb8d11563000d Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Wed, 16 Apr 2003 11:49:52 -0700 Subject: Fix broken windows distribution workspace file (libmysql.dsp), which is causing VC IDE to crash while loading Remove ctype_latin1_de.c from respective dsp files Fix to make_win_src_distribution.sh to delete all newly added IS Bitkeeper files --- scripts/make_win_src_distribution.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 9a787080c3e..7fd37a52b30 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -145,8 +145,7 @@ rm -r -f "$BASE/share/Makefile.am" if [ -d $BASE/SCCS ] then - find $BASE/ -name SCCS -print | xargs rm -r -f - rm -r -f "$BASE/InstallShield/Script Files/SCCS" + find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi mkdir $BASE/Docs $BASE/extra $BASE/include @@ -161,8 +160,8 @@ copy_dir_files() { for arg do print_debug "Copying files from directory '$arg'" cd $SOURCE/$arg/ - for i in *.c *.h *.ih *.i *.ic *.asm \ - README INSTALL* LICENSE + for i in *.c *.h *.ih *.i *.ic *.asm *.def \ + README INSTALL* LICENSE do if [ -f $i ] then -- cgit v1.2.1 From 093f661a8047b186022ad32cae48c6e808893916 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 25 Apr 2003 21:58:25 +0200 Subject: - Applied patch provided by Martin Mokrejs (General code cleanup, use the GRANT statement instead of updating the privilege tables directly, added option to revoke privileges) --- scripts/mysql_setpermission.sh | 233 ++++++++++++++++++++--------------------- 1 file changed, 112 insertions(+), 121 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 43bf8a14c06..9699cd28047 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -16,20 +16,25 @@ ## 1.2 begin screen now in a loop + quit is using 0 instead of 9 ## after ideas of Paul DuBois. ## 1.2a Add Grant, References, Index and Alter privilege handling (Monty) +## 1.3 Applied patch provided by Martin Mokrejs +## (General code cleanup, use the GRANT statement instead of updating +## the privilege tables directly, added option to revoke privileges) #### TODO # # empty ... suggestions ... mail them to me ... -$version="1.2"; +$version="1.3"; use DBI; use Getopt::Long; use strict; -use vars qw($dbh $hostname $opt_user $opt_password $opt_help $opt_host +use vars qw($dbh $sth $hostname $opt_user $opt_password $opt_help $opt_host $opt_socket $opt_port $host $version); +my $sqlhost = ""; +my $user = ""; $dbh=$host=$opt_user= $opt_password= $opt_help= $opt_host= $opt_socket= ""; $opt_port=0; @@ -42,11 +47,11 @@ usage() if ($opt_help); # the help function if ($opt_host eq '') { - $hostname = "localhost"; + $sqlhost = "localhost"; } else { - $hostname = $opt_host; + $sqlhost = $opt_host; } # ask for a password if no password is set already @@ -62,7 +67,7 @@ if ($opt_password eq '') # make the connection to MySQL -$dbh= DBI->connect("DBI:mysql:mysql:host=$hostname:port=$opt_port:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) || +$dbh= DBI->connect("DBI:mysql:mysql:host=$sqlhost:port=$opt_port:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) || die("Can't make a connection to the mysql server.\n The error: $DBI::errstr"); # the start of the program @@ -86,27 +91,44 @@ sub q1 { # first question ... print "#"x70; print "\n"; print "What would you like to do:\n"; - print " 1. Set password for a user.\n"; - print " 2. Add a database + user privilege for that database.\n"; - print " - user can do all except all admin functions\n"; - print " 3. Add user privilege for an existing database.\n"; - print " - user can do all except all admin functions\n"; - print " 4. Add user privilege for an existing database.\n"; - print " - user can do all except all admin functions + no create/drop\n"; - print " 5. Add user privilege for an existing database.\n"; - print " - user can do only selects (no update/delete/insert etc.)\n"; + print " 1. Set password for an existing user.\n"; + print " 2. Create a database + user privilege for that database\n"; + print " and host combination (user can only do SELECT)\n"; + print " 3. Create/append user privilege for an existing database\n"; + print " and host combination (user can only do SELECT)\n"; + print " 4. Create/append broader user privileges for an existing\n"; + print " database and host combination\n"; + print " (user can do SELECT,INSERT,UPDATE,DELETE)\n"; + print " 5. Create/append quite extended user privileges for an\n"; + print " existing database and host combination (user can do\n"; + print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,\n"; + print " LOCK TABLES,CREATE TEMPORARY TABLES)\n"; + print " 6. Create/append database administrative privileges for an\n"; + print " existing database and host combination (user can do\n"; + print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,\n"; + print " CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS)\n"; + print " 7. Create/append full privileges for an existing database\n"; + print " and host combination (user has FULL privilege)\n"; + print " 8. Remove all privileges for for an existing database and\n"; + print " host combination.\n"; + print " (user will have all permission fields set to N)\n"; print " 0. exit this program\n"; - print "\nMake your choice [1,2,3,4,5,0]: "; + print "\nMake your choice [1,2,3,4,5,6,7,0]: "; while () { $answer = $_; chomp($answer); - if ($answer =~ /1|2|3|4|5|0/) { - &setpwd if ($answer == 1); - &addall($answer) if ($answer =~ /^[2345]$/); - if ($answer == 0) { - print "Sorry, hope we can help you next time \n\n"; + if ($answer =~ /^[12345678]$/) { + if ($answer == 1) { + setpwd(); + } elsif ($answer =~ /^[2345678]$/) { + addall($answer); + } else { + print "Sorry, something went wrong. With such option number you should not get here.\n\n"; $end = 1; } + } elsif ($answer == 0) { + print "We hope we can help you next time \n\n"; + $end = 1; } else { print "Your answer was $answer\n"; print "and that's wrong .... Try again\n"; @@ -121,7 +143,7 @@ sub q1 { # first question ... ### sub setpwd { - my ($user,$pass,$host); + my ($user,$pass,$host) = ""; print "\n\nSetting a (new) password for a user.\n"; $user = user(); @@ -168,22 +190,18 @@ sub setpwd ### # all things which will be added are done here ### -sub addall -{ +sub addall { my ($todo) = @_; my ($answer,$good,$db,$user,$pass,$host,$priv); - if ($todo == 2) - { + if ($todo == 2) { $db = newdatabase(); - } - else - { + } else { $db = database(); } $user = newuser(); - $pass = newpass(); + $pass = newpass("$user"); $host = newhosts(); print "#"x70; @@ -198,104 +216,80 @@ sub addall print "Are you pretty sure you would like to implement this [yes/no]: "; my $no = ; chomp($no); - if ($no =~ /n/i) - { + if ($no =~ /n/i) { print "Okay .. that was it then ... See ya\n\n"; return(0); - } - else - { + } else { print "Okay ... let's go then ...\n\n"; } - if ($todo == 2) - { + if ($todo == 2) { # create the database - my $sth = $dbh->do("create database $db") || $dbh->errstr; - } - - # select the privilege .... - if (($todo == 2) || ($todo == 3)) - { - $priv = "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"; + if ($db) { + my $sth = $dbh->do("CREATE DATABASE $db") || $dbh->errstr; + } else { + print STDERR "What do you want? You wanted to create new database and add new user, right?\n"; + die "But then specify databasename, please\n"; } - elsif ($todo == 4) - { - $priv = "'Y','Y','Y','Y','N','N','N','Y','Y','Y'"; } - elsif ($todo == 5) - { - $priv = "'Y','N','N','N','N','N','N','N','N','N'"; - } - else - { - print "Sorry, choice number $todo isn't known inside the program .. See ya\n"; + + if ( ( !$todo ) or not ( $todo =~ m/^[2-8]$/ ) ) { + print STDERR "Sorry, select option $todo isn't known inside the program .. See ya\n"; quit(); } my @hosts = split(/,/,$host); - $user = $dbh->quote($user); - $db = $dbh->quote($db); - if ($pass eq '') - { - $pass = "''"; + if (!$user) { + die "username not specified: $user\n"; } - else - { - $pass = "PASSWORD(". $dbh->quote($pass) . ")"; + if (!$db) { + die "databasename is not specified nor *\n"; } - foreach my $key (@hosts) - { - my $key1 = $dbh->quote($key); - my $sth = $dbh->prepare("select Host,User from user where Host = $key1 and User = $user") || die $dbh->errstr; - $sth->execute || die $dbh->errstr; - my @r = $sth->fetchrow_array; - if ($r[0]) - { - print "WARNING WARNING SKIPPING CREATE FOR USER $user AND HOST $key\n"; - print "Reason: entry already exists in the user table.\n"; + foreach $host (@hosts) { + # user privileges: SELECT + if (($todo == 2) || ($todo == 3)) { + $sth = $dbh->do("GRANT SELECT ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + } elsif ($todo == 4) { + # user privileges: SELECT,INSERT,UPDATE,DELETE + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + } elsif ($todo == 5) { + # user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + } elsif ($todo == 6) { + # admin privileges: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + } elsif ($todo == 7) { + # all privileges + $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + } elsif ($todo == 8) { + # all privileges set to N + $sth = $dbh->do("REVOKE ALL ON *.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; } - else - { - $sth = $dbh->prepare("insert into user (Host,User,Password) values($key1,$user,$pass)") || die $dbh->errstr; - $sth->execute || die $dbh->errstr; - $sth->finish; } - $sth = $dbh->prepare("INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References_priv,Index_priv,Alter_priv) VALUES ($key1,$db,$user,$priv)") || die $dbh->errstr; - $sth->execute || die $dbh->errstr; - $sth->finish; - } - $dbh->do("flush privileges") || print "Can't load privileges\n"; + $dbh->do("FLUSH PRIVILEGES") || print STDERR "Can't flush privileges\n"; print "Everything is inserted and mysql privileges have been reloaded.\n\n"; } ### # ask for a new database name ### -sub newdatabase -{ +sub newdatabase { my ($answer,$good,$db); print "\n\nWhich database would you like to add: "; - while () - { + while () { $answer = $_; $good = 0; chomp($answer); - if ($answer) - { - my $sth = $dbh->prepare("show databases") || die $dbh->errstr; + if ($answer) { + my $sth = $dbh->prepare("SHOW DATABASES") || die $dbh->errstr; $sth->execute || die $dbh->errstr; - while (my @r = $sth->fetchrow_array) - { - if ($r[0] eq $answer) - { + while (my @r = $sth->fetchrow_array) { + if ($r[0] eq $answer) { print "\n\nSorry, this database name is already in use; try something else: "; $good = 1; } } - } - else - { + } else { print "You must type something ...\nTry again: "; next; } @@ -309,48 +303,44 @@ sub newdatabase ### # select a database ### -sub database -{ +sub database { my ($answer,$good,$db); - print "\n\nWhich database would you like to select: \n"; + print "\n\nWhich database from existing databases would you like to select: \n"; print "You can choose from: \n"; my $sth = $dbh->prepare("show databases") || die $dbh->errstr; $sth->execute || die $dbh->errstr; - while (my @r = $sth->fetchrow_array) - { + while (my @r = $sth->fetchrow_array) { print " - $r[0] \n"; } - print "Which database will it be (case sensitive): "; - while () - { + print "Which database will it be (case sensitive). Type * for any: \n"; + while () { $answer = $_; $good = 0; chomp($answer); - if ($answer) - { + if ($answer) { + if ($answer eq "*") { + print "OK, the user entry will NOT be limited to any database"; + return("*"); + } my $sth = $dbh->prepare("show databases") || die $dbh->errstr; $sth->execute || die $dbh->errstr; - while (my @r = $sth->fetchrow_array) - { - if ($r[0] eq $answer) - { + while (my @r = $sth->fetchrow_array) { + if ($r[0] eq $answer) { $good = 1; $db = $r[0]; last; } } - } - else - { - print "You must type something ...\nTry again: "; + } else { + print "Type either database name or * meaning any databasename. That means"; + print " any of those above but also any which will be created in future!"; + print " This option gives a user chance to operate on databse mysql, which"; + print " contains privilege settings. That is really risky!\n"; next; } - if ($good == 1) - { + if ($good == 1) { last; - } - else - { + } else { print "You must select one from the list.\nTry again: "; next; } @@ -364,7 +354,8 @@ sub database ### sub newuser { - my ($answer,$user); + my $user = ""; + my $answer = ""; print "\nWhat username is to be created: "; while() @@ -430,7 +421,7 @@ sub user sub newpass { my ($user) = @_; - my ($answer,$good,$pass,$yes); + my ($pass,$answer,$good,$yes); print "Would you like to set a password for $user [y/n]: "; $yes = ; @@ -487,7 +478,7 @@ sub newpass ### sub newhosts { - my ($answer,$good,$host); + my ($host,$answer,$good); print "We now need to know from what host(s) the user will connect.\n"; print "Keep in mind that % means 'from any host' ...\n"; -- cgit v1.2.1 From 55f2e0187958bdd3ab73d77646138967e8af63c3 Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Wed, 30 Apr 2003 09:42:08 -0700 Subject: make_win_src_distribution.sh: Fix for bdb/cxx as they contain .cpp files directly ( for 4.0 to go ) --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 7fd37a52b30..fca13e43e70 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -160,7 +160,7 @@ copy_dir_files() { for arg do print_debug "Copying files from directory '$arg'" cd $SOURCE/$arg/ - for i in *.c *.h *.ih *.i *.ic *.asm *.def \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ README INSTALL* LICENSE do if [ -f $i ] -- cgit v1.2.1 From 7179284df92516572a19fa9b0dfa46349042e11e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Sat, 3 May 2003 16:16:52 +0200 Subject: - applied patch from Tim Bunce (new --addtodest option that adds copied files into an already existing directory) --- scripts/mysqlhotcopy.sh | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index ec76aa479f3..a89a8919752 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -55,7 +55,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server - --allowold don\'t abort if target already exists (rename it _old) + --allowold don\'t abort if target dir already exists (rename it _old) + --addtodest don\'t rename target dir if it exists, just add files to it --keepold don\'t delete previous (now renamed) target when done --noindices don\'t include full index files in copy --method=# method for copy (only "cp" currently supported) @@ -98,6 +99,7 @@ GetOptions( \%opt, "socket|S=s", "allowold!", "keepold!", + "addtodest!", "noindices!", "method=s", "debug", @@ -380,14 +382,14 @@ if ($opt{method} =~ /^cp\b/) push @existing, $rdb->{target} if ( -d $rdb->{target} ); } - if ( @existing && !$opt{allowold} ) + if ( @existing && !($opt{allowold} || $opt{addtodest}) ) { $dbh->disconnect(); - die "Can't hotcopy to '", join( "','", @existing ), "' because directory\nalready exist and the --allowold option was not given.\n" + die "Can't hotcopy to '", join( "','", @existing ), "' because directory\nalready exist and the --allowold or --addtodest options were not given.\n" } } -retire_directory( @existing ) if ( @existing ); +retire_directory( @existing ) if @existing && !$opt{addtodest}; foreach my $rdb ( @db_desc ) { foreach my $td ( '', @{$rdb->{raid_dirs}} ) { @@ -403,8 +405,8 @@ foreach my $rdb ( @db_desc ) { ## ... } else { - mkdir($tgt_dirpath, 0750) - or die "Can't create '$tgt_dirpath': $!\n"; + mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" + unless -d $tgt_dirpath; } } } @@ -861,6 +863,22 @@ Any existing versions of the backup directory are deleted. Behaves as for the --allowold, with the additional feature of keeping the backup directory after the copy successfully completes. +=item --addtodest + +Don't rename target directory if it already exists, just add the +copied files into it. + +This is most useful when backing up a database with many large +tables and you don't want to have all the tables locked for the +whole duration. + +In this situation, I you are happy for groups of tables to be +backed up separately (and thus possibly not be logically consistant +with one another) then you can run mysqlhotcopy several times on +the same database each with different db_name./table_regex/. +All but the first should use the --addtodest option so the tables +all end up in the same directory. + =item --flushlog Rotate the log files by executing "FLUSH LOGS" after all tables are @@ -869,13 +887,13 @@ locked, and before they are copied. =item --resetmaster Reset the bin-log by executing "RESET MASTER" after all tables are -locked, and before they are copied. Usefull if you are recovering a +locked, and before they are copied. Useful if you are recovering a slave in a replication setup. =item --resetslave Reset the master.info by executing "RESET SLAVE" after all tables are -locked, and before they are copied. Usefull if you are recovering a +locked, and before they are copied. Useful if you are recovering a server in a mutual replication setup. =item --regexp pattern @@ -941,7 +959,7 @@ will vary with your ability to understand how scp works. 'man scp' and 'man ssh' are your friends. The destination directory _must exist_ on the target machine using the -scp method. --keepold and --allowold are meeningless with scp. +scp method. --keepold and --allowold are meaningless with scp. Liberal use of the --debug option will help you figure out what\'s really going on when you do an scp. -- cgit v1.2.1 From 1e2f2ae037bf7ebc7b4068e0b3a95f1282af9729 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 6 May 2003 06:20:16 +0300 Subject: Varbinary should be string as default --- scripts/make_win_src_distribution.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 7fd37a52b30..73600d5749b 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -258,6 +258,12 @@ do fi done +# +# Fix some windows files +# + +./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp + # # Initialize the initial data directory # -- cgit v1.2.1 From 33cabdc3b1b912f4ac6a5add91c6f98033eabb2c Mon Sep 17 00:00:00 2001 From: "gluh@gluh.mysql.r18.ru" <> Date: Tue, 6 May 2003 21:09:20 +0500 Subject: Expand the mysql.proc table --- scripts/mysql_install_db.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0ce45c8d114..9e7032244cc 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -361,6 +361,11 @@ then c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," c_p="$c_p type enum('function','procedure') NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL," + c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," + c_p="$c_p created timestamp," + c_p="$c_p modified timestamp," + c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," + c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," c_p="$c_p PRIMARY KEY (name,type)" c_p="$c_p )" c_p="$c_p comment='Stored Procedures';" -- cgit v1.2.1 From 4bde719df7b67e8c42c16724af0e3eacb64c3757 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 13 May 2003 10:54:07 +0300 Subject: Safety fix to enable RAID in max binaries Better fix for format('nan') Fix for HAVING COUNT(DISTINCT...) --- scripts/mysql_install_db.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 2f27f5d7c1a..64fdd0dfebb 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -118,7 +118,8 @@ then resolved=`$bindir/resolveip localhost 2>&1` if [ $? -eq 0 ] then - echo "Sorry, the host '$hostname' could not be looked up." + echo "Neither host '$hostname' and 'localhost' could not be looked up with" + echo "$bindir/resolveip" echo "Please configure the 'hostname' command to return a correct hostname." echo "If you want to solve this at a later stage, restart this script with" echo "the --force option" @@ -134,15 +135,12 @@ then fi # Create database directories mysql & test -if test "$IN_RPM" -eq 0 -then if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi if test -w / -a ! -z "$user"; then chown $user $ldata $ldata/mysql $ldata/test; fi -fi # Initialize variables c_d="" i_d="" -- cgit v1.2.1 From 55d4e55f7ce7b41d34cdcf2764e11d034bcb258a Mon Sep 17 00:00:00 2001 From: "vva@mysql.r18.ru" <> Date: Tue, 27 May 2003 16:58:57 +0500 Subject: fixed small merge bug --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b5048054832..15bc834e850 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -164,7 +164,7 @@ then fi # Create database directories mysql & test -if test "$in_rpm" -eq 0 || "$windows" -eq 0 + if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi -- cgit v1.2.1 From ea46c24279cda90a45c1ae87cb7334b048ae8870 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com[greg]" <> Date: Thu, 29 May 2003 14:28:02 -0400 Subject: rlyon-5.0.0-alpha.patch --- scripts/make_binary_distribution.sh | 93 ++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 28 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1731a7555e0..7e96c90905c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -73,9 +73,25 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ - LICENSE.doc README.NW Docs/mysqlbug.txt +# Non platform-specific doc files: +DOC_FILES=" \ + ChangeLog COPYING COPYING.LIB README \ + Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ + Docs/mysqlbug.txt \ +"; + +# Platform-specific doc files: +if [ $BASE_SYSTEM = "netware" ] ; then + DOC_FILES="$DOC_FILES \ + "; +# For all other platforms: +else + DOC_FILES="$DOC_FILES \ + Docs/INSTALL-BINARY MySQLEULA.txt \ + "; +fi + +for i in $DOC_FILES do if [ -f $i ] then @@ -83,7 +99,7 @@ do fi done -# Non platform-specific bin dir files: +# Non platform-specific bin files: BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ @@ -93,18 +109,18 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS + client/mysqlbinlog$BS \ "; -# Platform-specific bin dir files: +# Platform-specific bin files: if [ $BASE_SYSTEM = "netware" ] ; then BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ - netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql + netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; +# For all other platforms: else - # For all other platforms: BIN_FILES="$BIN_FILES \ client/mysqlmanagerc \ client/mysqlmanager-pwgen tools/mysqlmanager \ @@ -224,7 +240,9 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Make safe_mysqld a symlink to mysqld_safe for backwards portability # To be removed in MySQL 4.1 -(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +if [ $BASE_SYSTEM != "netware" ] ; then + (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then @@ -283,29 +301,48 @@ which_1 () exit 1 } -# -# Create the result tar file -# - -tar=`which_1 gnutar gtar` -if test "$?" = "1" -o "$tar" = "" -then - tar=tar -fi - -echo "Using $tar to create archive" cd $TMP + +if [ $BASE_SYSTEM = "netware" ] ; then + + # + # Create a zip file for NetWare users + # + + if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi + zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + echo "$NEW_NAME.zip created" + +else + + # + # Create the result tar file + # + + tar=`which_1 gnutar gtar` + if test "$?" = "1" -o "$tar" = "" + then + tar=tar + fi + + echo "Using $tar to create archive" + + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME + cd $SOURCE + + echo "Compressing archive" + gzip -9 $NEW_NAME.tar + + echo "$NEW_NAME.tar.gz created" -OPT=cvf -if [ x$SILENT = x1 ] ; then - OPT=cf fi -$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME -cd $SOURCE -echo "Compressing archive" -gzip -9 $NEW_NAME.tar echo "Removing temporary directory" rm -r -f $BASE -echo "$NEW_NAME.tar.gz created" + -- cgit v1.2.1 From b4014b903b115f4181fba03911c5a77fd87d1cba Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Thu, 29 May 2003 17:47:31 -0400 Subject: new version of help --- scripts/Makefile.am | 20 +- scripts/fill_help_tables.sh | 560 ++++++++++++++++++++++++++-------- scripts/mysql_create_system_tables.sh | 311 +++++++++++++++++++ scripts/mysql_install_db.sh | 220 ++----------- 4 files changed, 769 insertions(+), 342 deletions(-) create mode 100644 scripts/mysql_create_system_tables.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 88f561e0e6d..1134226bfaf 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,7 +32,9 @@ bin_SCRIPTS = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ - mysqld_multi + mysqld_multi \ + fill_help_tables \ + mysql_create_system_tables EXTRA_SCRIPTS = make_binary_distribution.sh \ make_win_src_distribution.sh \ @@ -54,14 +56,13 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ mysqld_safe.sh \ - fill_help_tables.sh + fill_help_tables.sh \ + mysql_create_system_tables.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = fill_help_tables.sql - # mysqlbug should be distributed built so that people can report build # failures with it. CLEANFILES = @server_scripts@ \ @@ -81,7 +82,7 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysqld_multi \ fill_help_tables \ - fill_help_tables.sql + mysql_create_system_tables SUPERCLEANFILES = mysqlbug @@ -137,12 +138,5 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_help_tables.sql make_win_src_distribution make_binary_distribution - -# The following rule is here to ensure that build will continue -# even if we don't have perl installed. In this case the help tables -# will be empty +all: make_win_src_distribution make_binary_distribution -fill_help_tables.sql: fill_help_tables ../Docs/manual.texi - -./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql - echo "" >> fill_help_tables.sql diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index e21b0ff2bb0..b8cf4ccb3a7 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -1,31 +1,178 @@ #!@PERL@ # -# Usage: fill_help_tables -# Example: ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql +# Copyright (C) 2003 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file. # # This script generates the SQL statements required by mysql_install_db to # fill up the tables for the server-side online function help, which can be # invoked with "help " from the MySQL client. # +# Usage: +# fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql +# +# --help display this helpscreen and exit +# --verbose print information about help completeness to STDERR +# --lexems=path path to file with lexems. it is used with verbose option. +# default value is ../sql/lex.h +# Examples: +# ./fill_help_tables --help +# ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql +# ./fill_help_tables < manual.texi > fill_help_tables.sql +# # Please note, that you first need to update Docs/manual.texi with the # manual file from the separate "mysqldoc" BitKeeper-Tree! The manual.texi # included in the source tree is just an empty stub file - the full manual # is now maintained in a separate tree. # +# extra tags in manual.texi: +# +# @c help_category [@] +# +# @c description_for_help_topic +# .... +# @c end_description_for_help_topic +# +# @c example_for_help_topic +# @example +# .... +# @example +# +# # Original version by Victor Vagin # -my $cat_name= ""; -my $func_name= ""; -my $text= ""; -my $example= ""; +use strict; +use Getopt::Long; + +my $insert_portion_size= 25; +my $error_prefix= "help parsing error:"; + +my $path_to_lex_file= "../sql/lex.h"; +my $verbose_option= 0; +my $help_option= 0; + +GetOptions( + "help",\$help_option, + "verbose",\$verbose_option, + "lexems=s",\$path_to_lex_file +); + +if ($help_option ne 0) +{ + print <<_HELP; + +This script generates the SQL statements required by mysql_install_db to +fill up the tables for the server-side online function help, which can be +invoked with "help " from the MySQL client. + +Usage: + fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql + + --help display this helpscreen and exit + --verbose print information about help completeness to STDERR + --lexems=path path to file with lexems. it is used with verbose option. + default value is ../sql/lex.h + +Examples: + ./fill_help_tables --help + ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql + ./fill_help_tables < manual.texi > fill_help_tables.sql + +_HELP + exit; +} -local $mode= ""; +my $current_category= ""; +my $current_parent_category= ""; +my $next_example_for_topic= ""; + +my %topics; +my %categories; +my %keywords; + +$categories{Contents}->{__parent_category__}= ""; + +sub add_topic_to_category +{ + my ($topic_name)= @_; + + $categories{$current_category}->{$topic_name}= $topics{$topic_name}; + my $category= $categories{$current_category}; + + if (exists($category->{__parent_category__})) + { + my $old_parent= $category->{__parent_category__}; + if ($old_parent ne $current_parent_category) + { + print STDERR "$error_prefix wrong parent for $current_category\n"; + } + } + + if ($current_parent_category ne "") + { + $category->{__parent_category__}= $current_parent_category; + } + + if (exists($topics{$topic_name}->{category})) + { + my $old_category= $topics{$topic_name}->{category}; + if ($old_category ne $category) + { + print STDERR "$error_prefix wrong category for $topic_name\n"; + } + } + + $topics{$topic_name}->{category}= $category; +} + +sub add_example +{ + my ($topic_name,$example)= @_; + + $topic_name=~ tr/a-z/A-Z/; + + if (exists($topics{$topic_name}->{example})) + { + print STDERR "$error_prefix double example for $topic_name\n"; + } + + $topics{$topic_name}->{example}= $example; + add_topic_to_category($topic_name); +} + +sub add_description +{ + my ($topic_name,$description)= @_; + + $topic_name=~ tr/a-z/A-Z/; + + if (exists($topics{$topic_name}->{description})) + { + print STDERR "$error_prefix double description for $topic_name\n"; + } + $topics{$topic_name}->{description}= $description; + add_topic_to_category($topic_name); +} + +sub add_keyword +{ + my ($topic_name,$keyword)= @_; + + $topic_name=~ tr/a-z/A-Z/; + $keyword=~ tr/a-z/A-Z/; + + push(@{$topics{$topic_name}->{keywords}},$keyword); + if (exists($keywords{$keyword}->{$topic_name})) + { + print STDERR "$error_prefix double keyword $keyword for $topic_name\n"; + } + $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; +} sub prepare_name { my ($a)= @_; - + $a =~ s/(\@itemize \@bullet)/ /g; $a =~ s/(\@end itemize)/ /g; $a =~ s/(\@end multitable)/ /g; @@ -46,41 +193,57 @@ sub prepare_name $a =~ s/\`/\`\`/g; $a =~ s/\@table \@code/ /g; - $a =~ s/\(\)//g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; + $a =~ s/\"/\\\"/g; + + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; + $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - + return $a; } -sub prepare_text +sub prepare_description { my ($a)= @_; - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; + $a =~ s/(\@itemize \@bullet\n)//g; + $a =~ s/(\@c help_keyword (.*?)\n)//g; + $a =~ s/(\@end itemize\n)//g; + $a =~ s/(\@end example\n)//g; + $a =~ s/(\@example\n)//g; + $a =~ s/(\@{)/{/g; + $a =~ s/(\@})/}/g; $a =~ s/(\@end multitable)/ /g; $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; + $a =~ s/(\@cindex(.*?)\n)//g; + $a =~ s/(\@findex(.*?)\n)//g; + $a =~ s/(\@table(.*?)\n)//g; $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; $a =~ s/(\@node(.*?)\n)/ /g; $a =~ s/(\@tab)/\t/g; $a =~ s/\@itemx/ /g; - $a =~ s/\@item/ /g; + $a =~ s/(\@item\n(\s*?))(\S)/ --- $3/g; + $a =~ s/(\@item)/ /g; + $a =~ s/(\@tindex\s(.*?)\n)//g; + $a =~ s/(\@c\s(.*?)\n)//g; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; $a =~ s/\@samp\{(.+?)\}/$1/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; + $a =~ s/\@w\{((.|\n)+?)\}/$1/go; + $a =~ s/\@strong\{((.|\n)+?)\}/\n!!!!\n$1\n!!!!\n/go; + $a =~ s/\@file\{((.|\n)+?)\}/\*$1/go; $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; + $a =~ s/\n\n$/\n/g; + $a =~ s/\n\n$/\n/g; + $a =~ s/\n\n$/\n/g; + $a =~ s/\n\n$/\n/g; + $a =~ s/\n\n$/\n/g; $a =~ s/\n/\\n/g; + $a =~ s/\"/\\\"/g; $a =~ s/\@table \@code/ /g; @@ -91,148 +254,291 @@ sub prepare_example { my ($a)= @_; - $a =~ s/\'/\'\'/g; + $a =~ s/(^\@c for_help_topic(.*?)\n)//g; + $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; + $a =~ s/(\@{)/{/g; + $a =~ s/(\@})/}/g; + $a =~ s/(\@\@)/\@/g; $a =~ s/(\n*?)$//g; $a =~ s/\n/\\n/g; - + $a =~ s/\"/\\\"/g; + return $a; } -sub flush_all +sub parse_example { - my ($mode) = @_; - - if ($mode eq ""){return;} - - $func_name= prepare_name($func_name); - $text= prepare_text($text); - $example= prepare_example($example); - - if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT IGNORE INTO help_topic (name,description,example) VALUES ("; - print "'$func_name',"; - print "'$text',"; - print "'$example'"; - print ");\n"; - print "INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + return if (!($_=~/\@example/)); + return if ($next_example_for_topic eq ""); + + my $topic_name= $next_example_for_topic; + $next_example_for_topic= ""; + my $text= ""; + + while (<>) + { + last if ($_=~/\@end example/); + $text .= $_; } + + $text= prepare_example($text); - $func_name= ""; - $text= ""; - $example= ""; - $mode= ""; + add_example($topic_name,$text) if ($topic_name ne ""); } -sub new_category +sub parse_example_for_topic { - my ($category)= @_; - - $category= prepare_text($category); - - print "INSERT IGNORE INTO help_category (name) VALUES (\'$category\');\n"; - print "SET \@cur_category=LAST_INSERT_ID();\n"; + my ($for_topic)= m|\@c example_for_help_topic (.+?)$|; + return if ($for_topic eq ""); + + $next_example_for_topic= $for_topic; } -#print "INSERT IGNORE INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -#print "CREATE DATABASE mysql_help;\n"; +sub parse_description +{ + my ($topic_description)= m|\@c description_for_help_topic (.+?)$|; + return if ($topic_description eq ""); + + my ($topic_name,$topic_keywords)= split(/ /,$topic_description); + + if ($topic_name eq "" || $topic_keywords eq "") + { + $topic_name= $topic_description; + } + else + { + my $keyword; + foreach $keyword (split(/ /,$topic_keywords)) + { + add_keyword($topic_name,$keyword) if ($keyword ne ""); + } + } + + my $text= ""; + + while (<>) + { + last if ($_=~/\@c end_description_for_help_topic/); + $text .= $_; + } + + $text= prepare_description($text); + add_description($topic_name,$text); +} -print "USE mysql;\n"; +sub parse_category +{ + my ($c_name,$pc_name)= m|\@c help_category (.+?)\@(.+?)$|; -print "DROP TABLE IF EXISTS help_topic;\n"; -print "CREATE TABLE help_topic ("; -print " help_topic_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " description text not null,"; -print " example text not null,"; -print " url varchar(128) not null,"; -print " primary key (help_topic_id),"; -print " unique index(name)"; -print ") type=myisam;\n\n"; + if ($pc_name ne "") + { + $current_category= prepare_name($c_name); + $current_parent_category= prepare_name($pc_name); + } + else + { + my ($c_name)=m|\@c help_category (.+?)$|; + return if ($c_name eq ""); -print "DROP TABLE IF EXISTS help_category;\n"; -print "CREATE TABLE help_category ("; -print " help_category_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " primary key (help_category_id),"; -print " unique index (name)"; -print ") type=myisam;\n\n"; + $current_category= prepare_name($c_name); + $current_parent_category= "Contents" + } +} -print "DROP TABLE IF EXISTS help_relation;\n"; -print "CREATE TABLE help_relation ("; -print" help_topic_id int unsigned not null references help_topic,"; -print" help_category_id smallint unsigned not null references help_category,"; -print" primary key (help_category_id, help_topic_id),"; -print ") type=myisam;\n\n"; +# parse manual: -print "SET \@cur_category=null;\n\n"; +while (<>) +{ + parse_example_for_topic (); + parse_example (); + parse_description (); + parse_category (); +} -my $in_section_6_3= 0; +# test results of parsing: -for(<>) +sub print_bad_names { - if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && - !$in_section_6_3){ - $in_section_6_3= 1; - next; + my($names,$prompt)= @_; + if (scalar(@{$names})) + { + print STDERR "\n-------------- $prompt : \n\n"; + my $name; + foreach $name (@{$names}) + { + print STDERR "$name\n"; + } + print STDERR "\n"; } +} - if ($_=~/\@section/ && $in_section_6_3){ - $in_section_6_3= 0; - next; +sub print_verbose_errors +{ + my($name_of_log_file)= @_; + + my @without_help; + my @description_with_at; + my @example_with_at; + my @without_description; + my @without_example; + + print STDERR "\n-------------- parameters of help completeness : \n\n"; + + my $count_lex= 0; + if (!open (TLEX,"<$path_to_lex_file")) + { + print STDERR "Error opening lex file \"$path_to_lex_file\" $!\n"; } + else + { + for () + { + my ($a,$lex,$b)=m|(.+?)\"(.+?)\"(.+?)$|; + next if ($lex eq ""); + $count_lex++; + next if (exists($topics{$lex}) || exists($keywords{$lex})); + push(@without_help,$lex); + } + close(TLEX); + print STDERR "number of lexems in \"$path_to_lex_file\" - $count_lex\n"; + } + + my $name; + my @topic_names= keys(%topics); + foreach $name (@topic_names) + { + my $topic= $topics{$name}; + push(@description_with_at,$name) if ($topic->{description}=~/\@/); + push(@example_with_at,$name) if ($topic->{example}=~/\@/); + push(@without_description,$name) if (!exists($topic->{description})); + push(@without_example,$name) if (!exists($topic->{example})); + } + + my $count_categories= scalar(keys(%categories)); + print STDERR "number of help categories - ",$count_categories,"\n"; + my $count_topics= scalar(@topic_names); + print STDERR "number of help topics - ",$count_topics,"\n"; + my $count_keywords= scalar(keys(%keywords)); + print STDERR "number of help keywords - ",$count_keywords,"\n"; + + my $count_without_help= scalar(@without_help); + print_bad_names(\@without_help,"lexems without help (". + $count_without_help." ~ ". + (int (($count_without_help/$count_lex)*100)). + "%)"); + print_bad_names(\@description_with_at, + " topics below have symbol \'@\' in their descriptions.\n". + "it's probably the litter from 'texi' tags (script needs fixing)"); + print_bad_names(\@example_with_at, + " topics below have symbol \'@\' in their examples.\n". + "it's probably the litter from 'texi' tags (script needs fixing)"); + print_bad_names(\@without_description,"topics without description"); + + my $count_without_example= scalar(@without_example); + print_bad_names(\@without_example,"topics without example (". + $count_without_example." ~ ". + (int (($count_without_example/$count_topics)*100)). + "%)"); +} - if (!$in_section_6_3) { next; } +print_verbose_errors if ($verbose_option ne 0); - my $c_name= ""; +# output result - ($c_name)=m|\@c for_mysql_help,(.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; +sub print_insert_header +{ + my($count,$header)= @_; + + if ($count % $insert_portion_size ne 0) { + print ","; + } else { + print ";\n" if ($count ne 0); + print "$header"; } +} - ($c_name)=m|\@subsubsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } +print "delete from help_topic;\n"; +print "delete from help_category;\n"; +print "delete from help_keyword;\n"; +print "delete from help_relation;\n\n"; - ($c_name)=m|\@subsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; +my @category_names= keys(%categories); +if (scalar(@category_names)) +{ + my $cat_name; + my $count= 0; + foreach $cat_name (@category_names) + { + $categories{$cat_name}->{__id__}= $count; + $count++; } - ($f_name)=m|\@findex (.+?)$|; - if (!($f_name eq "")){ - flush_all($mode); - ($func_name)= ($f_name); - $mode= "text"; - next; + my $header= "insert into help_category ". + "(help_category_id,name,parent_category_id) values "; + $count= 0; + foreach $cat_name (@category_names) + { + print_insert_header($count,$header); + my $parent_cat_name= $categories{$cat_name}->{__parent_category__}; + my $parent_cat_id= $parent_cat_name eq "" + ? "-1" : $categories{$parent_cat_name}->{__id__}; + print "($count,\"$cat_name\",$parent_cat_id)"; + $count++; } + printf ";\n\n"; +} - if ($_=~/\@example/ && ($mode eq "text")){ - $mode= "example"; - next; +my @topic_names= keys(%topics); +if (scalar(@topic_names)) +{ + my $header= "insert into help_topic ". + "(help_topic_id,help_category_id,name,description,example) values "; + my $topic_name; + my $count= 0; + foreach $topic_name (@topic_names) + { + print_insert_header($count,$header); + my $topic= $topics{$topic_name}; + print "($count,"; + print "$topic->{category}->{__id__},"; + print "\"$topic_name\","; + print "\"$topic->{description}\","; + print "\"$topic->{example}\")"; + $topics{$topic_name}->{__id__}= $count; + $count++; } + printf ";\n\n"; +} - if ($_=~/\@end example/ && ($mode eq "example")){ - flush_all($mode); - next; +my @keywords_names= keys(%keywords); +if (scalar(@keywords_names)) +{ + my $header= "insert into help_keyword (help_keyword_id,name) values "; + my $keyword_name; + my $count= 0; + foreach $keyword_name (@keywords_names) + { + print_insert_header($count,$header); + print "($count,\"$keyword_name\")"; + $count++; } - - if ($mode eq "text") { $text .= $_; } - if ($mode eq "example") { $example .= $_; } + printf ";\n\n"; + + $header= "insert into help_relation ". + "(help_topic_id,help_keyword_id) values "; + $count= 0; + my $count_keyword= 0; + foreach $keyword_name (@keywords_names) + { + my $topic_name; + foreach $topic_name (keys(%{$keywords{$keyword_name}})) + { + print_insert_header($count,$header); + print "($topics{$topic_name}->{__id__},$count_keyword)"; + $count++; + } + $count_keyword++; + } + printf ";\n\n"; } - - -print "DELETE help_category "; -print "FROM help_category "; -print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id "; -print "WHERE help_relation.help_category_id is null;" diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh new file mode 100644 index 00000000000..c54394305cd --- /dev/null +++ b/scripts/mysql_create_system_tables.sh @@ -0,0 +1,311 @@ +#!/bin/sh + +# Copyright (C) 1997-2002 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file + +# This script writes on stdout SQL commands to generate all not +# existing MySQL system tables. It also replaces the help tables with +# new context from the manual (from fill_help_tables.sql). + +# $1 - "test" or "real" or "verbose" variant of database +# $2 - path to mysql-database directory +# $3 - hostname +# $4 - windows option + +if test x$1 = x"" ; +then + echo " +This script writes on stdout SQL commands to generate all not +existing MySQL system tables. It also replaces the help tables with +new context from the manual (from fill_help_tables.sql). + +Usage: + mysql_create_system_tables {help|real|verbose} +"; + exit; +fi + +mdata=$2 +hostname=$3 +windows=$4 + +# Initialize variables +c_d="" i_d="" +c_h="" i_h="" +c_u="" i_u="" +c_f="" i_f="" +c_t="" c_c="" +c_ht="" +c_hc="" +c_hr="" +c_hk="" +i_ht="" + +# Check for old tables +if test ! -f $mdata/db.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing db table" 1>&2; + fi + + # mysqld --bootstrap wants one command/line + c_d="$c_d CREATE TABLE db (" + c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," + c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," + c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," + c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d PRIMARY KEY Host (Host,Db,User)," + c_d="$c_d KEY User (User)" + c_d="$c_d )" + c_d="$c_d comment='Database privileges';" + + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" +fi + +if test ! -f $mdata/host.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing host table" 1>&2; + fi + + c_h="$c_h CREATE TABLE host (" + c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," + c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," + c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h PRIMARY KEY Host (Host,Db)" + c_h="$c_h )" + c_h="$c_h comment='Host privileges; Merged with database privileges';" +fi + +if test ! -f $mdata/user.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing user table" 1>&2; + fi + + c_u="$c_u CREATE TABLE user (" + c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," + c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," + c_u="$c_u Password char(45) binary DEFAULT '' NOT NULL," + c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + c_u="$c_u ssl_cipher BLOB NOT NULL," + c_u="$c_u x509_issuer BLOB NOT NULL," + c_u="$c_u x509_subject BLOB NOT NULL," + c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u PRIMARY KEY Host (Host,User)" + c_u="$c_u )" + c_u="$c_u comment='Users and global privileges';" + + if test x$1 = x"test" + then + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname','');" + else + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost','');" + if test "$windows" -eq 0 + then + i_u="$i_u + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('$hostname','');" + fi + fi +fi + +if test ! -f $mdata/func.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing func table" 1>&2; + fi + + c_f="$c_f CREATE TABLE func (" + c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," + c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," + c_f="$c_f dl char(128) DEFAULT '' NOT NULL," + c_f="$c_f type enum ('function','aggregate') NOT NULL," + c_f="$c_f PRIMARY KEY (name)" + c_f="$c_f )" + c_f="$c_f comment='User defined functions';" +fi + +if test ! -f $mdata/tables_priv.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing tables_priv table" 1>&2; + fi + + c_t="$c_t CREATE TABLE tables_priv (" + c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," + c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," + c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," + c_t="$c_t Table_name char(60) binary DEFAULT '' NOT NULL," + c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," + c_t="$c_t Timestamp timestamp(14)," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," + c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," + c_t="$c_t KEY Grantor (Grantor)" + c_t="$c_t )" + c_t="$c_t comment='Table privileges';" +fi + +if test ! -f $mdata/columns_priv.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing columns_priv table" 1>&2; + fi + + c_c="$c_c CREATE TABLE columns_priv (" + c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," + c_c="$c_c Db char(64) binary DEFAULT '' NOT NULL," + c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," + c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," + c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," + c_c="$c_c Timestamp timestamp(14)," + c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" + c_c="$c_c )" + c_c="$c_c comment='Column privileges';" +fi + +if test ! -f $mdata/help_topic.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing help_topic table" 1>&2; + fi + + c_ht="$c_ht CREATE TABLE help_topic (" + c_ht="$c_ht help_topic_id int unsigned not null," + c_ht="$c_ht name varchar(64) not null," + c_ht="$c_ht help_category_id smallint unsigned not null," + c_ht="$c_ht description text not null," + c_ht="$c_ht example text not null," + c_ht="$c_ht url varchar(128) not null," + c_ht="$c_ht primary key (help_topic_id)," + c_ht="$c_ht unique index (name)" + c_ht="$c_ht )" + c_ht="$c_ht comment='help topics';" +fi + +old_categories="yes" + +if test ! -f $mdata/help_category.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing help_category table" 1>&2; + fi + + c_hc="$c_hc CREATE TABLE help_category (" + c_hc="$c_hc help_category_id smallint unsigned not null," + c_hc="$c_hc name varchar(64) not null," + c_hc="$c_hc parent_category_id smallint unsigned null," + c_hc="$c_hc url varchar(128) not null," + c_hc="$c_hc primary key (help_category_id)," + c_hc="$c_hc unique index (name)" + c_hc="$c_hc )" + c_hc="$c_hc comment='help categories';" +fi + +if test ! -f $mdata/help_keyword.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing help_keyword table" 1>&2; + fi + + c_hk="$c_hk CREATE TABLE help_keyword (" + c_hk="$c_hk help_keyword_id int unsigned not null," + c_hk="$c_hk name varchar(64) not null," + c_hk="$c_hk primary key (help_keyword_id)," + c_hk="$c_hk unique index (name)" + c_hk="$c_hk )" + c_hk="$c_hk comment='help keywords';" +fi + +if test ! -f $mdata/help_relation.frm +then + if test x$1 = x"verbose" ; then + echo "Preparing help_relation table" 1>&2; + fi + + c_hr="$c_hr CREATE TABLE help_relation (" + c_hr="$c_hr help_topic_id int unsigned not null references help_topic," + c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword," + c_hr="$c_hr primary key (help_keyword_id, help_topic_id)" + c_hr="$c_hr )" + c_hr="$c_hr comment='keyword-topic relation';" +fi + +cat << END_OF_DATA +use mysql; +$c_d +$i_d + +$c_h +$i_h + +$c_u +$i_u + +$c_f +$i_f + +$c_t +$c_c + +$c_ht +$c_hc +$c_hr +$c_hk +END_OF_DATA + diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 15bc834e850..96e33d3e7c5 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -87,7 +87,7 @@ if test -z "$basedir" then basedir=@prefix@ bindir=@bindir@ - execdir=@libexecdir@ + execdir=@libexecdir@ pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" @@ -100,24 +100,24 @@ else else execdir="$basedir/bin" fi - - # find fill_help_tables.sh - for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts @pkgdatadir@ - do - if test -f $i/fill_help_tables.sql - then - pkgdatadir=$i - fi - done fi +# find fill_help_tables.sh +for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` @pkgdatadir@ +do + if test -f $i/fill_help_tables.sql + then + pkgdatadir=$i + fi +done + if test -f $pkgdatadir/fill_help_tables.sql then fill_help_tables=$pkgdatadir/fill_help_tables.sql else if test $verbose -eq 1 then - echo "Could not find help file 'fill_help_tables.sql'". + echo "Could not find help file 'fill_help_tables.sql' ;$pkgdatadir; ;$basedir;". fi fi @@ -172,205 +172,21 @@ fi chown $user $ldata $ldata/mysql $ldata/test; fi -# Initialize variables -c_d="" i_d="" -c_h="" i_h="" -c_u="" i_u="" -c_f="" i_f="" -c_t="" c_c="" - -# Check for old tables if test ! -f $mdata/db.frm then - if test $verbose -eq 1 ; then - echo "Preparing db table" - fi - # mysqld --bootstrap wants one command/line - c_d="$c_d CREATE TABLE db (" - c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," - c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," - c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," - c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d PRIMARY KEY Host (Host,Db,User)," - c_d="$c_d KEY User (User)" - c_d="$c_d )" - c_d="$c_d comment='Database privileges';" - - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" -fi - -if test ! -f $mdata/host.frm -then - if test $verbose -eq 1 ; then - echo "Preparing host table" - fi - - c_h="$c_h CREATE TABLE host (" - c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," - c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," - c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h PRIMARY KEY Host (Host,Db)" - c_h="$c_h )" - c_h="$c_h comment='Host privileges; Merged with database privileges';" + c_d="yes" fi -if test ! -f $mdata/user.frm +if test $verbose -eq 1 then - if test $verbose -eq 1 ; then - echo "Preparing user table" - fi - - c_u="$c_u CREATE TABLE user (" - c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," - c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(45) binary DEFAULT '' NOT NULL," - c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," - c_u="$c_u ssl_cipher BLOB NOT NULL," - c_u="$c_u x509_issuer BLOB NOT NULL," - c_u="$c_u x509_subject BLOB NOT NULL," - c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u PRIMARY KEY Host (Host,User)" - c_u="$c_u )" - c_u="$c_u comment='Users and global privileges';" - - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); -" - - if test "$windows" -eq 0 - then - i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('$hostname','');" - fi -fi - -if test ! -f $mdata/func.frm -then - if test $verbose -eq 1 ; then - echo "Preparing func table" - fi - - c_f="$c_f CREATE TABLE func (" - c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," - c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," - c_f="$c_f dl char(128) DEFAULT '' NOT NULL," - c_f="$c_f type enum ('function','aggregate') NOT NULL," - c_f="$c_f PRIMARY KEY (name)" - c_f="$c_f )" - c_f="$c_f comment='User defined functions';" -fi - -if test ! -f $mdata/tables_priv.frm -then - if test $verbose -eq 1 ; then - echo "Preparing tables_priv table" - fi - - c_t="$c_t CREATE TABLE tables_priv (" - c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," - c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," - c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," - c_t="$c_t Table_name char(60) binary DEFAULT '' NOT NULL," - c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," - c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," - c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," - c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," - c_t="$c_t KEY Grantor (Grantor)" - c_t="$c_t )" - c_t="$c_t comment='Table privileges';" -fi - -if test ! -f $mdata/columns_priv.frm -then - if test $verbose -eq 1 ; then - echo "Preparing columns_priv table" - fi - - c_c="$c_c CREATE TABLE columns_priv (" - c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," - c_c="$c_c Db char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," - c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c Timestamp timestamp(14)," - c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," - c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" - c_c="$c_c )" - c_c="$c_c comment='Column privileges';" + create_option="verbose" +else + create_option="real" fi -echo "Installing privilege tables" +echo "Installing all prepared tables" if ( - cat << END_OF_DATA -use mysql; -$c_d -$i_d - -$c_h -$i_h - -$c_u -$i_u - -$c_f -$i_f - -$c_t -$c_c -END_OF_DATA + mysql_create_system_tables $create_option $mdata $hostname $windows if test -n "$fill_help_tables" then cat $fill_help_tables -- cgit v1.2.1 From 7c6522a74ed868e6b67577ebdaa0b1675ac7890b Mon Sep 17 00:00:00 2001 From: "gluh@gluh.mysql.r18.ru" <> Date: Mon, 2 Jun 2003 14:25:01 +0500 Subject: 'Expand the mysql.proc table to include (almost) all fields' task(851) Fix after review --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9e7032244cc..246fd33d1c6 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -362,8 +362,8 @@ then c_p="$c_p type enum('function','procedure') NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL," c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," - c_p="$c_p created timestamp," c_p="$c_p modified timestamp," + c_p="$c_p created timestamp," c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," c_p="$c_p PRIMARY KEY (name,type)" -- cgit v1.2.1 From 23145cfed72954c29f5a47e82af22898164be4b0 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Wed, 4 Jun 2003 18:28:51 +0300 Subject: Added SQLSTATE to client/server protocol bmove_allign -> bmove_align Added OLAP function ROLLUP Split mysql_fix_privilege_tables to a script and a .sql data file Added new (MEMROOT*) functions to avoid calling current_thd() when creating some common objects. Added table_alias_charset, for easier --lower-case-table-name handling Better SQL_MODE handling (Setting complex options also sets sub options) New (faster) assembler string functions for x86 --- scripts/Makefile.am | 2 +- scripts/mysql_fix_privilege_tables.sh | 344 ++++++++++++++------------------- scripts/mysql_fix_privilege_tables.sql | 89 +++++++++ 3 files changed, 239 insertions(+), 196 deletions(-) create mode 100644 scripts/mysql_fix_privilege_tables.sql (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 88f561e0e6d..7d256a70b10 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -60,7 +60,7 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = fill_help_tables.sql +pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql # mysqlbug should be distributed built so that people can report build # failures with it. diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 05d6f3ffb71..5d392f719f0 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,212 +1,166 @@ #!/bin/sh +# This script is a wrapper to pipe the mysql_fix_privilege_tables.sql +# through the mysql client program to the mysqld server -root_password="$1" +# Default values (Can be changed in my.cnf) +password="" host="localhost" user="root" - -if test -z $1 ; then - cmd="@bindir@/mysql -f --user=$user --host=$host mysql" +sql_only=0 +basedir="" +verbose=0 +args="" + +file=mysql_fix_privilege_tables.sql + +# The following code is almost identical to the code in mysql_install_db.sh + +parse_arguments() { + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg do + case "$arg" in + --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --sql|--sql-only) sql_only=1;; + --verbose) verbose=1 ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + fi + ;; + esac + done +} + +# Get first arguments from the my.cfg file, groups [mysqld] and +# [mysql_install_db], and then merge with the command line arguments +if test -x ./bin/my_print_defaults +then + print_defaults="./bin/my_print_defaults" +elif test -x @bindr@/my_print_defaults +then + print_defaults="@bindir@/my_print_defaults" +elif test -x @bindir@/mysql_print_defaults +then + print_defaults="@bindir@/mysql_print_defaults" else - root_password="$1" - cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql" + print_defaults="my_print_defaults" fi -# Debian addition -if [ "$1" = "--sql-only" ]; then - root_password="" - cmd="/usr/share/mysql/echo_stderr" -fi +parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` +parse_arguments PICK-ARGS-FROM-ARGV "$@" -echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" -echo "mysql.func tables to MySQL 3.22.14 and above." -echo "" -echo "This is needed if you want to use the new GRANT functions," -echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23" -echo "" -echo "If you get 'Access denied' errors, you should run this script again" -echo "and give the MySQL root user password as an argument!" - -echo "Converting all privilege tables to MyISAM format" -$cmd < Grant -# and Create -> Alter, Index, References - -if test $res = 0 +if test -z "$basedir" then - echo "Setting default privileges for the new grant, index and alter privileges" - $cmd < Column_priv from MySQL 3.22.12 -# - -echo "Changing name of columns_priv.Type -> columns_priv.Column_priv" -echo "You can ignore any Unknown column errors from this" - -$cmd <""; -END_OF_DATA - echo "" + password=`echo $args | sed -e 's/ *//g'` fi -# Add fields that can be used to limit number of questions and connections -# for some users. - -$cmd < /dev/null 2>&1 +else + cat $sql_file | $cmd > /dev/null +fi +if test $? = 0 +then + s_echo "done" +else + s_echo "Got a failure from command:" + s_echo "$cmd" + s_echo "Please check the above output and try again." + if test $verbose = 0 + then + s_echo "" + s_echo "Running the script with the --verbose option may give you some information" + s_echo "of what went wrong." + fi + s_echo "" + s_echo "If you get an 'Access denied' error, you should run this script again and" + s_echo "give the MySQL root user password as an argument with the --password= option" +fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql new file mode 100644 index 00000000000..3466e3cf799 --- /dev/null +++ b/scripts/mysql_fix_privilege_tables.sql @@ -0,0 +1,89 @@ +ALTER TABLE user type=MyISAM; +ALTER TABLE db type=MyISAM; +ALTER TABLE host type=MyISAM; +ALTER TABLE func type=MyISAM; +ALTER TABLE columns_priv type=MyISAM; +ALTER TABLE tables_priv type=MyISAM; +ALTER TABLE user change password password char(45) not null; +ALTER TABLE user add File_priv enum('N','Y') NOT NULL; +CREATE TABLE IF NOT EXISTS func ( + name char(64) DEFAULT '' NOT NULL, + ret tinyint(1) DEFAULT '0' NOT NULL, + dl char(128) DEFAULT '' NOT NULL, + type enum ('function','aggregate') NOT NULL, + PRIMARY KEY (name) +); + +-- Detect whether or not we had the Grant_priv column +SET @hadGrantPriv:=0; +SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; + +ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; + +--- Fix privileges for old tables +UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; + +ALTER TABLE user +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, +ADD ssl_cipher BLOB NOT NULL, +ADD x509_issuer BLOB NOT NULL, +ADD x509_subject BLOB NOT NULL; +ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; + +CREATE TABLE IF NOT EXISTS tables_priv ( + Host char(60) DEFAULT '' NOT NULL, + Db char(60) DEFAULT '' NOT NULL, + User char(16) DEFAULT '' NOT NULL, + Table_name char(60) DEFAULT '' NOT NULL, + Grantor char(77) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name) +); + +CREATE TABLE IF NOT EXISTS columns_priv ( + Host char(60) DEFAULT '' NOT NULL, + Db char(60) DEFAULT '' NOT NULL, + User char(16) DEFAULT '' NOT NULL, + Table_name char(60) DEFAULT '' NOT NULL, + Column_name char(59) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name,Column_name) +); + +ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; + +ALTER TABLE func add type enum ('function','aggregate') NOT NULL; + +# Detect whether we had Show_db_priv +SET @hadShowDbPriv:=0; +SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; + +ALTER TABLE user +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; + +UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; + +ALTER TABLE user +ADD max_questions int(11) NOT NULL AFTER x509_subject, +ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, +ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; + +ALTER TABLE db +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ALTER TABLE host +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; -- cgit v1.2.1 From 059b1e561287d87c18b39d317e7dbb8170b9fb74 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Thu, 5 Jun 2003 23:19:56 +0300 Subject: After merge fixes --- scripts/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 29cfad11220..6006222992e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -33,7 +33,6 @@ bin_SCRIPTS = @server_scripts@ \ mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ - fill_help_tables \ mysql_create_system_tables EXTRA_SCRIPTS = make_binary_distribution.sh \ @@ -140,5 +139,7 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: make_win_src_distribution make_binary_distribution +all: fill_help_tables.sql make_win_src_distribution make_binary_distribution +fill_help_tables.sql: fill_help_tables ../Docs/manual.texi + ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql -- cgit v1.2.1 From 2daa5643d3c9a5218f75a47476fa5624ad477cfe Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 11 Jun 2003 13:40:20 +0200 Subject: - applied patch to mysql_explain_log.sh provided by Dennis Haney to accept --socket option (Bug #592) --- scripts/mysql_explain_log.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts') 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 , http://www.mobile.de + Dennis Haney (Added socket support) =head1 RECRUITING -- cgit v1.2.1 From 63df5f7cb71ce01fa5f3dfc1a072cc57e8aab32b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 12 Jun 2003 13:52:24 +0200 Subject: - applied patch for mysqld_safe from Christian Hammers to be able to define a different niceness level in my.cnf (Bug #627) --- scripts/mysqld_safe.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e400c27b84c..626e04b1579 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -70,6 +70,7 @@ parse_arguments() { MYSQLD="mysqld" fi ;; + --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; *) if test -n "$pick_args" then @@ -110,6 +111,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 +169,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 +205,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 -- cgit v1.2.1 From 8a52c2d20bdb23ef154aa5c6a5980a2d763c9c4e Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Sat, 14 Jun 2003 12:29:42 +0300 Subject: Added option --skip-kill-mysqld to mysqld_safe. This can be useful, if one is running many mysqlds through mysqld_multi, for example. Without this option, on Linux one mysqld_safe process may kill other mysqlds as well, if started using the same binary and path. --- scripts/mysqld_safe.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 626e04b1579..fcd8e26c901 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=;;"` ;; @@ -83,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 \ @@ -298,7 +304,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) -- cgit v1.2.1 From e090f2d0cc0fbd5874d6e619d925793c2d903e5f Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Sun, 15 Jun 2003 23:24:37 +0300 Subject: Fixes for make_win_src_distributions Removed compiler warnings --- scripts/make_win_src_distribution.sh | 37 +++++++++++---------- scripts/mysql_create_system_tables.sh | 33 ++++++++++--------- scripts/mysql_install_db.sh | 60 ++++++++++++++++++++--------------- 3 files changed, 71 insertions(+), 59 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index a6312193221..f76fe02e2bd 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -12,6 +12,7 @@ CP="cp -p" DEBUG=0 SILENT=0 SUFFIX="" +DIRNAME="" OUTTAR=0 # @@ -75,6 +76,7 @@ parse_arguments() { --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 ;; @@ -155,11 +157,15 @@ mkdir $BASE/Docs $BASE/extra $BASE/include # Copy directory files # -copy_dir_files() { - +copy_dir_files() +{ for arg do print_debug "Copying files from directory '$arg'" - cd $SOURCE/$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 @@ -199,9 +205,6 @@ copy_dir_dirs() { for i in * do if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then - if [ ! -d $BASE/$basedir/$i ]; then - mkdir $BASE/$basedir/$i - fi copy_dir_files $basedir/$i fi done @@ -214,7 +217,7 @@ copy_dir_dirs() { for i in client dbug extra heap include isam \ libmysql libmysqld merge myisam \ - myisammrg mysys regex sql strings \ + myisammrg mysys regex sql strings sql-common \ vio zlib do copy_dir_files $i @@ -270,15 +273,19 @@ done if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" - scripts/mysql_install_db --windows --datadir=$BASE/data + scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data fi - # # Specify the distribution package name and copy it # -NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX +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 @@ -345,7 +352,7 @@ set_tarzip_options() EXT=".zip" NEED_COMPRESS=0 if [ "$SILENT" = "1" ] ; then - OPT="-r" + OPT="$OPT -q" fi fi done @@ -386,9 +393,7 @@ fi print_debug "Removing temporary directory" rm -r -f $BASE -echo "$NEW_NAME$EXT created successfully !!" - +if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" +fi # End of script - - - diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index c54394305cd..51fbb8a8097 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -1,6 +1,5 @@ #!/bin/sh - -# Copyright (C) 1997-2002 MySQL AB +# Copyright (C) 1997-2003 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file # This script writes on stdout SQL commands to generate all not @@ -12,7 +11,7 @@ # $3 - hostname # $4 - windows option -if test x$1 = x"" ; +if test "$1" = "" then echo " This script writes on stdout SQL commands to generate all not @@ -20,9 +19,9 @@ existing MySQL system tables. It also replaces the help tables with new context from the manual (from fill_help_tables.sql). Usage: - mysql_create_system_tables {help|real|verbose} -"; - exit; + mysql_create_system_tables [test|verbose|real] +" + exit fi mdata=$2 @@ -44,7 +43,7 @@ i_ht="" # Check for old tables if test ! -f $mdata/db.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing db table" 1>&2; fi @@ -76,7 +75,7 @@ fi if test ! -f $mdata/host.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing host table" 1>&2; fi @@ -102,7 +101,7 @@ fi if test ! -f $mdata/user.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing user table" 1>&2; fi @@ -142,7 +141,7 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - if test x$1 = x"test" + if test "$1" = "test" then i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -165,7 +164,7 @@ fi if test ! -f $mdata/func.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing func table" 1>&2; fi @@ -181,7 +180,7 @@ fi if test ! -f $mdata/tables_priv.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing tables_priv table" 1>&2; fi @@ -202,7 +201,7 @@ fi if test ! -f $mdata/columns_priv.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing columns_priv table" 1>&2; fi @@ -221,7 +220,7 @@ fi if test ! -f $mdata/help_topic.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing help_topic table" 1>&2; fi @@ -242,7 +241,7 @@ old_categories="yes" if test ! -f $mdata/help_category.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing help_category table" 1>&2; fi @@ -259,7 +258,7 @@ fi if test ! -f $mdata/help_keyword.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing help_keyword table" 1>&2; fi @@ -274,7 +273,7 @@ fi if test ! -f $mdata/help_relation.frm then - if test x$1 = x"verbose" ; then + if test "$1" = "verbose" ; then echo "Preparing help_relation table" 1>&2; fi diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 96e33d3e7c5..9e4f35dd5e1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -8,18 +8,8 @@ # All unrecognized arguments to this script are passed to mysqld. in_rpm=0 -case "$1" in - --rpm) - in_rpm="1"; shift - ;; -esac windows=0 -case "$1" in - --windows) - windows="1"; shift - ;; -esac -defaults= +defaults="" case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -44,6 +34,8 @@ parse_arguments() { --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --verbose) verbose=1 ;; + --rpm) in_rpm=1 ;; + --windows) windows=1 ;; *) if test -n "$pick_args" then @@ -61,6 +53,9 @@ parse_arguments() { if test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" +elif test -x ./extra/my_print_defaults +then + print_defaults="./extra/my_print_defaults" elif test -x @bindir@/my_print_defaults then print_defaults="@bindir@/my_print_defaults" @@ -79,6 +74,7 @@ basedir= force=0 verbose=0 fill_help_tables="" + parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -103,7 +99,7 @@ else fi # find fill_help_tables.sh -for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` @pkgdatadir@ +for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ do if test -f $i/fill_help_tables.sql then @@ -115,22 +111,28 @@ if test -f $pkgdatadir/fill_help_tables.sql then fill_help_tables=$pkgdatadir/fill_help_tables.sql else - if test $verbose -eq 1 - then - echo "Could not find help file 'fill_help_tables.sql' ;$pkgdatadir; ;$basedir;". - fi + echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir". + exit 1; fi mdata=$ldata/mysql +mysqld=$execdir/mysqld +mysqld_opt="" -if test "$windows" -eq 0 -a ! -x $execdir/mysqld +if test "$windows" = 1 +then + mysqld="./sql/mysqld" + mysqld_opt="--language=./sql/share/english" +fi + +if test ! -x $mysqld then if test "$in_rpm" -eq 1 then - echo "FATAL ERROR $execdir/mysqld not found!" + echo "FATAL ERROR $mysqld not found!" exit 1 else - echo "Didn't find $execdir/mysqld" + echo "Didn't find $mysqld" echo "You should do a 'make install' before executing this script" exit 1 fi @@ -184,23 +186,28 @@ else create_option="real" fi -echo "Installing all prepared tables" +if test "$in_rpm" -eq 0 -a "$windows" -eq 0 +then + echo "Installing all prepared tables" +fi if ( - mysql_create_system_tables $create_option $mdata $hostname $windows + $pkgdatadir/mysql_create_system_tables $create_option $mdata $hostname $windows if test -n "$fill_help_tables" then cat $fill_help_tables fi -) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ +) | eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then - echo "" - if test "$in_rpm" -eq 0 || "$windows" -eq 0 + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then + echo "" echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" echo fi + if test "$windows" -eq 0 + then echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "This is done with:" echo "$bindir/mysqladmin -u root password 'new-password'" @@ -216,7 +223,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + if test "$in_rpm" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" @@ -230,13 +237,14 @@ then echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" echo "Support MySQL by buying support/licenses at https://order.mysql.com" + fi exit 0 else echo "Installation of grant tables failed!" echo echo "Examine the logs in $ldata for more information." echo "You can also try to start the mysqld daemon with:" - echo "$execdir/mysqld --skip-grant &" + echo "$mysqld --skip-grant &" echo "You can use the command line tool" echo "$bindir/mysql to connect to the mysql" echo "database and look at the grant tables:" -- cgit v1.2.1 From 3b7911d36769ba3a822ef2740c24ce8e97f67ec6 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 16 Jun 2003 10:32:49 +0200 Subject: - changed "password" to "Password" as suggested by Paul DuBois to be consistent with the other column names in the table. --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 3466e3cf799..43dc6d89481 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -4,7 +4,7 @@ ALTER TABLE host type=MyISAM; ALTER TABLE func type=MyISAM; ALTER TABLE columns_priv type=MyISAM; ALTER TABLE tables_priv type=MyISAM; -ALTER TABLE user change password password char(45) not null; +ALTER TABLE user change Password Password char(45) not null; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) DEFAULT '' NOT NULL, -- cgit v1.2.1 From b648691535d41263abb17af2eb194d51563e114d Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Tue, 17 Jun 2003 12:22:57 -0700 Subject: Added new HOWTO doc 'INSTALL-WIN-SOURCE' on building 'mysql clients and server' on WINDOWS from BitKeeper as well as from distributed source archive --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index f76fe02e2bd..6c119e2f80e 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -249,7 +249,7 @@ touch $BASE/innobase/ib_config.h cd $SOURCE for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ - INSTALL-SOURCE-WIN \ + INSTALL-WIN-SOURCE Docs/manual_toc.html Docs/manual.html \ Docs/mysqld_error.txt Docs/INSTALL-BINARY -- cgit v1.2.1 From 75b8cb20363e3220d76354509aee0aecf7fbb2e4 Mon Sep 17 00:00:00 2001 From: "venu@myvenu.com" <> Date: Tue, 17 Jun 2003 14:29:20 -0700 Subject: Fix for --dirname and --suffix (missed ones) --- scripts/make_win_src_distribution.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 6c119e2f80e..1be301ee92a 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -59,6 +59,8 @@ show_usage() 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" -- cgit v1.2.1 From 7a6059cc88403a8d7ba25f3fdd2b0f0d7dd34235 Mon Sep 17 00:00:00 2001 From: "lenz@kallisto.local" <> Date: Fri, 20 Jun 2003 13:57:51 +0200 Subject: - make sure that scripts/*.sql files are being added to the source distribution as well --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6006222992e..ff35170dcf3 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -62,7 +62,7 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql +dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql # mysqlbug should be distributed built so that people can report build # failures with it. -- cgit v1.2.1 From 1bd306ccd49e0ea6b9c91339b78b7b73f4137abd Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Tue, 24 Jun 2003 12:10:35 +0300 Subject: Fixed some new memory leaks Updated VC++ files --- scripts/make_win_src_distribution.sh | 5 +++-- scripts/mysql_create_system_tables.sh | 11 +++++------ scripts/mysql_fix_privilege_tables.sh | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 1be301ee92a..df7ac29ee0d 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -251,7 +251,7 @@ touch $BASE/innobase/ib_config.h cd $SOURCE for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ - INSTALL-WIN-SOURCE + INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ Docs/mysqld_error.txt Docs/INSTALL-BINARY @@ -350,7 +350,7 @@ set_tarzip_options() else ZIPFILE1=zip ZIPFILE2="" - OPT="-vr" + OPT="-r" EXT=".zip" NEED_COMPRESS=0 if [ "$SILENT" = "1" ] ; then @@ -382,6 +382,7 @@ 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 diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 51fbb8a8097..1f0579f87c2 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -145,20 +145,19 @@ then then i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user (host,user) values ('localhost','');" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" -eq 0 then i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname','');" - fi + INSERT INTO user (host,user) values ('localhost',''); + else + i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + fi fi fi diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 5d392f719f0..4b6f74eae06 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -57,6 +57,9 @@ then elif test -x @bindir@/mysql_print_defaults then print_defaults="@bindir@/mysql_print_defaults" +elif test -x extra/my_print_defaults +then + print_defaults="extra/my_print_defaults" else print_defaults="my_print_defaults" fi -- cgit v1.2.1 From 63235ceeefbde0bf1e0d2979bbab30cfde998199 Mon Sep 17 00:00:00 2001 From: "bar@bar.mysql.r18.ru" <> Date: Tue, 24 Jun 2003 15:55:39 +0500 Subject: mysql_create_system_tables.sh: Type fix --- scripts/mysql_create_system_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 1f0579f87c2..a98e1739260 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -153,8 +153,8 @@ then then i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user (host,user) values ('$hostname','');" - INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname',''); + INSERT INTO user (host,user) values ('localhost','');" else i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi -- cgit v1.2.1 From 7455759f11c3229f45c4f3215e839cc287bf3f86 Mon Sep 17 00:00:00 2001 From: "gluh@gluh.mysql.r18.ru" <> Date: Thu, 26 Jun 2003 09:39:23 +0500 Subject: Bug fixed: mysql-test failure on rpl tests --- scripts/mysql_create_system_tables.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a98e1739260..2739c45e750 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -145,6 +145,7 @@ then then i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else -- cgit v1.2.1 From 7df0475847103581798ddacf75dbf634e8f98d0a Mon Sep 17 00:00:00 2001 From: "kostja@oak.local" <> Date: Tue, 1 Jul 2003 23:40:59 +0400 Subject: First version of new authentification procedure: now authentification is one-stage (instead of two-stage in 4.1) For now following tasks have been done: - PASSWORD() function was rewritten. PASSWORD() now returns SHA1 hash_stage2; for new passwords user.password contains '*'hash_stage2; sql_yacc.yy also fixed; - password.c: new functions were implemented, old rolled back to 4.0 state - server code was rewritten to use new authorization algorithm (check_user(), change user, and other stuff in sql/sql_parse.cc) - client code was rewritten to use new authorization algorithm (mysql_real_connect, myslq_authenticate in sql-common/client.c) - now server barks on 45-byte-length 4.1.0 passwords and refuses 4.1.0-style authentification. Users with 4.1.0 passwords are blocked (sql/sql_acl.cc) - mysqladmin.c was fixed to work correctly with new passwords Tests for 4.0-4.1.1, 4.1.1-4.1.1 (with or without db/password) logons was performed; mysqladmin also was tested. Additional check are nevertheless necessary. --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 2739c45e750..c4cdc7b52d7 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -108,7 +108,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(45) binary DEFAULT '' NOT NULL," + c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 43dc6d89481..8c5b29a49ff 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -4,7 +4,7 @@ ALTER TABLE host type=MyISAM; ALTER TABLE func type=MyISAM; ALTER TABLE columns_priv type=MyISAM; ALTER TABLE tables_priv type=MyISAM; -ALTER TABLE user change Password Password char(45) not null; +ALTER TABLE user change Password Password char(41) not null; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) DEFAULT '' NOT NULL, -- cgit v1.2.1 From fe025d40c48d28542aa2169f417c8127a737356d Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Fri, 4 Jul 2003 23:06:21 +0300 Subject: Fixed a compatibility bug in mysqlhotcopy between different versions of DBD. New mysqlhotcopy version supports both old and new DBD versions while versions elder than 1.19 support only old DBD versions. --- scripts/mysqlhotcopy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index a89a8919752..fa35a1c6555 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"; @@ -770,6 +770,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`"; } -- cgit v1.2.1 From dbf893fbd4b39ab0ace49996616619a2297c52a4 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 8 Jul 2003 17:27:22 +0200 Subject: added missing ~/.my.cnf support to mysqlhotcopy (bug #808) --- scripts/mysqlhotcopy.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index fa35a1c6555..7385be65092 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -81,6 +81,11 @@ sub usage { die @_, $OPTIONS; } +# reading ~/.my.cnf +my @defops = `@bindir@/my_print_defaults client mysqlhotcopy`; +chop @defops; +splice @ARGV, 0, 0, @defops; + my %opt = ( user => scalar getpwuid($>), noindices => 0, -- cgit v1.2.1 From a5a3eb94393e11aef81d9bec76b3d10ba8fa343c Mon Sep 17 00:00:00 2001 From: "paul@teton.kitebird.com" <> Date: Tue, 8 Jul 2003 11:25:46 -0500 Subject: mysqlhotcopy.sh: Undo serg's patch that used my_print_defaults, and instead simply do not define $opt{user}. This allows the script to use option files properly. --- scripts/mysqlhotcopy.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 7385be65092..fc89a967e16 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -81,13 +81,11 @@ sub usage { die @_, $OPTIONS; } -# reading ~/.my.cnf -my @defops = `@bindir@/my_print_defaults client mysqlhotcopy`; -chop @defops; -splice @ARGV, 0, 0, @defops; +# 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, @@ -170,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}, { -- cgit v1.2.1 From 7326dcbf23c0c5a2c68d57809e2934b9986d9d6b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 8 Jul 2003 23:29:55 +0200 Subject: - Fixed mysqlhotcopy to actually abort if copying the tables failed. (BUG#812) --- scripts/mysqlhotcopy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index fc89a967e16..98a5c5b9f85 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -660,9 +660,9 @@ sub safe_system 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}; #' + warn "Executing command failed ($cp_status). Trying backtick execution...\n"; ## try something else - `@cmd` && die "Error: @cmd failed ($cp_status) while copying files.\n"; + `@cmd` || die "Error: @cmd failed ($?) while copying files.\n"; } } -- cgit v1.2.1 From a8a29a39d27371613c862737f9ec1d56b9f48bf8 Mon Sep 17 00:00:00 2001 From: "pem@mysql.telia.com" <> Date: Wed, 9 Jul 2003 17:07:12 +0200 Subject: Merging 4.1 into 5.0 (second pass; post-merge fixes). One test in subselect.test still wrong. Had to reconstruct all errmsg.txt files completely, since auto-merge made a mess of the lot. :-( --- scripts/mysql_create_system_tables.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 2739c45e750..cf2e703a7b9 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -39,6 +39,7 @@ c_hc="" c_hr="" c_hk="" i_ht="" +c_p="" # Check for old tables if test ! -f $mdata/db.frm @@ -285,6 +286,22 @@ then c_hr="$c_hr comment='keyword-topic relation';" fi +if test ! -f $mdata/proc.frm +then + c_p="$c_p CREATE TABLE proc (" + c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p type enum('function','procedure') NOT NULL," + c_p="$c_p body blob DEFAULT '' NOT NULL," + c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," + c_p="$c_p modified timestamp," + c_p="$c_p created timestamp," + c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," + c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p PRIMARY KEY (name,type)" + c_p="$c_p )" + c_p="$c_p comment='Stored Procedures';" +fi + cat << END_OF_DATA use mysql; $c_d @@ -306,5 +323,8 @@ $c_ht $c_hc $c_hr $c_hk + +$c_p + END_OF_DATA -- cgit v1.2.1 From 2ca501f7ea66e862ad4b064a175a83bad930f8ba Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Thu, 10 Jul 2003 16:03:29 +0200 Subject: Fix for BUG#812 "mysqlhotcopy fails to copy tables but does not indicate a failure" ("does not indicate a failure"); this is about "mysqlhotcopy fails to copy tables". --- scripts/mysqlhotcopy.sh | 70 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 98a5c5b9f85..f23955da06a 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -569,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 @@ -646,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 "Executing command failed ($cp_status). Trying backtick execution...\n"; - ## try something else - `@cmd` || die "Error: @cmd failed ($?) 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 ) = @_; -- cgit v1.2.1 From ca8831e1ad37c4e5f6b3e183873b7a33b6726544 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 15 Jul 2003 12:50:17 +0200 Subject: - removed options sort_buffer and key_buffer from calls to (my)isamchk in mysqld_safe (commented out by default), to not override any options defined in my.cnf (thanks to Axel Schwenke from Jobpilot.de for the suggestion) --- scripts/mysqld_safe.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index fcd8e26c901..d7e3eedb84e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -274,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" -- cgit v1.2.1 From e76d7848644d75b4dca9b2881ba85e96530367df Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Thu, 17 Jul 2003 12:15:41 -0400 Subject: fixed bug with location of mysql_create_sytem_tables --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 9e4f35dd5e1..a69995e51a0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -191,7 +191,7 @@ then echo "Installing all prepared tables" fi if ( - $pkgdatadir/mysql_create_system_tables $create_option $mdata $hostname $windows + $bindir/mysql_create_system_tables $create_option $mdata $hostname $windows if test -n "$fill_help_tables" then cat $fill_help_tables -- cgit v1.2.1 From 216ca1e15d4abff653ff22c549a33c2e4c8905f8 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 1 Aug 2003 10:09:23 +0200 Subject: - fixed BUG#968 ("test: argument expected" error) - thanks to Alex Kiernan for the patch --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 526b7ac91b3..7ba42e560bb 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -4,7 +4,7 @@ root_password="$1" host="localhost" user="root" -if test -z $1 ; then +if test -z "$1" ; then cmd="@bindir@/mysql -f --user=$user --host=$host mysql" else root_password="$1" -- cgit v1.2.1 From 3d5d56cea9961971f7d72d9f7cd6c4ed66ed7bdb Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 6 Aug 2003 12:13:08 +0200 Subject: - try harder to obtain the FQDN with "hostname -f", if possible (BUG#897) Unfortunately the returned value of "hostname" is inconsistent on various platforms - some return the host name only, others return the FQDN by default. On Linux, one can use option "-f" to enable the output of the FQDN. Use it, if available. --- scripts/mysql_install_db.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 64fdd0dfebb..ffb857933cd 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -107,7 +107,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 "$IN_RPM" -eq 0 -a $force -eq 0 -- cgit v1.2.1 From d527253d04da2c6b0b778732b9d1c4917335672e Mon Sep 17 00:00:00 2001 From: "greg@gcw.ath.cx" <> Date: Wed, 6 Aug 2003 22:57:14 -0400 Subject: Copied Venu's make_win_src_distribution script from 4.1 tree --- scripts/Makefile.am | 1 + scripts/make_win_src_distribution.sh | 404 +++++++++++++++++++++++++++++++++++ 2 files changed, 405 insertions(+) create mode 100755 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 8f17d8519b8..f1ca6023fbe 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -35,6 +35,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ + make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh new file mode 100755 index 00000000000..d2b50e06f54 --- /dev/null +++ b/scripts/make_win_src_distribution.sh @@ -0,0 +1,404 @@ +#!/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 \ + 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 -- cgit v1.2.1 From e177eba89b552516138b5ae69fb054ccb4cb94bd Mon Sep 17 00:00:00 2001 From: "greg@gcw.ath.cx" <> Date: Thu, 7 Aug 2003 01:14:45 -0400 Subject: New option for Bootstrap: -w | --win-dist to create Windows source package --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index f1ca6023fbe..d6f59cb1ae9 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -65,6 +65,7 @@ pkgdata_DATA = make_binary_distribution # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ + make_win_src_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ -- cgit v1.2.1 From d5547ad13bc1a0b74bb137039c78431efb606bf0 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 7 Aug 2003 18:54:59 +0200 Subject: - some fixed for make_win_src_distribution to work properly --- scripts/Makefile.am | 1 + scripts/make_win_src_distribution.sh | 36 +++++++++++++++++------------------- 2 files changed, 18 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d6f59cb1ae9..72fc73ef28b 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.sh b/scripts/make_win_src_distribution.sh index d2b50e06f54..8f8ee344e93 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -38,9 +38,9 @@ fi # Debug print of the status # -print_debug() +print_debug() { - for statement + for statement do if [ "$DEBUG" = "1" ] ; then echo $statement @@ -52,7 +52,7 @@ print_debug() # Usage of the script # -show_usage() +show_usage() { echo "MySQL utility script to create a Windows src package, and it takes" echo "the following arguments:" @@ -98,14 +98,14 @@ parse_arguments "$@" for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp do - if [ "$i" ]; then + if [ "$i" ]; then print_debug "Setting TMP to '$i'" - TMP=$i + TMP=$i break fi done - + # # @@ -123,14 +123,12 @@ $CP -r $SOURCE/VC++Files $BASE ( find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( - while read v + 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 + # ^M -> type CTRL V + CTRL M + cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp rm $v mv $v.tmp $v done @@ -149,7 +147,7 @@ rm -r -f "$BASE/share/Makefile.am" # Clean up if we did this from a bk tree # -if [ -d $BASE/SCCS ] +if [ -d $BASE/SCCS ] then find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi @@ -171,9 +169,9 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE - do - if [ -f $i ] + README INSTALL* LICENSE + do + if [ -f $i ] then $CP $SOURCE/$arg/$i $BASE/$arg/$i fi @@ -198,14 +196,14 @@ copy_dir_dirs() { for arg do basedir=$arg - + if [ ! -d $BASE/$arg ]; then mkdir $BASE/$arg fi - + copy_dir_files $arg - - cd $SOURCE/$arg/ + + cd $SOURCE/$arg/ for i in * do if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then -- cgit v1.2.1 From 94c7024eaa4fb93b407e2aee0002bbd7014eb974 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 12 Aug 2003 23:21:21 +0200 Subject: - enabled embedded server in the binary distributions by default (Do-compile) - added mysql.info to the binary distribution files (BUG#1019) - heavily reworked the Do-rpm script to be more in line with Do-pkg - create a "docs" subdirectory in the binary distribution and moved the manual, ChangeLog and mysql.info file into it to unclutter the top directory --- scripts/make_binary_distribution.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 73aa95a1100..8735fc800ce 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -61,7 +61,7 @@ case $system in esac -mkdir $BASE $BASE/bin \ +mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data @@ -73,9 +73,20 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ - LICENSE.doc README.NW Docs/mysqlbug.txt +for i in ChangeLog \ + Docs/manual.html \ + Docs/manual.txt \ + Docs/manual_toc.html \ + Docs/mysql.info +do + if [ -f $i ] + then + $CP $i $BASE/docs + fi +done + +for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then -- cgit v1.2.1 From cde03a0183aeb7ade618037543dec6706793dd68 Mon Sep 17 00:00:00 2001 From: "gweir@build.mysql.com" <> Date: Wed, 13 Aug 2003 04:52:03 +0200 Subject: make_win_src_distribution.sh: Copy some previously missed files --- scripts/make_win_src_distribution.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8f8ee344e93..fc07068d735 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -249,11 +249,12 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING ChangeLog README \ +for i in COPYING COPYING.LIB ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ - Docs/mysqld_error.txt Docs/INSTALL-BINARY + Docs/manual.txt Docs/mysqld_error.txt \ + Docs/INSTALL-BINARY do print_debug "Copying file '$i'" @@ -263,6 +264,20 @@ do fi done +# +# Raw dirs from source tree +# + +for i in Docs/Flags scripts sql-bench SSL \ + tests tools +do + print_debug "Copying directory '$i'" + if [ -d $i ] + then + $CP -R $i $BASE/$i + fi +done + # # Fix some windows files # -- cgit v1.2.1 From 51008b109c1d30f20c88811870e044be3e79747d Mon Sep 17 00:00:00 2001 From: "gweir@build.mysql.com" <> Date: Wed, 13 Aug 2003 16:36:01 +0200 Subject: make_win_src_distribution.sh: Clean up script, add needed modifications to generate a complete 4.0 Windows source package --- scripts/make_win_src_distribution.sh | 82 ++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 36 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fc07068d735..f0cc70c10c5 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -98,16 +98,30 @@ parse_arguments "$@" for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp do - if [ "$i" ]; then + if [ "$i" ]; then print_debug "Setting TMP to '$i'" - TMP=$i + TMP=$i break fi done - + +# +# Convert argument file from unix to DOS text # +unix_to_dos() +{ + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + sed -e 's/$/\r/' $arg > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} + + # # Create a tmp dest directory to copy files # @@ -121,16 +135,11 @@ fi $CP -r $SOURCE/VC++Files $BASE ( -find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print +find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.txt" \) -and -not -path \*SCCS\* -print )|( - while read v + 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 + unix_to_dos $v done ) @@ -147,7 +156,7 @@ rm -r -f "$BASE/share/Makefile.am" # Clean up if we did this from a bk tree # -if [ -d $BASE/SCCS ] +if [ -d $BASE/SCCS ] then find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi @@ -169,9 +178,9 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE - do - if [ -f $i ] + README INSTALL* LICENSE + do + if [ -f $i ] then $CP $SOURCE/$arg/$i $BASE/$arg/$i fi @@ -195,21 +204,19 @@ 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 + cd $SOURCE + ( + find $arg -type d \ + -and -not -path \*SCCS\* \ + -and -not -path \*.deps\* \ + -and -not -path \*autom4te.cache -print + )|( + while read v + do + copy_dir_files $v + done + ) + done } @@ -254,11 +261,11 @@ for i in COPYING COPYING.LIB ChangeLog README \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ - Docs/INSTALL-BINARY - + Docs/INSTALL-BINARY + do print_debug "Copying file '$i'" - if [ -f $i ] + if [ -f $i ] then $CP $i $BASE/$i fi @@ -284,11 +291,14 @@ done ./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp +unix_to_dos $BASE/README +mv $BASE/README $BASE/README.txt + # # Initialize the initial data directory # -if [ -f scripts/mysql_install_db ]; then +if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data fi @@ -349,9 +359,9 @@ which_1 () # Create the result zip/tar file # -set_tarzip_options() +set_tarzip_options() { - for arg + for arg do if [ "$arg" = "tar" ]; then ZIPFILE1=gnutar -- cgit v1.2.1 From c369236517ec2b91e158b1f3398061fe79477fae Mon Sep 17 00:00:00 2001 From: "gweir@build.mysql.com" <> Date: Wed, 13 Aug 2003 16:45:28 +0200 Subject: make_win_src_distribution.sh: Adding *.txt here didn't work well-- infolist.txt is in a path containing spaces --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index f0cc70c10c5..89454345c7b 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -135,7 +135,7 @@ fi $CP -r $SOURCE/VC++Files $BASE ( -find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.txt" \) -and -not -path \*SCCS\* -print +find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( while read v do -- cgit v1.2.1 From 225eda66ce19f91caced72926e03b7bd17fcc344 Mon Sep 17 00:00:00 2001 From: "gweir@build.mysql.com" <> Date: Wed, 13 Aug 2003 17:00:22 +0200 Subject: make_win_src_distribution.sh: 'tools' contains intermediate files --- scripts/make_win_src_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 89454345c7b..1946da16186 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -227,7 +227,7 @@ copy_dir_dirs() { for i in client dbug extra heap include isam \ libmysql libmysqld merge myisam \ myisammrg mysys regex sql strings \ - vio zlib + tools vio zlib do copy_dir_files $i done @@ -276,7 +276,7 @@ done # for i in Docs/Flags scripts sql-bench SSL \ - tests tools + tests do print_debug "Copying directory '$i'" if [ -d $i ] -- cgit v1.2.1 From fe511fc48921708ea37604fefd8b84da182e73fe Mon Sep 17 00:00:00 2001 From: "gweir@build.mysql.com" <> Date: Wed, 13 Aug 2003 19:32:34 +0200 Subject: make_win_src_distribution.sh: Add --zip option for finer grain control over what package formats are created Bootstrap: Create both Windows source packages --- scripts/make_win_src_distribution.sh | 79 ++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 27 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 1946da16186..9b310722886 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -14,6 +14,7 @@ SILENT=0 SUFFIX="" DIRNAME="" OUTTAR=0 +OUTZIP=0 # # This script must run from MySQL top directory @@ -62,7 +63,8 @@ show_usage() 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 " --tar Create tar.gz package" + echo " --zip Create zip package" echo " --help Show this help message" exit 0 @@ -75,12 +77,14 @@ show_usage() parse_arguments() { for arg do case "$arg" in + --add-tar) ADDTAR=1 ;; --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 ;; + --zip) OUTZIP=1 ;; --help) show_usage ;; *) echo "Unknown argument '$arg'" @@ -359,6 +363,10 @@ which_1 () # Create the result zip/tar file # +if [ [ "$OUTTAR" = "0" ] && [ "$OUTZIP" = "0" ] ]; then + OUTZIP=1 +fi + set_tarzip_options() { for arg @@ -385,43 +393,60 @@ set_tarzip_options() 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 # +create_archive() +{ -print_debug "Using $tar to create archive" + print_debug "Using $tar to create archive" -cd $TMP + cd $TMP -rm -f $SOURCE/$NEW_NAME$EXT -$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME -cd $SOURCE + 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" + if [ "$NEED_COMPRESS" = "1" ] + then + print_debug "Compressing archive" + gzip -9 $NEW_NAME$EXT + EXT="$EXT.gz" + fi + + if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" + fi +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' + + 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_archive +fi + +if [ "$OUTZIP" = "1" ]; then + set_tarzip_options 'zip' + + tar=`which_1 $ZIPFILE1 $ZIPFILE2` + if test "$?" = "1" -o "$tar" = "" + then + echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" + fi + + create_archive fi print_debug "Removing temporary directory" rm -r -f $BASE -if [ "$SILENT" = "0" ] ; then - echo "$NEW_NAME$EXT created successfully !!" -fi # End of script -- cgit v1.2.1 From 4f7512160bfd467e5d53c3e133e1842fac2737ce Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Tue, 19 Aug 2003 00:08:08 +0300 Subject: After merge fixes Use server character set if --default-character-set is not used Added convert_string() for more efficient alloc+character-set convert of strings --- scripts/make_win_src_distribution.old | 402 ---------------------------------- scripts/make_win_src_distribution.sh | 2 +- 2 files changed, 1 insertion(+), 403 deletions(-) delete mode 100755 scripts/make_win_src_distribution.old (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.old b/scripts/make_win_src_distribution.old deleted file mode 100755 index df7ac29ee0d..00000000000 --- a/scripts/make_win_src_distribution.old +++ /dev/null @@ -1,402 +0,0 @@ -#!/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 8f8ee344e93..df7ac29ee0d 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 \ + myisammrg mysys regex sql strings sql-common \ vio zlib do copy_dir_files $i -- cgit v1.2.1 From 8424aec8db8297d07bc6f2fbf5123ca0fa6778ee Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 22 Aug 2003 23:41:56 +0200 Subject: added support for --libs_r --- scripts/mysql_config.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 3cc5b3a5016..e8cc9322eaf 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -86,6 +86,8 @@ client_libs='@CLIENT_LIBS@' libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" libs=`echo $libs | sed -e 's; +;;'` +libs_r="$ldflags -L'$pkglibdir' -lmysqlclient_r $client_libs" +libs_r=`echo $libs_r | sed -e 's; +;;'` cflags="-I'$pkgincludedir'" embedded_libs="$ldflags -L'$pkglibdir' -lmysqld @LIBS@ @innodb_system_libs@" @@ -95,6 +97,7 @@ Usage: $0 [OPTIONS] Options: --cflags [$cflags] --libs [$libs] + --libs_r [$libs_r] --socket [$socket] --port [$port] --version [$version] @@ -109,6 +112,7 @@ while test $# -gt 0; do case $1 in --cflags) echo "$cflags" ;; --libs) echo "$libs" ;; + --libs_r) echo "$libs_r" ;; --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; -- cgit v1.2.1 From fea30410ed9e25265991716fd5f9d86e8d504e82 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 26 Aug 2003 14:29:13 +0200 Subject: - Reverted a fix for bug#897, as it broke the installation on some other operating systems - some implementations of "hostname" simply set the host name to "-f" instead of giving an error about an unkown option --- scripts/mysql_install_db.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index ffb857933cd..920bd27cc88 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -107,13 +107,8 @@ then fi fi -# 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 +# Try to determine the hostname +hostname=`@HOSTNAME@` # Check if hostname is valid if test "$IN_RPM" -eq 0 -a $force -eq 0 -- cgit v1.2.1 From 5f8ef50b3561961c436d683c776f2254b7477346 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 27 Aug 2003 19:22:14 +0300 Subject: Added a warning to my_print_defaults if --verbose is given and --defaults-file is a non-existing or non-regular file. Bug#755 --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d7e3eedb84e..1c056e963cb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -148,7 +148,7 @@ else fi args= -parse_arguments `$print_defaults $defaults mysqld server mysqld_safe safe_mysqld` +parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" if test ! -x $ledir/$MYSQLD -- cgit v1.2.1 From 60dd8a2c4f6a64be933a82a1c0103c0a23879583 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Wed, 27 Aug 2003 22:30:50 +0300 Subject: hanged UDF interface to use clear() instead of reset() --- scripts/mysql_fix_privilege_tables.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 43dc6d89481..7af97b9fad5 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,3 +1,15 @@ +-- This script converts any old privilege tables to privilege tables suitable +-- for MySQL 4.0. + +-- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +-- as this just means that your tables where already up to date. +-- This script is safe to run even if your tables are already up to date! + +-- On unix, you should use the mysql_fix_privilege_tables script to execute +-- this sql script. +-- On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql' + +USE mysql; ALTER TABLE user type=MyISAM; ALTER TABLE db type=MyISAM; ALTER TABLE host type=MyISAM; -- cgit v1.2.1 From b450f654900f95bc22fe67d8b23f500e9e66e8cd Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Thu, 4 Sep 2003 12:56:02 -0400 Subject: Provide mysql_fix_privilege_tables.sql for Windows users to update grant tables (BUG #948) Fix make_win_src_distribution --- scripts/make_win_src_distribution.sh | 49 +++++++--- scripts/mysql_fix_privilege_tables.sql | 159 +++++++++++++++++++++++++++++++++ 2 files changed, 195 insertions(+), 13 deletions(-) create mode 100644 scripts/mysql_fix_privilege_tables.sql (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 9b310722886..b0d63f1d6d8 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -13,8 +13,8 @@ DEBUG=0 SILENT=0 SUFFIX="" DIRNAME="" -OUTTAR=0 -OUTZIP=0 +OUTTAR="0" +OUTZIP="0" # # This script must run from MySQL top directory @@ -114,16 +114,37 @@ done # Convert argument file from unix to DOS text # -unix_to_dos() -{ - for arg do - print_debug "Replacing LF -> CRLF from '$arg'" +if [ `which recode` ] +then - sed -e 's/$/\r/' $arg > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done -} + print_debug "Using 'recode' to convert from unix to dos text" + + unix_to_dos() + { + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + chmod u+w $arg + recode lat1..ibmpc $arg + done + } + +else + + print_debug "Using 'sed' to convert from unix to dos text" + + unix_to_dos() + { + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + sed -e 's/$/\r/' $arg > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done + } + +fi # @@ -363,8 +384,10 @@ which_1 () # Create the result zip/tar file # -if [ [ "$OUTTAR" = "0" ] && [ "$OUTZIP" = "0" ] ]; then - OUTZIP=1 +if [ "$OUTTAR" = "0" ]; then + if [ "$OUTZIP" = "0" ]; then + OUTZIP=1 + fi fi set_tarzip_options() diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql new file mode 100644 index 00000000000..aca9a9c21d4 --- /dev/null +++ b/scripts/mysql_fix_privilege_tables.sql @@ -0,0 +1,159 @@ +-- This scripts updates the mysql.user, mysql.db, mysql.host and the +-- mysql.func tables to MySQL 3.22.14 and above. + +-- This is needed if you want to use the new GRANT functions, +-- CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 + +-- If you get 'Access denied' errors, you should run this script again +-- and give the MySQL root user password as an argument! + + +-- Converting all privilege tables to MyISAM format +ALTER TABLE user type=MyISAM; +ALTER TABLE db type=MyISAM; +ALTER TABLE host type=MyISAM; +ALTER TABLE func type=MyISAM; +ALTER TABLE columns_priv type=MyISAM; +ALTER TABLE tables_priv type=MyISAM; + + +-- Fix old password format, add File_priv and func table + +-- If your tables are already up to date or partially up to date you will +-- get some warnings about 'Duplicated column name'. You can safely ignore these! + +alter table user change password password char(16) NOT NULL; +alter table user add File_priv enum('N','Y') NOT NULL; +CREATE TABLE if not exists func ( + name char(64) DEFAULT '' NOT NULL, + ret tinyint(1) DEFAULT '0' NOT NULL, + dl char(128) DEFAULT '' NOT NULL, + type enum ('function','aggregate') NOT NULL, + PRIMARY KEY (name) +); + +-- Add the new grant colums + +-- Creating Grant Alter and Index privileges if they don't exists +-- You can ignore any Duplicate column errors +alter table user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +alter table host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +alter table db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; + +-- If the new grant columns didn't exists, copy File -> Grant +-- and Create -> Alter, Index, References + +-- Setting default privileges for the new grant, index and alter privileges + UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; + UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; + UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; + +-- +-- The second alter changes ssl_type to new 4.0.2 format + +-- Adding columns needed by GRANT .. REQUIRE (openssl)" +-- You can ignore any Duplicate column errors" +ALTER TABLE user +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, +ADD ssl_cipher BLOB NOT NULL, +ADD x509_issuer BLOB NOT NULL, +ADD x509_subject BLOB NOT NULL; +ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; + +-- +-- Create tables_priv and columns_priv if they don't exists +-- + +-- Creating the new table and column privilege tables" + +CREATE TABLE IF NOT EXISTS tables_priv ( + Host char(60) DEFAULT '' NOT NULL, + Db char(60) DEFAULT '' NOT NULL, + User char(16) DEFAULT '' NOT NULL, + Table_name char(60) DEFAULT '' NOT NULL, + Grantor char(77) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name) +); +CREATE TABLE IF NOT EXISTS columns_priv ( + Host char(60) DEFAULT '' NOT NULL, + Db char(60) DEFAULT '' NOT NULL, + User char(16) DEFAULT '' NOT NULL, + Table_name char(60) DEFAULT '' NOT NULL, + Column_name char(59) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name,Column_name) +); + +-- +-- Name change of Type -> Column_priv from MySQL 3.22.12 +-- + +-- Changing name of columns_priv.Type -> columns_priv.Column_priv +-- You can ignore any Unknown column errors from this + + +ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; + + + +-- +-- Add the new 'type' column to the func table. +-- + +-- Fixing the func table +-- You can ignore any Duplicate column errors + +alter table func add type enum ('function','aggregate') NOT NULL; + + +-- +-- Change the user,db and host tables to MySQL 4.0 format +-- + +-- Adding new fields used by MySQL 4.0.2 to the privilege tables +-- You can ignore any Duplicate column errors + + +alter table user +add Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +add Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, +add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, +add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +add Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +add Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, +add Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; + + +-- Convert privileges so that users have similar privileges as before + +-- Updating new privileges in MySQL 4.0.2 from old ones + + update user set show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>""; + + +-- Add fields that can be used to limit number of questions and connections +-- for some users. + + +alter table user +add max_questions int(11) NOT NULL AFTER x509_subject, +add max_updates int(11) unsigned NOT NULL AFTER max_questions, +add max_connections int(11) unsigned NOT NULL AFTER max_updates; + + +-- +-- Add Create_tmp_table_priv and Lock_tables_priv to db and host +-- + + +alter table db +add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +alter table host +add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; + -- cgit v1.2.1 From 541189e746bd89d56657438bd7c9d14910857c2b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 10 Sep 2003 17:48:43 +0200 Subject: - Added option "--skip-name-resolve" to mysql_install_db to be able to use the local machine's IP address instead of the host name when building the initial grant tables if "skip-name-resolve" has been specified in my.cnf. This can be helpful on FreeBSD to avoid thread-safety problems with the FreeBSD resolver libraries. (Thanks to Jeremy Zawodny for the patch) --- scripts/mysql_install_db.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 920bd27cc88..0e685ba38e4 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -37,6 +37,7 @@ parse_arguments() { --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --skip-name-resolve) ip_only=1 ;; *) if test -n "$pick_args" then @@ -135,6 +136,12 @@ then fi fi +if test "$ip_only" -eq 1 +then + ip=`echo "$resolved" | awk '/ /{print $6}'` + hostname=$ip +fi + # Create database directories mysql & test if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi -- cgit v1.2.1 From cc6e3a2ec979c97beac45402a2236f3413be8365 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Fri, 12 Sep 2003 19:58:22 -0400 Subject: New Windows source package automation for 3.23 --- scripts/Makefile.am | 6 +- scripts/make_win_src_distribution.sh | 487 +++++++++++++++++++++++++++++++++++ 2 files changed, 491 insertions(+), 2 deletions(-) create mode 100755 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 18957b6422d..0f492e040af 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -28,7 +28,8 @@ bin_SCRIPTS = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysqld_multi + mysqld_multi \ + make_win_src_distribution EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ @@ -66,7 +67,8 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysqld_multi + mysqld_multi \ + make_win_src_distribution SUPERCLEANFILES = mysqlbug diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh new file mode 100755 index 00000000000..50518f96adf --- /dev/null +++ b/scripts/make_win_src_distribution.sh @@ -0,0 +1,487 @@ +#!/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" +OUTZIP="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" + echo " --zip Create zip package" + echo " --help Show this help message" + + exit 0 +} + +# +# Parse the input arguments +# + +parse_arguments() { + for arg do + case "$arg" in + --add-tar) ADDTAR=1 ;; + --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 ;; + --zip) OUTZIP=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 + + +# +# Convert argument file from unix to DOS text +# + +unix_to_dos() +{ + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + cat $arg | awk '{sub(/$/,"\r");print}' > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + 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 + unix_to_dos $v + done +) + +# +# Process version tags in InstallShield files +# + +vreplace() +{ + for arg do + unix_to_dos $arg + cat $arg | sed -e 's!@''VERSION''@!3.23.58!' > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} + +for d in 3.23.XX-gpl 3.23.XX-com +do + cd $BASE/InstallShield/$d/String\ Tables/0009-English + vreplace value.shl + cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent + vreplace infolist.txt +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 *.yy + 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 + + cd $SOURCE + ( + find $arg -type d \ + -and -not -path \*SCCS\* \ + -and -not -path \*.deps\* \ + -and -not -path \*autom4te.cache -print + )|( + while read v + do + copy_dir_files $v + done + ) + + done +} + +# +# Input directories to be copied +# + +for i in client dbug div extra heap include isam \ + libmysql libmysqld merge myisam \ + myisammrg mysys readline regex sql strings \ + tools 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 + +# +# Directories to be copied complete +# + +for i in mysql-test repl-tests support-files +do + $CP -R $SOURCE/$i $BASE/$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 COPYING.LIB ChangeLog README \ + INSTALL-SOURCE INSTALL-WIN \ + INSTALL-WIN-SOURCE \ + Docs/manual_toc.html Docs/manual.html \ + Docs/manual.txt Docs/mysqld_error.txt \ + Docs/INSTALL-BINARY + +do + print_debug "Copying file '$i'" + if [ -f $i ] + then + $CP $i $BASE/$i + fi +done + +# +# Raw dirs from source tree +# + +for i in Docs/Flags scripts sql-bench SSL \ + tests +do + print_debug "Copying directory '$i'" + if [ -d $i ] + then + $CP -R $i $BASE/$i + fi +done + +# +# Fix some windows files +# + +./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp + +unix_to_dos $BASE/README +mv $BASE/README $BASE/README.txt + +# +# Initialize the initial data directory +# + +if [ -f scripts/mysql_install_db ]; then + print_debug "Initializing the 'data' directory" + mkdir $BASE/data + scripts/mysql_install_db --no-defaults --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 +# + +if [ "$OUTTAR" = "0" ]; then + if [ "$OUTZIP" = "0" ]; then + OUTZIP=1 + fi +fi + +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 +} + + +# +# Create the archive +# +create_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 + + if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" + fi +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' + + 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_archive +fi + +if [ "$OUTZIP" = "1" ]; then + set_tarzip_options 'zip' + + tar=`which_1 $ZIPFILE1 $ZIPFILE2` + if test "$?" = "1" -o "$tar" = "" + then + echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" + fi + + create_archive +fi + +print_debug "Removing temporary directory" +rm -r -f $BASE + +# End of script -- cgit v1.2.1 From 564dad6c53a01ce28413cd7c2a997713bcf6ff46 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Mon, 15 Sep 2003 17:39:50 -0400 Subject: Remove 3.23 InstallShield files, improve make_win_src_distribution, add extra myTest.dsp to be copied into distributions as a fix for BUG#999 --- scripts/make_win_src_distribution.sh | 61 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b0d63f1d6d8..c521c4cfdcb 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -114,37 +114,16 @@ done # Convert argument file from unix to DOS text # -if [ `which recode` ] -then - - print_debug "Using 'recode' to convert from unix to dos text" - - unix_to_dos() - { - for arg do - print_debug "Replacing LF -> CRLF from '$arg'" - - chmod u+w $arg - recode lat1..ibmpc $arg - done - } - -else - - print_debug "Using 'sed' to convert from unix to dos text" - - unix_to_dos() - { - for arg do - print_debug "Replacing LF -> CRLF from '$arg'" - - sed -e 's/$/\r/' $arg > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done - } +unix_to_dos() +{ + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" -fi + cat $arg | awk '{sub(/$/,"\r");print}' > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} # @@ -168,6 +147,28 @@ find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print done ) +# +# Process version tags in InstallShield files +# + +vreplace() +{ + for arg do + unix_to_dos $arg + cat $arg | sed -e 's!@''VERSION''@!@VERSION@!' > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} + +for d in 4.0.XX-gpl 4.0.XX-pro 4.0.XX-classic +do + cd $BASE/InstallShield/$d/String\ Tables/0009-English + vreplace value.shl + cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent + vreplace infolist.txt +done + # # Move all error message files to root directory # -- cgit v1.2.1 From 74077c79fc51a2994df9b71cef7f152bc34a27e3 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 17 Sep 2003 22:01:08 +0200 Subject: - added make_win_src_distribution.sh to EXTRA_SCRIPTS --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 0f492e040af..19fb7cedc7a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,6 +32,7 @@ bin_SCRIPTS = @server_scripts@ \ make_win_src_distribution EXTRA_SCRIPTS = make_binary_distribution.sh \ + make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ -- cgit v1.2.1 From f05a1c83940557721a42c758e26f2adace291d0a Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Tue, 23 Sep 2003 13:36:01 +0300 Subject: Block SIGPIPE also for not threaded client programs. Added --include and --libs_r options to mysql_config. Added mysql_get_client_version() to client library Fixed some minor benchmark issues --- scripts/Makefile.am | 1 + scripts/mysql_config.sh | 22 ++++++++++++++++++---- scripts/mysql_install_db.sh | 8 ++++---- 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 72fc73ef28b..c83b0d0b043 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -113,6 +113,7 @@ SUFFIXES = .sh -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ + -e 's!@''openssl_libs''@!@openssl_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 3cc5b3a5016..52284104636 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -84,17 +84,29 @@ port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' client_libs='@CLIENT_LIBS@' -libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" -libs=`echo $libs | sed -e 's; +;;'` -cflags="-I'$pkgincludedir'" -embedded_libs="$ldflags -L'$pkglibdir' -lmysqld @LIBS@ @innodb_system_libs@" +# Create options, without end space + +libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" +libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +cflags="-I$pkgincludedir @CFLAGS@" +include="-I$pkgincludedir" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @innodb_system_libs@" +embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` + +# Remove some options that a client doesn't have to care about + +cflags=`echo "$cflags " | sed -e 's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g' | sed -e 's; *\$;;'` usage () { cat <&1` if [ $? -ne 0 ] @@ -333,7 +333,7 @@ $c_c END_OF_DATA then echo "" - if test "$IN_RPM" -eq 0 + if test "$IN_RPM" = "0" then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -354,7 +354,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" -eq 0 + if test "$IN_RPM" = "0" then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" -- cgit v1.2.1 From b0ae222ea2efb794ebd59d8b1508451c9604ae6a Mon Sep 17 00:00:00 2001 From: "monty@mishka.mysql.fi" <> Date: Wed, 24 Sep 2003 09:08:33 +0300 Subject: Merge script with 4.1 --- scripts/mysql_fix_privilege_tables.sql | 122 ++++++++++++++------------------- 1 file changed, 50 insertions(+), 72 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index aca9a9c21d4..1120f5c89c5 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,30 +1,24 @@ --- This scripts updates the mysql.user, mysql.db, mysql.host and the --- mysql.func tables to MySQL 3.22.14 and above. +-- This script converts any old privilege tables to privilege tables suitable +-- for MySQL 4.0. --- This is needed if you want to use the new GRANT functions, --- CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23 +-- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +-- as this just means that your tables where already up to date. +-- This script is safe to run even if your tables are already up to date! --- If you get 'Access denied' errors, you should run this script again --- and give the MySQL root user password as an argument! +-- On unix, you should use the mysql_fix_privilege_tables script to execute +-- this sql script. +-- On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql' - --- Converting all privilege tables to MyISAM format +USE mysql; ALTER TABLE user type=MyISAM; ALTER TABLE db type=MyISAM; ALTER TABLE host type=MyISAM; ALTER TABLE func type=MyISAM; ALTER TABLE columns_priv type=MyISAM; ALTER TABLE tables_priv type=MyISAM; - - --- Fix old password format, add File_priv and func table - --- If your tables are already up to date or partially up to date you will --- get some warnings about 'Duplicated column name'. You can safely ignore these! - -alter table user change password password char(16) NOT NULL; -alter table user add File_priv enum('N','Y') NOT NULL; -CREATE TABLE if not exists func ( +ALTER TABLE user change Password Password char(41) not null; +ALTER TABLE user add File_priv enum('N','Y') NOT NULL; +CREATE TABLE IF NOT EXISTS func ( name char(64) DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, @@ -32,27 +26,24 @@ CREATE TABLE if not exists func ( PRIMARY KEY (name) ); --- Add the new grant colums +-- Detect whether or not we had the Grant_priv column +SET @hadGrantPriv:=0; +SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; --- Creating Grant Alter and Index privileges if they don't exists --- You can ignore any Duplicate column errors -alter table user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -alter table host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -alter table db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; --- If the new grant columns didn't exists, copy File -> Grant --- and Create -> Alter, Index, References +--- Fix privileges for old tables +UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; --- Setting default privileges for the new grant, index and alter privileges - UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; - UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; - UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv; -- --- The second alter changes ssl_type to new 4.0.2 format - +-- The second alter changes ssl_type to new 4.0.2 format -- Adding columns needed by GRANT .. REQUIRE (openssl)" --- You can ignore any Duplicate column errors" + ALTER TABLE user ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, ADD ssl_cipher BLOB NOT NULL, @@ -64,8 +55,6 @@ ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; -- Create tables_priv and columns_priv if they don't exists -- --- Creating the new table and column privilege tables" - CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) DEFAULT '' NOT NULL, Db char(60) DEFAULT '' NOT NULL, @@ -77,6 +66,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ); + CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, Db char(60) DEFAULT '' NOT NULL, @@ -88,72 +78,60 @@ CREATE TABLE IF NOT EXISTS columns_priv ( PRIMARY KEY (Host,Db,User,Table_name,Column_name) ); + -- --- Name change of Type -> Column_priv from MySQL 3.22.12 +-- Name change of Type -> Column_priv from MySQL 3.22.12 -- --- Changing name of columns_priv.Type -> columns_priv.Column_priv --- You can ignore any Unknown column errors from this - - ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; - -- -- Add the new 'type' column to the func table. -- --- Fixing the func table --- You can ignore any Duplicate column errors - -alter table func add type enum ('function','aggregate') NOT NULL; - +ALTER TABLE func add type enum ('function','aggregate') NOT NULL; -- -- Change the user,db and host tables to MySQL 4.0 format -- --- Adding new fields used by MySQL 4.0.2 to the privilege tables --- You can ignore any Duplicate column errors - +# Detect whether we had Show_db_priv +SET @hadShowDbPriv:=0; +SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; -alter table user -add Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, -add Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, -add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, -add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -add Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -add Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, -add Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; +ALTER TABLE user +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before --- Updating new privileges in MySQL 4.0.2 from old ones - - update user set show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>""; +UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; -- Add fields that can be used to limit number of questions and connections -- for some users. - -alter table user -add max_questions int(11) NOT NULL AFTER x509_subject, -add max_updates int(11) unsigned NOT NULL AFTER max_questions, -add max_connections int(11) unsigned NOT NULL AFTER max_updates; +ALTER TABLE user +ADD max_questions int(11) NOT NULL AFTER x509_subject, +ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, +ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; -- -- Add Create_tmp_table_priv and Lock_tables_priv to db and host -- - -alter table db -add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; -alter table host -add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ALTER TABLE db +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ALTER TABLE host +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; -- cgit v1.2.1 From f9501393214fe34c8fd5c2ebff22f41c13e93cd8 Mon Sep 17 00:00:00 2001 From: "lenz@kallisto.local" <> Date: Sat, 27 Sep 2003 00:25:57 +0200 Subject: - better test for a string to avoid "test: integer expression expected" if a variable is not defined (empty). --- scripts/mysql_install_db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 09a720f273d..65731c2bcb7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -128,7 +128,7 @@ fi if test ! -x $mysqld then - if test "$in_rpm" -eq 1 + if test "$in_rpm" = 1 then echo "FATAL ERROR $mysqld not found!" exit 1 @@ -167,7 +167,7 @@ then fi fi -if test "$ip_only" -eq 1 +if test "$ip_only" = 1 then ip=`echo "$resolved" | awk '/ /{print $6}'` hostname=$ip @@ -187,7 +187,7 @@ then c_d="yes" fi -if test $verbose -eq 1 +if test $verbose = 1 then create_option="verbose" else -- cgit v1.2.1 From 1394684e12b85ed9808115b9fe3a80c4d84c64ef Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Sat, 27 Sep 2003 18:54:22 +0200 Subject: make mysqld to respect socket/port options of mysqld_safe command line and [mysqld_safe] section in my.cnf, even if they are also specified in [mysql] section. --- scripts/mysqld_safe.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 1c056e963cb..ece4ba098f4 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -51,9 +51,9 @@ parse_arguments() { ;; # these two might have been set in a [mysqld_safe] section of my.cnf - # they get passed via environment variables to mysqld_safe - --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; + # they are added to mysqld command line to override settings from my.cnf + --socket=*) mysql_unix_port=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --port=*) mysql_tcp_port=`echo "$arg" | sed -e "s;--port=;;"` ;; # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; @@ -114,8 +114,7 @@ else ledir=@libexecdir@ fi -MYSQL_UNIX_PORT=${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@} -MYSQL_TCP_PORT=${MYSQL_TCP_PORT:-@MYSQL_TCP_PORT@} +safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} user=@MYSQLD_USER@ niceness=0 @@ -171,9 +170,14 @@ else fi test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err -export MYSQL_UNIX_PORT -export MYSQL_TCP_PORT - +if test -n "$mysql_unix_port" +then + args="--socket=$mysql_unix_port $args" +fi +if test -n "$mysql_tcp_port" +then + args="--port=$mysql_tcp_port $args" +fi if test $niceness -eq 0 then @@ -296,7 +300,7 @@ echo "Starting $MYSQLD daemon with databases from $DATADIR" echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do - rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety + rm -f $safe_mysql_unix_port $pid_file # Some extra safety if test -z "$args" then $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 -- cgit v1.2.1 From 9e68df23333ecb21ed776fcb983e2f98ca2d1721 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Sun, 28 Sep 2003 21:35:47 +0200 Subject: typo fixed (bug #1390 - incorrect mysql_config output) --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 3cc5b3a5016..f7c4b4ff381 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -62,7 +62,7 @@ get_full_path () { case $1 in /*) echo "$1";; - ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/./;/;' ;; + ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;; *) which $1 ;; esac } -- cgit v1.2.1 From e2fe872181740f9f6b0413bcb6d38f34d86e1421 Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Mon, 29 Sep 2003 11:39:00 -0400 Subject: added fine error messages in scripts/fill_help_tables.sh --- scripts/fill_help_tables.sh | 46 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index b8cf4ccb3a7..8ba05910596 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -35,7 +35,7 @@ # @c example_for_help_topic # @example # .... -# @example +# @end example # # # Original version by Victor Vagin @@ -44,13 +44,16 @@ use strict; use Getopt::Long; -my $insert_portion_size= 25; -my $error_prefix= "help parsing error:"; +my $insert_portion_size= 15; +my $error_prefix= "---- help parsing errors :"; my $path_to_lex_file= "../sql/lex.h"; my $verbose_option= 0; my $help_option= 0; +my $cur_line= 0; +my $count_errors= 0; + GetOptions( "help",\$help_option, "verbose",\$verbose_option, @@ -92,6 +95,17 @@ my %keywords; $categories{Contents}->{__parent_category__}= ""; +sub print_error +{ + my ($text)= @_; + if ($count_errors==0) + { + print STDERR "$error_prefix\n"; + } + print STDERR "line $cur_line : $text"; + $count_errors++; +} + sub add_topic_to_category { my ($topic_name)= @_; @@ -104,7 +118,7 @@ sub add_topic_to_category my $old_parent= $category->{__parent_category__}; if ($old_parent ne $current_parent_category) { - print STDERR "$error_prefix wrong parent for $current_category\n"; + print_error "wrong parent for $current_category\n"; } } @@ -118,7 +132,7 @@ sub add_topic_to_category my $old_category= $topics{$topic_name}->{category}; if ($old_category ne $category) { - print STDERR "$error_prefix wrong category for $topic_name\n"; + print_error "wrong category for $topic_name\n"; } } @@ -133,7 +147,7 @@ sub add_example if (exists($topics{$topic_name}->{example})) { - print STDERR "$error_prefix double example for $topic_name\n"; + print_error "double example for $topic_name\n"; } $topics{$topic_name}->{example}= $example; @@ -148,7 +162,7 @@ sub add_description if (exists($topics{$topic_name}->{description})) { - print STDERR "$error_prefix double description for $topic_name\n"; + print_error "double description for $topic_name\n"; } $topics{$topic_name}->{description}= $description; add_topic_to_category($topic_name); @@ -164,7 +178,7 @@ sub add_keyword push(@{$topics{$topic_name}->{keywords}},$keyword); if (exists($keywords{$keyword}->{$topic_name})) { - print STDERR "$error_prefix double keyword $keyword for $topic_name\n"; + print_error "double keyword $keyword for $topic_name\n"; } $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; } @@ -195,10 +209,12 @@ sub prepare_name $a =~ s/\@table \@code/ /g; $a =~ s/\(\)//g; $a =~ s/\"/\\\"/g; - + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; + + $a =~ s/((\s)+)$//g; return $a; } @@ -278,12 +294,13 @@ sub parse_example while (<>) { + $cur_line++; last if ($_=~/\@end example/); $text .= $_; } $text= prepare_example($text); - + $topic_name= prepare_name($topic_name); add_example($topic_name,$text) if ($topic_name ne ""); } @@ -319,11 +336,13 @@ sub parse_description while (<>) { + $cur_line++; last if ($_=~/\@c end_description_for_help_topic/); $text .= $_; } $text= prepare_description($text); + $topic_name= prepare_name($topic_name); add_description($topic_name,$text); } @@ -354,6 +373,7 @@ while (<>) parse_example (); parse_description (); parse_category (); + $cur_line++; } # test results of parsing: @@ -542,3 +562,9 @@ if (scalar(@keywords_names)) } printf ";\n\n"; } + +if ($count_errors) +{ + print STDERR "$count_errors errors !!!\n"; + exit 1; +} -- cgit v1.2.1 From 70da491d34c93e2a5e2ef22e7d083e99ce7b67f5 Mon Sep 17 00:00:00 2001 From: "monty@mishka.mysql.fi" <> Date: Wed, 1 Oct 2003 16:50:50 +0300 Subject: Add proc table if not exists --- scripts/mysql_fix_privilege_tables.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 220bf4036db..4adc0655434 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -99,3 +99,20 @@ ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; ALTER TABLE host ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; + +# +# Create proc table if it doesn't exists +# + +CREATE TABLE IF NOT EXISTS proc ( + name char(64) binary DEFAULT '' NOT NULL, + type enum('function','procedure') NOT NULL, + body blob DEFAULT '' NOT NULL, + creator char(77) binary DEFAULT '' NOT NULL, + modified timestamp, + created timestamp, + suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL, + comment char(64) binary DEFAULT '' NOT NULL, + PRIMARY KEY (name,type) +) comment='Stored Procedures'; + -- cgit v1.2.1 From 62de13dca3930ceef4909c9313de46d5d2ef0ca8 Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Sat, 4 Oct 2003 17:41:17 -0500 Subject: Ride hobby horse. --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5b8fa4d4113..d66c33c16b1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -129,7 +129,7 @@ then fi echo "WARNING: The host '$hostname' could not be looked up with resolveip." echo "This probably means that your libc libraries are not 100 % compatible" - echo "with this binary MySQL version. The MySQL deamon, mysqld, should work" + echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" echo "normally with the exception that host name resolving will not work." echo "This means that you should use IP addresses instead of hostnames" echo "when specifying MySQL privileges !" -- cgit v1.2.1 From a5c83b05bd13c8b14bdd5fb1d134e641f956b2ef Mon Sep 17 00:00:00 2001 From: "monty@mishka.mysql.fi" <> Date: Mon, 6 Oct 2003 22:56:34 +0300 Subject: Move init_compiled_charsets to own file Remove dependency of charsets (in my_init) to get smaller binaries when charsets are not used Simple code cleanup --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index c4cdc7b52d7..a65004bec4c 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -150,7 +150,7 @@ then INSERT INTO user (host,user) values ('$hostname','');" else i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" - if test "$windows" -eq 0 + if test "$windows" = "0" then i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 220bf4036db..de5779b9ac0 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -99,3 +99,38 @@ ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; ALTER TABLE host ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; + +# +# Create some possible missing tables +# +CREATE TABLE IF NOT EXISTS help_topic ( +help_topic_id int unsigned not null, +name varchar(64) not null, +help_category_id smallint unsigned not null, +description text not null, +example text not null, +url varchar(128) not null, +primary key (help_topic_id), unique index (name) +) comment='help topics'; + +CREATE TABLE IF NOT EXISTS help_category ( +help_category_id smallint unsigned not null, +name varchar(64) not null, +parent_category_id smallint unsigned null, +url varchar(128) not null, +primary key (help_category_id), +unique index (name) +) comment='help categories'; + +CREATE TABLE IF NOT EXISTS help_relation ( +help_topic_id int unsigned not null references help_topic, +help_keyword_id int unsigned not null references help_keyword, +primary key (help_keyword_id, help_topic_id) +) comment='keyword-topic relation'; + +CREATE TABLE IF NOT EXISTS help_keyword ( +help_keyword_id int unsigned not null, +name varchar(64) not null, +primary key (help_keyword_id), +unique index (name) +) comment='help keywords'; -- cgit v1.2.1 From b82b76f4803816a5d2245c173fcd1ec5033f6494 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Tue, 7 Oct 2003 15:44:31 +0300 Subject: Simple cleanups --- scripts/Makefile.am | 1 - scripts/mysql_install_db.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index adb88290d9b..17b98fe45c3 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -66,7 +66,6 @@ pkgdata_DATA = make_binary_distribution # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ - make_win_src_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index d66c33c16b1..5a6b11fb19b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -136,7 +136,7 @@ then fi fi -if test "$ip_only" -eq 1 +if test "$ip_only" ="1" then ip=`echo "$resolved" | awk '/ /{print $6}'` hostname=$ip -- cgit v1.2.1 From 4bc3f12cafd3e1b506fe36fb398d01a861edfbeb Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 8 Oct 2003 12:35:24 +0200 Subject: - added make_sharedlib_distribution.sh to the source distribution --- scripts/Makefile.am | 4 +- scripts/make_sharedlib_distribution.sh | 117 +++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 scripts/make_sharedlib_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index c83b0d0b043..93a6666df39 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -36,6 +36,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ + make_sharedlib_distribution.sh \ make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ @@ -60,12 +61,13 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = make_binary_distribution +pkgdata_DATA = make_binary_distribution make_sharedlib_distribution # mysqlbug should be distributed built so that people can report build # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ + make_sharedlib_distribution \ make_win_src_distribution \ msql2mysql \ mysql_config \ diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh new file mode 100644 index 00000000000..4104a315296 --- /dev/null +++ b/scripts/make_sharedlib_distribution.sh @@ -0,0 +1,117 @@ +#!/bin/sh +# The default path should be /usr/local + +# Get some info from configure +# chmod +x ./scripts/setsomevars + +machine=@MACHINE_TYPE@ +system=@SYSTEM_TYPE@ +version=@VERSION@ +export machine system version +SOURCE=`pwd` +CP="cp -p" +MV="mv" + +STRIP=1 +DEBUG=0 +SILENT=0 +TMP=/tmp +SUFFIX="" + +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=;;"` ;; + --no-strip) STRIP=0 ;; + --silent) SILENT=1 ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" + +BASE=$TMP/my_dist$SUFFIX + +if [ -d $BASE ] ; then + rm -r -f $BASE +fi + +mkdir -p $BASE/lib + +for i in \ + libmysql/.libs/libmysqlclient.so* \ + libmysql_r/.libs/libmysqlclient_r.so* +do + if [ -f $i ] + then + $CP $i $BASE/lib + fi +done + +# Change the distribution to a long descriptive name +NEW_NAME=mysql-shared-$version-$system-$machine$SUFFIX +BASE2=$TMP/$NEW_NAME +rm -r -f $BASE2 +mv $BASE $BASE2 +BASE=$BASE2 + +#if we are debugging, do not do tar/gz +if [ x$DEBUG = x1 ] ; then + exit +fi + +# This is needed to prefer 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 tar file +# + +tar=`which_1 gnutar gtar` +if test "$?" = "1" -o "$tar" = "" +then + tar=tar +fi + +echo "Using $tar to create archive" +cd $TMP + +OPT=cvf +if [ x$SILENT = x1 ] ; then + OPT=cf +fi + +$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME +cd $SOURCE +echo "Compressing archive" +gzip -9 $NEW_NAME.tar +echo "Removing temporary directory" +rm -r -f $BASE + +echo "$NEW_NAME.tar.gz created" -- cgit v1.2.1 From 83f5c4dbf856d5deaecddd41bbd6bfedebbcbc03 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 16 Oct 2003 22:15:36 +0200 Subject: - fixed small typo to resolve "test: argument expected" error on Solaris and Tru64 when running "mysql_install_db" --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5a6b11fb19b..ba95ff3b5b9 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -136,7 +136,7 @@ then fi fi -if test "$ip_only" ="1" +if test "$ip_only" = "1" then ip=`echo "$resolved" | awk '/ /{print $6}'` hostname=$ip -- cgit v1.2.1 From 982e77be631c6f5c89795ede716477456a899c1b Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Sun, 19 Oct 2003 16:57:17 -0400 Subject: made more fine error message in scripts/fill_help_tables.sh --- scripts/fill_help_tables.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 8ba05910596..cb5437f7178 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -112,6 +112,7 @@ sub add_topic_to_category $categories{$current_category}->{$topic_name}= $topics{$topic_name}; my $category= $categories{$current_category}; + $category->{__name__}= $current_category; if (exists($category->{__parent_category__})) { @@ -132,7 +133,7 @@ sub add_topic_to_category my $old_category= $topics{$topic_name}->{category}; if ($old_category ne $category) { - print_error "wrong category for $topic_name\n"; + print_error "wrong category for $topic_name (first one's \"$old_category->{__name__}\" second one's \"$current_category\")\n"; } } -- cgit v1.2.1 From 07c9d4575bba8ac3c6b5d364f3a63890f46e6953 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 22 Oct 2003 16:02:27 +0300 Subject: Applied a patch from Travis Wheeler to mysqlhotcopy that allows using regexp with tablenames together with databasenames. --- scripts/mysqlhotcopy.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index f23955da06a..3e53af32653 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.19"; +my $VERSION = "1.20"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -235,10 +235,15 @@ else # --- resolve database names from regexp --- if ( defined $opt{regexp} ) { + my $t_regex = '.*'; + if ( $opt{regexp} =~ s{^/(.+)/\./(.+)/$}{$1} ) { + $t_regex = $2; + } + my $sth_dbs = $dbh->prepare("show databases"); $sth_dbs->execute; while ( my ($db_name) = $sth_dbs->fetchrow_array ) { - push @db_desc, { 'src' => $db_name } if ( $db_name =~ m/$opt{regexp}/o ); + push @db_desc, { 'src' => $db_name, 't_regex' => $t_regex } if ( $db_name =~ m/$opt{regexp}/o ); } } @@ -938,6 +943,14 @@ server in a mutual replication setup. Copy all databases with names matching the pattern +=item --regexp /pattern1/./pattern2/ + +Copy all tables with names matching pattern2 from all databases with +names matching pattern1. For example, to select all tables which +names begin with 'bar' from all databases which names end with 'foo': + + mysqlhotcopy --indices --method=cp --regexp /foo$/./^bar/ + =item db_name./pattern/ Copy only tables matching pattern. Shell metacharacters ( (, ), |, !, -- cgit v1.2.1 From 94cce644165e0009f9a057b8e21712e9b3f370ea Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 22 Oct 2003 18:19:59 +0300 Subject: Fixed bug #954 mysqlhotcopy permission problem. The database directory owner ship was not honored. --- scripts/mysqlhotcopy.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 3e53af32653..654e5466e12 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -418,6 +418,8 @@ foreach my $rdb ( @db_desc ) { else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" unless -d $tgt_dirpath; + my @f_info= stat "$datadir/$rdb->{src}"; + chown $f_info[4], $f_info[5], $tgt_dirpath; } } } -- cgit v1.2.1 From e69447933dce4c4bbd681e6b7eea15a1d23bb415 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 22 Oct 2003 18:40:37 +0300 Subject: Fixed a bug in mysqlhotcopy, which made special table names to cause program to abort. Such table name could have been one with a semicolon (:) in the middle. --- scripts/mysqlhotcopy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 654e5466e12..160a2611374 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -453,13 +453,13 @@ if ( $opt{dryrun} ) { } else { my $start = time; - $dbh->do("LOCK TABLES $hc_locks"); + $dbh->do('LOCK TABLES $hc_locks'); printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; $hc_started = time; # count from time lock is granted # flush tables to make on-disk copy uptodate $start = time; - $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + $dbh->do('FLUSH TABLES /*!32323 $hc_tables */'); printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); @@ -467,7 +467,7 @@ else { if ( $opt{record_log_pos} ) { record_log_pos( $dbh, $opt{record_log_pos} ); - $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + $dbh->do('FLUSH TABLES /*!32323 $hc_tables */'); } } -- cgit v1.2.1 From 7b3c89f1f6aec2658a51c39be53ae32a2869d6db Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 22 Oct 2003 19:24:19 +0300 Subject: Reverted a wrong patch from mysqlhotcopy. This is a real bug in MySQL server... --- scripts/mysqlhotcopy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 160a2611374..654e5466e12 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -453,13 +453,13 @@ if ( $opt{dryrun} ) { } else { my $start = time; - $dbh->do('LOCK TABLES $hc_locks'); + $dbh->do("LOCK TABLES $hc_locks"); printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; $hc_started = time; # count from time lock is granted # flush tables to make on-disk copy uptodate $start = time; - $dbh->do('FLUSH TABLES /*!32323 $hc_tables */'); + $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); @@ -467,7 +467,7 @@ else { if ( $opt{record_log_pos} ) { record_log_pos( $dbh, $opt{record_log_pos} ); - $dbh->do('FLUSH TABLES /*!32323 $hc_tables */'); + $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); } } -- cgit v1.2.1 From dcc36e671c3a458b77dba4ffc409b4dc8b24d9ef Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Fri, 24 Oct 2003 15:20:46 -0400 Subject: added to mysql_secure_installation changing root password on all hosts (bug 1228) --- scripts/mysql_secure_installation.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index d6392c57731..1c7ca34ad59 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -85,9 +85,13 @@ set_root_password() { return 1 fi - do_query "SET PASSWORD FOR root=PASSWORD('$password1');" + do_query "UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';" if [ $? -eq 0 ]; then echo "Password updated successfully!" + echo "Reloading privilege tables.." + if ! reload_privilege_tables; then + exit 1 + fi echo rootpass=$password1 make_config @@ -144,11 +148,11 @@ reload_privilege_tables() { do_query "FLUSH PRIVILEGES;" if [ $? -eq 0 ]; then echo " ... Success!" + return 0 else echo " ... Failed!" + return 1 fi - - return 0 } interrupt() { -- cgit v1.2.1 From e51d0ced6198b409c67f5239f15543fc2d1daaa4 Mon Sep 17 00:00:00 2001 From: "salle@vafla.online.bg" <> Date: Wed, 5 Nov 2003 14:35:08 +0200 Subject: Fix for Bug #1752 Wrong letter cases. Thanks to Daniel Convissor --- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 1120f5c89c5..2ea2e5b7373 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -101,7 +101,7 @@ SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, @@ -112,7 +112,7 @@ ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before -UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; +UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; -- Add fields that can be used to limit number of questions and connections -- cgit v1.2.1 From 24413c7d8cf42fca6be3d885a9516585929676d9 Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Sat, 15 Nov 2003 19:37:54 -0400 Subject: fixed bug #1650 "mysql_config --libmysqd-libs misses libwrap" --- scripts/Makefile.am | 1 + scripts/mysql_config.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e846976eceb..d14d7f38deb 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -114,6 +114,7 @@ SUFFIXES = .sh -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ + -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -e 's!@''openssl_libs''@!@openssl_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 6b543bf4a07..051f3fa9c14 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,7 +92,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@" include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @innodb_system_libs@" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about -- cgit v1.2.1 From 119b689b3be639353ed80973bbbd1bffa989bd61 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Tue, 18 Nov 2003 15:17:41 -0500 Subject: Add Docs/internals.texi to Windows source packages. --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2f1b7b2939a..e164f8c15dd 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -287,7 +287,7 @@ for i in COPYING COPYING.LIB ChangeLog README \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ - Docs/INSTALL-BINARY + Docs/INSTALL-BINARY Docs/internals.texi do print_debug "Copying file '$i'" -- cgit v1.2.1 From 12fb40460b356b445f5d0f76795fccdd3f96576e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 24 Nov 2003 17:05:24 +0100 Subject: - Rephrased two option help texts to not start with "use the ..." as this confuses RPM's Perl module dependency checking (it adds a bogus requirement to "Perl(the)", as "use" is a Perl keyword). (BUG#1931) --- scripts/mysqlaccess.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 699e74834e3..75ef63ecdd0 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -286,7 +286,7 @@ Release Notes: * --old_server: mysqlaccess will now use a full where clause when retrieving information from the MySQL-server. If you are connecting to an old server (before v3.21) - use the option --old_server. + then use the option --old_server. 2.03 : (1998-02-27) - bugfix: * in Host::MatchTemplate: incorrect match if host-field was left empty. -- cgit v1.2.1 From f8d52f7cf148420b0d18e2db2db739cf596b28e7 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 25 Nov 2003 16:08:55 +0100 Subject: a script that fixes anti-GRANT'ness of privilege tables. It can appear as a result of manual modifications with INSERT/UPDATE/DELETE This script converts privilege table to the state that could be created with GRANT commands only (with the exception of the short password) This is necessary for 5.0 --- scripts/mysql_prepare_privilege_tables_for_5.sql | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 scripts/mysql_prepare_privilege_tables_for_5.sql (limited to 'scripts') diff --git a/scripts/mysql_prepare_privilege_tables_for_5.sql b/scripts/mysql_prepare_privilege_tables_for_5.sql new file mode 100644 index 00000000000..a9b6d43aee0 --- /dev/null +++ b/scripts/mysql_prepare_privilege_tables_for_5.sql @@ -0,0 +1,53 @@ + +use mysql; + +-- +-- merging `host` table and `db` +-- + +UPDATE IGNORE host SET Host='%' WHERE Host=''; +DELETE FROM host WHERE Host=''; + +INSERT IGNORE INTO db (User, Host, Select_priv, Insert_priv, Update_priv, + Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, + Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv) + SELECT d.User, h.Host, + (d.Select_priv = 'Y' || h.Select_priv = 'Y') + 1, + (d.Insert_priv = 'Y' || h.Select_priv = 'Y') + 1, + (d.Update_priv = 'Y' || h.Update_priv = 'Y') + 1, + (d.Delete_priv = 'Y' || h.Delete_priv = 'Y') + 1, + (d.Create_priv = 'Y' || h.Create_priv = 'Y') + 1, + (d.Drop_priv = 'Y' || h.Drop_priv = 'Y') + 1, + (d.Grant_priv = 'Y' || h.Grant_priv = 'Y') + 1, + (d.References_priv = 'Y' || h.References_priv = 'Y') + 1, + (d.Index_priv = 'Y' || h.Index_priv = 'Y') + 1, + (d.Alter_priv = 'Y' || h.Alter_priv = 'Y') + 1, + (d.Create_tmp_table_priv = 'Y' || h.Create_tmp_table_priv = 'Y') + 1, + (d.Lock_tables_priv = 'Y' || h.Lock_tables_priv = 'Y') + 1 + FROM db d, host h WHERE d.Host = ''; + +UPDATE IGNORE db SET Host='%' WHERE Host = ''; +DELETE FROM db WHERE Host=''; + +TRUNCATE TABLE host; + +-- +-- Adding missing users to `user` table +-- +-- note that invalid password causes the user to be skipped during the +-- load of grand tables (at mysqld startup) thus three following inserts +-- do not affect anything + +INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM db; +INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM tables_priv; +INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM columns_priv; + +SELECT DISTINCT +"There are user accounts with the username 'PUBLIC'. In the SQL-1999 +(or later) standard this name is reserved for PUBLIC role and can +not be used as a valid user name. Consider renaming these accounts before +upgrading to MySQL-5.0. +These accounts are:" x +FROM user WHERE user='PUBLIC'; +SELECT CONCAT(user,'@',host) FROM user WHERE user='PUBLIC'; + -- cgit v1.2.1 From 531eb44301e559cc10a6c5905b6a87787ae17be6 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 25 Nov 2003 17:52:12 +0100 Subject: - Removed COPYING.LIB from all source and binary distributions after it was removed from manual.texi (where it was automatically generated from). --- scripts/make_binary_distribution.sh | 2 +- scripts/make_win_src_distribution.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8735fc800ce..300fc4a7020 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -85,7 +85,7 @@ do fi done -for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ +for i in COPYING README Docs/INSTALL-BINARY \ MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index c521c4cfdcb..3556b00cbc7 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -282,7 +282,7 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING COPYING.LIB ChangeLog README \ +for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ -- cgit v1.2.1 From e8aef44349bc3441013dad0ed469bdb04f18d5b6 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 8 Dec 2003 12:25:37 +0200 Subject: Portability fixes for Windows --- scripts/make_win_src_distribution.sh | 19 +++++++++---------- scripts/mysql_install_db.sh | 4 +++- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index d83548d0061..57612ac8edc 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -178,18 +178,8 @@ 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 # @@ -320,6 +310,15 @@ done unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt +# +# Clean up if we did this from a bk tree +# + +if [ -d $BASE/SSL/SCCS ] +then + find $BASE -type d -name SCCS | xargs rm -r -f +fi + # # Initialize the initial data directory # diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index acf0f8aa2c8..fcb1f2a4ef1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -119,11 +119,13 @@ fi mdata=$ldata/mysql mysqld=$execdir/mysqld mysqld_opt="" +scriptdir=$bindir if test "$windows" = 1 then mysqld="./sql/mysqld" mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" fi if test ! -x $mysqld @@ -199,7 +201,7 @@ then echo "Installing all prepared tables" fi if ( - $bindir/mysql_create_system_tables $create_option $mdata $hostname $windows + $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows if test -n "$fill_help_tables" then cat $fill_help_tables -- cgit v1.2.1 From b27e9d605233e6b5d5bb03360143a8bad84438f3 Mon Sep 17 00:00:00 2001 From: "pem@mysql.comhem.se" <> Date: Wed, 10 Dec 2003 19:05:37 +0100 Subject: WL#1363: Update the mysql.proc table and add new fields. Also made the parsing and handling of SP characteristics more general and extendable, and added a few ch:istics. --- scripts/mysql_create_system_tables.sh | 50 ++++++++++++++++++++++++++-------- scripts/mysql_fix_privilege_tables.sql | 46 ++++++++++++++++++++++++------- 2 files changed, 74 insertions(+), 22 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index c702a97f93d..7ae6773c1cf 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -289,19 +289,45 @@ fi if test ! -f $mdata/proc.frm then c_p="$c_p CREATE TABLE proc (" - c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," - c_p="$c_p type enum('function','procedure') NOT NULL," - c_p="$c_p body blob DEFAULT '' NOT NULL," - c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," - c_p="$c_p modified timestamp," - c_p="$c_p created timestamp," - c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," - c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," - c_p="$c_p PRIMARY KEY (name,type)" - c_p="$c_p )" - c_p="$c_p comment='Stored Procedures';" + c_p="$c_p schema char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," + c_p="$c_p specific_name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," + c_p="$c_p sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL," + c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," + c_p="$c_p definition blob DEFAULT '' NOT NULL," + c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'INVOKER' NOT NULL," + c_p="$c_p definer char(77) binary DEFAULT '' NOT NULL," + c_p="$c_p created timestamp," + c_p="$c_p modified timestamp," + c_p="$c_p sql_mode set(" + c_p="$c_p 'REAL_AS_FLOAT'," + c_p="$c_p 'PIPES_AS_CONCAT'," + c_p="$c_p 'ANSI_QUOTES'," + c_p="$c_p 'IGNORE_SPACE'," + c_p="$c_p 'NOT_USED'," + c_p="$c_p 'ONLY_FULL_GROUP_BY'," + c_p="$c_p 'NO_UNSIGNED_SUBTRACTION'," + c_p="$c_p 'NO_DIR_IN_CREATE'," + c_p="$c_p 'POSTGRESQL'," + c_p="$c_p 'ORACLE'," + c_p="$c_p 'MSSQL'," + c_p="$c_p 'DB2'," + c_p="$c_p 'MAXDB'," + c_p="$c_p 'NO_KEY_OPTIONS'," + c_p="$c_p 'NO_TABLE_OPTIONS'," + c_p="$c_p 'NO_FIELD_OPTIONS'," + c_p="$c_p 'MYSQL323'," + c_p="$c_p 'MYSQL40'," + c_p="$c_p 'ANSI'," + c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'" + c_p="$c_p ) DEFAULT 0 NOT NULL," + c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p PRIMARY KEY (schema,name,type)" + c_p="$c_p ) comment='Stored Procedures';" fi - + cat << END_OF_DATA use mysql; $c_d diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 4b571722bac..e342e08ea9d 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -140,14 +140,40 @@ unique index (name) # CREATE TABLE IF NOT EXISTS proc ( - name char(64) binary DEFAULT '' NOT NULL, - type enum('function','procedure') NOT NULL, - body blob DEFAULT '' NOT NULL, - creator char(77) binary DEFAULT '' NOT NULL, - modified timestamp, - created timestamp, - suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL, - comment char(64) binary DEFAULT '' NOT NULL, - PRIMARY KEY (name,type) + schema char(64) binary DEFAULT '' NOT NULL, + name char(64) binary DEFAULT '' NOT NULL, + type enum('FUNCTION','PROCEDURE') NOT NULL, + specific_name char(64) binary DEFAULT '' NOT NULL, + language enum('SQL') DEFAULT 'SQL' NOT NULL, + sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL, + is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, + definition blob DEFAULT '' NOT NULL, + security_type enum('INVOKER','DEFINER') DEFAULT 'INVOKER' NOT NULL, + definer char(77) binary DEFAULT '' NOT NULL, + created timestamp, + modified timestamp, + sql_mode set( + 'REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO' + ) DEFAULT 0 NOT NULL, + comment char(64) binary DEFAULT '' NOT NULL, + PRIMARY KEY (schema,name,type) ) comment='Stored Procedures'; - -- cgit v1.2.1 From 7a20e5282e6048c3ef33f1e1bc049aff7ad1a3b8 Mon Sep 17 00:00:00 2001 From: "pem@mysql.comhem.se" <> Date: Fri, 12 Dec 2003 14:05:29 +0100 Subject: In order to make ALTER PROCEDURE|FUNCTION work correctly, and in general to make characteristics (and SHOW) work right, we had to separate the old definition blob in the mysql.proc table into separate fields for parameters, return type, and body, and handle the characteristics (like SQL SECURITY) separately... and then reassemble the CREATE string for parsing, of course. This is rather ugly, mostly the parser bit. (Hopefully that will be better with the new parser.) --- scripts/mysql_create_system_tables.sh | 6 ++++-- scripts/mysql_fix_privilege_tables.sql | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 7ae6773c1cf..57198abd53a 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -296,8 +296,10 @@ then c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," c_p="$c_p sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL," c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," - c_p="$c_p definition blob DEFAULT '' NOT NULL," - c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'INVOKER' NOT NULL," + c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," + c_p="$c_p param_list blob DEFAULT '' NOT NULL," + c_p="$c_p returns char(64) DEFAULT '' NOT NULL," + c_p="$c_p body blob DEFAULT '' NOT NULL," c_p="$c_p definer char(77) binary DEFAULT '' NOT NULL," c_p="$c_p created timestamp," c_p="$c_p modified timestamp," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index e342e08ea9d..788913fa38e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -147,8 +147,10 @@ CREATE TABLE IF NOT EXISTS proc ( language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, - definition blob DEFAULT '' NOT NULL, - security_type enum('INVOKER','DEFINER') DEFAULT 'INVOKER' NOT NULL, + security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, + param_list blob DEFAULT '' NOT NULL, + returns char(64) DEFAULT '' NOT NULL, + body blob DEFAULT '' NOT NULL, definer char(77) binary DEFAULT '' NOT NULL, created timestamp, modified timestamp, -- cgit v1.2.1 From 7a1fddaa1f0ef402a4030276880eae5fc932cfbc Mon Sep 17 00:00:00 2001 From: "pem@mysql.comhem.se" <> Date: Tue, 16 Dec 2003 19:14:10 +0100 Subject: Renamed the "schema" column to "db" in mysql.proc to keep it in style with all the other mysql.* tables. --- scripts/mysql_create_system_tables.sh | 4 ++-- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 57198abd53a..d20d745d514 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -289,7 +289,7 @@ fi if test ! -f $mdata/proc.frm then c_p="$c_p CREATE TABLE proc (" - c_p="$c_p schema char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p db char(64) binary DEFAULT '' NOT NULL," c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," c_p="$c_p specific_name char(64) binary DEFAULT '' NOT NULL," @@ -326,7 +326,7 @@ then c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'" c_p="$c_p ) DEFAULT 0 NOT NULL," c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," - c_p="$c_p PRIMARY KEY (schema,name,type)" + c_p="$c_p PRIMARY KEY (db,name,type)" c_p="$c_p ) comment='Stored Procedures';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 788913fa38e..115236948c9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -140,7 +140,7 @@ unique index (name) # CREATE TABLE IF NOT EXISTS proc ( - schema char(64) binary DEFAULT '' NOT NULL, + db char(64) binary DEFAULT '' NOT NULL, name char(64) binary DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) binary DEFAULT '' NOT NULL, @@ -177,5 +177,5 @@ CREATE TABLE IF NOT EXISTS proc ( 'NO_AUTO_VALUE_ON_ZERO' ) DEFAULT 0 NOT NULL, comment char(64) binary DEFAULT '' NOT NULL, - PRIMARY KEY (schema,name,type) + PRIMARY KEY (db,name,type) ) comment='Stored Procedures'; -- cgit v1.2.1 From 2cae5989e9224a62d4a057c54b4f17de49df158b Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 19 Dec 2003 23:08:20 +0100 Subject: do not put --user into command line if the value comes from [mysqld] or [server] sections Bug #2163 --- scripts/mysqld_safe.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index ece4ba098f4..5d77863c9b4 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -46,8 +46,9 @@ parse_arguments() { --user=*) if test $SET_USER -eq 0 then - user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 + user=`echo "$arg" | sed -e "s;--[^=]*=;;"` fi + SET_USER=1 ;; # these two might have been set in a [mysqld_safe] section of my.cnf @@ -129,7 +130,6 @@ fi # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= -SET_USER=0 # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments @@ -147,7 +147,13 @@ else fi args= -parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld` +SET_USER=2 +parse_arguments `$print_defaults --loose-verbose $defaults mysqld server` +if test $SET_USER -eq 2 +then + SET_USER=0 +fi +parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" if test ! -x $ledir/$MYSQLD -- cgit v1.2.1 From 20733eed527e547e93cc67b397503081c2f155fc Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 13 Jan 2004 19:33:01 +0100 Subject: - improved wording in mysql_install_db on what to do to set the password for the MySQL root user (BUG#2375) --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index ba95ff3b5b9..6d6bacd831e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -340,7 +340,7 @@ then echo fi echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" - echo "This is done with:" + echo "To do so, start the server, then issue the following commands:" echo "$bindir/mysqladmin -u root password 'new-password'" echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." -- cgit v1.2.1 From 5693662fc0f12a7099b0714b837f01f2370eeb3b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 15 Jan 2004 16:14:30 +0100 Subject: - fixed early removing of socket file when multiple instances of mysqld are started via mysqld_safe (BUG#2114) Thanks to Rodrigo Marchant for the suggestion --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5d77863c9b4..0f415ccd5f0 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -115,7 +115,6 @@ else ledir=@libexecdir@ fi -safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} user=@MYSQLD_USER@ niceness=0 @@ -155,6 +154,7 @@ then fi parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" +safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} if test ! -x $ledir/$MYSQLD then -- cgit v1.2.1 From 9736c9c457dcf75768f1451241010d03a8ee196b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 3 Feb 2004 22:25:02 +0100 Subject: - renamed myisam/ft_dump to myisam/mysam_ftdump and added it to the binary distribution and Server RPM --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 300fc4a7020..c7945e31eda 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -100,6 +100,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ isam/isamchk$BS isam/pack_isam$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ + myisam/myisam_ftdump$BS \ sql/mysqld$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ -- cgit v1.2.1 From 0786eb656ccbb0ed861c7983d53e47c5141918f9 Mon Sep 17 00:00:00 2001 From: "greg@mysql.com" <> Date: Thu, 19 Feb 2004 19:04:47 -0100 Subject: Major work on Windows build automation-- add binary packaging, suffixes --- scripts/Makefile.am | 4 +- scripts/make_win_binary_distribution.sh | 178 ++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 scripts/make_win_binary_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d14d7f38deb..c464c271a55 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -33,11 +33,13 @@ bin_SCRIPTS = @server_scripts@ \ mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ - make_win_src_distribution + make_win_src_distribution \ + make_win_binary_distribution EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ make_win_src_distribution.sh \ + make_win_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh new file mode 100644 index 00000000000..e5893c1eb1e --- /dev/null +++ b/scripts/make_win_binary_distribution.sh @@ -0,0 +1,178 @@ +#!/bin/sh + +# +# Script to create a Windows binary package +# +# This is intended to be used under Cygwin, and will generate +# an archive named in the form mysql--noinstall.zip + +version=@VERSION@ + +DEBUG=0 +SUFFIX="" +DIRNAME="" +EXTRA="" + +# +# This script must run from MySQL top directory +# + +if [ ! -f scripts/make_win_binary_distribution ]; then + echo "ERROR : You must run this script from the MySQL top-level directory" + 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 binary package" + echo "" + echo "This is intended to be used under Cygwin, and will generate" + echo "an archive named in the form mysql--noinstall.zip" + echo "Takes the following arguments:" + echo "" + echo " --dirname Directory to use for copying files" + echo " --extra Directory to get extra files from" + echo " --suffix Name to append to 'mysql' for this binary" + echo " --help Show this help message" + exit 0 +} + +# +# Parse the input arguments +# + +parse_arguments() { + for arg do + case "$arg" in + --debug) DEBUG=1;; + --extra=*) EXTRA=`echo "$arg" | sed -e "s;--extra=;;"` ;; + --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; + --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;; + --help) show_usage ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" + +if [ -z "$DIRNAME" ]; then + $DIRNAME="dist" +fi + +print_debug "Making directories" +mkdir $DIRNAME +$DIRNAME="$DIRNAME/mysql-$version" +mkdir $DIRNAME + +for dir in bin lib lib/opt lib/debug Embedded Embedded/DLL Embedded/DLL/debug Embedded/DLL/release Embedded/static Embedded/static/release examples examples/libmysqltest +do + mkdir $DIRNAME/$dir +done + +if [ $EXTRA ]; then + print_debug "Copying extra files" + cp -fr $EXTRA/* $DIRNAME +fi + +# Dirs to be copied as-is +for dir in data Docs include scripts share +do + print_debug "Copying $dir to $DIRNAME/" + cp -fr $dir $DIRNAME +done + +print_debug "Copying tests to $DIRNAME/examples/" +cp -fr tests $DIRNAME/examples + +print_debug "Copying sql-bench to $DIRNAME/bench" +mkdir $DIRNAME/bench +cp -fr sql-bench/* $DIRNAME/bench + +# Files for bin +for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll +do + print_debug "Copying $i to $DIRNAME/bin" + cp $i $DIRNAME/bin +done + +# Files for include +for i in libmysql/libmysql.def libmysqld/libmysqld.def +do + print_debug "Copying $i to $DIRNAME/include" + cp $i $DIRNAME/include +done + +# Windows users are used to having dbug.h +cp include/my_dbug.h $DIRNAME/include/dbug.h + +# Libraries found in lib_release and lib_debug +for i in libmySQL.dll libmysql.lib zlib.lib mysqlclient.lib mysys.lib regex.lib strings.lib +do + print_debug "Copying lib_release/$i to $DIRNAME/lib/opt" + cp lib_release/$i $DIRNAME/lib/opt + print_debug "Copying lib_debug/$i to $DIRNAME/lib/debug" + cp lib_debug/$i $DIRNAME/lib/debug +done + +print_debug "Copying lib_release/mysys-max.lib to $DIRNAME/lib/opt" +cp lib_release/mysys-max.lib $DIRNAME/lib/opt + +# Embedded server +for i in libmysqld.dll libmysqld.lib libmysqld.exp +do + print_debug "Copying lib_release/$i to $DIRNAME/Embedded/DLL/release" + cp lib_release/$i $DIRNAME/Embedded/DLL/release + print_debug "Copying lib_debug/$i to $DIRNAME/Embedded/DLL/debug" + cp lib_debug/$i $DIRNAME/Embedded/DLL/debug +done + +# Static embedded +print_debug "Copying lib_release/mysqlserver.lib to $DIRNAME/Embedded/static/release" +cp lib_release/mysqlserver.lib $DIRNAME/Embedded/static/release + +# libmysqltest +for i in mytest.c mytest.dsp mytest.dsw mytest.exe +do + print_debug "Copying libmysqltest/release/$i to $DIRNAME/examples/libmysqltest" + cp libmysqltest/release/$i $DIRNAME/examples/libmysqltest +done + +print_debug "Copying README.txt" +cp README.txt $DIRNAME + +if [ -f MySQLEULA.txt ]; then + print_debug "Commercial version: copying MySQLEULA.txt" + cp MySQLEULA.txt $DIRNAME + rm $DIRNAME/Docs/COPYING +else + print_debug "GPL version: copying COPYING" + cp Docs/COPYING $DIRNAME +fi + +print_debug "Invoking zip to package the binary" +zip -r mysql$SUFFIX-$version-win-noinstall.zip $DIRNAME + +print_debug "Deleting intermediate directory" +rm -rf $DIRNAME -- cgit v1.2.1 From a35955d60fe984b2341b8d79415c0a742e2bdfc3 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 20 Feb 2004 12:02:34 +0100 Subject: \| is sed is on-portable --- scripts/mysql_config.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 051f3fa9c14..aa7af1cb2c6 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -84,20 +84,25 @@ port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' client_libs='@CLIENT_LIBS@' -# Create options, without end space +# Create options libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -cflags="-I$pkgincludedir @CFLAGS@" +cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about - -cflags=`echo "$cflags " | sed -e 's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g' | sed -e 's; *\$;;'` +for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ + DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ + DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' +do + cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` +done +cflags=`echo "$cflags"|sed -e 's/ *\$//'` usage () { cat < Date: Wed, 3 Mar 2004 17:12:13 +0200 Subject: basic reservations for VIEWs preveleges --- scripts/mysql_create_system_tables.sh | 22 ++++++++++++++-------- scripts/mysql_fix_privilege_tables.sql | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index d20d745d514..d7224b6eae0 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -65,13 +65,15 @@ then c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d )" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y');" fi if test ! -f $mdata/host.frm @@ -95,6 +97,8 @@ then c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h )" c_h="$c_h comment='Host privileges; Merged with database privileges';" @@ -131,6 +135,8 @@ then c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," @@ -144,21 +150,21 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else - i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 115236948c9..8c7fbabc375 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -86,6 +86,7 @@ ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; + UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; ALTER TABLE user @@ -100,6 +101,20 @@ ALTER TABLE host ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +# +# Create VIEWs privrlages (v5.1) +# +ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; + +# +# Show VIEWs privrlages (v5.1) +# +ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; + # # Create some possible missing tables # -- cgit v1.2.1 From 34a332c086c93cdd8fe11476a42265779e3ca593 Mon Sep 17 00:00:00 2001 From: "jani@ua72d24.elisa.omakaista.fi" <> Date: Thu, 4 Mar 2004 18:30:28 +0000 Subject: Added option chroot to mysqlhotcopy. Useful in case mysqld was started with chroot. --- scripts/mysqlhotcopy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 654e5466e12..ab06215c3ac 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.20"; +my $VERSION = "1.21"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -73,6 +73,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] --resetslave reset the master.info once all tables are locked --tmpdir=# temporary directory (instead of $opt_tmpdir) --record_log_pos=# record slave and master status in specified db.table + --chroot=# base directory of chroot jail in which mysqld operates Try \'perldoc $0 for more complete documentation\' _OPTIONS @@ -117,6 +118,7 @@ GetOptions( \%opt, "resetslave", "tmpdir|t=s", "dryrun|n", + "chroot=s", ) or usage("Invalid option"); # @db_desc @@ -210,6 +212,7 @@ while ( my ($var,$value) = $sth_vars->fetchrow_array ) { } my $datadir = $mysqld_vars{'datadir'} || die "datadir not in mysqld variables"; + $datadir= $opt{chroot}.$datadir if ($opt{chroot}); $datadir =~ s:/$::; -- cgit v1.2.1 From faa9c92765f641a3af3b7a757544f64bc0c6ab82 Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Wed, 10 Mar 2004 22:54:07 +0400 Subject: fixed BUG #2874 "Grant table bug" and added tests for testing structure of mysql db --- scripts/mysql_fix_privilege_tables.sh | 98 ++++++++++++++++++++++++++++++---- scripts/mysql_fix_privilege_tables.sql | 13 +++++ scripts/mysql_install_db.sh | 2 +- 3 files changed, 102 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 7ba42e560bb..5e3e4210aa4 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,20 +1,79 @@ #!/bin/sh +# +# Copyright (C) 2004 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file. +# +# This script converts any old privilege tables to privilege tables suitable +# for MySQL 4.0. +# +# You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +# as this just means that your tables where already up to date. +# This script is safe to run even if your tables are already up to date! +# +# On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql' +# instead of this script +# +# Usage: +# mysql_fix_privilege_tables +# - fix tables for host "localhost" as "root" with no password +# mysql_fix_privilege_tables +# - fix tables for host "localhost" as "root" with +# mysql_fix_privilege_tables --sql-only +# - output sql-script to file /usr/share/mysql/echo_stderr +# mysql_fix_privilege_tables OPTIONS +# - fix tables on connection with OPTIONS +# +# where OPTIONS are +# --host= +# --port= +# --socket= +# --user= +# --password= +# --database= + root_password="$1" host="localhost" user="root" +port="" +socket="" +comment="" +database="mysql" -if test -z "$1" ; then - cmd="@bindir@/mysql -f --user=$user --host=$host mysql" -else - root_password="$1" - cmd="@bindir@/mysql -f --user=$user --password=$root_password --host=$host mysql" -fi +# read all the options +parse_arguments() +{ + for arg do + case "$arg" in + --sql-only) cmd="/usr/share/mysql/echo_stderr" ;; + --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; + --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; + --host=*) host=`echo "$arg" | sed -e "s;--host=;;"` ;; + --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; + --password=*) root_password=`echo "$arg" | sed -e "s;--password=;;"` ;; + --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" -# Debian addition -if [ "$1" = "--sql-only" ]; then - root_password="" - cmd="/usr/share/mysql/echo_stderr" +if test -z "$cmd"; then + cmd="@bindir@/mysql -f --user=$user --host=$host" + if test ! -z "$root_password"; then + cmd="$cmd --password=$root_password" + fi + if test ! -z "$port"; then + cmd="$cmd --port=$port" + fi + if test ! -z "$socket"; then + cmd="$cmd --socket=$socket" + fi + cmd="$cmd $database" fi echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" @@ -201,3 +260,22 @@ alter table host add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; END_OF_DATA + +# +# Fix the new bugs discovered by new tests (for Bug #2874 Grant table bugs ) +# +$cmd < Date: Fri, 19 Mar 2004 14:52:48 +0200 Subject: Portability fixes Removed \r from new tests Fixes to get new sustem_mysql_db... tests to work --- scripts/mysql_fix_privilege_tables.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 5e3e4210aa4..1dac3ebc725 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -32,13 +32,23 @@ # --password= # --database= -root_password="$1" +root_password="" host="localhost" user="root" port="" socket="" comment="" database="mysql" +bindir="@bindir@" + +# Old format where there is only one argument and it's the password +if test "$#" == 1 +then + case "$1" in + --*) ;; + *) root_password="$1" ; shift ;; + esac +fi # read all the options parse_arguments() @@ -52,6 +62,7 @@ parse_arguments() --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --password=*) root_password=`echo "$arg" | sed -e "s;--password=;;"` ;; --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; + --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;; *) echo "Unknown argument '$arg'" exit 1 @@ -63,7 +74,7 @@ parse_arguments() parse_arguments "$@" if test -z "$cmd"; then - cmd="@bindir@/mysql -f --user=$user --host=$host" + cmd="$bindir/mysql -f --user=$user --host=$host" if test ! -z "$root_password"; then cmd="$cmd --password=$root_password" fi -- cgit v1.2.1 From b4577bc43a8b82cdf9071ee3dd4c2dbd53850c5b Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 19 Mar 2004 17:19:33 +0100 Subject: typo in mysql_install_db fixed --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0c1502823af..012725265a1 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -118,7 +118,7 @@ then if [ $? -ne 0 ] then resolved=`$bindir/resolveip localhost 2>&1` - if [ $? -eq 0 ] + if [ $? -ne 0 ] then echo "Neither host '$hostname' and 'localhost' could not be looked up with" echo "$bindir/resolveip" -- cgit v1.2.1 From 9a1baf7d62270e659d22a60da5f9cd3eb624ff31 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 19 Mar 2004 18:26:02 +0200 Subject: Portability fixes Fixed some wrong column specifications in mysql_fix_privilege_tables --- scripts/mysql_fix_privilege_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 1dac3ebc725..f5f641525cc 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -116,7 +116,7 @@ $cmd < Date: Fri, 19 Mar 2004 18:33:38 +0200 Subject: Added test to show bug in current union implementation After merge fixes Portability fixes --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sh | 25 +++++-------- scripts/mysql_fix_privilege_tables.sql | 65 ++++++++++++++++++++++++++++------ 3 files changed, 65 insertions(+), 27 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a65004bec4c..5129c028238 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -188,7 +188,7 @@ then c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," - c_t="$c_t Table_name char(60) binary DEFAULT '' NOT NULL," + c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 39a4554be77..69bf2bebaa8 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -56,21 +56,15 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [mysql_install_db], and then merge with the command line arguments -if test -x ./bin/my_print_defaults -then - print_defaults="./bin/my_print_defaults" -elif test -x @bindr@/my_print_defaults -then - print_defaults="@bindir@/my_print_defaults" -elif test -x @bindir@/mysql_print_defaults -then - print_defaults="@bindir@/mysql_print_defaults" -elif test -x extra/my_print_defaults -then - print_defaults="extra/my_print_defaults" -else - print_defaults="my_print_defaults" -fi + +for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra +do + if test -x $dir/my_print_defaults + then + print_defaults="$dir/my_print_defaults" + break + fi +done parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -109,7 +103,6 @@ fi cmd="$bindir/mysql -f --user=$user --host=$host" if test -z "$password" ; then -else cmd="$cmd --password=$password" fi if test ! -z "$port"; then diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index de5779b9ac0..dabc653bcbb 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -7,19 +7,18 @@ -- On unix, you should use the mysql_fix_privilege_tables script to execute -- this sql script. --- On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql' +-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -USE mysql; ALTER TABLE user type=MyISAM; ALTER TABLE db type=MyISAM; ALTER TABLE host type=MyISAM; ALTER TABLE func type=MyISAM; ALTER TABLE columns_priv type=MyISAM; ALTER TABLE tables_priv type=MyISAM; -ALTER TABLE user change Password Password char(41) not null; +ALTER TABLE user change Password Password char(41) binary not null; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( - name char(64) DEFAULT '' NOT NULL, + name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, @@ -39,6 +38,10 @@ UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Crea UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +-- +-- The second alter changes ssl_type to new 4.0.2 format +-- Adding columns needed by GRANT .. REQUIRE (openssl)" + ALTER TABLE user ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, ADD ssl_cipher BLOB NOT NULL, @@ -46,11 +49,15 @@ ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL; ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; +-- +-- Create tables_priv and columns_priv if they don't exists +-- + CREATE TABLE IF NOT EXISTS tables_priv ( - Host char(60) DEFAULT '' NOT NULL, - Db char(60) DEFAULT '' NOT NULL, - User char(16) DEFAULT '' NOT NULL, - Table_name char(60) DEFAULT '' NOT NULL, + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, @@ -69,16 +76,29 @@ CREATE TABLE IF NOT EXISTS columns_priv ( PRIMARY KEY (Host,Db,User,Table_name,Column_name) ); + +-- +-- Name change of Type -> Column_priv from MySQL 3.22.12 +-- + ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; +-- +-- Add the new 'type' column to the func table. +-- + ALTER TABLE func add type enum ('function','aggregate') NOT NULL; +-- +-- Change the user,db and host tables to MySQL 4.0 format +-- + # Detect whether we had Show_db_priv SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, @@ -86,13 +106,24 @@ ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0; +-- Convert privileges so that users have similar privileges as before + +UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; + + +-- Add fields that can be used to limit number of questions and connections +-- for some users. ALTER TABLE user ADD max_questions int(11) NOT NULL AFTER x509_subject, ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; + +-- +-- Add Create_tmp_table_priv and Lock_tables_priv to db and host +-- + ALTER TABLE db ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; @@ -100,6 +131,20 @@ ALTER TABLE host ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +alter table db change Db Db char(64) binary DEFAULT '' NOT NULL; +alter table host change Db Db char(64) binary DEFAULT '' NOT NULL; +alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; +alter table tables_priv change Db Db char(64) binary DEFAULT '' NOT NULL, change Host Host char(60) binary DEFAULT '' NOT NULL, change User User char(16) binary DEFAULT '' NOT NULL, change Table_name Table_name char(64) binary DEFAULT '' NOT NULL; +alter table tables_priv add KEY Grantor (Grantor); +alter table columns_priv change Db Db char(64) binary DEFAULT '' NOT NULL, change Host Host char(60) binary DEFAULT '' NOT NULL, change User User char(16) binary DEFAULT '' NOT NULL, change Table_name Table_name char(64) binary DEFAULT '' NOT NULL, change Column_name Column_name char(64) binary DEFAULT '' NOT NULL; + +alter table db comment='Database privileges'; +alter table host comment='Host privileges; Merged with database privileges'; +alter table user comment='Users and global privileges'; +alter table func comment='User defined functions'; +alter table tables_priv comment='Table privileges'; +alter table columns_priv comment='Column privileges'; + # # Create some possible missing tables # -- cgit v1.2.1 From 5954e94fa7b4c32011d209e03c87dbd8e5d22e99 Mon Sep 17 00:00:00 2001 From: "pem@mysql.comhem.se" <> Date: Tue, 23 Mar 2004 12:04:40 +0100 Subject: Fixed BUG#3259: Stored procedure names are case sensitive. Procedure names were unintentionally case-sensitive when read from the database (but case-insensitive when fetched from the cache). Note that the DB-part of qualified names is still case-sensitive (for consistency with other usage in mysql). --- scripts/mysql_create_system_tables.sh | 4 ++-- scripts/mysql_fix_privilege_tables.sql | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index d20d745d514..06999b81ca1 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -290,9 +290,9 @@ if test ! -f $mdata/proc.frm then c_p="$c_p CREATE TABLE proc (" c_p="$c_p db char(64) binary DEFAULT '' NOT NULL," - c_p="$c_p name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p name char(64) DEFAULT '' NOT NULL," c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," - c_p="$c_p specific_name char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL," c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," c_p="$c_p sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL," c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 115236948c9..e64bf59353f 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -141,9 +141,9 @@ unique index (name) CREATE TABLE IF NOT EXISTS proc ( db char(64) binary DEFAULT '' NOT NULL, - name char(64) binary DEFAULT '' NOT NULL, + name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, - specific_name char(64) binary DEFAULT '' NOT NULL, + specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, @@ -179,3 +179,7 @@ CREATE TABLE IF NOT EXISTS proc ( comment char(64) binary DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) comment='Stored Procedures'; + +# Correct the name fields to not binary +ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, + MODIFY specific_name char(64) DEFAULT '' NOT NULL; -- cgit v1.2.1 From 5de17ec592533251546db9927ebaf635fee1ae6d Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Wed, 24 Mar 2004 20:27:07 +0100 Subject: protection against "ln -s /etc/passwd /tmp/failed-mysql-bugreport" --- scripts/mysqlbug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index bd5cb497e59..3e0e2f9e8b8 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -252,9 +252,9 @@ eval $EDIT $TEMP if cmp -s $TEMP $TEMP.x then echo "File not changed, no bug report submitted." - cp $TEMP /tmp/failed-mysql-bugreport + mv -f $TEMP /tmp/failed-mysql-bugreport echo "The raw bug report exists in /tmp/failed-mysql-bugreport" - echo "If you use this remember that the first lines of the report now is a lie.." + echo "If you use this remember that the first lines of the report are now a lie.." exit 1 fi -- cgit v1.2.1 From f602829c7590e44e0c82ada24cab5c7cff7ebc63 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 30 Mar 2004 19:24:28 +0300 Subject: Fix to get correct metadata when using temporary tables to create result. (Bug #2654) --- scripts/mysqlaccess.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 75ef63ecdd0..9fd1f63f67a 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -414,7 +414,6 @@ _HOWTO use Getopt::Long; use Sys::Hostname; use IPC::Open3; -#use CGI; #moved to use of CGI by monty # **************************** @@ -527,7 +526,7 @@ if ($MySQLaccess::CMD) { #command-line version } } if ($MySQLaccess::CGI) { #CGI-version - use CGI; + require CGI; $Q = new CGI; $Param{'help'} = $Q->param('help') ; $Param{'host'} = $Q->param('host') || $Q->param('h') || $Param{'host'}; -- cgit v1.2.1 From bbbb3f6540b59414cd893973e7ab27f9b09f789c Mon Sep 17 00:00:00 2001 From: "lenz@kallisto.local" <> Date: Thu, 1 Apr 2004 17:34:26 +0200 Subject: - install all *.sql files into the "shared" directory for the binary tar.gz distribution (this is more in line with how "make install" would install them) - this should also fix a test failure in the "system_mysql_db_fix" test. --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4a4170f194b..6a13af09f4e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -192,7 +192,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi $CP support-files/* $BASE/support-files -$CP scripts/fill_help_tables.sql $BASE/support-files +$CP scripts/*.sql $BASE/share if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/support-files/magic \ @@ -230,6 +230,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la + rm -f $BASE/bin/*.sql fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -- cgit v1.2.1 From 85fc07703328ee0b14f8df8f981a291719562e11 Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Sun, 4 Apr 2004 18:48:41 -0500 Subject: Minor tweaks to help message of obscure script. --- scripts/mysql_zap.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index f485d164282..89823c1373b 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -111,10 +111,10 @@ Usage: $0 [-signal] [-?Ift] [--help] pattern Options: -I or -? "info" -f "force" -t "test". Version 1.0 -Kill processes with matches pattern. +Kill processes that match the pattern. If -f isn't given, ask user for confirmation for each process to kill. -If signal isn't given, try first with signal 15 and after that with signal 9. -If -t is given the processes is only shown on stdout. +If signal isn't given, try first with signal 15, then with signal 9. +If -t is given, the processes are only shown on stdout. EOF exit(1); } -- cgit v1.2.1 From 0f484ebae601f3c4a02c2eca17c9b9f88d4c5f88 Mon Sep 17 00:00:00 2001 From: "jani@a80-186-24-72.elisa-laajakaista.fi" <> Date: Tue, 6 Apr 2004 17:57:32 +0300 Subject: Fixed a problem with mysqld_multi log file. The default is now datadir/mysqld_multi.log, if doesn't exists or is not writable, then /var/log/mysqld_multi.log, if does not exists or is not writable, then /tmp/mysqld_multi.log, but only in case the file does not yet exists in /tmp. Otherwise log will be disabled, unless user explicitely sets it with an option. --- scripts/mysqld_multi.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 3165a01362c..a4f2b18fda8 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,12 +4,12 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.5"; +$VER="2.6"; $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = "/tmp/mysqld_multi.log"; +$opt_log = ""; $opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; @@ -18,6 +18,9 @@ $opt_tcp_ip = 0; $opt_user = "root"; $opt_version = 0; +my $my_print_defaults_exists= 1; +my $logdir= undef(); + my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname); $homedir = $ENV{HOME}; @@ -42,7 +45,9 @@ sub main print "Please make sure you have this command available and\n"; print "in your path. The command is available from the latest\n"; print "MySQL distribution.\n"; + $my_print_defaults_exists= 0; } + init_log(); my @defops = `my_print_defaults mysqld_multi`; chop @defops; splice @ARGV, 0, 0, @defops; @@ -112,6 +117,56 @@ sub main } } +#### +#### Init log file. Check for appropriate place for log file, in the following +#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp +#### + +sub init_log +{ + if ($my_print_defaults_exists) + { + @mysqld_opts= `my_print_defaults mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { + if ($opt =~ m/^\-\-datadir[=](.*)/) + { + if (-d "$1" && -w "$1") + { + $logdir= $1; + } + } + } + } + if (!defined($logdir)) + { + $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@"); + } + if (!defined($logdir)) + { + $logdir= "/var/log" if (-d "/var/log" && -w "/var/log"); + } + if (!defined($logdir)) + { + if (-d "/tmp" && -w "/tmp" && ! -e "/tmp/mysqld_multi.log") + { + $logdir= "/tmp"; + } + } + if (!defined($logdir)) + { + # We still couldn't get a default log file in place. Log file + # will be disabled unless user sets it with an option + + $opt_no_log= 1; + } + else + { + $opt_log= "$logdir/mysqld_multi.log"; + } +} + #### #### Report living and not running MySQL servers #### -- cgit v1.2.1 From 0e5cdf319dbcae5904ab0c2a70d7dfa711754901 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Wed, 7 Apr 2004 19:37:13 +0300 Subject: Fixed previous security patch. mysqld_safe will use the given --log=file, or if not given, it will try to use the one in datadir, if possible, otherwise log file will be disabled. --- scripts/mysqld_multi.sh | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index a4f2b18fda8..b30d521c093 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -9,7 +9,7 @@ $VER="2.6"; $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = ""; +$opt_log = undef(); $opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; @@ -47,7 +47,6 @@ sub main print "MySQL distribution.\n"; $my_print_defaults_exists= 0; } - init_log(); my @defops = `my_print_defaults mysqld_multi`; chop @defops; splice @ARGV, 0, 0, @defops; @@ -55,8 +54,8 @@ sub main "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") || die "Wrong option! See $my_progname --help for detailed information!\n"; + init_log(); $groupids = $ARGV[1]; - if ($opt_version) { print "$my_progname version $VER by Jani Tolonen\n"; @@ -145,20 +144,9 @@ sub init_log } if (!defined($logdir)) { - $logdir= "/var/log" if (-d "/var/log" && -w "/var/log"); - } - if (!defined($logdir)) - { - if (-d "/tmp" && -w "/tmp" && ! -e "/tmp/mysqld_multi.log") - { - $logdir= "/tmp"; - } - } - if (!defined($logdir)) - { - # We still couldn't get a default log file in place. Log file - # will be disabled unless user sets it with an option - + # Log file was not specified and we could not log to a standard place, + # so log file be disabled for now. + print "WARNING: Log file disabled. Maybe directory/file isn't writable?\n"; $opt_no_log= 1; } else -- cgit v1.2.1 From 96cb3ec0e9c3ace612b563e2cbd264c503595f85 Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Fri, 9 Apr 2004 09:59:11 +0300 Subject: - Merged in changes from mysqld_multi 2.6 - Changed reading of config file so that one can use a separate config file for [mysqld_multi] also. In other words --config-file=file will read group [mysqld_multi] from this file, earlier it wouldn't have. --- scripts/mysqld_multi.sh | 88 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 3165a01362c..b75aa1a7c31 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,12 +4,12 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.5"; +$VER="2.7"; $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = "/tmp/mysqld_multi.log"; +$opt_log = undef(); $opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; @@ -18,6 +18,9 @@ $opt_tcp_ip = 0; $opt_user = "root"; $opt_version = 0; +my $my_print_defaults_exists= 1; +my $logdir= undef(); + my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname); $homedir = $ENV{HOME}; @@ -42,16 +45,41 @@ sub main print "Please make sure you have this command available and\n"; print "in your path. The command is available from the latest\n"; print "MySQL distribution.\n"; + $my_print_defaults_exists= 0; + } + if ($my_print_defaults_exists) + { + foreach my $arg (@ARGV) + { + if ($arg =~ m/^--config-file=(.*)/) + { + if (!length($1)) + { + die "Option config-file requires an argument\n"; + } + elsif (!( -e $1 && -r $1)) + { + die "Option file '$1' doesn't exists, or is not readable\n"; + } + else + { + $opt_config_file= $1; + } + } + } + my $com= "my_print_defaults "; + $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); + $com.= "mysqld_multi"; + my @defops = `$com`; + chop @defops; + splice @ARGV, 0, 0, @defops; } - my @defops = `my_print_defaults mysqld_multi`; - chop @defops; - splice @ARGV, 0, 0, @defops; GetOptions("help","example","version","mysqld=s","mysqladmin=s", - "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") + "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") || die "Wrong option! See $my_progname --help for detailed information!\n"; + init_log(); $groupids = $ARGV[1]; - if ($opt_version) { print "$my_progname version $VER by Jani Tolonen\n"; @@ -112,6 +140,45 @@ sub main } } +#### +#### Init log file. Check for appropriate place for log file, in the following +#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp +#### + +sub init_log +{ + if ($my_print_defaults_exists) + { + @mysqld_opts= `my_print_defaults mysqld`; + chomp @mysqld_opts; + foreach my $opt (@mysqld_opts) + { + if ($opt =~ m/^\-\-datadir[=](.*)/) + { + if (-d "$1" && -w "$1") + { + $logdir= $1; + } + } + } + } + if (!defined($logdir)) + { + $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@"); + } + if (!defined($logdir)) + { + # Log file was not specified and we could not log to a standard place, + # so log file be disabled for now. + print "WARNING: Log file disabled. Maybe directory/file isn't writable?\n"; + $opt_no_log= 1; + } + else + { + $opt_log= "$logdir/mysqld_multi.log"; + } +} + #### #### Report living and not running MySQL servers #### @@ -589,12 +656,9 @@ reported. Note that you must not have any white spaces in the GNR list. Anything after a white space are ignored. Options: ---config-file=... Alternative config file. NOTE: This will not affect - this program's own options (group [mysqld_multi]), - but only groups [mysqld#]. Without this option everything - will be searched from the ordinary my.cnf file. +--config-file=... Alternative config file. Using: $opt_config_file ---example Give an example of a config file. (PLEASE DO CHECK THIS!) +--example Give an example of a config file. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended. -- cgit v1.2.1 From 8e381405ebc5b2f70d976b5dde265f483dc6ba74 Mon Sep 17 00:00:00 2001 From: "tomas@mc05.(none)" <> Date: Thu, 15 Apr 2004 15:43:10 +0200 Subject: make_binary_distribution.sh: added --with-ndbcluster switch --- scripts/make_binary_distribution.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6a13af09f4e..3261ec309d4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -17,6 +17,7 @@ DEBUG=0 SILENT=0 TMP=/tmp SUFFIX="" +NDBCLUSTER= parse_arguments() { for arg do @@ -26,6 +27,7 @@ parse_arguments() { --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; --silent) SILENT=1 ;; + --with-ndbcluster) NDBCLUSTER=1 ;; *) echo "Unknown argument '$arg'" exit 1 @@ -245,6 +247,18 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -r -f fi +# NDB Cluster +if [ x$NDBCLUSTER = x1 ]; then + if [ ! -f ndb/BinDist.sh ]; then + echo "Missing ndb/BinDist.sh"; exit 1 + fi + mkdir $BASE/ndb || exit 1 + # assume we have cpio.. + if (cd ndb && sh BinDist.sh | cpio -pdm $BASE/ndb); then :; else + echo "Copy failed - missing files in ndb/BinDist.sh ?"; exit 1 + fi +fi + # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX BASE2=$TMP/$NEW_NAME -- cgit v1.2.1 From f10d098f7dc4c2f2281b8ef49e945114996b91a1 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 28 Apr 2004 17:45:08 +0300 Subject: Fixed http address in some scripts (Bug #3460) Output TIMESTAMP in 4.1 format for 4.1 tables (or for TIMESTAMP(19)) (portability fix) Fixed that INTERVAL can handle big integers. (Bug #3498) Fixed that hostname="" works identical as hostname="%" for table/column grants (Bug #3473) --- scripts/mysqld_safe.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 0f415ccd5f0..779438e75c3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -162,6 +162,8 @@ then echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/mysqld_safe". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" exit 1 fi -- cgit v1.2.1 From 7c742e55839ba8e379943ad2e1a1874bb20add7e Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 30 Apr 2004 00:14:56 +0300 Subject: Portability fixes --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index f5f641525cc..2fbcd76c318 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -42,7 +42,7 @@ database="mysql" bindir="@bindir@" # Old format where there is only one argument and it's the password -if test "$#" == 1 +if test "$#" = 1 then case "$1" in --*) ;; -- cgit v1.2.1 From 6678ecf19a0daf521af92a7d175b1525f9a51ab5 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 30 Apr 2004 14:02:17 +0300 Subject: Update 'MYSQL_FIELD->max_length' on mysql_stmt_store_result() (Bug #1647) Added checking of cut read lines in bootstrap thread (Bug #2874) --- scripts/fill_help_tables.sh | 47 ++++++++++++++++++++++++++++++++++++++------- scripts/mysql_install_db.sh | 31 +++++++++++++++++++++--------- 2 files changed, 62 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index cb5437f7178..a62fe0e0b11 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -45,6 +45,7 @@ use strict; use Getopt::Long; my $insert_portion_size= 15; +my $maximum_line_length= 2040; my $error_prefix= "---- help parsing errors :"; my $path_to_lex_file= "../sql/lex.h"; @@ -166,6 +167,7 @@ sub add_description print_error "double description for $topic_name\n"; } $topics{$topic_name}->{description}= $description; + $topics{$topic_name}->{line_of_description}= $cur_line; add_topic_to_category($topic_name); } @@ -515,21 +517,52 @@ if (scalar(@topic_names)) { my $header= "insert into help_topic ". "(help_topic_id,help_category_id,name,description,example) values "; + my $line_accumulator= $header; + my $lines_in_accumulator= 0; + my $actual_max_line_length= $maximum_line_length-2; # for ";\n" my $topic_name; my $count= 0; foreach $topic_name (@topic_names) { - print_insert_header($count,$header); my $topic= $topics{$topic_name}; - print "($count,"; - print "$topic->{category}->{__id__},"; - print "\"$topic_name\","; - print "\"$topic->{description}\","; - print "\"$topic->{example}\")"; + my $line= "($count,"; + $line.= "$topic->{category}->{__id__},"; + $line.= "\"$topic_name\","; + $line.= "\"$topic->{description}\","; + $line.= "\"$topic->{example}\")"; + if ($lines_in_accumulator <= $insert_portion_size && + length($line) + length($line_accumulator) < $actual_max_line_length) + { + if ($lines_in_accumulator ne 0) + { + $line_accumulator.= ","; + } + $line_accumulator.= $line; + $lines_in_accumulator++; + } + else + { + if (length($line) + length($header) >= $actual_max_line_length) + { + $cur_line= $topics{$topic_name}->{line_of_description}; + print_error "too long record for topic \"$topic_name\" \n". + " please decrease its description or example!\n"; + } + else + { + print "$line_accumulator;\n"; + $line_accumulator= $header.$line; + $lines_in_accumulator= 1; + } + } $topics{$topic_name}->{__id__}= $count; $count++; } - printf ";\n\n"; + if ($lines_in_accumulator ne 0) + { + print "$line_accumulator;\n"; + } + printf "\n"; } my @keywords_names= keys(%keywords); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 1861e8c52f8..61d173aac05 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -200,15 +200,28 @@ if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" fi -if ( - $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows - if test -n "$fill_help_tables" - then - cat $fill_help_tables - fi -) | eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" +mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ +--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ +--skip-bdb $args" +if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" then + if test -n "$fill_help_tables" + then + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + then + echo "Fill help tables" + fi + if ! (echo "use mysql; + " + cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + then + echo "" + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly" + echo "" + fi + fi if test "$in_rpm" = 0 -a "$windows" = 0 then echo "" @@ -250,7 +263,7 @@ then fi exit 0 else - echo "Installation of grant tables failed!" + echo "Installation of system tables failed!" echo echo "Examine the logs in $ldata for more information." echo "You can also try to start the mysqld daemon with:" -- cgit v1.2.1 From 3856bdfb82d1b946727824a357e8b801964ca00b Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 30 Apr 2004 14:31:52 +0200 Subject: - reverted change to fill_help_tables.sh ("Added checking of maximum length of line in output (Bug #2874)" from last ChangeSet (should not have been applied) --- scripts/fill_help_tables.sh | 47 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index a62fe0e0b11..cb5437f7178 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -45,7 +45,6 @@ use strict; use Getopt::Long; my $insert_portion_size= 15; -my $maximum_line_length= 2040; my $error_prefix= "---- help parsing errors :"; my $path_to_lex_file= "../sql/lex.h"; @@ -167,7 +166,6 @@ sub add_description print_error "double description for $topic_name\n"; } $topics{$topic_name}->{description}= $description; - $topics{$topic_name}->{line_of_description}= $cur_line; add_topic_to_category($topic_name); } @@ -517,52 +515,21 @@ if (scalar(@topic_names)) { my $header= "insert into help_topic ". "(help_topic_id,help_category_id,name,description,example) values "; - my $line_accumulator= $header; - my $lines_in_accumulator= 0; - my $actual_max_line_length= $maximum_line_length-2; # for ";\n" my $topic_name; my $count= 0; foreach $topic_name (@topic_names) { + print_insert_header($count,$header); my $topic= $topics{$topic_name}; - my $line= "($count,"; - $line.= "$topic->{category}->{__id__},"; - $line.= "\"$topic_name\","; - $line.= "\"$topic->{description}\","; - $line.= "\"$topic->{example}\")"; - if ($lines_in_accumulator <= $insert_portion_size && - length($line) + length($line_accumulator) < $actual_max_line_length) - { - if ($lines_in_accumulator ne 0) - { - $line_accumulator.= ","; - } - $line_accumulator.= $line; - $lines_in_accumulator++; - } - else - { - if (length($line) + length($header) >= $actual_max_line_length) - { - $cur_line= $topics{$topic_name}->{line_of_description}; - print_error "too long record for topic \"$topic_name\" \n". - " please decrease its description or example!\n"; - } - else - { - print "$line_accumulator;\n"; - $line_accumulator= $header.$line; - $lines_in_accumulator= 1; - } - } + print "($count,"; + print "$topic->{category}->{__id__},"; + print "\"$topic_name\","; + print "\"$topic->{description}\","; + print "\"$topic->{example}\")"; $topics{$topic_name}->{__id__}= $count; $count++; } - if ($lines_in_accumulator ne 0) - { - print "$line_accumulator;\n"; - } - printf "\n"; + printf ";\n\n"; } my @keywords_names= keys(%keywords); -- cgit v1.2.1 From 894e8fca6e3882795df7b371fbc56f9236d42a14 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 12 May 2004 02:38:57 +0300 Subject: Portability fixes --- scripts/mysql_install_db.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 61d173aac05..abde6ecbe73 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,6 +10,8 @@ in_rpm=0 windows=0 defaults="" +tmp_file=/tmp/mysql_install_db.$$ + case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -212,9 +214,11 @@ then then echo "Fill help tables" fi - if ! (echo "use mysql; - " - cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + echo "use mysql;" > $tmp_file + cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line" + res=$? + rm $tmp_file + if test $res != 0 then echo "" echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" -- cgit v1.2.1 From b1f2932fff656fecc020283dee9bf7ecbb4bace6 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 13 May 2004 18:50:09 +0200 Subject: - make sure the binaries are executable before calling them during make_binary_distribution (bug#2857) --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c7945e31eda..730086bbb62 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -221,6 +221,7 @@ $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/* $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then + chmod a+x $BASE/bin/* $CP scripts/* $BASE/bin $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server -- cgit v1.2.1 From 86a966256be6818d20d138c1e687e1f195ddaf74 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 19 May 2004 16:38:12 +0300 Subject: Added support for projects 'classic', 'classic nt', 'pro' and 'pro nt' Ensured that all projects compile Removed compiler warnings Better setting of server_version variable. Fix that make_win_src_distribution creates the privilege tables. --- scripts/make_win_src_distribution.sh | 4 ++++ scripts/mysql_install_db.sh | 42 +++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 3556b00cbc7..54c25b49035 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -327,6 +327,10 @@ mv $BASE/README $BASE/README.txt if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data + if test "$?" = 1 + then + exit 1; + fi fi # diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 012725265a1..c03049c6a91 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002 MySQL AB +# Copyright (C) 2002-2004 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, @@ -7,13 +7,14 @@ # # All unrecognized arguments to this script are passed to mysqld. -IN_RPM=0 +in_rpm=0 +windows=0 +defaults="" case "$1" in -IN-RPM) - IN_RPM="1"; shift + in_rpm="1"; shift ;; esac -defaults= case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$1"; shift @@ -38,6 +39,9 @@ parse_arguments() { --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --skip-name-resolve) ip_only=1 ;; + --verbose) verbose=1 ;; + --rpm) in_rpm=1 ;; + --windows) windows=1 ;; *) if test -n "$pick_args" then @@ -55,6 +59,9 @@ parse_arguments() { if test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" +elif test -x ./extra/my_print_defaults +then + print_defaults="./extra/my_print_defaults" elif test -x @bindir@/my_print_defaults then print_defaults="@bindir@/my_print_defaults" @@ -80,6 +87,7 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ + pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" if test -x "$basedir/libexec/mysqld" @@ -94,15 +102,25 @@ fi fi mdata=$ldata/mysql +mysqld=$execdir/mysqld +mysqld_opt="" +scriptdir=$bindir + +if test "$windows" = 1 +then + mysqld="./sql/mysqld" + mysqld_opt="--language=./sql/share/english" + scriptdir="./scripts" +fi -if test ! -x $execdir/mysqld +if test ! -x $mysqld then - if test "$IN_RPM" = "1" + if test "$in_rpm" = 1 then - echo "FATAL ERROR $execdir/mysqld not found!" + echo "FATAL ERROR $mysqld not found!" exit 1 else - echo "Didn't find $execdir/mysqld" + echo "Didn't find $mysqld" echo "You should do a 'make install' before executing this script" exit 1 fi @@ -112,7 +130,7 @@ fi hostname=`@HOSTNAME@` # Check if hostname is valid -if test "$IN_RPM" = "0" -a $force = "0" +if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 then resolved=`$bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] @@ -313,7 +331,7 @@ then fi echo "Installing all prepared tables" -if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ +if eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA use mysql; $c_d @@ -333,7 +351,7 @@ $c_c END_OF_DATA then echo "" - if test "$IN_RPM" = "0" + if test "$in_rpm" = "0" then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -354,7 +372,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" = "0" + if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" -- cgit v1.2.1 From f2e1e3ce4c72d383f16fd8c525b28c4912e8f2de Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Tue, 25 May 2004 22:00:14 +0300 Subject: Added patches from Novell --- scripts/make_binary_distribution.sh | 77 +++++++++++++++++++++++++------------ scripts/mysqlhotcopy.sh | 20 +++++++++- 2 files changed, 71 insertions(+), 26 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c7945e31eda..240efbfad75 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -85,8 +85,8 @@ do fi done -for i in COPYING README Docs/INSTALL-BINARY \ - MySQLEULA.txt LICENSE.doc README.NW +for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then @@ -151,6 +151,7 @@ done if [ $BASE_SYSTEM = "netware" ] ; then $CP -r netware/*.pl $BASE/scripts + $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl fi for i in \ @@ -167,7 +168,7 @@ do fi done -# convert the libs to .lib for NetWare +# convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then for i in $BASE/lib/*.a do @@ -233,6 +234,16 @@ fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh + +# +# Remove system dependent files +# +if [ $BASE_SYSTEM = "netware" ] ; then + rm -f $BASE/MySQLEULA.txt +else + rm -f $BASE/README.NW +fi + # Make safe_mysqld a symlink to mysqld_safe for backwards portability # To be removed in MySQL 4.1 (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) @@ -294,29 +305,47 @@ which_1 () exit 1 } -# -# Create the result tar file -# +if [ $BASE_SYSTEM != "netware" ] ; then -tar=`which_1 gnutar gtar` -if test "$?" = "1" -o "$tar" = "" -then - tar=tar -fi + # + # Create the result tar file + # + + tar=`which_1 gnutar gtar` + if test "$?" = "1" -o "$tar" = "" + then + tar=tar + fi + + echo "Using $tar to create archive" + cd $TMP + + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME + cd $SOURCE + echo "Compressing archive" + rm -f $NEW_NAME.tar.gz + gzip -9 $NEW_NAME.tar + echo "Removing temporary directory" + rm -r -f $BASE + + echo "$NEW_NAME.tar.gz created" +else -echo "Using $tar to create archive" -cd $TMP + # + # Create a zip file for NetWare users + # -OPT=cvf -if [ x$SILENT = x1 ] ; then - OPT=cf -fi + cd $TMP + if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi + zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + echo "Removing temporary directory" + rm -r -f $BASE -$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME -cd $SOURCE -echo "Compressing archive" -gzip -9 $NEW_NAME.tar -echo "Removing temporary directory" -rm -r -f $BASE + echo "$NEW_NAME.zip created" -echo "$NEW_NAME.tar.gz created" +fi diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index ab06215c3ac..6388855eaa6 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -7,6 +7,7 @@ use File::Basename; use File::Path; use DBI; use Sys::Hostname; +use File::Copy; =head1 NAME @@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) { elsif ( $opt{suffix} ) { print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; } +elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.')) +{ + $tgt_dirname = $tgt_name; +} else { $tgt_name="" if (!defined($tgt_name)); @@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) { else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" unless -d $tgt_dirpath; + if ($^O !~ m/^(NetWare)$/) + { my @f_info= stat "$datadir/$rdb->{src}"; chown $f_info[4], $f_info[5], $tgt_dirpath; + } } } } @@ -578,7 +586,15 @@ sub copy_files { my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; - if ($method =~ /^s?cp\b/) { # cp or scp with optional flags + if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower) + { + foreach my $file ( @$files ) + { + copy($file, $target."/".basename($file)); + } + } + elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags + { my $cp = $method; # add option to preserve mod time etc of copied files # not critical, but nice to have @@ -717,7 +733,7 @@ sub retire_directory { if ( -d $tgt_oldpath ) { print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet}; - rmtree([$tgt_oldpath]) + rmtree([$tgt_oldpath],0,1); } rename($dir, $tgt_oldpath) or die "Can't rename $dir=>$tgt_oldpath: $!\n"; -- cgit v1.2.1 From 7d8f8bc77bd58b0a527a3874cda55311a068d05b Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 26 May 2004 19:12:49 +0300 Subject: Changed prototype of killed_ptr() to make it more portable Applied patches for Netware --- scripts/make_binary_distribution.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 230a62c5f11..ef1a895e4eb 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -197,14 +197,6 @@ fi $CP support-files/* $BASE/support-files $CP scripts/*.sql $BASE/share -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/support-files/magic \ - $BASE/support-files/mysql.server \ - $BASE/support-files/mysql*.spec \ - $BASE/support-files/mysql-log-rotate \ - $BASE/support-files/binary-configure -fi - $CP -r sql/share/* $MYSQL_SHARE rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD @@ -240,11 +232,25 @@ fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh +# +# Copy system dependent files +# +if [ $BASE_SYSTEM = "netware" ] ; then + cp ./netware/static_init_db.sql ./netware/init_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +fi + # # Remove system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/MySQLEULA.txt + rm -f $BASE/support-files/magic \ + $BASE/support-files/mysql.server \ + $BASE/support-files/mysql*.spec \ + $BASE/support-files/mysql-log-rotate \ + $BASE/support-files/binary-configure \ + $BASE/INSTALL-BINARY \ + $BASE/MySQLEULA.txt else rm -f $BASE/README.NW fi @@ -347,9 +353,6 @@ if [ $BASE_SYSTEM != "netware" ] ; then echo "Compressing archive" rm -f $NEW_NAME.tar.gz gzip -9 $NEW_NAME.tar - echo "Removing temporary directory" - rm -r -f $BASE - echo "$NEW_NAME.tar.gz created" else @@ -360,9 +363,8 @@ else cd $TMP if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME - echo "Removing temporary directory" - rm -r -f $BASE - echo "$NEW_NAME.zip created" fi +echo "Removing temporary directory" +rm -r -f $BASE -- cgit v1.2.1 From 518019f511ae292db9c0b1ee98fa7b96270e3e9c Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 28 May 2004 00:03:19 +0300 Subject: Remove some code from sql_yacc.cc that doesn't do anything except produce warnings on VC++ --- scripts/make_win_src_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 68ba488f3d5..f6102085021 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -302,10 +302,12 @@ do done # -# Fix some windows files +# Fix some windows files to avoid compiler warnings # -./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp +./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new +mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp + unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt -- cgit v1.2.1 From 8d7d4c077b887cde7b0c237bf1ce0f6b8b607fff Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.bredbandsbolaget.se" <> Date: Wed, 2 Jun 2004 00:54:58 +0000 Subject: several ndb make changes, see respective file --- scripts/make_binary_distribution.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ef1a895e4eb..189796377cc 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -267,14 +267,14 @@ fi # NDB Cluster if [ x$NDBCLUSTER = x1 ]; then - if [ ! -f ndb/BinDist.sh ]; then - echo "Missing ndb/BinDist.sh"; exit 1 - fi - mkdir $BASE/ndb || exit 1 - # assume we have cpio.. - if (cd ndb && sh BinDist.sh | cpio -pdm $BASE/ndb); then :; else - echo "Copy failed - missing files in ndb/BinDist.sh ?"; exit 1 - fi + ( cd ndb ; make DESTDIR=$BASE/ndb-stage install ) + ( cd mysql-test/ndb ; make DESTDIR=$BASE/ndb-stage install ) + $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. + $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. + $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. + $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/lib/. + $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 + rm -rf $BASE/ndb-stage fi # Change the distribution to a long descriptive name -- cgit v1.2.1 From 2f0ca1ce424a26f71d4b6ec85d890060ecb73c68 Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Thu, 3 Jun 2004 11:52:54 -0500 Subject: Fix skipp -> skip once and for all. (Note: This affects only comments, not variable names.) --- scripts/mysql_find_rows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 3d7bad3323e..91ffc326e16 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -16,7 +16,7 @@ usage() if ($opt_help || $opt_Information); $query=$search=$database=$set=""; $eoq=0; while (<>) { - next if (length($query) == 0 && /^\#/); # Skipp comments + next if (length($query) == 0 && /^\#/); # Skip comments $query.=search($_); if ($eoq) { -- cgit v1.2.1 From fb15e3e73f3292a50a7ce40eb2a6f30a295d9b92 Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Fri, 4 Jun 2004 16:11:47 -0500 Subject: mysql_install_db.sh: Correct a grammar error. --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index abde6ecbe73..1fd67b1d0ee 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -155,7 +155,7 @@ then resolved=`$bindir/resolveip localhost 2>&1` if [ $? -ne 0 ] then - echo "Neither host '$hostname' and 'localhost' could not be looked up with" + echo "Neither host '$hostname' nor 'localhost' could be looked up with" echo "$bindir/resolveip" echo "Please configure the 'hostname' command to return a correct hostname." echo "If you want to solve this at a later stage, restart this script with" -- cgit v1.2.1 From 4bd441850c3350c1d4a95109edcce6d557e8237b Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Wed, 9 Jun 2004 17:07:11 +0200 Subject: Fix for BUG#4038 "rpm postinstall script leaves files as owned by root": the rpm postinstall script must call mysql_install_db with --user=mysql, and mysql_install_db must then pass this to mysqld. Otherwise, mysqld runs as root, and if you have --log-bin=somewhere_out_of_var_lib_mysql it creates binlog files owned by root in this dir, and this dir is not fixed by the 'chmod mysql', so files remain owned by root, and later mysqld (running as 'mysql') can't read them. I'm hardcoding 'mysql' in the postinstall script, but it's already hardcoded there in many places (see the useradd and chown) so it's ok. --- scripts/mysql_install_db.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c03049c6a91..931c8f21a92 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -38,6 +38,9 @@ parse_arguments() { --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + # Note that this will be passed to mysqld so that it runs + # as 'user' (crucial e.g. if log-bin=/some_other_path/ + # where a chown of datadir won't help) --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ;; --rpm) in_rpm=1 ;; @@ -332,7 +335,8 @@ fi echo "Installing all prepared tables" if eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb \ + --user=$user $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From 56478093505dd4af1170a46d159033eb0cb9d359 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Thu, 10 Jun 2004 13:56:58 +0200 Subject: warn about multiple mysqld --user parameters only if their arguments differ --- scripts/mysqld_safe.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 779438e75c3..7b77bf449cd 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -43,13 +43,7 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) - if test $SET_USER -eq 0 - then - user=`echo "$arg" | sed -e "s;--[^=]*=;;"` - fi - SET_USER=1 - ;; + --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; # these two might have been set in a [mysqld_safe] section of my.cnf # they are added to mysqld command line to override settings from my.cnf -- cgit v1.2.1 From d28895d042e39ee3b64beb2f2b0667a9fd6bf35b Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 10 Jun 2004 16:44:39 +0300 Subject: After merge fix --- scripts/mysql_install_db.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 931c8f21a92..600a87328cb 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -37,10 +37,11 @@ parse_arguments() { --force) force=1 ;; --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - # Note that this will be passed to mysqld so that it runs - # as 'user' (crucial e.g. if log-bin=/some_other_path/ - # where a chown of datadir won't help) + --user=*) + # Note that the user will be passed to mysqld so that it runs + # as 'user' (crucial e.g. if log-bin=/some_other_path/ + # where a chown of datadir won't help) + user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ;; --rpm) in_rpm=1 ;; -- cgit v1.2.1 From f56df164f0603b268806108526d59e5d02fef82b Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 18 Jun 2004 04:22:43 +0300 Subject: ke it possible to use mysys functions in netware/mysql_test_run.c Don't pass --user to mysqld if --user is not used --- scripts/mysql_install_db.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 600a87328cb..c6e9f04fa91 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,6 +10,7 @@ in_rpm=0 windows=0 defaults="" +user="" case "$1" in -IN-RPM) in_rpm="1"; shift @@ -334,10 +335,14 @@ then c_c="$c_c comment='Column privileges';" fi +if test -n "$user"; then + args="$args --user=$user" +fi + echo "Installing all prepared tables" if eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb \ - --user=$user $args" << END_OF_DATA + $extra_arg $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From 09ba29e53977d7469c39bf181a6e5853869125ed Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Fri, 18 Jun 2004 10:11:31 +0400 Subject: WL#1264 "Per-thread time zone support infrastructure". Added basic per-thread time zone functionality (based on public domain elsie-code). Now user can select current time zone (from the list of time zones described in system tables). All NOW-like functions honor this time zone, values of TIMESTAMP type are interpreted as values in this time zone, so now our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH LOCAL TIME ZONE (or proper PostgresSQL type). WL#1266 "CONVERT_TZ() - basic time with time zone conversion function". Fixed problems described in Bug #2336 (Different number of warnings when inserting bad datetime as string or as number). This required reworking of datetime realted warning hadling (they now generated at Field object level not in conversion functions). Optimization: Now Field class descendants use table->in_use member instead of current_thd macro. --- scripts/mysql_create_system_tables.sh | 339 +++++++++++++++++++++++++++++++++ scripts/mysql_fix_privilege_tables.sql | 39 ++++ 2 files changed, 378 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5129c028238..85835498bc1 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -39,6 +39,8 @@ c_hc="" c_hr="" c_hk="" i_ht="" +c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" +i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" # Check for old tables if test ! -f $mdata/db.frm @@ -285,6 +287,332 @@ then c_hr="$c_hr comment='keyword-topic relation';" fi +if test ! -f $mdata/time_zone_name.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_name table" 1>&2; + fi + + c_tzn="$c_tzn CREATE TABLE time_zone_name (" + c_tzn="$c_tzn Name char(64) NOT NULL," + c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," + c_tzn="$c_tzn PRIMARY KEY Name (Name)" + c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1" + c_tzn="$c_tzn comment='Time zone names';" + + if test "$1" = "test" + then + i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" + i_tzn="$i_tzn ('MET', 1), ('UTC', 2), ('Universal', 2), " + i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4);" + fi +fi + +if test ! -f $mdata/time_zone.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone table" 1>&2; + fi + + c_tz="$c_tz CREATE TABLE time_zone (" + c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," + c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" + c_tz="$c_tz ) DEFAULT CHARACTER SET latin1" + c_tz="$c_tz comment='Time zones';" + + if test "$1" = "test" + then + i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" + i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');" + fi +fi + +if test ! -f $mdata/time_zone_transition.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_transition table" 1>&2; + fi + + c_tzt="$c_tzt CREATE TABLE time_zone_transition (" + c_tzt="$c_tzt Time_zone_id int unsigned NOT NULL," + c_tzt="$c_tzt Transition_time bigint signed NOT NULL," + c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," + c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" + c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1" + c_tzt="$c_tzt comment='Time zone transitions';" + + if test "$1" = "test" + then + i_tzt="$i_tzt INSERT INTO time_zone_transition" + i_tzt="$i_tzt (Time_zone_id, Transition_time, Transition_type_id)" + i_tzt="$i_tzt VALUES" + i_tzt="$i_tzt (1, -1693706400, 0) ,(1, -1680483600, 1)" + i_tzt="$i_tzt ,(1, -1663455600, 2) ,(1, -1650150000, 3)" + i_tzt="$i_tzt ,(1, -1632006000, 2) ,(1, -1618700400, 3)" + i_tzt="$i_tzt ,(1, -938905200, 2) ,(1, -857257200, 3)" + i_tzt="$i_tzt ,(1, -844556400, 2) ,(1, -828226800, 3)" + i_tzt="$i_tzt ,(1, -812502000, 2) ,(1, -796777200, 3)" + i_tzt="$i_tzt ,(1, 228877200, 2) ,(1, 243997200, 3)" + i_tzt="$i_tzt ,(1, 260326800, 2) ,(1, 276051600, 3)" + i_tzt="$i_tzt ,(1, 291776400, 2) ,(1, 307501200, 3)" + i_tzt="$i_tzt ,(1, 323830800, 2) ,(1, 338950800, 3)" + i_tzt="$i_tzt ,(1, 354675600, 2) ,(1, 370400400, 3)" + i_tzt="$i_tzt ,(1, 386125200, 2) ,(1, 401850000, 3)" + i_tzt="$i_tzt ,(1, 417574800, 2) ,(1, 433299600, 3)" + i_tzt="$i_tzt ,(1, 449024400, 2) ,(1, 465354000, 3)" + i_tzt="$i_tzt ,(1, 481078800, 2) ,(1, 496803600, 3)" + i_tzt="$i_tzt ,(1, 512528400, 2) ,(1, 528253200, 3)" + i_tzt="$i_tzt ,(1, 543978000, 2) ,(1, 559702800, 3)" + i_tzt="$i_tzt ,(1, 575427600, 2) ,(1, 591152400, 3)" + i_tzt="$i_tzt ,(1, 606877200, 2) ,(1, 622602000, 3)" + i_tzt="$i_tzt ,(1, 638326800, 2) ,(1, 654656400, 3)" + i_tzt="$i_tzt ,(1, 670381200, 2) ,(1, 686106000, 3)" + i_tzt="$i_tzt ,(1, 701830800, 2) ,(1, 717555600, 3)" + i_tzt="$i_tzt ,(1, 733280400, 2) ,(1, 749005200, 3)" + i_tzt="$i_tzt ,(1, 764730000, 2) ,(1, 780454800, 3)" + i_tzt="$i_tzt ,(1, 796179600, 2) ,(1, 811904400, 3)" + i_tzt="$i_tzt ,(1, 828234000, 2) ,(1, 846378000, 3)" + i_tzt="$i_tzt ,(1, 859683600, 2) ,(1, 877827600, 3)" + i_tzt="$i_tzt ,(1, 891133200, 2) ,(1, 909277200, 3)" + i_tzt="$i_tzt ,(1, 922582800, 2) ,(1, 941331600, 3)" + i_tzt="$i_tzt ,(1, 954032400, 2) ,(1, 972781200, 3)" + i_tzt="$i_tzt ,(1, 985482000, 2) ,(1, 1004230800, 3)" + i_tzt="$i_tzt ,(1, 1017536400, 2) ,(1, 1035680400, 3)" + i_tzt="$i_tzt ,(1, 1048986000, 2) ,(1, 1067130000, 3)" + i_tzt="$i_tzt ,(1, 1080435600, 2) ,(1, 1099184400, 3)" + i_tzt="$i_tzt ,(1, 1111885200, 2) ,(1, 1130634000, 3)" + i_tzt="$i_tzt ,(1, 1143334800, 2) ,(1, 1162083600, 3)" + i_tzt="$i_tzt ,(1, 1174784400, 2) ,(1, 1193533200, 3)" + i_tzt="$i_tzt ,(1, 1206838800, 2) ,(1, 1224982800, 3)" + i_tzt="$i_tzt ,(1, 1238288400, 2) ,(1, 1256432400, 3)" + i_tzt="$i_tzt ,(1, 1269738000, 2) ,(1, 1288486800, 3)" + i_tzt="$i_tzt ,(1, 1301187600, 2) ,(1, 1319936400, 3)" + i_tzt="$i_tzt ,(1, 1332637200, 2) ,(1, 1351386000, 3)" + i_tzt="$i_tzt ,(1, 1364691600, 2) ,(1, 1382835600, 3)" + i_tzt="$i_tzt ,(1, 1396141200, 2) ,(1, 1414285200, 3)" + i_tzt="$i_tzt ,(1, 1427590800, 2) ,(1, 1445734800, 3)" + i_tzt="$i_tzt ,(1, 1459040400, 2) ,(1, 1477789200, 3)" + i_tzt="$i_tzt ,(1, 1490490000, 2) ,(1, 1509238800, 3)" + i_tzt="$i_tzt ,(1, 1521939600, 2) ,(1, 1540688400, 3)" + i_tzt="$i_tzt ,(1, 1553994000, 2) ,(1, 1572138000, 3)" + i_tzt="$i_tzt ,(1, 1585443600, 2) ,(1, 1603587600, 3)" + i_tzt="$i_tzt ,(1, 1616893200, 2) ,(1, 1635642000, 3)" + i_tzt="$i_tzt ,(1, 1648342800, 2) ,(1, 1667091600, 3)" + i_tzt="$i_tzt ,(1, 1679792400, 2) ,(1, 1698541200, 3)" + i_tzt="$i_tzt ,(1, 1711846800, 2) ,(1, 1729990800, 3)" + i_tzt="$i_tzt ,(1, 1743296400, 2) ,(1, 1761440400, 3)" + i_tzt="$i_tzt ,(1, 1774746000, 2) ,(1, 1792890000, 3)" + i_tzt="$i_tzt ,(1, 1806195600, 2) ,(1, 1824944400, 3)" + i_tzt="$i_tzt ,(1, 1837645200, 2) ,(1, 1856394000, 3)" + i_tzt="$i_tzt ,(1, 1869094800, 2) ,(1, 1887843600, 3)" + i_tzt="$i_tzt ,(1, 1901149200, 2) ,(1, 1919293200, 3)" + i_tzt="$i_tzt ,(1, 1932598800, 2) ,(1, 1950742800, 3)" + i_tzt="$i_tzt ,(1, 1964048400, 2) ,(1, 1982797200, 3)" + i_tzt="$i_tzt ,(1, 1995498000, 2) ,(1, 2014246800, 3)" + i_tzt="$i_tzt ,(1, 2026947600, 2) ,(1, 2045696400, 3)" + i_tzt="$i_tzt ,(1, 2058397200, 2) ,(1, 2077146000, 3)" + i_tzt="$i_tzt ,(1, 2090451600, 2) ,(1, 2108595600, 3)" + i_tzt="$i_tzt ,(1, 2121901200, 2) ,(1, 2140045200, 3)" + i_tzt="$i_tzt ,(3, -1688265000, 2) ,(3, -1656819048, 1)" + i_tzt="$i_tzt ,(3, -1641353448, 2) ,(3, -1627965048, 3)" + i_tzt="$i_tzt ,(3, -1618716648, 1) ,(3, -1596429048, 3)" + i_tzt="$i_tzt ,(3, -1593829848, 5) ,(3, -1589860800, 4)" + i_tzt="$i_tzt ,(3, -1542427200, 5) ,(3, -1539493200, 6)" + i_tzt="$i_tzt ,(3, -1525323600, 5) ,(3, -1522728000, 4)" + i_tzt="$i_tzt ,(3, -1491188400, 7) ,(3, -1247536800, 4)" + i_tzt="$i_tzt ,(3, 354920400, 5) ,(3, 370728000, 4)" + i_tzt="$i_tzt ,(3, 386456400, 5) ,(3, 402264000, 4)" + i_tzt="$i_tzt ,(3, 417992400, 5) ,(3, 433800000, 4)" + i_tzt="$i_tzt ,(3, 449614800, 5) ,(3, 465346800, 8)" + i_tzt="$i_tzt ,(3, 481071600, 9) ,(3, 496796400, 8)" + i_tzt="$i_tzt ,(3, 512521200, 9) ,(3, 528246000, 8)" + i_tzt="$i_tzt ,(3, 543970800, 9) ,(3, 559695600, 8)" + i_tzt="$i_tzt ,(3, 575420400, 9) ,(3, 591145200, 8)" + i_tzt="$i_tzt ,(3, 606870000, 9) ,(3, 622594800, 8)" + i_tzt="$i_tzt ,(3, 638319600, 9) ,(3, 654649200, 8)" + i_tzt="$i_tzt ,(3, 670374000, 10) ,(3, 686102400, 11)" + i_tzt="$i_tzt ,(3, 695779200, 8) ,(3, 701812800, 5)" + i_tzt="$i_tzt ,(3, 717534000, 4) ,(3, 733273200, 9)" + i_tzt="$i_tzt ,(3, 748998000, 8) ,(3, 764722800, 9)" + i_tzt="$i_tzt ,(3, 780447600, 8) ,(3, 796172400, 9)" + i_tzt="$i_tzt ,(3, 811897200, 8) ,(3, 828226800, 9)" + i_tzt="$i_tzt ,(3, 846370800, 8) ,(3, 859676400, 9)" + i_tzt="$i_tzt ,(3, 877820400, 8) ,(3, 891126000, 9)" + i_tzt="$i_tzt ,(3, 909270000, 8) ,(3, 922575600, 9)" + i_tzt="$i_tzt ,(3, 941324400, 8) ,(3, 954025200, 9)" + i_tzt="$i_tzt ,(3, 972774000, 8) ,(3, 985474800, 9)" + i_tzt="$i_tzt ,(3, 1004223600, 8) ,(3, 1017529200, 9)" + i_tzt="$i_tzt ,(3, 1035673200, 8) ,(3, 1048978800, 9)" + i_tzt="$i_tzt ,(3, 1067122800, 8) ,(3, 1080428400, 9)" + i_tzt="$i_tzt ,(3, 1099177200, 8) ,(3, 1111878000, 9)" + i_tzt="$i_tzt ,(3, 1130626800, 8) ,(3, 1143327600, 9)" + i_tzt="$i_tzt ,(3, 1162076400, 8) ,(3, 1174777200, 9)" + i_tzt="$i_tzt ,(3, 1193526000, 8) ,(3, 1206831600, 9)" + i_tzt="$i_tzt ,(3, 1224975600, 8) ,(3, 1238281200, 9)" + i_tzt="$i_tzt ,(3, 1256425200, 8) ,(3, 1269730800, 9)" + i_tzt="$i_tzt ,(3, 1288479600, 8) ,(3, 1301180400, 9)" + i_tzt="$i_tzt ,(3, 1319929200, 8) ,(3, 1332630000, 9)" + i_tzt="$i_tzt ,(3, 1351378800, 8) ,(3, 1364684400, 9)" + i_tzt="$i_tzt ,(3, 1382828400, 8) ,(3, 1396134000, 9)" + i_tzt="$i_tzt ,(3, 1414278000, 8) ,(3, 1427583600, 9)" + i_tzt="$i_tzt ,(3, 1445727600, 8) ,(3, 1459033200, 9)" + i_tzt="$i_tzt ,(3, 1477782000, 8) ,(3, 1490482800, 9)" + i_tzt="$i_tzt ,(3, 1509231600, 8) ,(3, 1521932400, 9)" + i_tzt="$i_tzt ,(3, 1540681200, 8) ,(3, 1553986800, 9)" + i_tzt="$i_tzt ,(3, 1572130800, 8) ,(3, 1585436400, 9)" + i_tzt="$i_tzt ,(3, 1603580400, 8) ,(3, 1616886000, 9)" + i_tzt="$i_tzt ,(3, 1635634800, 8) ,(3, 1648335600, 9)" + i_tzt="$i_tzt ,(3, 1667084400, 8) ,(3, 1679785200, 9)" + i_tzt="$i_tzt ,(3, 1698534000, 8) ,(3, 1711839600, 9)" + i_tzt="$i_tzt ,(3, 1729983600, 8) ,(3, 1743289200, 9)" + i_tzt="$i_tzt ,(3, 1761433200, 8) ,(3, 1774738800, 9)" + i_tzt="$i_tzt ,(3, 1792882800, 8) ,(3, 1806188400, 9)" + i_tzt="$i_tzt ,(3, 1824937200, 8) ,(3, 1837638000, 9)" + i_tzt="$i_tzt ,(3, 1856386800, 8) ,(3, 1869087600, 9)" + i_tzt="$i_tzt ,(3, 1887836400, 8) ,(3, 1901142000, 9)" + i_tzt="$i_tzt ,(3, 1919286000, 8) ,(3, 1932591600, 9)" + i_tzt="$i_tzt ,(3, 1950735600, 8) ,(3, 1964041200, 9)" + i_tzt="$i_tzt ,(3, 1982790000, 8) ,(3, 1995490800, 9)" + i_tzt="$i_tzt ,(3, 2014239600, 8) ,(3, 2026940400, 9)" + i_tzt="$i_tzt ,(3, 2045689200, 8) ,(3, 2058390000, 9)" + i_tzt="$i_tzt ,(3, 2077138800, 8) ,(3, 2090444400, 9)" + i_tzt="$i_tzt ,(3, 2108588400, 8) ,(3, 2121894000, 9)" + i_tzt="$i_tzt ,(3, 2140038000, 8)" + i_tzt="$i_tzt ,(4, -1688265000, 2) ,(4, -1656819048, 1)" + i_tzt="$i_tzt ,(4, -1641353448, 2) ,(4, -1627965048, 3)" + i_tzt="$i_tzt ,(4, -1618716648, 1) ,(4, -1596429048, 3)" + i_tzt="$i_tzt ,(4, -1593829848, 5) ,(4, -1589860800, 4)" + i_tzt="$i_tzt ,(4, -1542427200, 5) ,(4, -1539493200, 6)" + i_tzt="$i_tzt ,(4, -1525323600, 5) ,(4, -1522728000, 4)" + i_tzt="$i_tzt ,(4, -1491188400, 7) ,(4, -1247536800, 4)" + i_tzt="$i_tzt ,(4, 354920409, 5) ,(4, 370728010, 4)" + i_tzt="$i_tzt ,(4, 386456410, 5) ,(4, 402264011, 4)" + i_tzt="$i_tzt ,(4, 417992411, 5) ,(4, 433800012, 4)" + i_tzt="$i_tzt ,(4, 449614812, 5) ,(4, 465346812, 8)" + i_tzt="$i_tzt ,(4, 481071612, 9) ,(4, 496796413, 8)" + i_tzt="$i_tzt ,(4, 512521213, 9) ,(4, 528246013, 8)" + i_tzt="$i_tzt ,(4, 543970813, 9) ,(4, 559695613, 8)" + i_tzt="$i_tzt ,(4, 575420414, 9) ,(4, 591145214, 8)" + i_tzt="$i_tzt ,(4, 606870014, 9) ,(4, 622594814, 8)" + i_tzt="$i_tzt ,(4, 638319615, 9) ,(4, 654649215, 8)" + i_tzt="$i_tzt ,(4, 670374016, 10) ,(4, 686102416, 11)" + i_tzt="$i_tzt ,(4, 695779216, 8) ,(4, 701812816, 5)" + i_tzt="$i_tzt ,(4, 717534017, 4) ,(4, 733273217, 9)" + i_tzt="$i_tzt ,(4, 748998018, 8) ,(4, 764722818, 9)" + i_tzt="$i_tzt ,(4, 780447619, 8) ,(4, 796172419, 9)" + i_tzt="$i_tzt ,(4, 811897219, 8) ,(4, 828226820, 9)" + i_tzt="$i_tzt ,(4, 846370820, 8) ,(4, 859676420, 9)" + i_tzt="$i_tzt ,(4, 877820421, 8) ,(4, 891126021, 9)" + i_tzt="$i_tzt ,(4, 909270021, 8) ,(4, 922575622, 9)" + i_tzt="$i_tzt ,(4, 941324422, 8) ,(4, 954025222, 9)" + i_tzt="$i_tzt ,(4, 972774022, 8) ,(4, 985474822, 9)" + i_tzt="$i_tzt ,(4, 1004223622, 8) ,(4, 1017529222, 9)" + i_tzt="$i_tzt ,(4, 1035673222, 8) ,(4, 1048978822, 9)" + i_tzt="$i_tzt ,(4, 1067122822, 8) ,(4, 1080428422, 9)" + i_tzt="$i_tzt ,(4, 1099177222, 8) ,(4, 1111878022, 9)" + i_tzt="$i_tzt ,(4, 1130626822, 8) ,(4, 1143327622, 9)" + i_tzt="$i_tzt ,(4, 1162076422, 8) ,(4, 1174777222, 9)" + i_tzt="$i_tzt ,(4, 1193526022, 8) ,(4, 1206831622, 9)" + i_tzt="$i_tzt ,(4, 1224975622, 8) ,(4, 1238281222, 9)" + i_tzt="$i_tzt ,(4, 1256425222, 8) ,(4, 1269730822, 9)" + i_tzt="$i_tzt ,(4, 1288479622, 8) ,(4, 1301180422, 9)" + i_tzt="$i_tzt ,(4, 1319929222, 8) ,(4, 1332630022, 9)" + i_tzt="$i_tzt ,(4, 1351378822, 8) ,(4, 1364684422, 9)" + i_tzt="$i_tzt ,(4, 1382828422, 8) ,(4, 1396134022, 9)" + i_tzt="$i_tzt ,(4, 1414278022, 8) ,(4, 1427583622, 9)" + i_tzt="$i_tzt ,(4, 1445727622, 8) ,(4, 1459033222, 9)" + i_tzt="$i_tzt ,(4, 1477782022, 8) ,(4, 1490482822, 9)" + i_tzt="$i_tzt ,(4, 1509231622, 8) ,(4, 1521932422, 9)" + i_tzt="$i_tzt ,(4, 1540681222, 8) ,(4, 1553986822, 9)" + i_tzt="$i_tzt ,(4, 1572130822, 8) ,(4, 1585436422, 9)" + i_tzt="$i_tzt ,(4, 1603580422, 8) ,(4, 1616886022, 9)" + i_tzt="$i_tzt ,(4, 1635634822, 8) ,(4, 1648335622, 9)" + i_tzt="$i_tzt ,(4, 1667084422, 8) ,(4, 1679785222, 9)" + i_tzt="$i_tzt ,(4, 1698534022, 8) ,(4, 1711839622, 9)" + i_tzt="$i_tzt ,(4, 1729983622, 8) ,(4, 1743289222, 9)" + i_tzt="$i_tzt ,(4, 1761433222, 8) ,(4, 1774738822, 9)" + i_tzt="$i_tzt ,(4, 1792882822, 8) ,(4, 1806188422, 9)" + i_tzt="$i_tzt ,(4, 1824937222, 8) ,(4, 1837638022, 9)" + i_tzt="$i_tzt ,(4, 1856386822, 8) ,(4, 1869087622, 9)" + i_tzt="$i_tzt ,(4, 1887836422, 8) ,(4, 1901142022, 9)" + i_tzt="$i_tzt ,(4, 1919286022, 8) ,(4, 1932591622, 9)" + i_tzt="$i_tzt ,(4, 1950735622, 8) ,(4, 1964041222, 9)" + i_tzt="$i_tzt ,(4, 1982790022, 8) ,(4, 1995490822, 9)" + i_tzt="$i_tzt ,(4, 2014239622, 8) ,(4, 2026940422, 9)" + i_tzt="$i_tzt ,(4, 2045689222, 8) ,(4, 2058390022, 9)" + i_tzt="$i_tzt ,(4, 2077138822, 8) ,(4, 2090444422, 9)" + i_tzt="$i_tzt ,(4, 2108588422, 8) ,(4, 2121894022, 9)" + i_tzt="$i_tzt ,(4, 2140038022, 8);" + fi +fi + +if test ! -f $mdata/time_zone_transition_type.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_transition_type table" 1>&2; + fi + + c_tztt="$c_tztt CREATE TABLE time_zone_transition_type (" + c_tztt="$c_tztt Time_zone_id int unsigned NOT NULL," + c_tztt="$c_tztt Transition_type_id int unsigned NOT NULL," + c_tztt="$c_tztt Offset int signed DEFAULT 0 NOT NULL," + c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," + c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," + c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" + c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1" + c_tztt="$c_tztt comment='Time zone transition types';" + + if test "$1" = "test" + then + i_tztt="$i_tztt INSERT INTO time_zone_transition_type (Time_zone_id," + i_tztt="$i_tztt Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" + i_tztt="$i_tztt (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" + i_tztt="$i_tztt ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" + i_tztt="$i_tztt ,(2, 0, 0, 0, 'UTC')" + i_tztt="$i_tztt ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" + i_tztt="$i_tztt ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" + i_tztt="$i_tztt ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" + i_tztt="$i_tztt ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" + i_tztt="$i_tztt ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');" + fi +fi + +if test ! -f $mdata/time_zone_leap_second.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_leap_second table" 1>&2; + fi + + c_tzls="$c_tzls CREATE TABLE time_zone_leap_second (" + c_tzls="$c_tzls Transition_time bigint signed NOT NULL," + c_tzls="$c_tzls Correction int signed NOT NULL," + c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" + c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1" + c_tzls="$c_tzls comment='Leap seconds information for time zones';" + + if test "$1" = "test" + then + i_tzls="$i_tzls INSERT INTO time_zone_leap_second " + i_tzls="$i_tzls (Transition_time, Correction) VALUES " + i_tzls="$i_tzls (78796800, 1) ,(94694401, 2) ,(126230402, 3)" + i_tzls="$i_tzls ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)" + i_tzls="$i_tzls ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)" + i_tzls="$i_tzls ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)" + i_tzls="$i_tzls ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)" + i_tzls="$i_tzls ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)" + i_tzls="$i_tzls ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)" + i_tzls="$i_tzls ,(915148821, 22);" + fi +fi + cat << END_OF_DATA use mysql; $c_d @@ -306,5 +634,16 @@ $c_ht $c_hc $c_hr $c_hk + +$c_tzn +$i_tzn +$c_tz +$i_tz +$c_tzt +$i_tzt +$c_tztt +$i_tztt +$c_tzls +$i_tzls END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index dabc653bcbb..41d991250c2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -179,3 +179,42 @@ name varchar(64) not null, primary key (help_keyword_id), unique index (name) ) comment='help keywords'; + +# +# Create missing time zone related tables +# + +CREATE TABLE IF NOT EXISTS time_zone_name ( +Name char(64) NOT NULL, +Time_zone_id int unsigned NOT NULL, +PRIMARY KEY Name (Name) +) DEFAULT CHARACTER SET latin1 comment='Time zone names'; + +CREATE TABLE IF NOT EXISTS time_zone ( +Time_zone_id int unsigned NOT NULL auto_increment, +Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, +PRIMARY KEY TzId (Time_zone_id) +) DEFAULT CHARACTER SET latin1 comment='Time zones'; + +CREATE TABLE IF NOT EXISTS time_zone_transition ( +Time_zone_id int unsigned NOT NULL, +Transition_time bigint signed NOT NULL, +Transition_type_id int unsigned NOT NULL, +PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) +) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; + +CREATE TABLE IF NOT EXISTS time_zone_transition_type ( +Time_zone_id int unsigned NOT NULL, +Transition_type_id int unsigned NOT NULL, +Offset int signed DEFAULT 0 NOT NULL, +Is_DST tinyint unsigned DEFAULT 0 NOT NULL, +Abbreviation char(8) DEFAULT '' NOT NULL, +PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) +) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; + +CREATE TABLE IF NOT EXISTS time_zone_leap_second ( +Transition_time bigint signed NOT NULL, +Correction int signed NOT NULL, +PRIMARY KEY TranTime (Transition_time) +) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; + -- cgit v1.2.1 From ad86016e2ff3af18892d24577e956b886bd150fd Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 23 Jun 2004 16:44:34 +0300 Subject: lower_case_table_names=2 (Keep case for table names) was not honored with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109) Make net_buffer_length visible for mysql clients (Bug #4206) --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c6e9f04fa91..7ab312baa5c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -342,7 +342,7 @@ fi echo "Installing all prepared tables" if eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb \ - $extra_arg $args" << END_OF_DATA + $args" << END_OF_DATA use mysql; $c_d $i_d -- cgit v1.2.1 From edb9af25bc6e2c514dd86d8f1a3d86e567cbb6a7 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 24 Jun 2004 09:22:45 +0200 Subject: - added mysql_tzinfo_to_sql to binary distributions --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 189796377cc..7692869c607 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -103,7 +103,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ isam/isamchk$BS isam/pack_isam$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ myisam/myisam_ftdump$BS \ - sql/mysqld$BS \ + sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ -- cgit v1.2.1 From 65fe5e7289df6f18e382fa2aeac5f521c0900bf1 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Fri, 25 Jun 2004 15:09:26 +0500 Subject: a fix (bug #4241: system_mysql_db_fix.test fails) --- scripts/mysql_fix_privilege_tables.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 69bf2bebaa8..9b1ec87b74e 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -125,6 +125,7 @@ do if test -f $i/$file then pkgdatadir=$i + break fi done -- cgit v1.2.1 From fe3bb82b2b8f4864c252fabdf798a47182b3afb3 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Fri, 25 Jun 2004 15:26:50 +0500 Subject: Changed a comment. --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 9b1ec87b74e..f841a21b788 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -118,7 +118,7 @@ then cmd="cat" fi -# Find where mysql_fix_privilege_tables.sql is located +# Find where first mysql_fix_privilege_tables.sql is located for i in $basedir/support-files $basedir/share $basedir/share/mysql \ $basedir/scripts @pkgdatadir@ . ./scripts do -- cgit v1.2.1 From f6765146c1b97bbb71f79adbd275dc2b6ca79333 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 25 Jun 2004 18:49:36 +0300 Subject: Added missing root user to mysql.user on windows. (Bug #4242) Set default max_allowed_packet to be able to read help tables even if an my.cnf file with this option is present. (Bug #3938) Don't use default arguments for ha_rnd_init() Simple code cleanups since last pull --- scripts/fill_func_tables.sh | 0 scripts/make_win_src_distribution.sh | 3 +-- scripts/mysql_create_system_tables.sh | 5 +++-- scripts/mysql_install_db.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 scripts/fill_func_tables.sh mode change 100755 => 100644 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh old mode 100755 new mode 100644 diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh old mode 100755 new mode 100644 index f6102085021..e50fbf9f024 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -308,7 +308,6 @@ done ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp - unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt @@ -318,7 +317,7 @@ mv $BASE/README $BASE/README.txt if [ -d $BASE/SSL/SCCS ] then - find $BASE -type d -name SCCS | xargs rm -r -f + find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi # diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 85835498bc1..9ab5734d549 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -154,12 +154,13 @@ then i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" = "0" then - i_u="$i_u + i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else - i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="$i_u + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 558b0e2da0c..aa5b99aebcc 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb $args" +--skip-bdb $args --max_allowed_packet=8M" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then -- cgit v1.2.1 From b87824094070854b7284115ff43d146bb980ca73 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 25 Jun 2004 18:54:43 +0300 Subject: Add missing .cnf files to windows installation (Bug #4216) --- scripts/make_win_binary_distribution.sh | 5 ++++- scripts/make_win_src_distribution.sh | 29 +++++++++++++++++------------ 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh index e5893c1eb1e..9b2cc2d7d22 100644 --- a/scripts/make_win_binary_distribution.sh +++ b/scripts/make_win_binary_distribution.sh @@ -110,6 +110,9 @@ print_debug "Copying sql-bench to $DIRNAME/bench" mkdir $DIRNAME/bench cp -fr sql-bench/* $DIRNAME/bench +print_debug "Copying support-files to $DIRNAME" +cp support-files/* $DIRNAME + # Files for bin for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll do @@ -124,7 +127,7 @@ do cp $i $DIRNAME/include done -# Windows users are used to having dbug.h +# Windows users are used to having dbug.h ? cp include/my_dbug.h $DIRNAME/include/dbug.h # Libraries found in lib_release and lib_debug diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 54c25b49035..135c2a38f87 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -178,18 +178,8 @@ 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 # @@ -287,7 +277,7 @@ for i in COPYING ChangeLog README \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ - Docs/INSTALL-BINARY + Docs/INSTALL-BINARY Docs/internals.texi do print_debug "Copying file '$i'" @@ -297,6 +287,12 @@ do fi done +# +# support files +# +mkdir $BASE/support-files +cp support-files/*.cnf $BASE/support-files + # # Raw dirs from source tree # @@ -312,7 +308,7 @@ do done # -# Fix some windows files +# Fix some windows files to avoid compiler warnings # ./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp @@ -320,6 +316,15 @@ done unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt +# +# Clean up if we did this from a bk tree +# + +if [ -d $BASE/SSL/SCCS ] +then + find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f +fi + # # Initialize the initial data directory # -- cgit v1.2.1 From a65f2afbaea2d9c886a1f0ed104a479385b6fe01 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Fri, 25 Jun 2004 19:11:46 -0700 Subject: mysql_create_system_tables.sh: fix to user table during make_win_src_distribution --- scripts/mysql_create_system_tables.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 9ab5734d549..988dcec90f8 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -160,7 +160,10 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" fi fi fi -- cgit v1.2.1 From 6fa7e370f9c754e9e4dca8818c99fe65e23117cf Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Fri, 25 Jun 2004 19:25:36 -0700 Subject: make_win_src_distribution.sh: 4.1 tree must use installshield project files due to new tables --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 856324074d9..1c00ac751d7 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -161,7 +161,7 @@ vreplace() done } -for d in 4.0.XX-gpl 4.0.XX-pro 4.0.XX-classic +for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic do cd $BASE/InstallShield/$d/String\ Tables/0009-English vreplace value.shl -- cgit v1.2.1 From 137b8517c4224f46ed0ea3f14d12f874426951c8 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Sat, 26 Jun 2004 10:57:00 +0300 Subject: Cleanup for creating windows source distribution --- scripts/make_win_src_distribution.sh | 17 ++++++++++------- scripts/mysql_create_system_tables.sh | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 1c00ac751d7..eaaf219afc4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -161,13 +161,16 @@ vreplace() done } -for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic -do - cd $BASE/InstallShield/$d/String\ Tables/0009-English - vreplace value.shl - cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent - vreplace infolist.txt -done +if test -d $BASE/InstallShield +then + for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic + do + cd $BASE/InstallShield/$d/String\ Tables/0009-English + vreplace value.shl + cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent + vreplace infolist.txt + done +fi # # Move all error message files to root directory diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 988dcec90f8..e45c0ec5571 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -160,7 +160,6 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" -- cgit v1.2.1 From 380ff9c22891960e08e2063d9e181abb69f0b9b6 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Sun, 27 Jun 2004 18:20:06 +0300 Subject: Fix to be able to cross-compile for modesto --- scripts/make_win_src_distribution.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh old mode 100755 new mode 100644 -- cgit v1.2.1 From ba22a7aaa973a9b4a36720122a91d1c0c6060fa1 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Mon, 28 Jun 2004 15:37:42 +0200 Subject: Fix for BUG#4240 "mysql_fix_privilege_tables Does not use --password properly" Pass password if it is NOT empty. Typo fixed. --- scripts/mysql_fix_privilege_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 69bf2bebaa8..5c3e1c85248 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -102,7 +102,7 @@ then fi cmd="$bindir/mysql -f --user=$user --host=$host" -if test -z "$password" ; then +if test ! -z "$password" ; then cmd="$cmd --password=$password" fi if test ! -z "$port"; then @@ -154,7 +154,7 @@ s_echo "" if test $verbose = 1 then s_echo "You can safely ignore all 'Duplicate column' and 'Unknown column' errors" - s_echo "as this just means that your tables where already up to date." + s_echo "as this just means that your tables are already up to date." s_echo "This script is safe to run even if your tables are already up to date!" s_echo "" fi -- cgit v1.2.1 From f1218f982af5701114e5007ff9d2728eac0bc7ff Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Mon, 28 Jun 2004 11:26:54 -0500 Subject: Message/comment touchup. --- scripts/mysql_fix_privilege_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index bb48d8ba5c9..f3c5c009f1c 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -155,7 +155,7 @@ s_echo "" if test $verbose = 1 then s_echo "You can safely ignore all 'Duplicate column' and 'Unknown column' errors" - s_echo "as this just means that your tables are already up to date." + s_echo "because these just mean that your tables are already up to date." s_echo "This script is safe to run even if your tables are already up to date!" s_echo "" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 41d991250c2..b578d8d06f3 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -2,7 +2,7 @@ -- for MySQL 4.0. -- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" --- as this just means that your tables where already up to date. +-- because these just mean that your tables are already up to date. -- This script is safe to run even if your tables are already up to date! -- On unix, you should use the mysql_fix_privilege_tables script to execute -- cgit v1.2.1 From 021242bc6c82d8ccab4386cd7229ec24317faede Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 6 Jul 2004 16:29:26 +0200 Subject: mysql_fix_privilege_tables.sh: various fixes (for mysql-test-run at least): * accept --no-defaults * 4.0 compatible password handling (only it no other argumensts, only if doesn't start with --) ps_3innodb.test: only run ps_3innodb.test if innodb is present mysql-test-run.sh: it's --verbose, not --verbose=1 --- scripts/mysql_fix_privilege_tables.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index f3c5c009f1c..79b4bc627b7 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -17,8 +17,24 @@ bindir="" file=mysql_fix_privilege_tables.sql +# The following test is to make this script compatible with the 4.0 where +# the single argument could be a password +if test "$#" = 1 +then + case "$1" in + --*) ;; + *) old_style_password="$1" ; shift ;; + esac +fi + # The following code is almost identical to the code in mysql_install_db.sh +case "$1" in + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; +esac + parse_arguments() { # We only need to pass arguments through to the server if we don't # handle them here. So, we collect unrecognized options (passed on @@ -36,7 +52,7 @@ parse_arguments() { --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --sql|--sql-only) sql_only=1;; + --sql|--sql-only) sql_only=1 ;; --verbose) verbose=1 ;; --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; @@ -47,7 +63,7 @@ parse_arguments() { then # This sed command makes sure that any special chars are quoted, # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'` fi ;; esac @@ -94,11 +110,9 @@ else fi 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" then - password=`echo $args | sed -e 's/ *//g'` + password=$old_style_password fi cmd="$bindir/mysql -f --user=$user --host=$host" -- cgit v1.2.1 From 8064f06562089d07bae3d3868c522a917fea484a Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 9 Jul 2004 14:30:51 +0200 Subject: mysqlhotcopy: fix MYI copying with scp safer tempfile creation --- scripts/mysqlhotcopy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 6388855eaa6..af4e6084c59 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -8,6 +8,7 @@ use File::Path; use DBI; use Sys::Hostname; use File::Copy; +use File::Temp; =head1 NAME @@ -626,7 +627,6 @@ sub copy_files { sub copy_index { my ($method, $files, $source, $target) = @_; - my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; print "Copying indices for ".@$files." files...\n" unless $opt{quiet}; foreach my $file (@$files) @@ -652,23 +652,23 @@ sub copy_index } close OUTPUT || die "Error on close of $to: $!\n"; } - elsif ($opt{method} eq 'scp') + elsif ($opt{method} =~ /^scp\b/) { - my $tmp=$tmpfile; - open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n"; - if (syswrite(OUTPUT,$buff) != length($buff)) + my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir); + die "Can\'t create/open file in $opt_tmpdir\n"; + if (syswrite($fh,$buff) != length($buff)) { die "Error when writing data to $tmp: $!\n"; } - close OUTPUT || die "Error on close of $tmp: $!\n"; - safe_system("scp $tmp $to"); + close $fh || die "Error on close of $tmp: $!\n"; + safe_system("$opt{method} $tmp $to"); + unlink $tmp; } else { die "Can't use unsupported method '$opt{method}'\n"; } } - unlink "$tmpfile" if ($opt{method} eq 'scp'); } -- cgit v1.2.1 From 791bdf2c480188119a0666423bef1ea3a3adadaf Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Wed, 14 Jul 2004 11:33:00 -0500 Subject: mysql_fix_privilege_tables.sh: Language fixups. --- scripts/mysql_fix_privilege_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 79b4bc627b7..c9e8e0c4dfd 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -159,11 +159,11 @@ s_echo() fi } -s_echo "This scripts updates all the mysql privilege tables to be usable by" +s_echo "This script updates all the mysql privilege tables to be usable by" s_echo "MySQL 4.0 and above." s_echo "" s_echo "This is needed if you want to use the new GRANT functions," -s_echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 4.1" +s_echo "CREATE AGGREGATE FUNCTION, or the more secure passwords in 4.1" s_echo "" if test $verbose = 1 -- cgit v1.2.1 From 5b3c418b4835c688b0859a3e82d0280cd177e52a Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 15 Jul 2004 04:19:07 +0300 Subject: After merge fixes Note: The following tests fails - fulltext (Sergei has promised to fix) - rpl_charset (Guilhem should fix) - rpl_timezone (Dimitray has promised to fix) Sanja needs to check out the calling of close_thread_tables() in sp_head.cc --- scripts/mysql_fix_privilege_tables.sh | 45 ++++++++++++++--------------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 79b4bc627b7..6a0618fc1b5 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -7,13 +7,14 @@ password="" host="localhost" user="root" sql_only=0 -basedir="" +basedir="@prefix@" verbose=0 args="" port="" socket="" database="mysql" bindir="" +pkgdatadir="@pkgdatadir@" file=mysql_fix_privilege_tables.sql @@ -85,34 +86,23 @@ done parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` parse_arguments PICK-ARGS-FROM-ARGV "$@" -if test -z "$basedir" +if test -z "$password" then - basedir=@prefix@ - if test -z "$bindir" - then - bindir=@bindir@ - fi - execdir=@libexecdir@ - pkgdatadir=@pkgdatadir@ -else - if test -z "$bindir" - then - bindir="$basedir/bin" - fi - if test -x "$basedir/libexec/mysqld" - then - execdir="$basedir/libexec" - elif test -x "@libexecdir@/mysqld" - then - execdir="@libexecdir@" - else - execdir="$basedir/bin" - fi + password=$old_style_password fi -if test -z "$password" +# Find where 'mysql' command is located + +if test -z "$bindir" then - password=$old_style_password + for i in @bindir@ $basedir/bin client + do + if test -f $i/mysql + then + bindir=$i + break + fi + done fi cmd="$bindir/mysql -f --user=$user --host=$host" @@ -134,7 +124,7 @@ fi # Find where first mysql_fix_privilege_tables.sql is located for i in $basedir/support-files $basedir/share $basedir/share/mysql \ - $basedir/scripts @pkgdatadir@ . ./scripts + $basedir/scripts $pkgdatadir . ./scripts do if test -f $i/$file then @@ -163,7 +153,8 @@ s_echo "This scripts updates all the mysql privilege tables to be usable by" s_echo "MySQL 4.0 and above." s_echo "" s_echo "This is needed if you want to use the new GRANT functions," -s_echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 4.1" +s_echo "CREATE AGGREGATE FUNCTION, use stored procedures or want to use the" +s_echo "more secure passwords in 4.1" s_echo "" if test $verbose = 1 -- cgit v1.2.1 From fe2425b7254bd403f607ad53990213e9948b6e16 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 15 Jul 2004 21:18:31 +0200 Subject: - Avoid the error message "Can't read index header from..." when copying a small index file because the value returned for $length is < 1024. This can happen if the filehandle was open()ed as an UTF-8 encoded file with Unicode characters (In this case read() returns characters not bytes) (Thanks to Mike Bethune) for this hint) --- scripts/mysqlhotcopy.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index af4e6084c59..fe93aa5a1bc 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -635,6 +635,7 @@ sub copy_index my $to="$target/$file"; my $buff; open(INPUT, "<$from") || die "Can't open file $from: $!\n"; + binmode(INPUT, ":raw"); my $length=read INPUT, $buff, 2048; die "Can't read index header from $from\n" if ($length < 1024); close INPUT; -- cgit v1.2.1 From 9336d36cf81f404088844fc31918887799d3da03 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Fri, 16 Jul 2004 01:15:55 +0300 Subject: VIEW two TABLE_LIST copy eliminated --- scripts/mysql_fix_privilege_tables.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 83b802ee567..ff872338c0f 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -144,6 +144,19 @@ alter table user comment='Users and global privileges'; alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; +# +# Create VIEWs privrlages (v5.0) +# +ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; + +# +# Show VIEWs privrlages (v5.0) +# +ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; # # Create some possible missing tables -- cgit v1.2.1 From 166a9ab465567398b8b97e3a7fd4641a50dee33a Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Fri, 16 Jul 2004 12:25:26 +0300 Subject: changes in system db creation procedure for view privileges --- scripts/mysql_create_system_tables.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 87f49107a40..99e997d6adc 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -67,13 +67,15 @@ then c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d )" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');" + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y');" fi if test ! -f $mdata/host.frm @@ -97,6 +99,8 @@ then c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h )" c_h="$c_h comment='Host privileges; Merged with database privileges';" @@ -133,6 +137,8 @@ then c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," @@ -146,24 +152,24 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" fi fi fi -- cgit v1.2.1 From d74b122fd9bbba954aece964acda6bb7dbd9fa52 Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Sun, 18 Jul 2004 22:11:47 -0500 Subject: mysql_fix_privilege_tables.sql: Fix typo in comments. --- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index ff872338c0f..1869f87239b 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -145,14 +145,14 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; # -# Create VIEWs privrlages (v5.0) +# Create VIEWs privilages (v5.0) # ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; # -# Show VIEWs privrlages (v5.0) +# Show VIEWs privilages (v5.0) # ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -- cgit v1.2.1 From 849de1e629f40f4642f8d1bdb4fe7744ce90610b Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Sun, 18 Jul 2004 22:16:42 -0500 Subject: mysql_fix_privilege_tables.sql: Fix the other typo, too. :-) --- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 1869f87239b..3e7a2f12f3e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -145,14 +145,14 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; # -# Create VIEWs privilages (v5.0) +# Create VIEWs privileges (v5.0) # ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; # -# Show VIEWs privilages (v5.0) +# Show VIEWs privileges (v5.0) # ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -- cgit v1.2.1 From 0b8fd9d66dcc2285d96de5c1400d871752523ca5 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 23 Jul 2004 12:44:09 +0200 Subject: - match shared library file name suffixes on Mac OS X (.dylib) and HP-UX (.sl) for creating "mysql-shared" packages there --- scripts/make_sharedlib_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh index 4104a315296..fbc945e445a 100644 --- a/scripts/make_sharedlib_distribution.sh +++ b/scripts/make_sharedlib_distribution.sh @@ -45,8 +45,10 @@ fi mkdir -p $BASE/lib for i in \ - libmysql/.libs/libmysqlclient.so* \ - libmysql_r/.libs/libmysqlclient_r.so* + libmysql/.libs/libmysqlclient.s{l,o}* \ + libmysql/.libs/libmysqlclient*.dylib \ + libmysql_r/.libs/libmysqlclient_r.s{l,o}* \ + libmysql_r/.libs/libmysqlclient_r*.dylib do if [ -f $i ] then -- cgit v1.2.1 From 0d0a50ce6a2743a1ec5806e8535d5b4e0b4efe99 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Thu, 29 Jul 2004 23:33:23 +0200 Subject: language fix --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7ab312baa5c..f9f3160d220 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -143,7 +143,7 @@ then resolved=`$bindir/resolveip localhost 2>&1` if [ $? -ne 0 ] then - echo "Neither host '$hostname' and 'localhost' could not be looked up with" + echo "Neither host '$hostname' nor 'localhost' could not be looked up with" echo "$bindir/resolveip" echo "Please configure the 'hostname' command to return a correct hostname." echo "If you want to solve this at a later stage, restart this script with" -- cgit v1.2.1 From e5cb60dcaad6a17a6368321e7a02ed9299c8c5ac Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 5 Aug 2004 01:54:04 +0200 Subject: - applied the required changes to create the FOSS License exception file "EXCEPTIONS" and include it in the source and binary distributions --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ea64f5ccfbd..d78a7ee28b9 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -86,7 +86,7 @@ do done for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - MySQLEULA.txt LICENSE.doc README.NW + EXCEPTIONS MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then -- cgit v1.2.1 From 26f0fdd5e8c8ddf745105f823cd2dfadc9e02a70 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 5 Aug 2004 11:22:02 +0200 Subject: - More changes to include the FLOSS License Exception in the various distributions --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 135c2a38f87..8837628a1a5 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -272,7 +272,7 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING ChangeLog README \ +for i in COPYING ChangeLog README EXCEPTIONS\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ -- cgit v1.2.1 From 1097805cf2bdf833f7d07886c7a35b9af54ba068 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 5 Aug 2004 17:05:11 +0200 Subject: - rename: EXCEPTIONS->EXCEPTIONS-CLIENT --- scripts/make_binary_distribution.sh | 2 +- scripts/make_win_src_distribution.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d78a7ee28b9..8ea9a16f56b 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -86,7 +86,7 @@ do done for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - EXCEPTIONS MySQLEULA.txt LICENSE.doc README.NW + EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8837628a1a5..9aca62527e6 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -272,7 +272,7 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING ChangeLog README EXCEPTIONS\ +for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ -- cgit v1.2.1 From f49d4f5350299e31ec4176210e2d457795fb5ed8 Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Tue, 10 Aug 2004 12:42:31 +0400 Subject: Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server". Instead of trying to open time zone tables during calculation of CONVERT_TZ() function or setting of @@time_zone variable we should open and lock them with the rest of statement's table (so we should add them to global table list) and after that use such pre-opened tables for loading info about time zones. --- scripts/mysql_create_system_tables.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index e45c0ec5571..7a30bcdbeca 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -307,7 +307,8 @@ then then i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" i_tzn="$i_tzn ('MET', 1), ('UTC', 2), ('Universal', 2), " - i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4);" + i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4), " + i_tzn="$i_tzn ('Japan', 5);" fi fi @@ -327,7 +328,7 @@ then if test "$1" = "test" then i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" - i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');" + i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');" fi fi @@ -546,7 +547,8 @@ then i_tzt="$i_tzt ,(4, 2045689222, 8) ,(4, 2058390022, 9)" i_tzt="$i_tzt ,(4, 2077138822, 8) ,(4, 2090444422, 9)" i_tzt="$i_tzt ,(4, 2108588422, 8) ,(4, 2121894022, 9)" - i_tzt="$i_tzt ,(4, 2140038022, 8);" + i_tzt="$i_tzt ,(4, 2140038022, 8)" + i_tzt="$i_tzt ,(5, -1009875600, 1);" fi fi @@ -584,7 +586,8 @@ then i_tztt="$i_tztt ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" i_tztt="$i_tztt ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" i_tztt="$i_tztt ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" - i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');" + i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');" fi fi -- cgit v1.2.1 From b49b5e9c68364e86be885eaec9cde6c380eb263e Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 10 Aug 2004 16:34:29 +0200 Subject: disable safe-updates for mysql_fix_privilege_tables --- scripts/mysql_fix_privilege_tables.sql | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index bfff05151e5..6e1fd0d1be5 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,6 +9,8 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' +SET SQL_SAFE_UPDATES=0; + USE mysql; ALTER TABLE user type=MyISAM; ALTER TABLE db type=MyISAM; -- cgit v1.2.1 From 521643c85a248bc7e664b811618030c565cedd19 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 27 Aug 2004 21:12:53 +0500 Subject: Bu#4526 building with utf8_bin collation causes help to be case sensitive --- scripts/mysql_create_system_tables.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 7a30bcdbeca..5a6ea6025f2 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -231,11 +231,11 @@ then c_ht="$c_ht CREATE TABLE help_topic (" c_ht="$c_ht help_topic_id int unsigned not null," - c_ht="$c_ht name varchar(64) not null," + c_ht="$c_ht name nvarchar(64) not null," c_ht="$c_ht help_category_id smallint unsigned not null," c_ht="$c_ht description text not null," c_ht="$c_ht example text not null," - c_ht="$c_ht url varchar(128) not null," + c_ht="$c_ht url nvarchar(128) not null," c_ht="$c_ht primary key (help_topic_id)," c_ht="$c_ht unique index (name)" c_ht="$c_ht )" @@ -252,9 +252,9 @@ then c_hc="$c_hc CREATE TABLE help_category (" c_hc="$c_hc help_category_id smallint unsigned not null," - c_hc="$c_hc name varchar(64) not null," + c_hc="$c_hc name nvarchar(64) not null," c_hc="$c_hc parent_category_id smallint unsigned null," - c_hc="$c_hc url varchar(128) not null," + c_hc="$c_hc url nvarchar(128) not null," c_hc="$c_hc primary key (help_category_id)," c_hc="$c_hc unique index (name)" c_hc="$c_hc )" @@ -269,7 +269,7 @@ then c_hk="$c_hk CREATE TABLE help_keyword (" c_hk="$c_hk help_keyword_id int unsigned not null," - c_hk="$c_hk name varchar(64) not null," + c_hk="$c_hk name nvarchar(64) not null," c_hk="$c_hk primary key (help_keyword_id)," c_hk="$c_hk unique index (name)" c_hk="$c_hk )" -- cgit v1.2.1 From e27714591161894ee4a2e966ff142cb91a547052 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Tue, 31 Aug 2004 18:59:41 -0700 Subject: mysqld_safe.sh: bug #5001, added conditional if to test if port set, then only kill the processes for this port, not all processes (in the case of this bug where multiple servers are killed.) The change to the 'grep' to make sure mysqld_safe isn't killed was per Serg's discovery that mysqld_safe would get killed. In my testing, in killing one of the pids for a running server, the "if test ! -f $pid_file" was the case that evaluated as true, so in order to test, I had to comment that block out. --- scripts/mysqld_safe.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 7b77bf449cd..8ad2ee1df4d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -311,6 +311,7 @@ do fi if test ! -f $pid_file # This is removed if normal shutdown then + echo "STOPPING server from pid file $pid_file" break fi @@ -321,12 +322,24 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` + if test -n "$mysql_tcp_port" + then + numofproces=`ps xa | grep -v "grep" | grep $ledir/$MYSQLD| grep -c "port=$mysql_tcp_port"` + else + numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` + fi + echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'` + if test -n "$mysql_tcp_port" + then + PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "port=$mysql_tcp_port" | sed -n '$p'` + else + PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | sed -n '$p'` + fi + for T in $PROC do break -- cgit v1.2.1 From f37df2fdcc472d179ecfbe9d2b39ac2416721023 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 2 Sep 2004 12:34:27 +0500 Subject: Bug#4338 mysql-test-run fails if compiled with non-latin1 character set --- scripts/mysql_create_system_tables.sh | 35 +++++++++++++++++++++++---------- scripts/mysql_fix_privilege_tables.sql | 36 +++++++++++++++++----------------- 2 files changed, 43 insertions(+), 28 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5a6ea6025f2..e95d65a1224 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -69,6 +69,7 @@ then c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d )" + c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" c_d="$c_d comment='Database privileges';" i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); @@ -98,6 +99,7 @@ then c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h )" + c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" c_h="$c_h comment='Host privileges; Merged with database privileges';" fi @@ -141,6 +143,7 @@ then c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u PRIMARY KEY Host (Host,User)" c_u="$c_u )" + c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin" c_u="$c_u comment='Users and global privileges';" if test "$1" = "test" @@ -180,6 +183,7 @@ then c_f="$c_f type enum ('function','aggregate') NOT NULL," c_f="$c_f PRIMARY KEY (name)" c_f="$c_f )" + c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" c_f="$c_f comment='User defined functions';" fi @@ -201,6 +205,7 @@ then c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" c_t="$c_t )" + c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin" c_t="$c_t comment='Table privileges';" fi @@ -220,6 +225,7 @@ then c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c )" + c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" c_c="$c_c comment='Column privileges';" fi @@ -231,14 +237,15 @@ then c_ht="$c_ht CREATE TABLE help_topic (" c_ht="$c_ht help_topic_id int unsigned not null," - c_ht="$c_ht name nvarchar(64) not null," + c_ht="$c_ht name varchar(64) not null," c_ht="$c_ht help_category_id smallint unsigned not null," c_ht="$c_ht description text not null," c_ht="$c_ht example text not null," - c_ht="$c_ht url nvarchar(128) not null," + c_ht="$c_ht url varchar(128) not null," c_ht="$c_ht primary key (help_topic_id)," c_ht="$c_ht unique index (name)" c_ht="$c_ht )" + c_ht="$c_ht CHARACTER SET utf8" c_ht="$c_ht comment='help topics';" fi @@ -252,12 +259,13 @@ then c_hc="$c_hc CREATE TABLE help_category (" c_hc="$c_hc help_category_id smallint unsigned not null," - c_hc="$c_hc name nvarchar(64) not null," + c_hc="$c_hc name varchar(64) not null," c_hc="$c_hc parent_category_id smallint unsigned null," - c_hc="$c_hc url nvarchar(128) not null," + c_hc="$c_hc url varchar(128) not null," c_hc="$c_hc primary key (help_category_id)," c_hc="$c_hc unique index (name)" c_hc="$c_hc )" + c_hc="$c_hc CHARACTER SET utf8" c_hc="$c_hc comment='help categories';" fi @@ -269,10 +277,11 @@ then c_hk="$c_hk CREATE TABLE help_keyword (" c_hk="$c_hk help_keyword_id int unsigned not null," - c_hk="$c_hk name nvarchar(64) not null," + c_hk="$c_hk name varchar(64) not null," c_hk="$c_hk primary key (help_keyword_id)," c_hk="$c_hk unique index (name)" c_hk="$c_hk )" + c_hk="$c_hk CHARACTER SET utf8" c_hk="$c_hk comment='help keywords';" fi @@ -287,6 +296,7 @@ then c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword," c_hr="$c_hr primary key (help_keyword_id, help_topic_id)" c_hr="$c_hr )" + c_hr="$c_hr CHARACTER SET utf8" c_hr="$c_hr comment='keyword-topic relation';" fi @@ -300,7 +310,8 @@ then c_tzn="$c_tzn Name char(64) NOT NULL," c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," c_tzn="$c_tzn PRIMARY KEY Name (Name)" - c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1" + c_tzn="$c_tzn )" + c_tzn="$c_tzn CHARACTER SET utf8" c_tzn="$c_tzn comment='Time zone names';" if test "$1" = "test" @@ -322,7 +333,8 @@ then c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" - c_tz="$c_tz ) DEFAULT CHARACTER SET latin1" + c_tz="$c_tz )" + c_tz="$c_tz CHARACTER SET utf8" c_tz="$c_tz comment='Time zones';" if test "$1" = "test" @@ -343,7 +355,8 @@ then c_tzt="$c_tzt Transition_time bigint signed NOT NULL," c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" - c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1" + c_tzt="$c_tzt )" + c_tzt="$c_tzt CHARACTER SET utf8" c_tzt="$c_tzt comment='Time zone transitions';" if test "$1" = "test" @@ -565,7 +578,8 @@ then c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" - c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1" + c_tztt="$c_tztt )" + c_tztt="$c_tztt CHARACTER SET utf8" c_tztt="$c_tztt comment='Time zone transition types';" if test "$1" = "test" @@ -601,7 +615,8 @@ then c_tzls="$c_tzls Transition_time bigint signed NOT NULL," c_tzls="$c_tzls Correction int signed NOT NULL," c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" - c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1" + c_tzls="$c_tzls )" + c_tzts="$c_tzts CHARACTER SET utf8" c_tzls="$c_tzls comment='Leap seconds information for time zones';" if test "$1" = "test" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index b578d8d06f3..a60d987f8b5 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,12 +9,12 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -ALTER TABLE user type=MyISAM; -ALTER TABLE db type=MyISAM; -ALTER TABLE host type=MyISAM; -ALTER TABLE func type=MyISAM; -ALTER TABLE columns_priv type=MyISAM; -ALTER TABLE tables_priv type=MyISAM; +ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user change Password Password char(41) binary not null; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS func ( dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name) -); +) CHARACTER SET utf8 COLLATE utf8_bin; -- Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; @@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) -); +) CHARACTER SET utf8 COLLATE utf8_bin; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, @@ -74,7 +74,7 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) -); +) CHARACTER SET utf8 COLLATE utf8_bin; -- @@ -156,7 +156,7 @@ description text not null, example text not null, url varchar(128) not null, primary key (help_topic_id), unique index (name) -) comment='help topics'; +) CHARACTER SET utf8 comment='help topics'; CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, @@ -165,20 +165,20 @@ parent_category_id smallint unsigned null, url varchar(128) not null, primary key (help_category_id), unique index (name) -) comment='help categories'; +) CHARACTER SET utf8 comment='help categories'; CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) -) comment='keyword-topic relation'; +) CHARACTER SET utf8 comment='keyword-topic relation'; CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name varchar(64) not null, primary key (help_keyword_id), unique index (name) -) comment='help keywords'; +) CHARACTER SET utf8 comment='help keywords'; # # Create missing time zone related tables @@ -188,20 +188,20 @@ CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) -) DEFAULT CHARACTER SET latin1 comment='Time zone names'; +) CHARACTER SET utf8 comment='Time zone names'; CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) -) DEFAULT CHARACTER SET latin1 comment='Time zones'; +) CHARACTER SET utf8 comment='Time zones'; CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) -) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; +) CHARACTER SET utf8 comment='Time zone transitions'; CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, @@ -210,11 +210,11 @@ Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) -) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; +) CHARACTER SET utf8 comment='Time zone transition types'; CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) -) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; +) CHARACTER SET utf8 comment='Leap seconds information for time zones'; -- cgit v1.2.1 From e66d0fa7d83339880c72e84181794c9851babe18 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 3 Sep 2004 17:20:00 +0200 Subject: add engine=MyISAM to all create table statements in mysql_create_system_tables, just in case --- scripts/mysql_create_system_tables.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5a6ea6025f2..04d3a1e07e1 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -68,7 +68,7 @@ then c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" - c_d="$c_d )" + c_d="$c_d ) engine=MyISAM" c_d="$c_d comment='Database privileges';" i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); @@ -97,7 +97,7 @@ then c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" - c_h="$c_h )" + c_h="$c_h ) engine=MyISAM" c_h="$c_h comment='Host privileges; Merged with database privileges';" fi @@ -140,7 +140,7 @@ then c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u PRIMARY KEY Host (Host,User)" - c_u="$c_u )" + c_u="$c_u ) engine=MyISAM" c_u="$c_u comment='Users and global privileges';" if test "$1" = "test" @@ -179,7 +179,7 @@ then c_f="$c_f dl char(128) DEFAULT '' NOT NULL," c_f="$c_f type enum ('function','aggregate') NOT NULL," c_f="$c_f PRIMARY KEY (name)" - c_f="$c_f )" + c_f="$c_f ) engine=MyISAM" c_f="$c_f comment='User defined functions';" fi @@ -200,7 +200,7 @@ then c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" - c_t="$c_t )" + c_t="$c_t ) engine=MyISAM" c_t="$c_t comment='Table privileges';" fi @@ -219,7 +219,7 @@ then c_c="$c_c Timestamp timestamp(14)," c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" - c_c="$c_c )" + c_c="$c_c ) engine=MyISAM" c_c="$c_c comment='Column privileges';" fi @@ -238,7 +238,7 @@ then c_ht="$c_ht url nvarchar(128) not null," c_ht="$c_ht primary key (help_topic_id)," c_ht="$c_ht unique index (name)" - c_ht="$c_ht )" + c_ht="$c_ht ) engine=MyISAM" c_ht="$c_ht comment='help topics';" fi @@ -257,7 +257,7 @@ then c_hc="$c_hc url nvarchar(128) not null," c_hc="$c_hc primary key (help_category_id)," c_hc="$c_hc unique index (name)" - c_hc="$c_hc )" + c_hc="$c_hc ) engine=MyISAM" c_hc="$c_hc comment='help categories';" fi @@ -272,7 +272,7 @@ then c_hk="$c_hk name nvarchar(64) not null," c_hk="$c_hk primary key (help_keyword_id)," c_hk="$c_hk unique index (name)" - c_hk="$c_hk )" + c_hk="$c_hk ) engine=MyISAM" c_hk="$c_hk comment='help keywords';" fi @@ -286,7 +286,7 @@ then c_hr="$c_hr help_topic_id int unsigned not null references help_topic," c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword," c_hr="$c_hr primary key (help_keyword_id, help_topic_id)" - c_hr="$c_hr )" + c_hr="$c_hr ) engine=MyISAM" c_hr="$c_hr comment='keyword-topic relation';" fi @@ -300,7 +300,7 @@ then c_tzn="$c_tzn Name char(64) NOT NULL," c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," c_tzn="$c_tzn PRIMARY KEY Name (Name)" - c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1" + c_tzn="$c_tzn ) engine=MyISAM DEFAULT CHARACTER SET latin1" c_tzn="$c_tzn comment='Time zone names';" if test "$1" = "test" @@ -322,7 +322,7 @@ then c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" - c_tz="$c_tz ) DEFAULT CHARACTER SET latin1" + c_tz="$c_tz ) engine=MyISAM DEFAULT CHARACTER SET latin1" c_tz="$c_tz comment='Time zones';" if test "$1" = "test" @@ -343,7 +343,7 @@ then c_tzt="$c_tzt Transition_time bigint signed NOT NULL," c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" - c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1" + c_tzt="$c_tzt ) engine=MyISAM DEFAULT CHARACTER SET latin1" c_tzt="$c_tzt comment='Time zone transitions';" if test "$1" = "test" @@ -565,7 +565,7 @@ then c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" - c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1" + c_tztt="$c_tztt ) engine=MyISAM DEFAULT CHARACTER SET latin1" c_tztt="$c_tztt comment='Time zone transition types';" if test "$1" = "test" @@ -601,7 +601,7 @@ then c_tzls="$c_tzls Transition_time bigint signed NOT NULL," c_tzls="$c_tzls Correction int signed NOT NULL," c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" - c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1" + c_tzls="$c_tzls ) engine=MyISAM DEFAULT CHARACTER SET latin1" c_tzls="$c_tzls comment='Leap seconds information for time zones';" if test "$1" = "test" -- cgit v1.2.1 From 707def6fd0914e673cd9bde1271a59de2af5ef2c Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 7 Sep 2004 13:48:38 +0200 Subject: better fix for bug#5001 --- scripts/mysqld_safe.sh | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 8ad2ee1df4d..b9e7ce21f79 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -322,36 +322,26 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - if test -n "$mysql_tcp_port" - then - numofproces=`ps xa | grep -v "grep" | grep $ledir/$MYSQLD| grep -c "port=$mysql_tcp_port"` - else - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` - fi + numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - if test -n "$mysql_tcp_port" + PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` + + for T in $PROC + do + break + done + # echo "TEST $I - $T **" + if kill -9 $T then - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "port=$mysql_tcp_port" | sed -n '$p'` - else - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | sed -n '$p'` + echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log + else + break fi - - for T in $PROC - do - break - done - # echo "TEST $I - $T **" - if kill -9 $T - then - echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log - else - break - fi - I=`expr $I + 1` + I=`expr $I + 1` done fi echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log @@ -359,3 +349,4 @@ done echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log echo "" | tee -a $err_log + -- cgit v1.2.1 From 2eec5d460dea693de5e4982f6f12f9f7a05213dd Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Fri, 10 Sep 2004 19:55:43 +0500 Subject: Fix for bug #5396(libmysql depends on SSL) Since libmysqld has libmysql's capabilities it needs lssl to compile --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index aa7af1cb2c6..86cbe944416 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,7 +92,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@ $client_libs" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about -- cgit v1.2.1 From 3c239d0bec7ef2054a7f59f9fdbac9e506bf1cef Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Sat, 11 Sep 2004 18:46:06 +0300 Subject: fixed privilege system upgrade script, to allow VIEW privileges for used who have CREATE privilege (BUG#5329) --- scripts/mysql_fix_privilege_tables.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 18dfe14bc45..5b335862584 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -144,6 +144,13 @@ alter table user comment='Users and global privileges'; alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; + +# +# Detect whether we had Create_view_priv +# +SET @hadCreateViewPriv:=0; +SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; + # # Create VIEWs privileges (v5.0) # @@ -158,6 +165,11 @@ ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Creat ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +# +# Assign create/show view privileges to people who have create provileges +# +UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; + # # Create some possible missing tables # -- cgit v1.2.1 From 484d54b2317aa833e9f9edcaba584aa768387191 Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Tue, 14 Sep 2004 12:23:18 -0700 Subject: fixed bug 5531 --- scripts/mysqlhotcopy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index af4e6084c59..2256e028eb4 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -77,7 +77,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] --record_log_pos=# record slave and master status in specified db.table --chroot=# base directory of chroot jail in which mysqld operates - Try \'perldoc $0 for more complete documentation\' + Try \'perldoc $0\' for more complete documentation\' _OPTIONS sub usage { -- cgit v1.2.1 From 78fa3aeff4ee40212ccc28d87aa8031fb1773bdf Mon Sep 17 00:00:00 2001 From: "patg@krsna.patg.net" <> Date: Tue, 14 Sep 2004 14:10:29 -0700 Subject: another small change for bug 5531 --- scripts/mysqlhotcopy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 2256e028eb4..b90ca4dc7c0 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -77,7 +77,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] --record_log_pos=# record slave and master status in specified db.table --chroot=# base directory of chroot jail in which mysqld operates - Try \'perldoc $0\' for more complete documentation\' + Try \'perldoc $0\' for more complete documentation _OPTIONS sub usage { -- cgit v1.2.1 From 5488f207db3433efcbcd29431020ea4dac216e22 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.(none)" <> Date: Thu, 16 Sep 2004 08:22:22 +0000 Subject: mysql_install_db should do skip-ndbcluster set a printout in SocketClient only for debug --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index aa5b99aebcc..b4f59790e73 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb $args --max_allowed_packet=8M" +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then -- cgit v1.2.1 From be4ca46fbe308faa155fade0875fe0edaa408ddd Mon Sep 17 00:00:00 2001 From: "monty@mishka.local" <> Date: Sat, 2 Oct 2004 22:20:08 +0300 Subject: More fixes for strict mode: More tests. Better error messages. Fixed bug when checking if we updated all needed columns for INSERT. Give an error if we encounter a wrong float value during parsing. Don't print DEFAULT for columns without a default value in SHOW CREATE/SHOW FIELDS. Fixed UPDATE IGNORE when using STRICT mode. --- scripts/mysql_fix_privilege_tables.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 5b335862584..3c01b69f57e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -15,7 +15,7 @@ ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user change Password Password char(41) binary not null; +ALTER TABLE user change Password Password char(41) binary not null default ''; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, @@ -115,9 +115,9 @@ UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv -- for some users. ALTER TABLE user -ADD max_questions int(11) NOT NULL AFTER x509_subject, -ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, -ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; +ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, +ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, +ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; -- -- cgit v1.2.1 From 5db0d20b887ed5c4dea153879639e20c66fcdd9e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 5 Oct 2004 14:42:15 +0200 Subject: - Rename the *.cnf files to *.ini for the Windows source distribution --- scripts/make_win_src_distribution.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 19a5fb7276b..8385a7f9bb0 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -294,7 +294,13 @@ done # support files # mkdir $BASE/support-files -cp support-files/*.cnf $BASE/support-files + +# Rename the cnf files to .ini +for i in support-files/*.cnf +do + i=`echo $i | sed 's/.cnf$//g'` + cp $i.cnf $BASE/$i.ini +done # # Raw dirs from source tree -- cgit v1.2.1 From 7c18f064e697b388197000f78427f967ff0d7d70 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 7 Oct 2004 18:30:56 +0200 Subject: - removed the Docs/Flags and Docs/RawFlags directories - Updated Docs/Makefile.am and scripts/make_win_src_distribution.sh accordingly --- scripts/make_win_src_distribution.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8385a7f9bb0..e58d44f336b 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -306,8 +306,7 @@ done # Raw dirs from source tree # -for i in Docs/Flags scripts sql-bench SSL \ - tests +for i in scripts sql-bench SSL tests do print_debug "Copying directory '$i'" if [ -d $i ] -- cgit v1.2.1 From c73cd9ff8a91bfed583245d1096e2906d098deda Mon Sep 17 00:00:00 2001 From: "jani@a80-186-41-201.elisa-laajakaista.fi" <> Date: Thu, 7 Oct 2004 20:30:30 +0300 Subject: Fixed Bug#5575, mysqlhotcopy is broken when using --noindices --- scripts/mysqlhotcopy.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index b90ca4dc7c0..f9e29e33195 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -8,7 +8,7 @@ use File::Path; use DBI; use Sys::Hostname; use File::Copy; -use File::Temp; +use File::Temp qw(tempfile); =head1 NAME @@ -39,7 +39,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.21"; +my $VERSION = "1.22"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -654,8 +654,8 @@ sub copy_index } elsif ($opt{method} =~ /^scp\b/) { - my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir); - die "Can\'t create/open file in $opt_tmpdir\n"; + my ($fh, $tmp)= tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir) or + die "Can\'t create/open file in $opt_tmpdir\n"; if (syswrite($fh,$buff) != length($buff)) { die "Error when writing data to $tmp: $!\n"; -- cgit v1.2.1 From 4ec44183e2fc11cdf6597549b9d367b2e92672d0 Mon Sep 17 00:00:00 2001 From: "jani@a80-186-41-201.elisa-laajakaista.fi" <> Date: Thu, 7 Oct 2004 23:51:47 +0300 Subject: Fixed a bug in --log option. --- scripts/mysqld_multi.sh | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 9767976460c..b2931468e82 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.7"; +$VER="2.8"; $opt_config_file = undef(); $opt_example = 0; @@ -78,7 +78,7 @@ sub main "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") || die "Wrong option! See $my_progname --help for detailed information!\n"; - init_log(); + init_log() if (!defined($opt_log)); $groupids = $ARGV[1]; if ($opt_version) { @@ -179,45 +179,6 @@ sub init_log } } -#### -#### Init log file. Check for appropriate place for log file, in the following -#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp -#### - -sub init_log -{ - if ($my_print_defaults_exists) - { - @mysqld_opts= `my_print_defaults mysqld`; - chomp @mysqld_opts; - foreach my $opt (@mysqld_opts) - { - if ($opt =~ m/^\-\-datadir[=](.*)/) - { - if (-d "$1" && -w "$1") - { - $logdir= $1; - } - } - } - } - if (!defined($logdir)) - { - $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@"); - } - if (!defined($logdir)) - { - # Log file was not specified and we could not log to a standard place, - # so log file be disabled for now. - print "WARNING: Log file disabled. Maybe directory/file isn't writable?\n"; - $opt_no_log= 1; - } - else - { - $opt_log= "$logdir/mysqld_multi.log"; - } -} - #### #### Report living and not running MySQL servers #### -- cgit v1.2.1 From 951e54df74dce1fdf756119607ed93e8ab7f5c97 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-2.elisa-laajakaista.fi" <> Date: Fri, 8 Oct 2004 20:18:25 +0300 Subject: Changed a fatal error to a warning in case the default mysqld binary for mysqld_multi was not found. This is because it is possible to define one under each mysqldN group separately. Bailing out if mysqld binary is not found at all. Added option --silent to turn off warnings. --- scripts/mysqld_multi.sh | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index b2931468e82..01d6e4457d9 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.8"; +$VER="2.9"; $opt_config_file = undef(); $opt_example = 0; @@ -17,6 +17,7 @@ $opt_password = undef(); $opt_tcp_ip = 0; $opt_user = "root"; $opt_version = 0; +$opt_silent = 0; my $my_print_defaults_exists= 1; my $logdir= undef(); @@ -41,10 +42,13 @@ sub main { # We can't throw out yet, since --version, --help, or --example may # have been given - print "WARNING! my_print_defaults command not found!\n"; - print "Please make sure you have this command available and\n"; - print "in your path. The command is available from the latest\n"; - print "MySQL distribution.\n"; + if (!$opt_silent) + { + print "WARNING! my_print_defaults command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; + } $my_print_defaults_exists= 0; } if ($my_print_defaults_exists) @@ -75,7 +79,8 @@ sub main splice @ARGV, 0, 0, @defops; } GetOptions("help","example","version","mysqld=s","mysqladmin=s", - "config-file=s","user=s","password=s","log=s","no-log","tcp-ip") + "config-file=s","user=s","password=s","log=s","no-log","tcp-ip", + "silent") || die "Wrong option! See $my_progname --help for detailed information!\n"; init_log() if (!defined($opt_log)); @@ -86,11 +91,6 @@ sub main exit(0); } example() if ($opt_example); - if (!defined(($mysqld = my_which($opt_mysqld)))) - { - print "Couldn't find the mysqld binary! Tried: $opt_mysqld\n"; - $flag_exit=1; - } if (!defined(($mysqladmin = my_which($opt_mysqladmin)))) { print "Couldn't find the mysqladmin binary! Tried: $opt_mysqladmin\n"; @@ -132,6 +132,14 @@ sub main } elsif ($ARGV[0] eq 'start' || $ARGV[0] eq 'START') { + if (!defined(($mysqld = my_which($opt_mysqld))) && !$opt_silent) + { + print "WARNING: Couldn't find the default mysqld binary. "; + print "Tried: $opt_mysqld\n"; + print "This is OK, if you are using option --mysqld= under groups"; + print " [mysqldN] separately for each.\n"; + print "(Disable warnings with --silent)\n"; + } start_mysqlds(); } else @@ -170,7 +178,10 @@ sub init_log { # Log file was not specified and we could not log to a standard place, # so log file be disabled for now. - print "WARNING: Log file disabled. Maybe directory/file isn't writable?\n"; + if (!$opt_silent) + { + print "WARNING: Log file disabled. Maybe directory or file isn't writable?\n"; + } $opt_no_log= 1; } else @@ -269,6 +280,8 @@ sub start_mysqlds() @options = `$com`; chop @options; + $mysqld_found= 1; # The default + $mysqld_found= 0 if (!length($mysqld)); $com= "$mysqld"; for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { @@ -276,6 +289,7 @@ sub start_mysqlds() { $options[$j]=~ s/\-\-mysqld\=//; $com= $options[$j]; + $mysqld_found= 1; } else { @@ -286,6 +300,15 @@ sub start_mysqlds() $com.= $tmp; $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; + if (!$mysqld_found) + { + print "\n\n"; + print "FATAL ERROR: Tried to start mysqld under group [$groups[$i]], "; + print "but no mysqld binary was found.\n"; + print "Please add --mysqld=... in group [mysqld_multi], or add it to "; + print "group [$groups[$i]] separately.\n"; + exit(1); + } system($com); } if (!$i && !$opt_no_log) @@ -678,6 +701,7 @@ Options: --no-log Print to stdout instead of the log file. By default the log file is turned on. --password=... Password for user for mysqladmin. +--silent Disable warnings. --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be -- cgit v1.2.1 From edc4b65d5c156d221502295deae105231cf29cb8 Mon Sep 17 00:00:00 2001 From: "mwagner@here.mwagner.org" <> Date: Fri, 8 Oct 2004 13:38:35 -0500 Subject: mysql-test-run.sh: Look for 'client_test' in tests/ not bin/ make_binary_distribution.sh: Copy 'client_test' into the dist --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 5165f63955c..9af7913999f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -187,7 +187,7 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests + $CP tests/client_test tests/*.res tests/*.tst tests/*.pl $BASE/tests fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 -- cgit v1.2.1 From 2450f4afa2a76882a7131b0501975e116ce0a65d Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-2.elisa-laajakaista.fi" <> Date: Sat, 9 Oct 2004 12:33:24 +0300 Subject: - Added --verbose - Made some of the warnings under --verbose only - Added possibility to add mysqladmin= under groups [mysqldN] mysqladmin=... is no longer mandatory under [mysqld_multi] - Made 'start', 'stop' and 'report' commands truly case-insensitive - Some other common places code merge and cleanup --- scripts/mysqld_multi.sh | 159 +++++++++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 68 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 01d6e4457d9..1e8a8ecb88e 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.9"; +$VER="2.10"; $opt_config_file = undef(); $opt_example = 0; @@ -18,6 +18,7 @@ $opt_tcp_ip = 0; $opt_user = "root"; $opt_version = 0; $opt_silent = 0; +$opt_verbose = 0; my $my_print_defaults_exists= 1; my $logdir= undef(); @@ -42,13 +43,10 @@ sub main { # We can't throw out yet, since --version, --help, or --example may # have been given - if (!$opt_silent) - { - print "WARNING! my_print_defaults command not found!\n"; - print "Please make sure you have this command available and\n"; - print "in your path. The command is available from the latest\n"; - print "MySQL distribution.\n"; - } + print "WARNING! my_print_defaults command not found!\n"; + print "Please make sure you have this command available and\n"; + print "in your path. The command is available from the latest\n"; + print "MySQL distribution.\n"; $my_print_defaults_exists= 0; } if ($my_print_defaults_exists) @@ -80,7 +78,7 @@ sub main } GetOptions("help","example","version","mysqld=s","mysqladmin=s", "config-file=s","user=s","password=s","log=s","no-log","tcp-ip", - "silent") + "silent","verbose") || die "Wrong option! See $my_progname --help for detailed information!\n"; init_log() if (!defined($opt_log)); @@ -91,11 +89,6 @@ sub main exit(0); } example() if ($opt_example); - if (!defined(($mysqladmin = my_which($opt_mysqladmin)))) - { - print "Couldn't find the mysqladmin binary! Tried: $opt_mysqladmin\n"; - $flag_exit=1; - } usage() if ($opt_help); if ($flag_exit) { @@ -111,9 +104,9 @@ sub main exit(1); } usage() if (!defined($ARGV[0]) || - ($ARGV[0] ne 'start' && $ARGV[0] ne 'START' && - $ARGV[0] ne 'stop' && $ARGV[0] ne 'STOP' && - $ARGV[0] ne 'report' && $ARGV[0] ne 'REPORT')); + (!($ARGV[0] =~ m/^start$/i) && + !($ARGV[0] =~ m/^stop$/i) && + !($ARGV[0] =~ m/^report$/i))); if (!$opt_no_log) { @@ -126,25 +119,34 @@ sub main print strftime "%a %b %e %H:%M:%S %Y", localtime; print "\n"; } - if ($ARGV[0] eq 'report' || $ARGV[0] eq 'REPORT') - { - report_mysqlds(); - } - elsif ($ARGV[0] eq 'start' || $ARGV[0] eq 'START') + if ($ARGV[0] =~ m/^start$/i) { - if (!defined(($mysqld = my_which($opt_mysqld))) && !$opt_silent) + if (!defined(($mysqld= my_which($opt_mysqld))) && $opt_verbose) { - print "WARNING: Couldn't find the default mysqld binary. "; + print "WARNING: Couldn't find the default mysqld binary.\n"; print "Tried: $opt_mysqld\n"; - print "This is OK, if you are using option --mysqld= under groups"; - print " [mysqldN] separately for each.\n"; - print "(Disable warnings with --silent)\n"; + print "This is OK, if you are using option \"mysqld=...\" in "; + print "groups [mysqldN] separately for each.\n\n"; } start_mysqlds(); } else { - stop_mysqlds(); + if (!defined(($mysqladmin= my_which($opt_mysqladmin))) && $opt_verbose) + { + print "WARNING: Couldn't find the default mysqladmin binary.\n"; + print "Tried: $opt_mysqladmin\n"; + print "This is OK, if you are using option \"mysqladmin=...\" in "; + print "groups [mysqldN] separately for each.\n\n"; + } + if ($ARGV[0] =~ m/^report$/i) + { + report_mysqlds(); + } + else + { + stop_mysqlds(); + } } } @@ -196,7 +198,7 @@ sub init_log sub report_mysqlds { - my (@groups, $com, $i, @options, $j, $pec); + my (@groups, $com, $i, @options, $pec); print "Reporting MySQL servers\n"; if (!$opt_no_log) @@ -206,23 +208,7 @@ sub report_mysqlds @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; - - $com = "$mysqladmin -u $opt_user"; - $com.= defined($opt_password) ? " -p$opt_password" : ""; - $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; - for ($j = 0; defined($options[$j]); $j++) - { - if ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) - { - $com.= " $options[$j]"; - } - } + $com= get_mysqladmin_options($i, @groups); $com.= " ping >> /dev/null 2>&1"; system($com); $pec = $? >> 8; @@ -261,7 +247,7 @@ sub report_mysqlds sub start_mysqlds() { - my (@groups, $com, $tmp, $i, @options, $j); + my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found); if (!$opt_no_log) { @@ -285,7 +271,11 @@ sub start_mysqlds() $com= "$mysqld"; for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { - if ("--mysqld=" eq substr($options[$j], 0, 9)) + if ("--mysqladmin=" eq substr($options[$j], 0, 13)) + { + # catch this and ignore + } + elsif ("--mysqld=" eq substr($options[$j], 0, 9)) { $options[$j]=~ s/\-\-mysqld\=//; $com= $options[$j]; @@ -302,10 +292,10 @@ sub start_mysqlds() $com.= " &"; if (!$mysqld_found) { - print "\n\n"; + print "\n"; print "FATAL ERROR: Tried to start mysqld under group [$groups[$i]], "; print "but no mysqld binary was found.\n"; - print "Please add --mysqld=... in group [mysqld_multi], or add it to "; + print "Please add \"mysqld=...\" in group [mysqld_multi], or add it to "; print "group [$groups[$i]] separately.\n"; exit(1); } @@ -324,7 +314,7 @@ sub start_mysqlds() sub stop_mysqlds() { - my (@groups, $com, $i, @options, $j); + my (@groups, $com, $i, @options); if (!$opt_no_log) { @@ -337,23 +327,7 @@ sub stop_mysqlds() @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; - - $com = "$mysqladmin -u $opt_user"; - $com.= defined($opt_password) ? " -p$opt_password" : ""; - $com.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; - for ($j = 0; defined($options[$j]); $j++) - { - if ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || - ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) - { - $com.= " $options[$j]"; - } - } + $com= get_mysqladmin_options($i, @groups); $com.= " shutdown"; $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; @@ -366,6 +340,54 @@ sub stop_mysqlds() } } +#### +#### Sub function for mysqladmin option parsing +#### + +sub get_mysqladmin_options +{ + my ($i, @groups)= @_; + my ($mysqladmin_found, $com, $tmp, $j); + + $com = "my_print_defaults"; + $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; + $com.= " $groups[$i]"; + @options = `$com`; + chop @options; + + $mysqladmin_found= 1; # The default + $mysqladmin_found= 0 if (!length($mysqladmin)); + $com = "$mysqladmin"; + $tmp = " -u $opt_user"; + $tmp.= defined($opt_password) ? " -p$opt_password" : ""; + $tmp.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; + for ($j = 0; defined($options[$j]); $j++) + { + if ("--mysqladmin=" eq substr($options[$j], 0, 13)) + { + $options[$j]=~ s/\-\-mysqladmin\=//; + $com= $options[$j]; + $mysqladmin_found= 1; + } + elsif ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || + ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) + { + $tmp.= " $options[$j]"; + } + } + if (!$mysqladmin_found) + { + print "\n"; + print "FATAL ERROR: Tried to use mysqladmin in group [$groups[$i]], "; + print "but no mysqladmin binary was found.\n"; + print "Please add \"mysqladmin=...\" in group [mysqld_multi], or "; + print "in group [$groups[$i]].\n"; + exit(1); + } + $com.= $tmp; + return $com; +} + #### #### Find groups. Takes the valid group numbers as an argument, parses #### them, puts them in the ascending order, removes duplicates and @@ -702,6 +724,7 @@ Options: file is turned on. --password=... Password for user for mysqladmin. --silent Disable warnings. +--verbose Be more verbose. --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be -- cgit v1.2.1 From 26e34093c3c05d54ab0260c902e060195bc9040b Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-2.elisa-laajakaista.fi" <> Date: Sat, 9 Oct 2004 13:23:00 +0300 Subject: Added some extra information to output in case --verbose was given. --- scripts/mysqld_multi.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 1e8a8ecb88e..229cb9015f4 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -81,6 +81,12 @@ sub main "silent","verbose") || die "Wrong option! See $my_progname --help for detailed information!\n"; + if ($opt_verbose && $opt_silent) + { + print "Both --verbose and --silent has been given. Some of the warnings "; + print "will be disabled\nand some will be enabled.\n\n"; + } + init_log() if (!defined($opt_log)); $groupids = $ARGV[1]; if ($opt_version) @@ -247,7 +253,7 @@ sub report_mysqlds sub start_mysqlds() { - my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found); + my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $info_sent); if (!$opt_no_log) { @@ -287,6 +293,15 @@ sub start_mysqlds() $tmp.= " $options[$j]"; } } + if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) + { + print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; + print "safe_mysqld in order to find the actual mysqld binary.\n"; + print "ledir (library executable directory) should be the path to the "; + print "wanted mysqld binary.\n\n"; + $info_sent= 1; + } $com.= $tmp; $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; @@ -724,13 +739,13 @@ Options: file is turned on. --password=... Password for user for mysqladmin. --silent Disable warnings. ---verbose Be more verbose. --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket. --user=... MySQL user for mysqladmin. Using: $opt_user +--verbose Be more verbose. --version Print the version number and exit. EOF exit(0); -- cgit v1.2.1 From 4d55c4a321f8bd3dfc47fe23b5f38cc11972734b Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 11 Oct 2004 20:54:48 +0300 Subject: Improved mysqld_multi documentation, especially the --example section, which had gotten somewhat out-dated. --- scripts/mysqld_multi.sh | 184 ++++++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 86 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 229cb9015f4..00f46009c84 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.10"; +$VER="2.11"; $opt_config_file = undef(); $opt_example = 0; @@ -577,67 +577,73 @@ sub my_which sub example { print < mysql -u root -S /tmp/mysql.sock -proot_password -e -# "GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'multipass'" -# You will have to do the above for each mysqld running in each data -# directory, that you have (just change the socket, -S=...) -# See more detailed information from chapter: -# '6 The MySQL Access Privilege System' from the MySQL manual. -# 2.pid-file is very important, if you are using mysqld_safe to start mysqld -# (e.g. --mysqld=mysqld_safe) Every mysqld should have it's own pid-file. -# The advantage using mysqld_safe instead of mysqld directly here is, that -# mysqld_safe 'guards' every mysqld process and will restart it, if mysqld -# process fails due to signal kill -9, or similar. (Like segmentation fault, -# which MySQL should never do, of course ;) Please note that mysqld_safe -# script may require that you start it from a certain place. This means that -# you may have to CD to a certain directory, before you start the -# mysqld_multi. If you have problems starting, please see the script. -# Check especially the lines: -# -------------------------------------------------------------------------- -# 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 \ -# -x ./bin/mysqld -# -------------------------------------------------------------------------- -# The above test should be successful, or you may encounter problems. -# 3.Beware of the dangers starting multiple mysqlds in the same data directory. -# Use separate data directories, unless you *KNOW* what you are doing! -# 4.The socket file and the TCP/IP port must be different for every mysqld. -# 5.The first and fifth mysqld was intentionally left out from the example. -# You may have 'gaps' in the config file. This gives you more flexibility. -# The order in which the mysqlds are started or stopped depends on the order -# in which they appear in the config file. -# 6.When you want to refer to a certain group with GNR with this program, -# just use the number in the end of the group name ( [mysqld# <== ) -# 7.You may want to use option '--user' for mysqld, but in order to do this -# you need to be root when you start this script. Having the option -# in the config file doesn't matter; you will just get a warning, if you are -# not the superuser and the mysqlds are started under *your* unix account. -# IMPORTANT: Make sure that the pid-file and the data directory are -# read+write(+execute for the latter one) accessible for *THAT* UNIX user, -# who the specific mysqld process is started as. *DON'T* use the UNIX root -# account for this, unless you *KNOW* what you are doing! -# 8.MOST IMPORTANT: Make sure that you understand the meanings of the options -# that are passed to the mysqlds and why *WOULD YOU WANT* to have separate -# mysqld processes. Starting multiple mysqlds in one data directory *WON'T* -# give you extra performance in a threaded system! +# This is an example of a my.cnf file for $my_progname. +# Usually this file is located in home dir ~/.my.cnf or /etc/my.cnf # +# SOME IMPORTANT NOTES FOLLOW: +# +# 1.COMMON USER +# +# Make sure that the MySQL user, who is stopping the mysqld services, has +# the same password to all MySQL servers being accessed by $my_progname. +# This user needs to have the 'Shutdown_priv' -privilege, but for security +# reasons should have no other privileges. It is advised that you create a +# common 'multi_admin' user for all MySQL servers being controlled by +# $my_progname. Here is an example how to do it: +# +# GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'password' +# +# You will need to apply the above to all MySQL servers that are being +# controlled by $my_progname. 'multi_admin' will shutdown the servers +# using 'mysqladmin' -binary, when '$my_progname stop' is being called. +# +# 2.PID-FILE +# +# If you are using mysqld_safe to start mysqld, make sure that every +# MySQL server has a separate pid-file. In order to use mysqld_safe +# via $my_progname, you need to use two options: +# +# mysqld=/path/to/mysqld_safe +# ledir=/path/to/mysqld-binary/ +# +# ledir (library executable directory), is an option that only mysqld_safe +# accepts, so you will get an error if you try to pass it to mysqld directly. +# For this reason you might want to use the above options within [mysqld#] +# group directly. +# +# 3.DATA DIRECTORY +# +# It is NOT advised to run many MySQL servers within the same data directory. +# You can do so, but please make sure to understand and deal with the +# underlying caveats. In short they are: +# - Speed penalty +# - Risk of table/data corruption +# - Data synchronising problems between the running servers +# - Heavily disk bound +# - Relies on the system (external) file locking +# +# 4.TCP/IP Port +# +# Every server requires one and it must be unique. +# +# 5.[mysqld#] Groups +# +# In the example below the first and the fifth mysqld group was +# intentionally left out. You may have 'gaps' in the config file. This +# gives you more flexibility. +# +# 6.MySQL Server User +# +# You can pass the user=... option inside [mysqld#] groups. This +# can be very handy in some cases, but then you need to run $my_progname +# as UNIX root. +# + [mysqld_multi] mysqld = @bindir@/mysqld_safe mysqladmin = @bindir@/mysqladmin -user = root -password = your_password +user = multi_admin +password = my_password [mysqld2] socket = /tmp/mysql.sock2 @@ -645,15 +651,18 @@ port = 3307 pid-file = @localstatedir@2/hostname.pid2 datadir = @localstatedir@2 language = @datadir@/mysql/english -user = john +user = unix_user1 [mysqld3] +mysqld = /path/to/safe_mysqld/safe_mysqld +ledir = /path/to/mysqld-binary/ +mysqladmin = /path/to/mysqladmin/mysqladmin socket = /tmp/mysql.sock3 port = 3308 pid-file = @localstatedir@3/hostname.pid3 datadir = @localstatedir@3 language = @datadir@/mysql/swedish -user = monty +user = unix_user2 [mysqld4] socket = /tmp/mysql.sock4 @@ -661,16 +670,15 @@ port = 3309 pid-file = @localstatedir@4/hostname.pid4 datadir = @localstatedir@4 language = @datadir@/mysql/estonia -user = tonu +user = unix_user3 - [mysqld6] socket = /tmp/mysql.sock6 port = 3311 pid-file = @localstatedir@6/hostname.pid6 datadir = @localstatedir@6 language = @datadir@/mysql/japanese -user = jani +user = unix_user4 EOF exit(0); } @@ -691,39 +699,43 @@ Description: $my_progname can be used to start, or stop any number of separate mysqld processes running in different TCP/IP ports and UNIX sockets. -This program can read group [mysqld_multi] from my.cnf file. -You may want to put options mysqld=... and mysqladmin=... there. - -The program will search for group(s) named [mysqld#] from my.cnf (or -the given --config-file=...), where # can be any positive number -starting from 1. These groups should be the same as the usual [mysqld] -group (e.g. options to mysqld, see MySQL manual for detailed -information about this group), but with those port, socket -etc. options that are wanted for each separate mysqld processes. The -number in the group name has another function; it can be used for -starting, stopping, or reporting some specific mysqld servers with -this program. See the usage and options below for more information. +$my_progname can read group [mysqld_multi] from my.cnf file. You may +want to put options mysqld=... and mysqladmin=... there. Since +version 2.10 these options can also be given under groups [mysqld#], +which gives more control over different versions. One can have the +default mysqld and mysqladmin under group [mysqld_multi], but this is +not mandatory. Please note that if mysqld or mysqladmin is missing +from both [mysqld_multi] and [mysqld#], a group that is tried to be +used, $my_progname will abort with an error. + +$my_progname will search for groups named [mysqld#] from my.cnf (or +the given --config-file=...), where '#' can be any positive integer +starting from 1. These groups should be the same as the regular +[mysqld] group, but with those port, socket and any other options +that are to be used with each separate mysqld process. The number +in the group name has another function; it can be used for starting, +stopping, or reporting any specific mysqld server. Usage: $my_progname [OPTIONS] {start|stop|report} [GNR,GNR,GNR...] or $my_progname [OPTIONS] {start|stop|report} [GNR-GNR,GNR,GNR-GNR,...] -The GNR above means the group number. You can start, stop or report -any GNR, or several of them at the same time. (See --example) The GNRs -list can be comma separated, or a dash combined, of which the latter -means that all the GNRs between GNR1-GNR2 will be affected. Without -GNR argument all the found groups will be either started, stopped, or -reported. Note that you must not have any white spaces in the GNR -list. Anything after a white space are ignored. +The GNR means the group number. You can start, stop or report any GNR, +or several of them at the same time. (See --example) The GNRs list can +be comma separated or a dash combined. The latter means that all the +GNRs between GNR1-GNR2 will be affected. Without GNR argument all the +groups found will either be started, stopped, or reported. Note that +syntax for specifying GNRs must appear without spaces. Options: --config-file=... Alternative config file. Using: $opt_config_file ---example Give an example of a config file. +--example Give an example of a config file with extra information. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended. Using: $opt_log --mysqladmin=... mysqladmin binary to be used for a server shutdown. + Since version 2.10 this can be given within groups [mysqld#] Using: $mysqladmin --mysqld=... mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just @@ -732,19 +744,19 @@ Options: Please note: Since mysqld_multi version 2.3 you can also give this option inside groups [mysqld#] in ~/.my.cnf, where '#' stands for an integer (number) of the group in - question. This will be recognized as a special option and + question. This will be recognised as a special option and will not be passed to the mysqld. This will allow one to start different mysqld versions with mysqld_multi. --no-log Print to stdout instead of the log file. By default the log file is turned on. ---password=... Password for user for mysqladmin. +--password=... Password for mysqladmin user. --silent Disable warnings. --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket. ---user=... MySQL user for mysqladmin. Using: $opt_user +--user=... mysqladmin user. Using: $opt_user --verbose Be more verbose. --version Print the version number and exit. EOF -- cgit v1.2.1 From 900157304070ed904b51f3de61c4a39490b6bba7 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Mon, 11 Oct 2004 23:59:37 +0300 Subject: Added documentation. --- scripts/mysqld_multi.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 00f46009c84..ba46fd6fa29 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -619,8 +619,10 @@ sub example # - Speed penalty # - Risk of table/data corruption # - Data synchronising problems between the running servers -# - Heavily disk bound +# - Heavily media (disk) bound # - Relies on the system (external) file locking +# - Is not applicable with all table types. (Such as InnoDB) +# Trying so will end up with undesirable results. # # 4.TCP/IP Port # @@ -638,6 +640,23 @@ sub example # can be very handy in some cases, but then you need to run $my_progname # as UNIX root. # +# 7.A Start-up Manage Script for $my_progname +# +# In the recent MySQL distributions you can find a file called +# mysqld_multi.server.sh. It is a wrapper for $my_progname. This can +# be used to start and stop multiple servers during boot and shutdown. +# +# You can place the file in /etc/init.d/mysqld_multi.server.sh and +# make the needed symbolic links to it from various run levels +# (as per Linux/Unix standard). You may even replace the +# /etc/init.d/mysql.server script with it. +# +# Before using, you must create a my.cnf file either in /etc/my.cnf +# or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups. +# +# The script can be found from support-files/mysqld_multi.server.sh +# in MySQL distribution. (Verify the script before using) +# [mysqld_multi] mysqld = @bindir@/mysqld_safe -- cgit v1.2.1 From 4043c0f3dba2070f2b53568dace8fa6091d66ba0 Mon Sep 17 00:00:00 2001 From: "pem@mysql.comhem.se" <> Date: Thu, 14 Oct 2004 18:07:09 +0200 Subject: Implemented the stored procedure data access characteristics: NO SQL CONTAINS SQL (default) READS SQL DATA MODIFIES SQL DATA These are needed as hints for the replication. (Before this, we did have the default in the mysql.proc table, but no support in the parser.) --- scripts/mysql_create_system_tables.sh | 6 +++++- scripts/mysql_fix_privilege_tables.sql | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5a2a45c4b3d..7a4da55f851 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -644,7 +644,11 @@ then c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL," c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," - c_p="$c_p sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL," + c_p="$c_p sql_data_access enum('CONTAINS_SQL'," + c_p="$c_p 'NO_SQL'," + c_p="$c_p 'READS_SQL_DATA'," + c_p="$c_p 'MODIFIES_SQL_DATA'" + c_p="$c_p ) DEFAULT 'CONTAINS_SQL' NOT NULL," c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," c_p="$c_p param_list blob DEFAULT '' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 3c01b69f57e..cae6a1d07b9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -254,7 +254,11 @@ CREATE TABLE IF NOT EXISTS proc ( type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, - sql_data_access enum('CONTAINS_SQL') DEFAULT 'CONTAINS_SQL' NOT NULL, + sql_data_access enum('CONTAINS_SQL', + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, @@ -289,6 +293,12 @@ CREATE TABLE IF NOT EXISTS proc ( PRIMARY KEY (db,name,type) ) comment='Stored Procedures'; -# Correct the name fields to not binary +# Correct the name fields to not binary, and expand sql_data_access ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, - MODIFY specific_name char(64) DEFAULT '' NOT NULL; + MODIFY specific_name char(64) DEFAULT '' NOT NULL, + MODIFY sql_data_access + enum('CONTAINS_SQL', + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL; -- cgit v1.2.1 From 307b7e85af741dd15af2a300b3344642dfa75d14 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Wed, 20 Oct 2004 18:10:44 +0500 Subject: A fix (bug #6000 No "@%"-accounts after install). --- scripts/mysql_install_db.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f9f3160d220..c75f9854a2a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -275,14 +275,16 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + if test "$windows" = 1 + then + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost','');" + else + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname','');" + fi fi if test ! -f $mdata/func.frm -- cgit v1.2.1 From 009bf319153c920000e76c3b45e028a272ed49d4 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Fri, 22 Oct 2004 08:57:52 +0000 Subject: use the right make in make_binary_distribution --- scripts/Makefile.am | 1 + scripts/make_binary_distribution.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d4da77d0387..4158b5a34dc 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -139,6 +139,7 @@ SUFFIXES = .sh -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ + -e "s!@MAKE@!$(MAKE)!" \ $< > $@-t @CHMOD@ +x $@-t @MV@ $@-t $@ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 9af7913999f..281ef9bd469 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -267,8 +267,8 @@ fi # NDB Cluster if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; make DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; make DESTDIR=$BASE/ndb-stage install ) + ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) + ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. -- cgit v1.2.1 From 5163c03bada8cc800499284e3da9d1e4ecdcf8f0 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Wed, 27 Oct 2004 21:59:34 +0200 Subject: Fix for bug#5385 ("Text files have unix line break"): Windows style line end \r\n on README, license, and similar essential plaintext files. --- scripts/make_win_src_distribution.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index e58d44f336b..fd7884068ba 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -6,7 +6,6 @@ version=@VERSION@ export version -SOURCE=`pwd` CP="cp -p" DEBUG=0 @@ -24,6 +23,7 @@ if [ ! -f scripts/make_win_src_distribution ]; then echo "ERROR : You must run this script from the MySQL top-level directory" exit 1 fi +SOURCE=`pwd` # # Check for source compilation/configuration @@ -119,7 +119,7 @@ unix_to_dos() for arg do print_debug "Replacing LF -> CRLF from '$arg'" - cat $arg | awk '{sub(/$/,"\r");print}' > $arg.tmp + awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp rm -f $arg mv $arg.tmp $arg done @@ -138,14 +138,6 @@ if [ -d $BASE ] ; then fi $CP -r $SOURCE/VC++Files $BASE -( -find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print -)|( - while read v - do - unix_to_dos $v - done -) # # Process version tags in InstallShield files @@ -281,7 +273,6 @@ for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ Docs/INSTALL-BINARY Docs/internals.texi - do print_debug "Copying file '$i'" if [ -f $i ] @@ -322,7 +313,18 @@ done ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp -unix_to_dos $BASE/README +# +# Search the tree for plain text files and adapt the line end marker +# +find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ +| while read v + do + unix_to_dos $v + done +# File extension '.txt' matches too many other files, error messages etc. +unix_to_dos $BASE/Docs/*.txt + mv $BASE/README $BASE/README.txt # -- cgit v1.2.1 From b0510c7fd46f462f9456d16cb8cba58d1dbe12c1 Mon Sep 17 00:00:00 2001 From: "tim@siva.hindu.god" <> Date: Tue, 2 Nov 2004 17:53:25 -0700 Subject: Portability fixes to mysqld_safe for non-Linux systems. Fix FIND_PROC for Solaris test, and fix if @IS_LINUX@ test in mysqld_safe itself. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index b9e7ce21f79..da7e06f6c05 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -315,7 +315,7 @@ do break fi - if test @IS_LINUX@ -a $KILL_MYSQLD -eq 1 + if @IS_LINUX@ && test $KILL_MYSQLD -eq 1 then # Test if one process was hanging. # This is only a fix for Linux (running as base 3 mysqld processes) -- cgit v1.2.1 From 47bbf768d4bdb9ca0abd2ef94bd9a734dafeed50 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 3 Nov 2004 12:39:38 +0200 Subject: Fixes after merge with 4.1 FOUND is not a reserved keyword anymore Added Item_field::set_no_const_sub() to be able to mark fields that can't be substituted Added 'simple_select' method to be able to quickly determinate if a select_result is a normal SELECT Note that the 5.0 tree is not yet up to date: Sanja will have to fix multi-update-locks for this merge to be complete --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 89b96f2bc6e..2d6434a0eb5 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -176,7 +176,7 @@ then s_echo "done" else s_echo "Got a failure from command:" - s_echo "$cmd" + s_echo "cat $sql_file | $cmd" s_echo "Please check the above output and try again." if test $verbose = 0 then -- cgit v1.2.1 From 32796b486074ab19d3be4bc9c9c572e70eae1a6a Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Wed, 10 Nov 2004 00:03:01 +0100 Subject: wl1744 - ndb on windows Add rules for creating dsp-files --- scripts/make_win_src_distribution.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..d9144ab3dce 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -188,7 +188,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ README INSTALL* LICENSE do if [ -f $i ] @@ -243,11 +243,16 @@ do copy_dir_files $i done +# +# Create project files for ndb +# +make -C ndb windoze + # # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase ndb do copy_dir_dirs $i done -- cgit v1.2.1 From 5172eace09bc4178695e1a487407581fc7cb1f83 Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Wed, 10 Nov 2004 14:18:49 +0100 Subject: wl1744 - nbd windoze port --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index d9144ab3dce..62a9fb54b59 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -246,7 +246,7 @@ done # # Create project files for ndb # -make -C ndb windoze +make -C $SOURCE/ndb windoze # # Input directories to be copied recursively -- cgit v1.2.1 From 9ee3bf9efa9f73617b2a693283f18ffaf9f4ebae Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Wed, 10 Nov 2004 22:43:09 -0600 Subject: fill_help_tables.sh: Handle some additional Texinfo tags that were being missed. --- scripts/fill_help_tables.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index cb5437f7178..1f44e9fa488 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -197,6 +197,9 @@ sub prepare_name $a =~ s/(\@node(.*?)\n)/ /g; $a =~ s/(\@tab)/\t/g; $a =~ s/\@item/ /g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; $a =~ s/\@samp\{(.+?)\}/$1/go; @@ -244,6 +247,9 @@ sub prepare_description $a =~ s/(\@item)/ /g; $a =~ s/(\@tindex\s(.*?)\n)//g; $a =~ s/(\@c\s(.*?)\n)//g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; $a =~ s/\@samp\{(.+?)\}/$1/go; @@ -273,6 +279,7 @@ sub prepare_example $a =~ s/(^\@c for_help_topic(.*?)\n)//g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\\/\\\\/g; $a =~ s/(\@{)/{/g; $a =~ s/(\@})/}/g; -- cgit v1.2.1 From 1288f453cc834ba5cf432282ae054a2d69efcf71 Mon Sep 17 00:00:00 2001 From: "paul@ice.snake.net" <> Date: Fri, 12 Nov 2004 08:45:58 -0600 Subject: fill_help_tables.sh: Recognize another Texinfo tag. --- scripts/fill_help_tables.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 1f44e9fa488..78dfe7b6088 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -198,6 +198,7 @@ sub prepare_name $a =~ s/(\@tab)/\t/g; $a =~ s/\@item/ /g; $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; @@ -248,6 +249,7 @@ sub prepare_description $a =~ s/(\@tindex\s(.*?)\n)//g; $a =~ s/(\@c\s(.*?)\n)//g; $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; @@ -280,6 +282,7 @@ sub prepare_example $a =~ s/(^\@c for_help_topic(.*?)\n)//g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\\/\\\\/g; $a =~ s/(\@{)/{/g; $a =~ s/(\@})/}/g; -- cgit v1.2.1 From eb304bd49f3228352a328d158db37c61f4cccd93 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 26 Nov 2004 02:31:22 +0200 Subject: Fixes while reviewing code (Cleanups and better bug fixes) --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 2fbcd76c318..381cf599e32 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -74,7 +74,7 @@ parse_arguments() parse_arguments "$@" if test -z "$cmd"; then - cmd="$bindir/mysql -f --user=$user --host=$host" + cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$root_password"; then cmd="$cmd --password=$root_password" fi -- cgit v1.2.1 From 075a8879955d67377fa6cea95d61217b67551e3c Mon Sep 17 00:00:00 2001 From: "tsmith@build.mysql.com" <> Date: Tue, 30 Nov 2004 22:17:43 +0100 Subject: mysqld_safe.sh: Fix calls to my_print_defaults. Some how, --loose-verbose had been added before --no-defaults/defaults-file, which must be the first option. NOTE: this may make some installations behave differently, if they depend on this broken behavior. --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index da7e06f6c05..1f4d17f8885 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -141,12 +141,12 @@ fi args= SET_USER=2 -parse_arguments `$print_defaults --loose-verbose $defaults mysqld server` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` if test $SET_USER -eq 2 then SET_USER=0 fi -parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} -- cgit v1.2.1 From 67ce24796584e80cf843b37b09aeb794c9231190 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Mon, 6 Dec 2004 02:00:37 +0200 Subject: Add support for up to VARCHAR (size up to 65535) Renamed HA_VAR_LENGTH to HA_VAR_LENGTH_PART Renamed in all files FIELD_TYPE_STRING and FIELD_TYPE_VAR_STRING to MYSQL_TYPE_STRING and MYSQL_TYPE_VAR_STRING to make it easy to catch all possible errors Added support for VARCHAR KEYS to heap Removed support for ISAM Now only long VARCHAR columns are changed to TEXT on demand (not CHAR) Internal temporary files can now use fixed length tables if the used VARCHAR columns are short --- scripts/mysql_fix_privilege_tables.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 2d6434a0eb5..7cd651d15b4 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -13,7 +13,7 @@ args="" port="" socket="" database="mysql" -bindir="" +bindir="." pkgdatadir="@pkgdatadir@" file=mysql_fix_privilege_tables.sql @@ -74,6 +74,7 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [mysql_install_db], and then merge with the command line arguments +print_defaults=my_print_defaults for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra do if test -x $dir/my_print_defaults -- cgit v1.2.1 From bd247e3d56ed2ea8353c617081de5d064b258fab Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Mon, 6 Dec 2004 18:45:41 +0400 Subject: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). --- scripts/fill_help_tables.sh | 12 ++++++++---- scripts/mysql_install_db.sh | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 78dfe7b6088..51edfc8af78 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -454,10 +454,12 @@ sub print_verbose_errors print STDERR "number of help keywords - ",$count_keywords,"\n"; my $count_without_help= scalar(@without_help); + my $percent_without_help= $count_lex ? + int (($count_without_help/$count_lex)*100) : + "100"; print_bad_names(\@without_help,"lexems without help (". $count_without_help." ~ ". - (int (($count_without_help/$count_lex)*100)). - "%)"); + $percent_without_help."%)"); print_bad_names(\@description_with_at, " topics below have symbol \'@\' in their descriptions.\n". "it's probably the litter from 'texi' tags (script needs fixing)"); @@ -467,10 +469,12 @@ sub print_verbose_errors print_bad_names(\@without_description,"topics without description"); my $count_without_example= scalar(@without_example); + my $percent_without_example= $count_topics ? + int (($count_without_example/$count_topics)*100) : + "100"; print_bad_names(\@without_example,"topics without example (". $count_without_example." ~ ". - (int (($count_without_example/$count_topics)*100)). - "%)"); + $percent_without_example."%)"); } print_verbose_errors if ($verbose_option ne 0); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b4f59790e73..8b2e42bd8cd 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M" +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then -- cgit v1.2.1 From 01e4740f4cff58af5f2aeb64c92b539dd51a6571 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 9 Dec 2004 12:47:20 +0200 Subject: Ensure that we free memory used with --order-by-primary (in mysqldump) Simple, non critical, fix to mysql_fix_privilege_tables --- scripts/mysql_fix_privilege_tables.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index b84e512b69a..56807a81d7c 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -14,6 +14,7 @@ port="" socket="" database="mysql" bindir="" +print_defaults_bindir="." file=mysql_fix_privilege_tables.sql @@ -57,7 +58,9 @@ parse_arguments() { --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; - --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;; + --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` + print_defaults_bindir=$bindir + ;; *) if test -n "$pick_args" then @@ -73,7 +76,8 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [mysql_install_db], and then merge with the command line arguments -for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra +print_defaults=my_print_defaults +for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra do if test -x $dir/my_print_defaults then -- cgit v1.2.1 From a045161e5b12697e1f7259d05f4fb63c9d240e66 Mon Sep 17 00:00:00 2001 From: "anjuta@arthur.local" <> Date: Tue, 14 Dec 2004 01:54:16 +0200 Subject: Added pathes to mysqld_error.h and sql_state.h; fixed segfault bug; --- scripts/make_win_src_distribution.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..e68b5bebbd4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -281,6 +281,8 @@ do fi done +cp extra/sql_state.h extra/mysqld_error.h $BASE/include + # # support files # -- cgit v1.2.1 From e81d48fdd94799e2aa1c2d593011888c5e2f7c96 Mon Sep 17 00:00:00 2001 From: "wax@kishkin.ru" <> Date: Tue, 14 Dec 2004 18:46:55 +0500 Subject: corrected mysqltest.dsp corrected mysql_test_run_new.dsp added dependency corrected path of mysql_test_run_new.dsp fixed wrong code added my_create_tables.c removed command_line fixed #elif restored NAME_MAX and MAX_FNAME added create_system_files() added compare() for windows added all files of testes in script added mysql-test in script --- scripts/make_win_src_distribution.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..a635f266165 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -189,7 +189,10 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE + README INSTALL* LICENSE *.inc *.test *.result \ + *.pem Moscow_leap des_key_file *.dat *.000001 \ + *.require *.opt + do if [ -f $i ] then @@ -247,7 +250,7 @@ done # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase mysql-test do copy_dir_dirs $i done -- cgit v1.2.1 From adfb20f64aee9b1dd3cdd63cbb02722e1e31200c Mon Sep 17 00:00:00 2001 From: "paul@frost.snake.net" <> Date: Sat, 18 Dec 2004 14:22:20 -0600 Subject: fill_help_tables.sh: Convert @samp{c} to 'c', not c. --- scripts/fill_help_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 51edfc8af78..fbe7c597b34 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -203,7 +203,7 @@ sub prepare_name $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; @@ -254,7 +254,7 @@ sub prepare_description $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; -- cgit v1.2.1 From b1e30904d5f10d2273819c25cb2dcc251a097bd9 Mon Sep 17 00:00:00 2001 From: "acurtis@pcgem.rdg.cyberkinetica.com" <> Date: Thu, 23 Dec 2004 10:46:24 +0000 Subject: WL#925 - Privileges for stored routines Implement fine-grained control over access to stored procedures Privileges are cached (same way as existing table/column privs) --- scripts/mysql_create_system_tables.sh | 49 ++++++++++++++++++++++++++-------- scripts/mysql_fix_privilege_tables.sql | 39 +++++++++++++++++++++++++++ scripts/mysql_install_db.sh | 2 +- 3 files changed, 78 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 7a4da55f851..be99a081bcb 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -41,7 +41,7 @@ c_hk="" i_ht="" c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" -c_p="" +c_p="" c_pp="" # Check for old tables if test ! -f $mdata/db.frm @@ -69,14 +69,17 @@ then c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y');" + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');" fi if test ! -f $mdata/host.frm @@ -141,6 +144,8 @@ then c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," @@ -155,24 +160,24 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" fi fi fi @@ -236,6 +241,27 @@ then c_c="$c_c comment='Column privileges';" fi +if test ! -f $mdata/procs_priv.frm +then + if test "$1" = "verbose" ; then + echo "Preparing procs_priv table" 1>&2; + fi + + c_pp="$c_pp CREATE TABLE procs_priv (" + c_pp="$c_pp Host char(60) binary DEFAULT '' NOT NULL," + c_pp="$c_pp Db char(64) binary DEFAULT '' NOT NULL," + c_pp="$c_pp User char(16) binary DEFAULT '' NOT NULL," + c_pp="$c_pp Routine_name char(64) binary DEFAULT '' NOT NULL," + c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," + c_pp="$c_pp Timestamp timestamp(14)," + c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') DEFAULT '' NOT NULL," + c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name)," + c_pp="$c_pp KEY Grantor (Grantor)" + c_pp="$c_pp ) engine=MyISAM" + c_pp="$c_pp CHARACTER SET utf8 COLLATE utf8_bin" + c_pp="$c_pp comment='Procedure privileges';" +fi + if test ! -f $mdata/help_topic.frm then if test "$1" = "verbose" ; then @@ -718,6 +744,7 @@ $c_tzls $i_tzls $c_p +$c_pp END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index cae6a1d07b9..d4f095f5201 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -15,6 +15,7 @@ ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE procs_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user change Password Password char(41) binary not null default ''; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( @@ -170,9 +171,47 @@ ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Cre # UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; +# +# +# +SET @hadCreateRoutinePriv:=0; +SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; + +# +# Create PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE user ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +# +# Alter PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE user ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE db ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + +# +# Assign create/alter routine privileges to people who have create privileges +# +UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; + # # Create some possible missing tables # +CREATE TABLE IF NOT EXISTS procs_priv ( +Host char(60) binary DEFAULT '' NOT NULL, +Db char(64) binary DEFAULT '' NOT NULL, +User char(16) binary DEFAULT '' NOT NULL, +Routine_name char(64) binary DEFAULT '' NOT NULL, +Grantor char(77) DEFAULT '' NOT NULL, +Timestamp timestamp(14), +Proc_priv set('Execute','Alter Routine','Grant') DEFAULT '' NOT NULL, +PRIMARY KEY (Host,Db,User,Routine_name), +KEY Grantor (Grantor) +) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; + CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name varchar(64) not null, diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b4f59790e73..3be1320f0b0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -3,7 +3,7 @@ # For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, -# columns_priv in the mysql database, as well as the func table. +# columns_priv, procs_priv in the mysql database, as well as the func table. # # All unrecognized arguments to this script are passed to mysqld. -- cgit v1.2.1 From ffa7393330359dddf60d0a6952071961daeb5a21 Mon Sep 17 00:00:00 2001 From: "dlenev@brandersnatch.localdomain" <> Date: Wed, 29 Dec 2004 20:30:37 +0300 Subject: WL#1339 "Add per account max_user_connections limit (maximum number of concurrent connections for the same account)" Added support of account specific max_user_connections limit. Made all user limits to be counted per account instead of the old behavior, which was per user/host accounting. Added option which enables the old behavior. Added testing of these to the test suite. (After review version). --- scripts/mysql_create_system_tables.sh | 17 +++++++++-------- scripts/mysql_fix_privilege_tables.sql | 5 +++++ 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 7a4da55f851..fa888322073 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -148,6 +148,7 @@ then c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," + c_u="$c_u max_user_connections int(11) unsigned DEFAULT 0 NOT NULL," c_u="$c_u PRIMARY KEY Host (Host,User)" c_u="$c_u ) engine=MyISAM" c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin" @@ -155,24 +156,24 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0);" fi fi fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index cae6a1d07b9..d10fee9f119 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -170,6 +170,11 @@ ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Cre # UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; +# +# Add max_user_connections resource limit +# +ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; + # # Create some possible missing tables # -- cgit v1.2.1 From bb806c1e98b50859944db62c45bfddb804ebe0e5 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 1 Jan 2005 21:13:09 +0100 Subject: make_win_src_distribution.sh, make_binary_distribution.sh, mysql-test-run.sh: Removed references to ISAM and MERGE --- scripts/make_binary_distribution.sh | 1 - scripts/make_win_src_distribution.sh | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d79245a1aad..889550a3aad 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -100,7 +100,6 @@ done BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - isam/isamchk$BS isam/pack_isam$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index eec4ddda27b..8883021abcc 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -238,8 +238,8 @@ copy_dir_dirs() { # Input directories to be copied # -for i in client dbug extra heap include isam \ - libmysql libmysqld merge myisam \ +for i in client dbug extra heap include \ + libmysql libmysqld myisam \ myisammrg mysys regex sql strings sql-common \ tools vio zlib do -- cgit v1.2.1 From 663396653ab5ebed874d7ec89daf6e8e86472c9e Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 4 Jan 2005 01:49:29 +0100 Subject: Use 'ps xaww' in mysqld_safe (on Linux) so whole command-line is searched for port and/or pid-file parameters. (Bug #5878) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 1f4d17f8885..270c08679eb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -322,13 +322,13 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` + numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` + PROC=`ps xaww | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` for T in $PROC do -- cgit v1.2.1 From 81d99da104a856f27a19059f4f7b548cd6a0d2ff Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 4 Jan 2005 20:13:47 +0200 Subject: Added checking for my.cnf file from environment variable MYSQL_HOME instead of DATADIR. --- scripts/mysqld_multi.sh | 12 +++++++++++- scripts/mysqld_safe.sh | 15 ++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index ba46fd6fa29..ee873a86c8d 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.11"; +$VER="2.12"; $opt_config_file = undef(); $opt_example = 0; @@ -430,6 +430,16 @@ sub find_groups { $data[$i] = $line; } + if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" && + -r "$ENV{MYSQL_HOME}/my.cnf") + { + open(MY_CNF, "<$ENV{MYSQL_HOME}/my.cnf") && (@tmp=) && + close(MY_CNF); + } + for (; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") { open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 1f4d17f8885..0e18f137c5a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -52,11 +52,7 @@ parse_arguments() { # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - # err-log should be removed in 5.0 - --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; - # QQ The --open-files should be removed in 5.0 - --open-files=*) open_files=`echo "$arg" | sed -e "s;--open-files=;;"` ;; --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; @@ -94,7 +90,7 @@ then DATADIR=$MY_BASEDIR_VERSION/data if test -z "$defaults" then - defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" + defaults="--defaults-extra-file=$DATADIR/my.cnf" fi # Check if this is a 'moved install directory' elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ @@ -106,8 +102,17 @@ then else MY_BASEDIR_VERSION=@prefix@ DATADIR=@localstatedir@ + if test -z "$MYSQL_HOME" + then + MYSQL_HOME=$DATADIR # Installation in a not common path + fi ledir=@libexecdir@ fi +if test -z "$MYSQL_HOME" +then + MYSQL_HOME=$MY_BASEDIR_VERSION +fi +export MYSQL_HOME user=@MYSQLD_USER@ niceness=0 -- cgit v1.2.1 From 0ed892f1975a380066b4ac7cc38852021344dbbd Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 01:08:45 +0100 Subject: Change mysqld_safe search for mysqld relative to the current working directory to only look for the mysqld binary (and english error strings) and assume the datadir from that. Then, if that datadir turns out to not exist, startup will fail. This avoids the behavior where mysqld_safe would go off and run a totally different binary because the data directory had been moved (even when --datadir was specified on the command line). (Bug #7249) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 270c08679eb..f6b0169d230 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -86,7 +86,7 @@ parse_arguments() { 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 \ +if test -f ./share/mysql/english/errmsg.sys -a \ -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are @@ -97,7 +97,7 @@ then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi # Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ +elif test -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are -- cgit v1.2.1 From 30808e9ab993a98220cd96290ff49a4d6212cd10 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 02:04:12 +0100 Subject: Make sure to include ZLIB_LIBS in mysql_config --libs_r (Bug #7021) --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 86cbe944416..79d8eef868b 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -88,7 +88,7 @@ client_libs='@CLIENT_LIBS@' libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @ZLIB_LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -- cgit v1.2.1 From d14f3d76752f311c6fe81ba808cf1131da517e29 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 5 Jan 2005 03:43:37 +0100 Subject: Protect flags like -Wl,-O2 from being mangled by mysql_config (Bug #6964) (Second commit of this patch -- first included wrong changes.) --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 86cbe944416..35ddbcac471 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -100,7 +100,7 @@ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' do - cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` + cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` done cflags=`echo "$cflags"|sed -e 's/ *\$//'` -- cgit v1.2.1 From 2acb7387842baec2b3171afe7de08e1a52d7e8ce Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Jan 2005 19:57:02 +0100 Subject: Add comment to make code for option-stripping in mysql_config more clear --- scripts/mysql_config.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 35ddbcac471..3676e03ab48 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -100,6 +100,8 @@ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' do + # The first option we might strip will always have a space before it because + # we set -I$pkgincludedir as the first option cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` done cflags=`echo "$cflags"|sed -e 's/ *\$//'` -- cgit v1.2.1 From b1eab7097c3dd0f871df24ba3c560c1fc864161a Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 6 Jan 2005 20:42:06 +0100 Subject: Make sure all char columns in the mysql.* tables have the proper width in mysql_fix_privilege_tables.sql, or they may get truncated during conversion to utf8. (Bug #7539) --- scripts/mysql_fix_privilege_tables.sql | 39 ++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index a60d987f8b5..536b263f7bd 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,13 +9,38 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user change Password Password char(41) binary not null; +-- Convert all tables to UTF-8 with binary collation +-- and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Password char(41) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, -- cgit v1.2.1 From 804a952f9bd1b70ada98449c09274f1f95b57a19 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 7 Jan 2005 19:50:41 +0100 Subject: Create columns_priv with correct column lengths (the alter table that used to fix it was removed in a merge, and now the alter table that fixes the length comes before the create table so it fixes pre-existing tables but not the newly-created one). --- scripts/mysql_fix_privilege_tables.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 975d8dddbb0..9373a888bc2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -93,10 +93,10 @@ CREATE TABLE IF NOT EXISTS tables_priv ( CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, - Db char(60) DEFAULT '' NOT NULL, + Db char(64) DEFAULT '' NOT NULL, User char(16) DEFAULT '' NOT NULL, - Table_name char(60) DEFAULT '' NOT NULL, - Column_name char(59) DEFAULT '' NOT NULL, + Table_name char(64) DEFAULT '' NOT NULL, + Column_name char(64) DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) -- cgit v1.2.1 From 39d90b710f787d33d044072bdd92b7b8f49c1813 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Jan 2005 21:50:30 +0100 Subject: Replace ZLIB_LIBS in mysql_config. (Bug #6418) --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4158b5a34dc..71b70fc0e4a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -121,6 +121,7 @@ SUFFIXES = .sh -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -- cgit v1.2.1 From 1d33747d3aadbb9a6339e4a28175c045169fae8c Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Wed, 12 Jan 2005 23:30:54 +0100 Subject: Symlink vulnerability fixed. reported by Javier Fernandez-Sanguino Pena and Debian Security Audit Team (http://www.debian.org/security/audit) --- scripts/mysqlaccess.sh | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 75ef63ecdd0..b71f6847baf 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2,7 +2,7 @@ # **************************** package MySQLaccess; #use strict; -use POSIX qw(tmpnam); +use File::Temp qw(tempfile tmpnam); use Fcntl; BEGIN { @@ -32,7 +32,6 @@ BEGIN { $ACCESS_U_BCK = 'user_backup'; $ACCESS_D_BCK = 'db_backup'; $DIFF = '/usr/bin/diff'; - $TMP_PATH = '/tmp'; #path to writable tmp-directory $MYSQLDUMP = '@bindir@/mysqldump'; #path to mysqldump executable @@ -432,7 +431,7 @@ use IPC::Open3; # no caching on STDOUT $|=1; - $MYSQL_CNF = POSIX::tmpnam(); + $MYSQL_CNF = tmpnam(); %MYSQL_CNF = (client => { }, mysql => { }, mysqldump => { }, @@ -577,8 +576,6 @@ if (!defined($Param{'host'})) { $Param{'host'}='localhost'; } push(@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); push(@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); -push(@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); -push(@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); if (@MySQLaccess::Grant::Error) { MySQLaccess::Report::Print_Error_Messages() ; exit 0; @@ -1777,17 +1774,15 @@ sub Diff_Privileges { @before = sort(@before); @after = sort(@after); - $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; - $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; - #$after = "/tmp/t0"; - open(BEFORE,"> $before") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); - open(AFTER,"> $after") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); - print BEFORE join("\n",@before); - print AFTER join("\n",@after); - close(BEFORE); - close(AFTER); + ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + ($ha, $after) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + + print $hb join("\n",@before); + print $ha join("\n",@after); + close $hb; + close $ha; # ---------------------------------- # compute difference @@ -1800,8 +1795,8 @@ sub Diff_Privileges { # ---------------------------------- # cleanup temp. files - unlink(BEFORE); - unlink(AFTER); + unlink($before); + unlink($after); return \@diffs; } @@ -2316,14 +2311,6 @@ BEGIN { => "The diff program <$MySQLaccess::DIFF> could not be found.\n" ."+ Check your path, or\n" ."+ edit the source of this script to point \$DIFF to the diff program.\n" - ,'not_found_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" - ."+ create this directory (writeable!), or\n" - ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" - ,'write_err_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" - ."+ make this directory writeable!, or\n" - ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" ,'Unrecognized_option' => "Sorry,\n" ."You are using an old version of the mysql-program,\n" -- cgit v1.2.1 From f3e73e26d766fbd295eebda621a1798afcfd0677 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 13 Jan 2005 19:24:54 +0200 Subject: A patch for Netware. --- scripts/make_binary_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 889550a3aad..0851edd56ce 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -235,8 +235,10 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - cp ./netware/static_init_db.sql ./netware/init_db.sql - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql + echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test > $BASE/bin/test_db.sql fi # -- cgit v1.2.1 From d7389eedd1f29fe4e66ca09071b190eac4ed816b Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Jan 2005 11:58:10 -0800 Subject: Fix mysql_install_db to look for libexecdir relative to basedir when it has been specified. (Bug #7347) --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f9f3160d220..8d47d67792a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -98,9 +98,9 @@ else if test -x "$basedir/libexec/mysqld" then execdir="$basedir/libexec" -elif test -x "@libexecdir@/mysqld" +elif test -x "$basedir/sbin/mysqld" then - execdir="@libexecdir@" + execdir="$basedir/sbin" else execdir="$basedir/bin" fi -- cgit v1.2.1 From d28f83359b69a6057db3449c355d05aee54a71cc Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 18 Jan 2005 17:01:06 -0800 Subject: Update list of files copied for binary distribution. (Bug #7632) --- scripts/make_binary_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0851edd56ce..69f9092f1fd 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -210,8 +210,10 @@ do done $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data -$CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r -- cgit v1.2.1 From 9675b0698f911b2f9120a99ef959202908b40244 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 20 Jan 2005 16:25:38 +0100 Subject: - renamed client_test -> mysql_client_test - renamed the tests that use the embedded server (client_test -> mysql_client_test_embedded, mysqltest -> mysql_test_embedded and changed some Makefiles and scripts so they are installed in $bindir (required to be able to run the test suite against the embedded server) --- scripts/make_binary_distribution.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 281ef9bd469..22b51168c23 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -127,6 +127,8 @@ else client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + tests/.libs/mysql_client_test libmysqld/examples/mysql_client_test_embedded \ + libmysqld/examples/mysqltest_embedded \ "; fi @@ -187,7 +189,7 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then if [ -d tests ] ; then - $CP tests/client_test tests/*.res tests/*.tst tests/*.pl $BASE/tests + $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 -- cgit v1.2.1 From 3229e67a20510d11ccdfffb6da8a8697de25b451 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 27 Jan 2005 14:29:06 -0800 Subject: Fix handling of table-name matching in mysqlhotcopy when newer versions of DBD::mysql that quote table names are used by removing the quoting. Also fix a bug that stripped all '~' characters out of the table regex instead of just the leading one used to negate the expression. (Bug #8136) --- scripts/mysqlhotcopy.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 2cfe91da115..e3f4fdaf3ee 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -272,10 +272,7 @@ foreach my $rdb ( @db_desc ) { my $negated; if ($rdb->{t_regex}) { $t_regex = $rdb->{t_regex}; ## assign temporary regex - $negated = $t_regex =~ tr/~//d; ## remove and count - ## negation operator: we - ## don't allow ~ in table - ## names + $negated = $t_regex =~ s/^~//; ## note and remove negation operator $t_regex = qr/$t_regex/; ## make regex string from ## user regex @@ -820,6 +817,13 @@ sub get_list_of_tables { }); my @dbh_tables = eval { $dbh->tables() }; + + ## Remove quotes around table names + my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR + if ($quote) { + foreach (@dbh_tables) { s/^$quote(.*)$quote$/$1/; } + } + $dbh->disconnect(); return @dbh_tables; } -- cgit v1.2.1 From edba2b9b335a4e3ca0feb7e9dcd6776ad349df39 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Fri, 28 Jan 2005 15:26:17 +0400 Subject: A fix (bug #6000: No "@%"-accounts after install). --- scripts/mysql_install_db.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 8d47d67792a..40827f8b6ef 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -275,14 +275,16 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + if test "$windows" = 1 + then + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost','');" + else + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname','');" + fi fi if test ! -f $mdata/func.frm -- cgit v1.2.1 From 852f2e0abac3b6eab3b8a0f978682af449a6be50 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Fri, 28 Jan 2005 17:14:03 +0100 Subject: small Makefile.am cleanup clean: targets removed generated *.h files moved to include/ --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 71b70fc0e4a..221fab13635 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -90,7 +90,7 @@ CLEANFILES = @server_scripts@ \ fill_help_tables \ mysql_create_system_tables -SUPERCLEANFILES = mysqlbug +DISTCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug mysqlbug: ${top_builddir}/config.status mysqlbug.sh -- cgit v1.2.1 From a8039e1ac8904b98337d4978d48e830e63cf3a9e Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 1 Feb 2005 11:59:44 -0800 Subject: Make sure mysql_client_test and embedded test clients get added to binary distribution on all platforms. --- scripts/make_binary_distribution.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 22b51168c23..33d4794e4f7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -107,8 +107,11 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS -"; + client/mysqlbinlog$BS \ + tests/mysql_client_test$BS \ + libmysqld/examples/mysql_client_test_embedded$BS \ + libmysqld/examples/mysqltest_embedded$BS \ + "; # Platform-specific bin dir files: if [ $BASE_SYSTEM = "netware" ] ; then @@ -127,8 +130,9 @@ else client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ - tests/.libs/mysql_client_test libmysqld/examples/mysql_client_test_embedded \ - libmysqld/examples/mysqltest_embedded \ + tests/.libs/mysql_client_test \ + libmysqld/examples/.libs/mysql_client_test_embedded \ + libmysqld/examples/.libs/mysqltest_embedded \ "; fi -- cgit v1.2.1 From 70f35fa6da3a702254809d2798eb326eae5d3f4e Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 2 Feb 2005 19:41:33 -0800 Subject: Add --help to mysqld_safe. (Bug #7931) --- scripts/mysqld_safe.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d6ee11f226d..a8615ff2113 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -23,6 +23,29 @@ case "$1" in ;; esac +usage () { + cat < Date: Thu, 3 Feb 2005 14:21:16 -0800 Subject: Copy *.result.es files for binary distribution so embedded tests can be run --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 33d4794e4f7..910aa38c33f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -220,7 +220,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/r/*result mysql-test/r/*result.es mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From e531136c1f359280cf8c757c75304de8205393d9 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Sat, 5 Feb 2005 01:21:16 +0300 Subject: A fix for Bug#6273 "building fails on link": we should not use CLIENT_LIBS in mysql_config as CLIENT_LIBS point to builddir when we use the bundled zlib. --- scripts/Makefile.am | 3 +++ scripts/mysql_config.sh | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 71b70fc0e4a..d5337df35b1 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -140,6 +140,9 @@ SUFFIXES = .sh -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ + -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ + -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \ + -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \ -e "s!@MAKE@!$(MAKE)!" \ $< > $@-t @CHMOD@ +x $@-t diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 90418de3d1d..a5c8af5ecb2 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -82,13 +82,14 @@ version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' -client_libs='@CLIENT_LIBS@' # Create options -libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" +libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @ZLIB_LIBS@ @openssl_libs@" + +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -- cgit v1.2.1 From 21caf15bca4c792ea3243f4d924051b5b54e031c Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 7 Feb 2005 18:40:14 -0800 Subject: Add Create_routine_priv, Alter_routine_priv, and Execute_priv privileges to the 'host' privilege table. (Bug #8166) --- scripts/mysql_create_system_tables.sh | 3 +++ scripts/mysql_fix_privilege_tables.sql | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 75ab48227f7..02bc4857213 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -105,6 +105,9 @@ then c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h ) engine=MyISAM" c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9373a888bc2..5a235c24d50 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -202,21 +202,25 @@ SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; # Create PROCEDUREs privileges (v5.0) # ALTER TABLE db ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE host ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; ALTER TABLE user ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; # # Alter PROCEDUREs privileges (v5.0) # ALTER TABLE db ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE host ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; ALTER TABLE user ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; ALTER TABLE db ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE host ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; # # Assign create/alter routine privileges to people who have create privileges # UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0; # # Add max_user_connections resource limit -- cgit v1.2.1 From 1c2f4ffecb5ee57c91f8961544f20a73de360bc3 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 8 Feb 2005 19:49:40 +0200 Subject: Applied a patch for Netware. --- scripts/make_binary_distribution.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 910aa38c33f..7a6e052f5c7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -242,8 +242,12 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - cp ./netware/static_init_db.sql ./netware/init_db.sql - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql +# cp ./netware/static_init_db.sql ./netware/init_db.sql +# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # -- cgit v1.2.1 From 8999d5ab11444b56a9d96b887543534931d8da02 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 9 Feb 2005 17:40:10 +0100 Subject: - added copyright header on top of the fill_help_tables.sql file (BUG#5772) - updated mysql-copyright-2 to properly convert this new header from GPL to commercial for the commercial distribution --- scripts/fill_help_tables.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index fbe7c597b34..fc0c684c2dc 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -493,6 +493,24 @@ sub print_insert_header } } +print < Date: Thu, 10 Feb 2005 20:25:14 -0800 Subject: Fix all of the enum and set columns in privilege tables to be case-insensitive. (Bug #7989) --- scripts/mysql_create_system_tables.sh | 102 +++++++++---------- scripts/mysql_fix_privilege_tables.sql | 178 +++++++++++++++++++++++---------- 2 files changed, 174 insertions(+), 106 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index f524b322388..7f4a1105201 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -54,18 +54,18 @@ then c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," - c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" @@ -85,18 +85,18 @@ then c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," - c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h ) engine=MyISAM" c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" @@ -113,28 +113,28 @@ then c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," - c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," c_u="$c_u x509_subject BLOB NOT NULL," @@ -180,7 +180,7 @@ then c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," c_f="$c_f dl char(128) DEFAULT '' NOT NULL," - c_f="$c_f type enum ('function','aggregate') NOT NULL," + c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL," c_f="$c_f PRIMARY KEY (name)" c_f="$c_f ) engine=MyISAM" c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" @@ -200,8 +200,8 @@ then c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," - c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL," + c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" c_t="$c_t ) engine=MyISAM" @@ -222,7 +222,7 @@ then c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Timestamp timestamp(14)," - c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c ) engine=MyISAM" c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" @@ -330,7 +330,7 @@ then c_tz="$c_tz CREATE TABLE time_zone (" c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," - c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8" c_tz="$c_tz comment='Time zones';" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 536b263f7bd..8f398689bd9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,54 +9,23 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' --- Convert all tables to UTF-8 with binary collation --- and reset all char columns to correct width -ALTER TABLE user - MODIFY Host char(60) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Password char(41) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Column_name char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Grantor char(77) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, - type enum ('function','aggregate') NOT NULL, + type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + -- Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; -ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; --- Fix privileges for old tables UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; @@ -68,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr -- Adding columns needed by GRANT .. REQUIRE (openssl)" ALTER TABLE user -ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, ADD ssl_cipher BLOB NOT NULL, ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL; @@ -85,10 +54,14 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE tables_priv + modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, @@ -97,22 +70,25 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Table_name char(60) DEFAULT '' NOT NULL, Column_name char(59) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Name change of Type -> Column_priv from MySQL 3.22.12 -- -ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; +ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Add the new 'type' column to the func table. -- -ALTER TABLE func add type enum ('function','aggregate') NOT NULL; +ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; -- -- Change the user,db and host tables to MySQL 4.0 format @@ -123,13 +99,13 @@ SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, -ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, -ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; +ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, +ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before @@ -150,11 +126,11 @@ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; -- ALTER TABLE db -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE host -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; alter table db change Db Db char(64) binary DEFAULT '' NOT NULL; alter table host change Db Db char(64) binary DEFAULT '' NOT NULL; @@ -170,6 +146,95 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; +-- Convert all tables to UTF-8 with binary collation +-- and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Password char(41) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + # # Create some possible missing tables # @@ -217,9 +282,12 @@ PRIMARY KEY Name (Name) CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, -Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, +Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) CHARACTER SET utf8 comment='Time zones'; +-- Make enum field case-insensitive +ALTER TABLE time_zone + MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, -- cgit v1.2.1 From 10c53ae1e5295c46f240d890e13b56f483708fee Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Mon, 14 Feb 2005 11:14:04 +0100 Subject: remove passwordless remote accounts from windows distro --- scripts/mysql_create_system_tables.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index f524b322388..83fdc0639ce 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -163,9 +163,7 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi -- cgit v1.2.1 From 87d6da972f9a173e0145ac620f24459892ecc13d Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Thu, 17 Feb 2005 20:07:52 +0100 Subject: make_binary_distribution.sh, Makefile.am: Make .disabled files part of distribution --- scripts/make_binary_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4c339b063d9..2afb091da3e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -220,8 +220,10 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ $BASE/mysql-test/std_data -$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*result mysql-test/r/*result.es mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ + mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/r/*.result mysql-test/r/*.result.es mysql-test/r/*.require \ + $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From e9a5b7d50006b891d45064e8150e7646d18094ae Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 17 Feb 2005 18:07:14 -0800 Subject: Clean up merge from 4.1, including making several enum fields in the grant tables case-insensitive and updating test results. --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index b7dab0d931b..ea4c85d7a2c 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -253,7 +253,7 @@ then c_pp="$c_pp Routine_name char(64) binary DEFAULT '' NOT NULL," c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," c_pp="$c_pp Timestamp timestamp(14)," - c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') DEFAULT '' NOT NULL," + c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name)," c_pp="$c_pp KEY Grantor (Grantor)" c_pp="$c_pp ) engine=MyISAM" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 918d37264e1..e8012ecc03a 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -243,16 +243,16 @@ SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; # # Create VIEWs privileges (v5.0) # -ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; +ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; # # Show VIEWs privileges (v5.0) # -ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; # # Assign create/show view privileges to people who have create provileges @@ -268,16 +268,16 @@ SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; # # Create PROCEDUREs privileges (v5.0) # -ALTER TABLE db ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE user ADD Create_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; # # Alter PROCEDUREs privileges (v5.0) # -ALTER TABLE db ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE user ADD Alter_routine_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE db ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; # # Assign create/alter routine privileges to people who have create privileges -- cgit v1.2.1 From 99bd939b3e90753412e030570c015b33f8acd1ad Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Feb 2005 12:37:18 -0800 Subject: Remove doubled quotes (used for escaping) in table names in mysqlhotcopy. Part of fix for Bug #8136. --- scripts/mysqlhotcopy.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index e3f4fdaf3ee..632174dc41a 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -821,7 +821,10 @@ sub get_list_of_tables { ## Remove quotes around table names my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR if ($quote) { - foreach (@dbh_tables) { s/^$quote(.*)$quote$/$1/; } + foreach (@dbh_tables) { + s/^$quote(.*)$quote$/$1/; + s/$quote$quote/$quote/g; + } } $dbh->disconnect(); -- cgit v1.2.1 From 84f0f11fff0d01f9728a9244b8a5673385170774 Mon Sep 17 00:00:00 2001 From: "tulin@mysql.com" <> Date: Mon, 21 Feb 2005 10:52:29 +0100 Subject: bug #8611, ndb includes in lib dir instead of include dir --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 910aa38c33f..c3c16c8bf41 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -278,7 +278,7 @@ if [ x$NDBCLUSTER = x1 ]; then $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/lib/. + $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 rm -rf $BASE/ndb-stage fi -- cgit v1.2.1 From 6e9b26e8b75422959b48c673b5f6abeae7fa69ad Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Wed, 23 Feb 2005 18:59:54 +0200 Subject: Fixed a compatibility problem. 1) If my.cnf is found in datadir and basedir, give a warning and use the one in basedir. 2) If my.cnf is found in datadir, use it, but give a warning. 3) No warning if my.cnf is in basedir. --- scripts/mysqld_safe.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a8615ff2113..e38127ffd8e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -128,15 +128,28 @@ then else MY_BASEDIR_VERSION=@prefix@ DATADIR=@localstatedir@ - if test -z "$MYSQL_HOME" - then - MYSQL_HOME=$DATADIR # Installation in a not common path - fi ledir=@libexecdir@ fi + if test -z "$MYSQL_HOME" then - MYSQL_HOME=$MY_BASEDIR_VERSION + if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" + then + echo "WARNING: Found two instances of my.cnf -" + echo "$MY_BASEDIR_VERSION/my.cnf and" + echo "$DATADIR/my.cnf" + echo "IGNORING $DATADIR/my.cnf" + echo + MYSQL_HOME=$MY_BASEDIR_VERSION + elif test -r "$DATADIR/my.cnf" + then + echo "WARNING: Found $DATADIR/my.cnf" + echo "Datadir is deprecated place for my.cnf, please move it to $MY_BASEDIR_VERSION" + echo + MYSQL_HOME=$DATADIR + else + MYSQL_HOME=$MY_BASEDIR_VERSION + fi fi export MYSQL_HOME -- cgit v1.2.1 From bb9d7bfc792b8496641ee633875266e65cdc1c58 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 2 Mar 2005 12:19:44 -0800 Subject: Create directory for UNIX socket in mysqld_safe if it doesn't already exist. (Bug #8513) --- scripts/mysqld_safe.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f6b0169d230..308db270828 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -150,6 +150,15 @@ parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysq parse_arguments PICK-ARGS-FROM-ARGV "$@" safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} +# Make sure that directory for $safe_mysql_unix_port exists +mysql_unix_port_dir=`dirname $safe_mysql_unix_port` +if [ ! -d $mysql_unix_port_dir ] +then + mkdir $mysql_unix_port_dir + chown $user $mysql_unix_port_dir +fi + + if test ! -x $ledir/$MYSQLD then echo "The file $ledir/$MYSQLD doesn't exist or is not executable" -- cgit v1.2.1 From c6002966be64f522a431d18e444b3344665e90b0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 9 Mar 2005 01:34:22 +0100 Subject: mysql-test-run.pl: Removed -c from /bin/sh call make_win_src_distribution.sh: Copy all content in mysql-test make_win_binary_distribution.sh, make_binary_distribution.sh: Add Perl version of mysql-test-run to package s_win32_dsp, s_win32, s_vxworks, s_test, s_readme, s_java, s_javah: Bug #6209 changes for building Berkeley DB from BitKeeper on Solaris --- scripts/make_binary_distribution.sh | 8 +++++--- scripts/make_win_binary_distribution.sh | 4 ++++ scripts/make_win_src_distribution.sh | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 70eff2db79b..01d635688d8 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -66,7 +66,7 @@ esac mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ @@ -207,7 +207,7 @@ $CP -r sql/share/* $MYSQL_SHARE rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD for i in mysql-test/mysql-test-run mysql-test/install_test_db \ - mysql-test/README \ + mysql-test/mysql-test-run.pl mysql-test/README \ netware/mysql_test_run.nlm netware/install_test_db.ncf do if [ -f $i ] @@ -216,6 +216,8 @@ do fi done +$CP mysql-test/lib/*.pl $BASE/mysql-test/lib +$CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data @@ -242,7 +244,7 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then -echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh index 9b2cc2d7d22..c611454450c 100644 --- a/scripts/make_win_binary_distribution.sh +++ b/scripts/make_win_binary_distribution.sh @@ -110,6 +110,10 @@ print_debug "Copying sql-bench to $DIRNAME/bench" mkdir $DIRNAME/bench cp -fr sql-bench/* $DIRNAME/bench +print_debug "Copying mysql-test to $DIRNAME/mysql-test" +mkdir $DIRNAME/mysql-test +cp -fr mysql-test/* $DIRNAME/mysql-test + print_debug "Copying support-files to $DIRNAME" cp support-files/* $DIRNAME diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 16a033b8de4..b52cc3799aa 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -255,7 +255,7 @@ make -C $SOURCE/ndb windoze # Input directories to be copied recursively # -for i in bdb innobase mysql-test ndb +for i in bdb innobase ndb do copy_dir_dirs $i done @@ -305,7 +305,7 @@ done # Raw dirs from source tree # -for i in scripts sql-bench SSL tests +for i in scripts sql-bench mysql-test SSL tests do print_debug "Copying directory '$i'" if [ -d $i ] -- cgit v1.2.1 From 2b2efa420802b9dd7a6302ace3eb4a174c9b5fc2 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 8 Mar 2005 17:40:43 -0800 Subject: Add all SQL_MODE settings to proc table. (Bug #8902) --- scripts/mysql_create_system_tables.sh | 12 ++++++++- scripts/mysql_fix_privilege_tables.sql | 46 ++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index ea4c85d7a2c..d87113d3656 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -702,7 +702,17 @@ then c_p="$c_p 'MYSQL323'," c_p="$c_p 'MYSQL40'," c_p="$c_p 'ANSI'," - c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'" + c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'," + c_p="$c_p 'NO_BACKSLASH_ESCAPES'," + c_p="$c_p 'STRICT_TRANS_TABLES'," + c_p="$c_p 'STRICT_ALL_TABLES'," + c_p="$c_p 'NO_ZERO_IN_DATE'," + c_p="$c_p 'NO_ZERO_DATE'," + c_p="$c_p 'INVALID_DATES'," + c_p="$c_p 'ERROR_FOR_DIVISION_BY_ZERO'," + c_p="$c_p 'TRADITIONAL'," + c_p="$c_p 'NO_AUTO_CREATE_USER'," + c_p="$c_p 'HIGH_NOT_PRECEDENCE'" c_p="$c_p ) DEFAULT 0 NOT NULL," c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," c_p="$c_p PRIMARY KEY (db,name,type)" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index e8012ecc03a..2310e8d0bef 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -422,7 +422,17 @@ CREATE TABLE IF NOT EXISTS proc ( 'MYSQL323', 'MYSQL40', 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO' + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' ) DEFAULT 0 NOT NULL, comment char(64) binary DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) @@ -436,4 +446,36 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL; + ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY sql_mode + set('REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' + ) DEFAULT 0 NOT NULL; -- cgit v1.2.1 From 3ce3295e3fd775f70a5d61e5e0c3424e83131f2b Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 9 Mar 2005 15:00:40 +0100 Subject: mysqldumpslow.sh: bug#4914 added --help and usage information --- scripts/mysqldumpslow.sh | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index e8f73c25b55..ccb006f692d 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -17,8 +17,9 @@ my %opt = ( ); GetOptions(\%opt, - 'v+', # verbose - 'd+', # debug + 'verbose|v+',# verbose + 'help+', # write usage info + 'debug|d+', # debug 's=s', # what to sort by (t, at, l, al, r, ar etc) 'r!', # reverse the sort order (largest last instead of first) 't=i', # just show the top n queries @@ -28,8 +29,9 @@ GetOptions(\%opt, 'h=s', # hostname of db server for *-slow.log filename (can be wildcard) 'i=s', # name of server instance (if using mysql.server startup script) 'l!', # don't subtract lock time from total time -) or die "Bad option"; +) or usage("bad option"); +$opt{'help'} and usage(); unless (@ARGV) { my $defaults = `my_print_defaults mysqld`; @@ -141,3 +143,38 @@ foreach (@sorted) { printf "Count: %d Time=%.2fs (%ds) Lock=%.2fs (%ds) Rows=%.1f (%d), $user\@$host\n%s\n\n", $c, $at,$t, $al,$l, $ar,$r, $_; } + +sub usage { + my $str= shift; + my $text= < Date: Thu, 10 Mar 2005 21:13:46 +0100 Subject: Correct "make_win_src_distribution" to not introduce additional directory layers, adapt the Windows build files accordingly. --- scripts/make_win_src_distribution.sh | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b52cc3799aa..036ed6fcc93 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -15,13 +15,26 @@ DIRNAME="" OUTTAR="0" OUTZIP="0" +# +# An "abort" function taking a variable number of strings (one per line) +# + +abort() +{ + for line + do + echo "$line" + done + exit 1 +} + + # # 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 + abort "ERROR : You must run this script from the MySQL top-level directory" fi SOURCE=`pwd` @@ -30,9 +43,8 @@ SOURCE=`pwd` # 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 + abort "ERROR : Sorry, you must run this script after the complete build," \ + " hope you know what you are trying to do !!" fi # @@ -86,9 +98,7 @@ parse_arguments() { --tar) OUTTAR=1 ;; --zip) OUTZIP=1 ;; --help) show_usage ;; - *) - echo "Unknown argument '$arg'" - exit 1 + *) abort "Unknown argument '$arg'" ;; esac done @@ -138,6 +148,7 @@ if [ -d $BASE ] ; then fi $CP -r $SOURCE/VC++Files $BASE +# This includes an implicit 'mkdir $BASE' ! # # Process version tags in InstallShield files @@ -310,7 +321,12 @@ do print_debug "Copying directory '$i'" if [ -d $i ] then - $CP -R $i $BASE/$i + if [ -d $BASE/$i ] + then + $CP -R $i $BASE + else + $CP -R $i $BASE/$i + fi fi done -- cgit v1.2.1 From f1ce374acca75941632d5ae8e9c95a2a627776a5 Mon Sep 17 00:00:00 2001 From: "lars@mysql.com" <> Date: Mon, 21 Mar 2005 17:53:48 +0100 Subject: Correction of a bad manual merge --- scripts/mysql_fix_privilege_tables.sql | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 0f914d91713..ecf437ebdc6 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,5 +1,5 @@ -- This script converts any old privilege tables to privilege tables suitable --- for MySQL 4.0. +-- for this version of MySQL -- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" -- because these just mean that your tables are already up to date. @@ -131,26 +131,8 @@ ALTER TABLE db ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE host -<<<<<<< gca scripts/mysql_fix_privilege_tables.sql 1.9.1.14 ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; -<<<<<<< local scripts/mysql_fix_privilege_tables.sql 1.12 -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; - -# -# Create VIEWs privrlages (v5.1) -# -ALTER TABLE db ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE host ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE user ADD Create_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_client_priv; - -# -# Show VIEWs privrlages (v5.1) -# -ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE host ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE user ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_view_priv; alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; alter table tables_priv add KEY Grantor (Grantor); -- cgit v1.2.1 From ad26a667e69b964c60d1a30916dea3c7fbefaf4a Mon Sep 17 00:00:00 2001 From: "mysqldev@mysql.com" <> Date: Tue, 22 Mar 2005 15:54:18 +0100 Subject: sql_acl.cc, sql_acl.h, sql_parse.cc New privilege CREATE USER (CREATE_USER_ACL, Create_user_priv) added grant2.test: new tests (mostly backported from jani's patch) system_mysql_db.result, sp.result, grant2.result, grant.result: results updated --- scripts/mysql_create_system_tables.sh | 13 +++++++------ scripts/mysql_fix_privilege_tables.sql | 12 ++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index d87113d3656..29f6f7b41e1 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -146,6 +146,7 @@ then c_u="$c_u Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," @@ -161,22 +162,22 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 2310e8d0bef..628b034362d 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -290,6 +290,18 @@ UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Ex # ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; +# +# user.Create_user_priv +# + +SET @hadCreateUserPriv:=0; +SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; + +ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' + WHERE @hadCreateUserPriv = 0 AND + (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); + # # Create some possible missing tables # -- cgit v1.2.1 From 3ef3c59ed0682f8c892efbe3ec612517cd5f8c72 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 22 Mar 2005 21:52:01 +0100 Subject: Hack to ensure that CHAR's created in 5.0 are not converted to VARCHAR even if the row type is dynamic (For 4.1 tables old 'VARCHAR' fields are converted to true VARCHAR in the next ALTER TABLE) This ensures that one can use MySQL 5.0 privilege tables with MySQL 4.1. (Fix imported from main 5.0 tree to 5.0.3 build tree.) --- scripts/fill_func_tables.sh | 8 +++---- scripts/mysql_create_system_tables.sh | 10 ++++---- scripts/mysql_fix_privilege_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 42 ++++++++++++++++++++++++++++++---- 4 files changed, 47 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh index 459afee2fe1..203c730dd9a 100644 --- a/scripts/fill_func_tables.sh +++ b/scripts/fill_func_tables.sh @@ -131,8 +131,8 @@ print "USE mysql_help;\n"; print "DROP TABLE IF EXISTS function;\n"; print "CREATE TABLE function ("; print " func_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; +print " name char(64) not null,"; +print " url char(128) not null,"; print " description text not null,"; print " example text not null,"; print " min_args tinyint not null,"; @@ -145,8 +145,8 @@ print ") type=myisam;\n\n"; print "DROP TABLE IF EXISTS function_category_name;\n"; print "CREATE TABLE function_category_name ("; print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; +print " name char(64) not null,"; +print " url char(128) not null,"; print " date_created datetime not null,"; print " last_modified timestamp not null,"; print " primary key (cat_id)"; diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 29f6f7b41e1..bb4c2f08193 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -270,11 +270,11 @@ then c_ht="$c_ht CREATE TABLE help_topic (" c_ht="$c_ht help_topic_id int unsigned not null," - c_ht="$c_ht name varchar(64) not null," + c_ht="$c_ht name char(64) not null," c_ht="$c_ht help_category_id smallint unsigned not null," c_ht="$c_ht description text not null," c_ht="$c_ht example text not null," - c_ht="$c_ht url varchar(128) not null," + c_ht="$c_ht url char(128) not null," c_ht="$c_ht primary key (help_topic_id)," c_ht="$c_ht unique index (name)" c_ht="$c_ht ) engine=MyISAM" @@ -292,9 +292,9 @@ then c_hc="$c_hc CREATE TABLE help_category (" c_hc="$c_hc help_category_id smallint unsigned not null," - c_hc="$c_hc name varchar(64) not null," + c_hc="$c_hc name char(64) not null," c_hc="$c_hc parent_category_id smallint unsigned null," - c_hc="$c_hc url varchar(128) not null," + c_hc="$c_hc url char(128) not null," c_hc="$c_hc primary key (help_category_id)," c_hc="$c_hc unique index (name)" c_hc="$c_hc ) engine=MyISAM" @@ -310,7 +310,7 @@ then c_hk="$c_hk CREATE TABLE help_keyword (" c_hk="$c_hk help_keyword_id int unsigned not null," - c_hk="$c_hk name varchar(64) not null," + c_hk="$c_hk name char(64) not null," c_hk="$c_hk primary key (help_keyword_id)," c_hk="$c_hk unique index (name)" c_hk="$c_hk ) engine=MyISAM" diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index d5c96532782..d080b68b268 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -13,7 +13,7 @@ args="" port="" socket="" database="mysql" -bindir="." +bindir="" pkgdatadir="@pkgdatadir@" print_defaults_bindir="." diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 628b034362d..dee4ebd3d2f 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -319,19 +319,19 @@ KEY Grantor (Grantor) CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, -name varchar(64) not null, +name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, -url varchar(128) not null, +url char(128) not null, primary key (help_topic_id), unique index (name) ) CHARACTER SET utf8 comment='help topics'; CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, -name varchar(64) not null, +name char(64) not null, parent_category_id smallint unsigned null, -url varchar(128) not null, +url char(128) not null, primary key (help_category_id), unique index (name) ) CHARACTER SET utf8 comment='help categories'; @@ -344,7 +344,7 @@ primary key (help_keyword_id, help_topic_id) CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, -name varchar(64) not null, +name char(64) not null, primary key (help_keyword_id), unique index (name) ) CHARACTER SET utf8 comment='help keywords'; @@ -491,3 +491,35 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT 0 NOT NULL; + +# +# Change all varchar fields in privilege tables to CHAR, to ensure that +# we can use the privilege tables in MySQL 4.1 +# Note that for this hack to work, we must change all CHAR() columns at +# the same time +# + +ALTER TABLE mysql.user +modify Host char(60) binary DEFAULT '' NOT NULL, +modify User char(16) binary DEFAULT '' NOT NULL, +modify Password char(41) binary DEFAULT '' NOT NULL; + +ALTER TABLE mysql.db +modify Host char(60) binary DEFAULT '' NOT NULL, +modify Db char(64) binary DEFAULT '' NOT NULL, +modify User char(16) binary DEFAULT '' NOT NULL; + +ALTER TABLE mysql.host +modify Host char(60) binary DEFAULT '' NOT NULL, +modify Db char(64) binary DEFAULT '' NOT NULL; + +ALTER TABLE help_topic +modify name char(64) not null, +modify url char(128) not null; + +ALTER TABLE help_category +modify name char(64) not null, +modify url char(128) not null; + +ALTER TABLE help_keyword +modify name char(64) not null; -- cgit v1.2.1 From 94ede0717af1ad69e0cc0fbe2748795d053282be Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Thu, 31 Mar 2005 20:27:29 +0200 Subject: include sql/examples in the window source distribution --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 036ed6fcc93..a003e52196e 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -251,7 +251,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 sql-common sql/examples \ tools vio zlib do copy_dir_files $i -- cgit v1.2.1 From 77303197385208926a96f7b42ebff7ea5cda1fbd Mon Sep 17 00:00:00 2001 From: "petr@mysql.com" <> Date: Mon, 4 Apr 2005 03:49:10 +0400 Subject: Enable IM in the binary distribution and fix Bug #9513 (mysql.server script from the binary distibution doesn't work out of the box) --- scripts/make_binary_distribution.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ddce55c063d..6ebe05fe116 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -103,6 +103,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ + server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ @@ -122,13 +123,13 @@ if [ $BASE_SYSTEM = "netware" ] ; then # For all other platforms: else BIN_FILES="$BIN_FILES \ - client/mysqlmanagerc \ - client/mysqlmanager-pwgen tools/mysqlmanager \ + client/mysqltestmanagerc \ + client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqldump client/.libs/mysqlimport \ client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ - client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ + client/.libs/mysqltestmanager-pwgen tools/.libs/mysqltestmanager \ tests/.libs/mysql_client_test \ libmysqld/examples/.libs/mysql_client_test_embedded \ libmysqld/examples/.libs/mysqltest_embedded \ @@ -231,7 +232,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* $CP scripts/* $BASE/bin $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server + $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@MYSQLD_USER\@ mysql \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure -- cgit v1.2.1 From 127afff8c87cf8d6a56de799a6b7d5ad2a20d5bd Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 5 Apr 2005 13:01:42 -0700 Subject: Remove references to result.es files --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6ebe05fe116..a1c380780b0 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -225,7 +225,7 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*.result mysql-test/r/*.result.es mysql-test/r/*.require \ +$CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then -- cgit v1.2.1 From 49e721677f9eec2ae8e869dacc8acb522f72ef05 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Wed, 6 Apr 2005 17:22:21 +0300 Subject: Fixed errors descovered by valgrind 2.4 Added suppression file for some valgrind warnings that are not real errors --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ddce55c063d..22bf13d8bef 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -207,6 +207,7 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD for i in mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf do if [ -f $i ] -- cgit v1.2.1 From 3dcfc31e769a5127294c5d80d19b1bdb9a2d1a43 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 12 Apr 2005 18:04:32 -0700 Subject: Remove references to result.es files --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 01d635688d8..46d1b74d2bf 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -222,7 +222,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*result mysql-test/r/*result.es mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From 11df4eec8546fc6d6230753f7b5f7b60f2c6d658 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 13 Apr 2005 11:51:38 +0200 Subject: - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all references to the .texi file and the build targets that depend on manual.texi as the input file. - added COPYING as a regular file instead of creating it during the build. This ensures that it's part of the sources when pulling from BK (it used to be extracted from the manual) - Removed a lot of cruft and unused/obsolete stuff from the Docs directory (e.g. Flags, Images) - added a dummy mysql.info placeholder file (the info file is still used as the source to extract various text files during the build). It will be replaced with a "real" file during the Bootstrap process to create the official source distribution - the placeholder just satisfies build dependencies. --- scripts/make_win_src_distribution.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 9aca62527e6..0800fec1ac6 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -275,9 +275,7 @@ cd $SOURCE for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ - Docs/manual_toc.html Docs/manual.html \ - Docs/manual.txt Docs/mysqld_error.txt \ - Docs/INSTALL-BINARY Docs/internals.texi + Docs/INSTALL-BINARY do print_debug "Copying file '$i'" @@ -297,8 +295,7 @@ cp support-files/*.cnf $BASE/support-files # Raw dirs from source tree # -for i in Docs/Flags scripts sql-bench SSL \ - tests +for i in scripts sql-bench SSL tests do print_debug "Copying directory '$i'" if [ -d $i ] -- cgit v1.2.1 From 077368fc28da81cc05eeb515b58b6dff47b79afe Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 13 Apr 2005 18:29:23 +0200 Subject: More changes to reflect the removal of manual.texi from the sources: - Added a stub scripts/fill_help_tables.sql file to satisfy the build dependencies - Removed scripts/fill_help_tables.sh and updated scripts/Makefile.am accordingly The fill_help_tables.sql stub will be replaced with the approriate content when building the official source distribution via Bootstrap - it's now autogenerated on the documentation server and will be copied into place before packing up the source distribution. --- scripts/Makefile.am | 7 +------ scripts/fill_help_tables.sql | 3 +++ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 scripts/fill_help_tables.sql (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d5337df35b1..b170fa483b2 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -59,7 +59,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ mysqld_safe.sh \ - fill_help_tables.sh \ mysql_create_system_tables.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ @@ -87,7 +86,6 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysqld_multi \ make_win_src_distribution \ - fill_help_tables \ mysql_create_system_tables SUPERCLEANFILES = mysqlbug @@ -151,7 +149,4 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_help_tables.sql make_win_src_distribution make_binary_distribution make_sharedlib_distribution - -fill_help_tables.sql: fill_help_tables ../Docs/manual.texi - ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql +all: make_win_src_distribution make_binary_distribution make_sharedlib_distribution diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql new file mode 100644 index 00000000000..9f527c288e9 --- /dev/null +++ b/scripts/fill_help_tables.sql @@ -0,0 +1,3 @@ +-- fill_help_tables.sql - this file is a placeholder to satisfy build dependencies - +-- it will be replaced with the appropriate content by the Boostrap script that +-- creates the official source distribution. -- cgit v1.2.1 From 2b322f36d8e458927845e81e6585a61e8dfff038 Mon Sep 17 00:00:00 2001 From: "monty@mishka.local" <> Date: Sat, 16 Apr 2005 04:12:30 +0300 Subject: Ensure that all privilege tables are created in MyISAM --- scripts/mysql_create_system_tables.sh | 1 + scripts/mysql_fix_privilege_tables.sql | 2 ++ 2 files changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 993efcb0fda..4c642423879 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -629,6 +629,7 @@ fi cat << END_OF_DATA use mysql; +set table_type=myisam; $c_d $i_d diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 8f398689bd9..0d7d32fd6a9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,6 +9,8 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' +set table_type=MyISAM; + CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, -- cgit v1.2.1 From de1b1fe54d4e7cac521fd0447031786e86ae8727 Mon Sep 17 00:00:00 2001 From: "monty@mishka.local" <> Date: Sat, 16 Apr 2005 10:53:30 +0300 Subject: Added more rows to test to get predictable results --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b99519b87c9..17a9be17108 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -233,7 +233,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* $CP scripts/* $BASE/bin $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@MYSQLD_USER\@ mysql \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server + $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@libexecdir\@ ./bin \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure -- cgit v1.2.1 From 1ef7bbc74b934db6f59f28b8953d0b0569878fa6 Mon Sep 17 00:00:00 2001 From: "acurtis@xiphis.org" <> Date: Mon, 18 Apr 2005 22:01:18 +0100 Subject: Update for VARCHAR and remove 4.1-specific actions. by Philip Antoniades --- scripts/mysql_fix_privilege_tables.sql | 46 ++++++---------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 00fe5c053d0..d18536e1c81 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,7 +9,7 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -set table_type=MyISAM; +set storage_engine=MyISAM; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, @@ -64,7 +64,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( ALTER TABLE tables_priv modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -ALTER TABLE procs_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE procs_priv ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE procs_priv modify Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL; @@ -321,19 +321,19 @@ KEY Grantor (Grantor) CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, -name char(64) not null, +name varchar(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, -url char(128) not null, +url varchar(128) not null, primary key (help_topic_id), unique index (name) ) CHARACTER SET utf8 comment='help topics'; CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, -name char(64) not null, +name varchar(64) not null, parent_category_id smallint unsigned null, -url char(128) not null, +url varchar(128) not null, primary key (help_category_id), unique index (name) ) CHARACTER SET utf8 comment='help categories'; @@ -346,7 +346,7 @@ primary key (help_keyword_id, help_topic_id) CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, -name char(64) not null, +name varchar(64) not null, primary key (help_keyword_id), unique index (name) ) CHARACTER SET utf8 comment='help keywords'; @@ -493,35 +493,3 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT 0 NOT NULL; - -# -# Change all varchar fields in privilege tables to CHAR, to ensure that -# we can use the privilege tables in MySQL 4.1 -# Note that for this hack to work, we must change all CHAR() columns at -# the same time -# - -ALTER TABLE mysql.user -modify Host char(60) binary DEFAULT '' NOT NULL, -modify User char(16) binary DEFAULT '' NOT NULL, -modify Password char(41) binary DEFAULT '' NOT NULL; - -ALTER TABLE mysql.db -modify Host char(60) binary DEFAULT '' NOT NULL, -modify Db char(64) binary DEFAULT '' NOT NULL, -modify User char(16) binary DEFAULT '' NOT NULL; - -ALTER TABLE mysql.host -modify Host char(60) binary DEFAULT '' NOT NULL, -modify Db char(64) binary DEFAULT '' NOT NULL; - -ALTER TABLE help_topic -modify name char(64) not null, -modify url char(128) not null; - -ALTER TABLE help_category -modify name char(64) not null, -modify url char(128) not null; - -ALTER TABLE help_keyword -modify name char(64) not null; -- cgit v1.2.1 From 48ba5e495666fd5db051c1a1aa9d4d61a85f07c0 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Wed, 20 Apr 2005 20:10:28 +0200 Subject: Step 1 of the switch to support configuration with NPTL: Rename 'IS_LINUX' configuration variable to 'TARGET_LINUX'. --- scripts/Makefile.am | 2 +- scripts/mysqld_safe.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b170fa483b2..e2ef1bba97c 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -135,7 +135,7 @@ SUFFIXES = .sh -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ - -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ + -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 308db270828..8a232f4f7f9 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -324,7 +324,7 @@ do break fi - if @IS_LINUX@ && test $KILL_MYSQLD -eq 1 + if @TARGET_LINUX@ && test $KILL_MYSQLD -eq 1 then # Test if one process was hanging. # This is only a fix for Linux (running as base 3 mysqld processes) -- cgit v1.2.1 From 3022cbc60c79ef8efcc767e2fb5ebc4f2981c1dc Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Sun, 24 Apr 2005 22:37:43 +0200 Subject: Informing of deprecation of mysql_tableinfo by INFORMATION_SCHEMA (and I'm thinking of removing the script in 5.1). --- scripts/mysql_tableinfo.sh | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh index f5083a776c6..2ed7e381fa3 100644 --- a/scripts/mysql_tableinfo.sh +++ b/scripts/mysql_tableinfo.sh @@ -6,6 +6,14 @@ use DBI; =head1 NAME +WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA +pseudo-database which contains always up-to-date metadata information +about all tables. So instead of using this script one can now +simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, +INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. +Please see the MySQL manual for more information about INFORMATION_SCHEMA. +This script will be removed from the MySQL distribution in version 5.1. + mysql_tableinfo - creates and populates information tables with the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), SHOW COLUMNS and SHOW INDEX. @@ -62,6 +70,19 @@ GetOptions( \%opt, "quiet|q", ) or usage("Invalid option"); +if (!$opt{'quiet'}) + { + print <quote($tbl_like_wild); if (!$opt{'quiet'}) { - print "\n!! This program is doing to do:\n\n"; + print "\n!! This program is going to do:\n\n"; print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild **INSERT** INTO ... @@ -456,17 +477,14 @@ UNIX domain socket to use when connecting to server =head1 WARRANTY -This software is free and comes without warranty of any kind. You -should never trust backup software without studying the code yourself. -Study the code inside this script and only rely on it if I believe -that it does the right thing for you. +This software is free and comes without warranty of any kind. Patches adding bug fixes, documentation and new features are welcome. =head1 TO DO -Use extended inserts to be faster (for servers with many databases -or tables). But to do that, must care about net-buffer-length. +Nothing: starting from MySQL 5.0, this program is replaced by the +INFORMATION_SCHEMA pseudo-database. =head1 AUTHOR -- cgit v1.2.1 From 7810721f401c28193af8cecb22dc9b047681fb23 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 26 Apr 2005 14:28:22 +0300 Subject: Fixed Bug#9835: mysqld_multi --help won't output help if there are parameter problems. --- scripts/mysqld_multi.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index ee873a86c8d..e4895ae4bef 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.12"; +$VER="2.13"; $opt_config_file = undef(); $opt_example = 0; @@ -37,13 +37,13 @@ main(); sub main { - my ($flag_exit); + my $flag_exit= 0; if (!defined(my_which(my_print_defaults))) { # We can't throw out yet, since --version, --help, or --example may # have been given - print "WARNING! my_print_defaults command not found!\n"; + print "WARNING: my_print_defaults command not found.\n"; print "Please make sure you have this command available and\n"; print "in your path. The command is available from the latest\n"; print "MySQL distribution.\n"; @@ -76,10 +76,14 @@ sub main chop @defops; splice @ARGV, 0, 0, @defops; } - GetOptions("help","example","version","mysqld=s","mysqladmin=s", - "config-file=s","user=s","password=s","log=s","no-log","tcp-ip", - "silent","verbose") - || die "Wrong option! See $my_progname --help for detailed information!\n"; + if (!GetOptions("help","example","version","mysqld=s","mysqladmin=s", + "config-file=s","user=s","password=s","log=s","no-log", + "tcp-ip", "silent","verbose")) + { + $flag_exit= 1; + } + + usage() if ($opt_help); if ($opt_verbose && $opt_silent) { @@ -95,15 +99,14 @@ sub main exit(0); } example() if ($opt_example); - usage() if ($opt_help); if ($flag_exit) { - print "Error with an option, see $my_progname --help for more info!\n"; + print "Error with an option, see $my_progname --help for more info.\n"; exit(1); } if (!defined(my_which(my_print_defaults))) { - print "ABORT: Can't find command 'my_print_defaults'!\n"; + print "ABORT: Can't find command 'my_print_defaults'.\n"; print "This command is available from the latest MySQL\n"; print "distribution. Please make sure you have the command\n"; print "in your PATH.\n"; -- cgit v1.2.1 From d4d0f9c1269cbac0c7accca7d27eb97138eb3a49 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 26 Apr 2005 16:16:38 +0300 Subject: Fixed Bug#6221, "mysqld_multi doesn't read the init_connect option in my.cnf correctly" --- scripts/mysqld_multi.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index e4895ae4bef..8c363836a25 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.13"; +$VER="2.14"; $opt_config_file = undef(); $opt_example = 0; @@ -159,6 +159,31 @@ sub main } } +#### +#### Quote option argument. Add double quotes around the argument +#### and escape the following: $, \, " +#### This function is needed, because my_print_defaults drops possible +#### quotes, single or double, from in front of an argument and from +#### the end. +#### + +sub quote_opt_arg +{ + my ($option)= @_; + + if ($option =~ m/(\-\-[a-zA-Z0-9\_\-]+)=(.*)/) + { + $option= $1; + $arg= $2; + $arg=~ s/\\/\\\\/g; # Escape escape character first to avoid doubling. + $arg=~ s/\$/\\\$/g; + $arg=~ s/\"/\\\"/g; + $arg= "\"" . $arg . "\""; + $option= $option . "=" . $arg; + } + return $option; +} + #### #### Init log file. Check for appropriate place for log file, in the following #### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp @@ -293,6 +318,7 @@ sub start_mysqlds() else { $options[$j]=~ s/;/\\;/g; + $options[$j]= quote_opt_arg($options[$j]); $tmp.= " $options[$j]"; } } -- cgit v1.2.1 From c98b90bbfb168f5d5653380e54cd19eeba3b9fff Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 26 Apr 2005 17:46:43 +0300 Subject: Fixed Bug#9834, "mysqld_multi --config-file parameter requires absolute path". --- scripts/mysqld_multi.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 8c363836a25..19434c3dc27 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -66,6 +66,11 @@ sub main else { $opt_config_file= $1; + if (!($opt_config_file =~ m/\//)) + { + # No path. Use current working directory + $opt_config_file= "./" . $opt_config_file; + } } } } @@ -82,7 +87,11 @@ sub main { $flag_exit= 1; } - + if (!($opt_config_file =~ m/\//)) + { + # No path. Use current working directory + $opt_config_file= "./" . $opt_config_file; + } usage() if ($opt_help); if ($opt_verbose && $opt_silent) -- cgit v1.2.1 From 005c447183651411ead446e463909118f7020298 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Tue, 26 Apr 2005 17:57:14 +0300 Subject: Added a check for config-file. --- scripts/mysqld_multi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 19434c3dc27..642772bca44 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -87,7 +87,7 @@ sub main { $flag_exit= 1; } - if (!($opt_config_file =~ m/\//)) + if (defined($opt_config_file) && !($opt_config_file =~ m/\//)) { # No path. Use current working directory $opt_config_file= "./" . $opt_config_file; -- cgit v1.2.1 From c5cb8a2bfa286f6db671187df7d92e5bde8f924f Mon Sep 17 00:00:00 2001 From: "mwagner@ultrafly.mysql.com" <> Date: Sun, 8 May 2005 23:02:50 +0200 Subject: make_binary_distribution.sh: - Remove vendor tag from package names. - Map standard OS names to user-friendly versions. --- scripts/make_binary_distribution.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 17a9be17108..6c0487aee40 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -294,6 +294,22 @@ if [ x$NDBCLUSTER = x1 ]; then rm -rf $BASE/ndb-stage fi +# Remove vendor from $system +system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` + +# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) +system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` +system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` +system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` +system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` +system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` +system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` +system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` +system=`echo $system | sed -e 's/osf5.1b/tru64/g'` +system=`echo $system | sed -e 's/linux-gnu/linux/g'` +system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` +system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` + # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX BASE2=$TMP/$NEW_NAME -- cgit v1.2.1 From b1edf499520e0dbce658ebab13ba2ef4e99a7eba Mon Sep 17 00:00:00 2001 From: "serg@sergbook.mylan" <> Date: Mon, 9 May 2005 09:24:05 +0200 Subject: don't use tmp file for such a triviality --- scripts/mysql_install_db.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0b82e02761e..8dd95da11e3 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -11,7 +11,6 @@ in_rpm=0 windows=0 defaults="" user="" -tmp_file=/tmp/mysql_install_db.$$ case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) @@ -223,10 +222,8 @@ then then echo "Fill help tables" fi - echo "use mysql;" > $tmp_file - cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line" + (echo "use mysql;"; cat $fill_help_tables) | eval "$mysqld_install_cmd_line" res=$? - rm $tmp_file if test $res != 0 then echo "" -- cgit v1.2.1 From f5ba5ab02462749f2fb77c727ab7890e2e57f6c1 Mon Sep 17 00:00:00 2001 From: "mwagner@ultrafly.mysql.com" <> Date: Mon, 9 May 2005 12:05:13 +0200 Subject: make_binary_distribution.sh: - Print the platform name for the build logs. --- scripts/make_binary_distribution.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6c0487aee40..48461135b44 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -312,6 +312,10 @@ system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX + +# Print the platform name for build logs +echo "PLATFORM NAME: $system-$machine" + BASE2=$TMP/$NEW_NAME rm -r -f $BASE2 mv $BASE $BASE2 -- cgit v1.2.1 From 58409db4c95b86aac1d65ee869a067d252afa452 Mon Sep 17 00:00:00 2001 From: "mwagner@ultrafly.mysql.com" <> Date: Mon, 9 May 2005 14:57:45 +0200 Subject: make_binary_distribution.sh: - Add --machine override --- scripts/make_binary_distribution.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 48461135b44..1f28b8e4538 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -15,6 +15,7 @@ MV="mv" STRIP=1 DEBUG=0 SILENT=0 +MACHINE= TMP=/tmp SUFFIX="" NDBCLUSTER= @@ -26,6 +27,7 @@ parse_arguments() { --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; + --machine) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; *) @@ -38,6 +40,8 @@ parse_arguments() { parse_arguments "$@" + + #make # This should really be integrated with automake and not duplicate the @@ -310,6 +314,11 @@ system=`echo $system | sed -e 's/linux-gnu/linux/g'` system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` +# Use the override --machine if present +if [ $MACHINE != "" ] ; then + machine= $MACHINE +fi + # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX -- cgit v1.2.1 From 43d9b1d8c97a4053e7aab33aaa616d42de572976 Mon Sep 17 00:00:00 2001 From: "gbichot@quadita2.mysql.com" <> Date: Thu, 12 May 2005 22:28:26 +0200 Subject: mysql_tableinfo removed (replaced by information schema; put a warning in the 5.0 version of the script about removal in 5.1). Sad to say good bye to my contribution - this is hara-kiri, but that's for the sake of not confusing our users with a now useless script. --- scripts/Makefile.am | 2 - scripts/mysql_tableinfo.sh | 494 --------------------------------------------- 2 files changed, 496 deletions(-) delete mode 100644 scripts/mysql_tableinfo.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b2fef9acadf..48e748f8cf0 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -31,7 +31,6 @@ bin_SCRIPTS = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysql_explain_log \ - mysql_tableinfo \ mysqld_multi \ make_win_src_distribution \ make_win_binary_distribution \ @@ -57,7 +56,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqldumpslow.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ - mysql_tableinfo.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh deleted file mode 100644 index 2ed7e381fa3..00000000000 --- a/scripts/mysql_tableinfo.sh +++ /dev/null @@ -1,494 +0,0 @@ -#!@PERL@ -w - -use strict; -use Getopt::Long; -use DBI; - -=head1 NAME - -WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA -pseudo-database which contains always up-to-date metadata information -about all tables. So instead of using this script one can now -simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES, -INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables. -Please see the MySQL manual for more information about INFORMATION_SCHEMA. -This script will be removed from the MySQL distribution in version 5.1. - -mysql_tableinfo - creates and populates information tables with -the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), -SHOW COLUMNS and SHOW INDEX. - -This is version 1.1. - -=head1 SYNOPSIS - - mysql_tableinfo [OPTIONS] database_to_write [database_like_wild] [table_like_wild] - - Do not backquote (``) database_to_write, - and do not quote ('') database_like_wild or table_like_wild - - Examples: - - mysql_tableinfo info - - mysql_tableinfo info this_db - - mysql_tableinfo info %a% b% - - mysql_tableinfo info --clear-only - - mysql_tableinfo info --col --idx --table-status - -=cut - -# Documentation continued at end of file - - -sub usage { - die @_,"\nExecute 'perldoc $0' for documentation\n"; -} - -my %opt = ( - 'user' => scalar getpwuid($>), - 'host' => "localhost", - 'prefix' => "", #to avoid 'use of uninitialized value...' -); -Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P -GetOptions( \%opt, - "help", - "user|u=s", - "password|p=s", - "host|h=s", - "port|P=s", - "socket|S=s", - "tbl-status", - "col", - "idx", - "clear", - "clear-only", - "prefix=s", - "quiet|q", -) or usage("Invalid option"); - -if (!$opt{'quiet'}) - { - print <0) { usage("Too many arguments"); } - -$0 = $1 if $0 =~ m:/([^/]+)$:; - -my $info_db="`".$opt{'prefix'}."db`"; -my $info_tbl="`".$opt{'prefix'}."tbl". - (($opt{'tbl-status'})?"_status":"")."`"; -my $info_col="`".$opt{'prefix'}."col`"; -my $info_idx="`".$opt{'prefix'}."idx`"; - - -# --- connect to the database --- - -my $dsn = ";host=$opt{'host'}"; -$dsn .= ";port=$opt{'port'}" if $opt{'port'}; -$dsn .= ";mysql_socket=$opt{'socket'}" if $opt{'socket'}; - -my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=perl", - $opt{'user'}, $opt{'password'}, -{ - RaiseError => 1, - PrintError => 0, - AutoCommit => 1, -}); - -$db_like_wild=$dbh->quote($db_like_wild); -$tbl_like_wild=$dbh->quote($tbl_like_wild); - -#Ask - -if (!$opt{'quiet'}) -{ - print "\n!! This program is going to do:\n\n"; - print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); - print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild -**INSERT** INTO ... - -on the following tables :\n"; - - foreach (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) - { - print(" $db_to_write.$_\n"); - } - print "\nContinue (you can skip this confirmation step with --quiet) ? (y|n) [n]"; - if ( !~ /^\s*y\s*$/i) - { - print "Nothing done!\n";exit; - } -} - -if ($opt{'clear'} or $opt{'clear-only'}) -{ -#do not drop the $db_to_write database ! - foreach (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) - { - $dbh->do("DROP TABLE IF EXISTS $db_to_write.$_"); - } - if ($opt{'clear-only'}) - { - print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); - exit; - } -} - - -my %sth; -my %extra_col_desc; -my %row; -my %done_create_table; - -#create the $db_to_write database -$dbh->do("CREATE DATABASE IF NOT EXISTS $db_to_write"); -$dbh->do("USE $db_to_write"); - -#get databases -$sth{'db'}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); -$sth{'db'}->execute; - -#create $info_db which will receive info about databases. -#Ensure that the first column to be called "Database" (as SHOW DATABASES LIKE -#returns a varying -#column name (of the form "Database (%...)") which is not suitable) -$extra_col_desc{'db'}=do_create_table("db",$info_db,undef,"`Database`"); -#we'll remember the type of the `Database` column (as returned by -#SHOW DATABASES), which we will need when creating the next tables. - -#clear out-of-date info from this table -$dbh->do("DELETE FROM $info_db WHERE `Database` LIKE $db_like_wild"); - - -while ($row{'db'}=$sth{'db'}->fetchrow_arrayref) #go through all databases -{ - -#insert the database name - $dbh->do("INSERT INTO $info_db VALUES(" - .join(',' , ( map $dbh->quote($_), @{$row{'db'}} ) ).")" ); - -#for each database, get tables - - $sth{'tbl'}=$dbh->prepare("SHOW TABLE" - .( ($opt{'tbl-status'}) ? - " STATUS" - : "S" ) - ." from `$row{'db'}->[0]` LIKE $tbl_like_wild"); - $sth{'tbl'}->execute; - unless ($done_create_table{$info_tbl}) - -#tables must be created only once, and out-of-date info must be -#cleared once - { - $done_create_table{$info_tbl}=1; - $extra_col_desc{'tbl'}= - do_create_table("tbl",$info_tbl, -#add an extra column (database name) at the left -#and ensure that the table name will be called "Table" -#(this is unncessesary with -#SHOW TABLE STATUS, but necessary with SHOW TABLES (which returns a column -#named "Tables_in_...")) - "`Database` ".$extra_col_desc{'db'},"`Table`"); - $dbh->do("DELETE FROM $info_tbl WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); - } - - while ($row{'tbl'}=$sth{'tbl'}->fetchrow_arrayref) - { - $dbh->do("INSERT INTO $info_tbl VALUES(" - .$dbh->quote($row{'db'}->[0])."," - .join(',' , ( map $dbh->quote($_), @{$row{'tbl'}} ) ).")"); - -#for each table, get columns... - - if ($opt{'col'}) - { - $sth{'col'}=$dbh->prepare("SHOW COLUMNS FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); - $sth{'col'}->execute; - unless ($done_create_table{$info_col}) - { - $done_create_table{$info_col}=1; - do_create_table("col",$info_col, - "`Database` ".$extra_col_desc{'db'}."," - ."`Table` ".$extra_col_desc{'tbl'}."," - ."`Seq_in_table` BIGINT(3)"); -#We need to add a sequence number (1 for the first column of the table, -#2 for the second etc) so that users are able to retrieve columns in order -#if they want. This is not needed for INDEX -#(where there is already Seq_in_index) - $dbh->do("DELETE FROM $info_col WHERE `Database` - LIKE $db_like_wild - AND `Table` LIKE $tbl_like_wild"); - } - my $col_number=0; - while ($row{'col'}=$sth{'col'}->fetchrow_arrayref) - { - $dbh->do("INSERT INTO $info_col VALUES(" - .$dbh->quote($row{'db'}->[0])."," - .$dbh->quote($row{'tbl'}->[0])."," - .++$col_number."," - .join(',' , ( map $dbh->quote($_), @{$row{'col'}} ) ).")"); - } - } - -#and get index. - - if ($opt{'idx'}) - { - $sth{'idx'}=$dbh->prepare("SHOW INDEX FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); - $sth{'idx'}->execute; - unless ($done_create_table{$info_idx}) - { - $done_create_table{$info_idx}=1; - do_create_table("idx",$info_idx, - "`Database` ".$extra_col_desc{'db'}); - $dbh->do("DELETE FROM $info_idx WHERE `Database` - LIKE $db_like_wild - AND `Table` LIKE $tbl_like_wild"); - } - while ($row{'idx'}=$sth{'idx'}->fetchrow_arrayref) - { - $dbh->do("INSERT INTO $info_idx VALUES(" - .$dbh->quote($row{'db'}->[0])."," - .join(',' , ( map $dbh->quote($_), @{$row{'idx'}} ) ).")"); - } - } - } -} - -print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); -exit; - - -sub do_create_table -{ - my ($sth_key,$target_tbl,$extra_col_desc,$first_col_name)=@_; - my $create_table_query=$extra_col_desc; - my ($i,$first_col_desc,$col_desc); - - for ($i=0;$i<$sth{$sth_key}->{NUM_OF_FIELDS};$i++) - { - if ($create_table_query) { $create_table_query.=", "; } - $col_desc=$sth{$sth_key}->{mysql_type_name}->[$i]; - if ($col_desc =~ /char|int/i) - { - $col_desc.="($sth{$sth_key}->{PRECISION}->[$i])"; - } - elsif ($col_desc =~ /decimal|numeric/i) #(never seen that) - { - $col_desc.= - "($sth{$sth_key}->{PRECISION}->[$i],$sth{$sth_key}->{SCALE}->[$i])"; - } - elsif ($col_desc !~ /date/i) #date and datetime are OK, - #no precision or scale for them - { - warn "unexpected column type '$col_desc' -(neither 'char','int','decimal|numeric') -when creating $target_tbl, hope table creation will go OK\n"; - } - if ($i==0) {$first_col_desc=$col_desc}; - $create_table_query.= - ( ($i==0 and $first_col_name) ? - "$first_col_name " :"`$sth{$sth_key}->{NAME}->[$i]` " ) - .$col_desc; - } -if ($create_table_query) -{ - $dbh->do("CREATE TABLE IF NOT EXISTS $target_tbl ($create_table_query)"); -} -return $first_col_desc; -} - -__END__ - - -=head1 DESCRIPTION - -mysql_tableinfo asks a MySQL server information about its -databases, tables, table columns and index, and stores this -in tables called `db`, `tbl` (or `tbl_status`), `col`, `idx` -(with an optional prefix specified with --prefix). -After that, you can query these information tables, for example -to build your admin scripts with SQL queries, like - -SELECT CONCAT("CHECK TABLE ",`database`,".",`table`," EXTENDED;") -FROM info.tbl WHERE ... ; - -as people usually do with some other RDBMS -(note: to increase the speed of your queries on the info tables, -you may add some index on them). - -The database_like_wild and table_like_wild instructs the program -to gather information only about databases and tables -whose names match these patterns. If the info -tables already exist, their rows matching the patterns are simply -deleted and replaced by the new ones. That is, -old rows not matching the patterns are not touched. -If the database_like_wild and table_like_wild arguments -are not specified on the command-line they default to "%". - -The program : - -- does CREATE DATABASE IF NOT EXISTS database_to_write -where database_to_write is the database name specified on the command-line. - -- does CREATE TABLE IF NOT EXISTS database_to_write.`db` - -- fills database_to_write.`db` with the output of -SHOW DATABASES LIKE database_like_wild - -- does CREATE TABLE IF NOT EXISTS database_to_write.`tbl` -(respectively database_to_write.`tbl_status` -if the --tbl-status option is on) - -- for every found database, -fills database_to_write.`tbl` (respectively database_to_write.`tbl_status`) -with the output of -SHOW TABLES FROM found_db LIKE table_like_wild -(respectively SHOW TABLE STATUS FROM found_db LIKE table_like_wild) - -- if the --col option is on, - * does CREATE TABLE IF NOT EXISTS database_to_write.`col` - * for every found table, - fills database_to_write.`col` with the output of - SHOW COLUMNS FROM found_tbl FROM found_db - -- if the --idx option is on, - * does CREATE TABLE IF NOT EXISTS database_to_write.`idx` - * for every found table, - fills database_to_write.`idx` with the output of - SHOW INDEX FROM found_tbl FROM found_db - -Some options may modify this general scheme (see below). - -As mentioned, the contents of the info tables are the output of -SHOW commands. In fact the contents are slightly more complete : - -- the `tbl` (or `tbl_status`) info table - has an extra column which contains the database name, - -- the `col` info table - has an extra column which contains the table name, - and an extra column which contains, for each described column, - the number of this column in the table owning it (this extra column - is called `Seq_in_table`). `Seq_in_table` makes it possible for you - to retrieve your columns in sorted order, when you are querying - the `col` table. - -- the `index` info table - has an extra column which contains the database name. - -Caution: info tables contain certain columns (e.g. -Database, Table, Null...) whose names, as they are MySQL reserved words, -need to be backquoted (`...`) when used in SQL statements. - -Caution: as information fetching and info tables filling happen at the -same time, info tables may contain inaccurate information about -themselves. - -=head1 OPTIONS - -=over 4 - -=item --clear - -Does DROP TABLE on the info tables (only those that the program is -going to fill, for example if you do not use --col it won't drop -the `col` table) and processes normally. Does not drop database_to_write. - -=item --clear-only - -Same as --clear but exits after the DROPs. - -=item --col - -Adds columns information (into table `col`). - -=item --idx - -Adds index information (into table `idx`). - -=item --prefix prefix - -The info tables are named from the concatenation of prefix and, -respectively, db, tbl (or tbl_status), col, idx. Do not quote ('') -or backquote (``) prefix. - -=item -q, --quiet - -Does not warn you about what the script is going to do (DROP TABLE etc) -and does not ask for a confirmation before starting. - -=item --tbl-status - -Instead of using SHOW TABLES, uses SHOW TABLE STATUS -(much more complete information, but slower). - -=item --help - -Display helpscreen and exit - -=item -u, --user=# - -user for database login if not current user. Give a user -who has sufficient privileges (CREATE, ...). - -=item -p, --password=# - -password to use when connecting to server - -=item -h, --host=# - -host to connect to - -=item -P, --port=# - -port to use when connecting to server - -=item -S, --socket=# - -UNIX domain socket to use when connecting to server - -=head1 WARRANTY - -This software is free and comes without warranty of any kind. - -Patches adding bug fixes, documentation and new features are welcome. - -=head1 TO DO - -Nothing: starting from MySQL 5.0, this program is replaced by the -INFORMATION_SCHEMA pseudo-database. - -=head1 AUTHOR - -2002-06-18 Guilhem Bichot (guilhem.bichot@mines-paris.org) - -And all the authors of mysqlhotcopy, which served as a model for -the structure of the program. -- cgit v1.2.1 From 8df5887ad5a3c9945adffe4961df4b062c0fed31 Mon Sep 17 00:00:00 2001 From: "acurtis@xiphis.org" <> Date: Tue, 17 May 2005 19:54:20 +0100 Subject: Bug#10246 - Parser: bad syntax for GRANT EXECUTE Rename some functions more fine-grained sp privileges make grant/revoke sp grammar less ambigious --- scripts/mysql_create_system_tables.sh | 5 +++-- scripts/mysql_fix_privilege_tables.sql | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 0eb14cd5e65..a8f6c02b057 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -255,10 +255,11 @@ then c_pp="$c_pp Db char(64) binary DEFAULT '' NOT NULL," c_pp="$c_pp User char(16) binary DEFAULT '' NOT NULL," c_pp="$c_pp Routine_name char(64) binary DEFAULT '' NOT NULL," + c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL," c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," - c_pp="$c_pp Timestamp timestamp(14)," c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name)," + c_pp="$c_pp Timestamp timestamp(14)," + c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type)," c_pp="$c_pp KEY Grantor (Grantor)" c_pp="$c_pp ) engine=MyISAM" c_pp="$c_pp CHARACTER SET utf8 COLLATE utf8_bin" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 292720371c8..68b31cf1519 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -67,6 +67,10 @@ ALTER TABLE tables_priv ALTER TABLE procs_priv ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE procs_priv modify Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE procs_priv + add Routine_type enum('FUNCTION','PROCEDURE') COLLATE utf8_general_ci NOT NULL AFTER Routine_name; +ALTER TABLE procs_priv + modify Timestamp timestamp(14) AFTER Proc_priv; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, @@ -316,10 +320,11 @@ Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, +Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, -Timestamp timestamp(14), Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, -PRIMARY KEY (Host,Db,User,Routine_name), +Timestamp timestamp(14), +PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- cgit v1.2.1 From 4dca62401c9c6d351562f73a64ea3a2b869f1b87 Mon Sep 17 00:00:00 2001 From: "matt@mysql.com" <> Date: Wed, 18 May 2005 03:45:01 +0200 Subject: make_binary_distribution.sh: Use portable check for empty string. --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1f28b8e4538..d273e67ec01 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -315,8 +315,8 @@ system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` # Use the override --machine if present -if [ $MACHINE != "" ] ; then - machine= $MACHINE +if [ -n $MACHINE ] ; then + machine=$MACHINE fi # Change the distribution to a long descriptive name -- cgit v1.2.1 From f81e6248d23e1acc25120b48808bbba1ee9d636e Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 18 May 2005 12:49:43 +0200 Subject: make_binary_distribution.sh: To be safe, put "..." around variables to the test command --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d273e67ec01..ecfe9e8be88 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -315,7 +315,7 @@ system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` # Use the override --machine if present -if [ -n $MACHINE ] ; then +if [ -n "$MACHINE" ] ; then machine=$MACHINE fi -- cgit v1.2.1 From 2b5f9fad811752c93580ae90ac37313ade345b7c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 18 May 2005 16:04:44 +0200 Subject: make_win_src_distribution.sh: Add YASSL to Windows source distribution Skip .deps, and remove .o files from source dist --- scripts/make_win_src_distribution.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8fdf23f3119..6165a31fac2 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -199,11 +199,10 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ - README INSTALL* LICENSE *.inc *.test *.result \ - *.pem Moscow_leap des_key_file *.dat *.000001 \ - *.require *.opt - + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ + README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ + *.inc *.test *.result *.pem Moscow_leap des_key_file \ + *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -234,6 +233,7 @@ copy_dir_dirs() { find $arg -type d \ -and -not -path \*SCCS\* \ -and -not -path \*.deps\* \ + -and -not -path \*.libs\* \ -and -not -path \*autom4te.cache -print )|( while read v @@ -266,7 +266,7 @@ make -C $SOURCE/ndb windoze # Input directories to be copied recursively # -for i in bdb innobase ndb +for i in bdb innobase ndb extra/yassl do copy_dir_dirs $i done @@ -328,6 +328,8 @@ do $CP -R $i $BASE/$i fi fi + # But remove object files from destination + find $BASE/$i -type f -name \*.o | xargs rm -f done # -- cgit v1.2.1 From 8a77c6f7417771efc826bd0595ca414ead94d582 Mon Sep 17 00:00:00 2001 From: "tim@siva.hindu.god" <> Date: Fri, 27 May 2005 12:44:06 +1200 Subject: scripts/mysqld_safe.sh Only add --defaults-extra-file=$DATADIR/my.cnf if $DATADIR/my.cnf is readable. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 9ec573737bd..3a06c4d1fb5 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -114,7 +114,7 @@ then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is DATADIR=$MY_BASEDIR_VERSION/data - if test -z "$defaults" + if test -z "$defaults" -a -r "$DATADIR/my.cnf" then defaults="--defaults-extra-file=$DATADIR/my.cnf" fi -- cgit v1.2.1 From 7bd3dd7cb319e901290846544c6a518dfcef0baa Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 1 Jun 2005 12:59:10 +0200 Subject: - removed references to some obsolete files (BUG#10824) - removed obsolete mysql-max.spec.sc RPM spec file (Max is built out of the standard spec file) --- scripts/make_binary_distribution.sh | 3 --- 1 file changed, 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8ea9a16f56b..ffef1648954 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -74,9 +74,6 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi for i in ChangeLog \ - Docs/manual.html \ - Docs/manual.txt \ - Docs/manual_toc.html \ Docs/mysql.info do if [ -f $i ] -- cgit v1.2.1 From b906f31388b5c7c5a7cbd38b9a2f7b2f38b4b0c2 Mon Sep 17 00:00:00 2001 From: "elliot@mysql.com" <> Date: Mon, 6 Jun 2005 22:17:16 -0400 Subject: BUG#7967 Fix mysqlhotcopy --record-log-position --- scripts/mysqlhotcopy.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 632174dc41a..1c5cd6a4faf 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -746,9 +746,15 @@ sub record_log_pos { my ($file,$position) = get_row( $dbh, "show master status" ); die "master status is undefined" if !defined $file || !defined $position; - my ($master_host, undef, undef, undef, $log_file, $log_pos ) - = get_row( $dbh, "show slave status" ); - + my $row_hash = get_row_hash( $dbh, "show slave status" ); + my ($master_host, $log_file, $log_pos ); + if ( $dbh->{mysql_serverinfo} =~ /^3\.23/ ) { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Log_File Pos / }; + } else { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Master_Log_File Read_Master_Log_Pos / }; + } my $hostname = hostname(); $dbh->do( qq{ replace into $table_name @@ -773,6 +779,14 @@ sub get_row { return $sth->fetchrow_array(); } +sub get_row_hash { + my ( $dbh, $sql ) = @_; + + my $sth = $dbh->prepare($sql); + $sth->execute; + return $sth->fetchrow_hashref(); +} + sub scan_raid_dir { my ( $r_db_files, $data_dir, @raid_dir ) = @_; -- cgit v1.2.1 From 1c21f84afb529afba7f18609bbd417552d46698f Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 7 Jun 2005 10:25:51 +0200 Subject: - BUG#10676: don't install "make_win_src_distribution" and "make_win_binary_distribution" when doing "make install" (they are not needed/useful) outside the build tree. Added "mysql_client_test" to the "MySQL-bench" RPM. - some small RPM spec file improvements (more variables than hard-coded values, cleanups) --- scripts/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e2ef1bba97c..7614148ae3e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -33,8 +33,6 @@ bin_SCRIPTS = @server_scripts@ \ mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ - make_win_src_distribution \ - make_win_binary_distribution \ mysql_create_system_tables EXTRA_SCRIPTS = make_binary_distribution.sh \ @@ -86,6 +84,7 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysqld_multi \ make_win_src_distribution \ + make_win_binary_distribution \ mysql_create_system_tables SUPERCLEANFILES = mysqlbug -- cgit v1.2.1 From 024010e562ae166033f69bd8e7b6c1f394cdf310 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 8 Jun 2005 11:49:24 +0200 Subject: - make sure to include mysql-test/t/*.sql files in the binary distributions and when "make install" is called (mysql_delimiter.sql was missing) --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 064c5e63f40..74734f4dd5f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -226,7 +226,7 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ - mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t + mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -- cgit v1.2.1 From 9f4c796922306965c7dd0e352f65184d3a96b4ac Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 24 Jun 2005 17:14:16 -0700 Subject: Fix handling of datadir by mysqld_safe to support specifying a different DATADIR via the command line or during ./configure and still starting up mysqld_safe via a relative path. (Bug #7249) --- scripts/mysqld_safe.sh | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 8a232f4f7f9..d6585f4a552 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -84,31 +84,49 @@ parse_arguments() { } +# +# First, try to find BASEDIR and ledir (where mysqld is) +# + MY_PWD=`pwd` -# Check if we are starting this relative (for the binary release) -if test -f ./share/mysql/english/errmsg.sys -a \ - -x ./bin/mysqld +# Check for the directories we would expect from a binary release install +if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is - DATADIR=$MY_BASEDIR_VERSION/data - if test -z "$defaults" - then - defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" - fi -# Check if this is a 'moved install directory' +# Check for the directories we would expect from a source install elif test -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is - DATADIR=$MY_BASEDIR_VERSION/var +# Since we didn't find anything, used the compiled-in defaults else MY_BASEDIR_VERSION=@prefix@ - DATADIR=@localstatedir@ ledir=@libexecdir@ fi +# +# Second, try to find the data directory +# + +# Try where the binary installs put it +if test -d $MY_BASEDIR_VERSION/data/mysql +then + DATADIR=$MY_BASEDIR_VERSION/data + if test -z "$defaults" + then + defaults="--defaults-extra-file=$DATADIR/my.cnf" + fi +# Next try where the source installs put it +elif test -d $MY_BASEDIR_VERSION/var/mysql +then + DATADIR=$MY_BASEDIR_VERSION/var +# Or just give up and use our compiled-in default +else + DATADIR=@localstatedir@ +fi + user=@MYSQLD_USER@ niceness=0 -- cgit v1.2.1 From 13773acc1b534ab2edb6701f0c54184ae45d82f3 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 24 Jun 2005 17:59:19 -0700 Subject: If mysql_config is a symlink, resolve it before trying to find the lib and include directories relative to where it is located. (Bug #10986) --- scripts/mysql_config.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index a5c8af5ecb2..16e50c044ca 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -60,11 +60,19 @@ fix_path () get_full_path () { - case $1 in - /*) echo "$1";; - ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;; - *) which $1 ;; - esac + file=$1 + + # if the file is a symlink, try to resolve it + if [ -h $file ]; + then + file=`ls -l $file | awk '{ print $NF }'` + fi + + case $file in + /*) echo "$file";; + */*) tmp=`pwd`/$file; echo $tmp | sed -e 's;/\./;/;' ;; + *) which $file ;; + esac } me=`get_full_path $0` -- cgit v1.2.1 From d16e1cafa77f9fb8a208b7076bb63d41e06ce76c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 28 Jun 2005 05:25:29 +0200 Subject: make_win_src_distribution.sh: Bug#11009, some more cleanup of unneded files from bootstrap --- scripts/make_win_src_distribution.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b8dd907920c..71d61b7a02d 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -357,6 +357,9 @@ if [ -d $BASE/SSL/SCCS ] then find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi +find $BASE/ -type d -name .deps -printf " \"%p\"" | xargs rm -r -f +find $BASE/ -type d -name .libs -printf " \"%p\"" | xargs rm -r -f +rm -r -f "$BASE/mysql-test/var" # # Initialize the initial data directory -- cgit v1.2.1 From bfbd0e241b8ece9f212310116a69af20692790a0 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Tue, 5 Jul 2005 13:36:36 +0300 Subject: added processing of view grants to table grants (BUG#9795) --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a8f6c02b057..bc07d857c4b 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -215,7 +215,7 @@ then c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 68b31cf1519..3da2f7504a1 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -260,6 +260,11 @@ ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +# +# Show/Create views table privileges (v5.0) +# +ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + # # Assign create/show view privileges to people who have create provileges # -- cgit v1.2.1 From 49986c7e05770bccd28c72ce90a8ef2eb6bf0e76 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 6 Jul 2005 13:58:29 +0200 Subject: - backported a change for make_binary_distribution.sh from 5.0 for easier building of all versions: added an option "--machine" that allows to override the autodetected architecture string (e.g. "i386") that becomes part of the binary package name with a different one - moved the removal of the BASE directory to the end of the make_binary_distribution script --- scripts/make_binary_distribution.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ffef1648954..0236d8b8bfe 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -15,6 +15,7 @@ MV="mv" STRIP=1 DEBUG=0 SILENT=0 +MACHINE= TMP=/tmp SUFFIX="" @@ -25,6 +26,7 @@ parse_arguments() { --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; + --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; --silent) SILENT=1 ;; *) echo "Unknown argument '$arg'" @@ -252,8 +254,17 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -r -f fi +# Use the override --machine if present +if [ -n "$MACHINE" ] ; then + machine=$MACHINE +fi + # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX + +# Print the platform name for build logs +echo "PLATFORM NAME: $system-$machine" + BASE2=$TMP/$NEW_NAME rm -r -f $BASE2 mv $BASE $BASE2 -- cgit v1.2.1 From 780d699b869b6346cfbaab6705c663ebf9d28b98 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 8 Jul 2005 11:07:05 +0200 Subject: - added mysql-test/t/*.def to the source and binary distributions --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3b8cc1ca12a..51bebc3ce31 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -221,6 +221,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then -- cgit v1.2.1 From 5ce9198f20c3df447cf052ababf02488f17582fb Mon Sep 17 00:00:00 2001 From: "pem@mysql.com" <> Date: Fri, 8 Jul 2005 16:33:15 +0200 Subject: Fixed BUG#11365: Stored Procedure: Crash on Procedure operation Two separate problems. A key buffer was too small in sp.cc for multi-byte fields, and the creation and fixing of mysql.proc in the scripts hadn't been updated with the correct character sets and collations (like the other system tables had). Note: No special test case, as the use of utf8 for mysql.proc will make any existing crash (if the buffer overrrun wasn't fixed). --- scripts/mysql_create_system_tables.sh | 12 +++++---- scripts/mysql_fix_privilege_tables.sql | 45 ++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index bc07d857c4b..a3036b5c10b 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -669,7 +669,7 @@ fi if test ! -f $mdata/proc.frm then c_p="$c_p CREATE TABLE proc (" - c_p="$c_p db char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p db char(64) collate utf8_bin DEFAULT '' NOT NULL," c_p="$c_p name char(64) DEFAULT '' NOT NULL," c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL," @@ -684,7 +684,7 @@ then c_p="$c_p param_list blob DEFAULT '' NOT NULL," c_p="$c_p returns char(64) DEFAULT '' NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL," - c_p="$c_p definer char(77) binary DEFAULT '' NOT NULL," + c_p="$c_p definer char(77) collate utf8_bin DEFAULT '' NOT NULL," c_p="$c_p created timestamp," c_p="$c_p modified timestamp," c_p="$c_p sql_mode set(" @@ -718,10 +718,12 @@ then c_p="$c_p 'TRADITIONAL'," c_p="$c_p 'NO_AUTO_CREATE_USER'," c_p="$c_p 'HIGH_NOT_PRECEDENCE'" - c_p="$c_p ) DEFAULT 0 NOT NULL," - c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," + c_p="$c_p ) DEFAULT '' NOT NULL," + c_p="$c_p comment char(64) collate utf8_bin DEFAULT '' NOT NULL," c_p="$c_p PRIMARY KEY (db,name,type)" - c_p="$c_p ) comment='Stored Procedures';" + c_p="$c_p ) engine=MyISAM" + c_p="$c_p character set utf8" + c_p="$c_p comment='Stored Procedures';" fi cat << END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 3da2f7504a1..b93e0a47b1b 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -412,22 +412,22 @@ PRIMARY KEY TranTime (Transition_time) # CREATE TABLE IF NOT EXISTS proc ( - db char(64) binary DEFAULT '' NOT NULL, + db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', - 'NO_SQL', - 'READS_SQL_DATA', - 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL, + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body blob DEFAULT '' NOT NULL, - definer char(77) binary DEFAULT '' NOT NULL, + definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( @@ -461,20 +461,22 @@ CREATE TABLE IF NOT EXISTS proc ( 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' - ) DEFAULT 0 NOT NULL, - comment char(64) binary DEFAULT '' NOT NULL, + ) DEFAULT '' NOT NULL, + comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) -) comment='Stored Procedures'; +) engine=MyISAM + character set utf8 + comment='Stored Procedures'; # Correct the name fields to not binary, and expand sql_data_access ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, MODIFY specific_name char(64) DEFAULT '' NOT NULL, - MODIFY sql_data_access - enum('CONTAINS_SQL', - 'NO_SQL', - 'READS_SQL_DATA', - 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY sql_data_access + enum('CONTAINS_SQL', + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL, MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', @@ -506,4 +508,15 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' - ) DEFAULT 0 NOT NULL; + ) DEFAULT '' NOT NULL + DEFAULT CHARACTER SET utf8; + +# Correct the character set and collation +ALTER TABLE proc CONVERT TO CHARACTER SET utf8; +# Reset some fields after the conversion +ALTER TABLE proc MODIFY db + char(64) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY definer + char(77) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY comment + char(64) collate utf8_bin DEFAULT '' NOT NULL; -- cgit v1.2.1 From 611ae5924561965c3940f97e831e12d3873f71d8 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 8 Jul 2005 21:04:54 +0200 Subject: - reverted adding mysql-test/t/*.def to the distribution (it is not supported in 4.1 at all) --- scripts/make_binary_distribution.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 51bebc3ce31..3b8cc1ca12a 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -221,7 +221,6 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then -- cgit v1.2.1 From ca9087a82c9acad64abca32c38f3cf6f08d0948f Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 20 Jul 2005 19:15:48 +0200 Subject: - don't install the Mac OS X support files when running "make install" - they're not needed outside of the source tree (BUG#12057) - Removed some more unneeded files from "make install" along the way --- scripts/Makefile.am | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index c464c271a55..533545aba25 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,9 +32,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ - mysqld_multi \ - make_win_src_distribution \ - make_win_binary_distribution + mysqld_multi EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ @@ -63,8 +61,6 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = make_binary_distribution make_sharedlib_distribution - # mysqlbug should be distributed built so that people can report build # failures with it. CLEANFILES = @server_scripts@ \ -- cgit v1.2.1 From 16bfcd3c754cf479ba450d1276119deb0abeb129 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Thu, 21 Jul 2005 21:47:46 +0200 Subject: File / directory structure change from 5.0 to 5.1: Table handlers "bdb", "heap", "innobase", "myisam", and "myisammrg" have been moved into a common subdirectory "storage". This must be reflected in the tools for Windows: 1) When the source package is created, there is the additional level "storage". 2) The project files below "VC++Files" also get that additional directory level, to keep structures in sync. 3) Within the project files, references to/from the table handlers must cross that level. --- scripts/make_win_src_distribution.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index c79433f97c1..0b280217ed5 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -184,7 +184,7 @@ rm -r -f "$BASE/share/Makefile" rm -r -f "$BASE/share/Makefile.in" rm -r -f "$BASE/share/Makefile.am" -mkdir $BASE/Docs $BASE/extra $BASE/include +mkdir $BASE/Docs $BASE/extra $BASE/include $BASE/storage # # Copy directory files @@ -249,9 +249,9 @@ copy_dir_dirs() { # Input directories to be copied # -for i in client dbug extra heap include \ - libmysql libmysqld myisam \ - myisammrg mysys regex sql strings sql-common sql/examples \ +for i in client dbug extra storage/heap include \ + libmysql libmysqld storage/myisam \ + storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib do copy_dir_files $i @@ -260,13 +260,13 @@ done # # Create project files for ndb # -make -C $SOURCE/ndb windoze +make -C $SOURCE/storage/ndb windoze # # Input directories to be copied recursively # -for i in bdb innobase ndb extra/yassl +for i in storage/bdb storage/innobase storage/ndb extra/yassl do copy_dir_dirs $i done @@ -275,10 +275,10 @@ done # Create dummy innobase configure header # -if [ -f $BASE/innobase/ib_config.h ]; then - rm -f $BASE/innobase/ib_config.h +if [ -f $BASE/storage/innobase/ib_config.h ]; then + rm -f $BASE/storage/innobase/ib_config.h fi -touch $BASE/innobase/ib_config.h +touch $BASE/storage/innobase/ib_config.h # -- cgit v1.2.1 From d9bacfa236ceaf1b91caf6197122ad01ad8bfe37 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Mon, 25 Jul 2005 14:14:24 +0200 Subject: - Make sure the scripts make_binary_distribution, make_sharedlib_distribution and make_win_src_distribution are created, but not installed - removed make_win_binary_distribution.sh as it's obsolete and outdated --- scripts/Makefile.am | 5 +- scripts/make_win_binary_distribution.sh | 181 -------------------------------- 2 files changed, 4 insertions(+), 182 deletions(-) delete mode 100644 scripts/make_win_binary_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 533545aba25..a5e6b094bf6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -34,10 +34,13 @@ bin_SCRIPTS = @server_scripts@ \ mysql_tableinfo \ mysqld_multi +noinst_SCRIPTS = make_binary_distribution \ + make_sharedlib_distribution \ + make_win_src_distribution + EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ make_win_src_distribution.sh \ - make_win_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh deleted file mode 100644 index 9b2cc2d7d22..00000000000 --- a/scripts/make_win_binary_distribution.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/sh - -# -# Script to create a Windows binary package -# -# This is intended to be used under Cygwin, and will generate -# an archive named in the form mysql--noinstall.zip - -version=@VERSION@ - -DEBUG=0 -SUFFIX="" -DIRNAME="" -EXTRA="" - -# -# This script must run from MySQL top directory -# - -if [ ! -f scripts/make_win_binary_distribution ]; then - echo "ERROR : You must run this script from the MySQL top-level directory" - 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 binary package" - echo "" - echo "This is intended to be used under Cygwin, and will generate" - echo "an archive named in the form mysql--noinstall.zip" - echo "Takes the following arguments:" - echo "" - echo " --dirname Directory to use for copying files" - echo " --extra Directory to get extra files from" - echo " --suffix Name to append to 'mysql' for this binary" - echo " --help Show this help message" - exit 0 -} - -# -# Parse the input arguments -# - -parse_arguments() { - for arg do - case "$arg" in - --debug) DEBUG=1;; - --extra=*) EXTRA=`echo "$arg" | sed -e "s;--extra=;;"` ;; - --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; - --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;; - --help) show_usage ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} - -parse_arguments "$@" - -if [ -z "$DIRNAME" ]; then - $DIRNAME="dist" -fi - -print_debug "Making directories" -mkdir $DIRNAME -$DIRNAME="$DIRNAME/mysql-$version" -mkdir $DIRNAME - -for dir in bin lib lib/opt lib/debug Embedded Embedded/DLL Embedded/DLL/debug Embedded/DLL/release Embedded/static Embedded/static/release examples examples/libmysqltest -do - mkdir $DIRNAME/$dir -done - -if [ $EXTRA ]; then - print_debug "Copying extra files" - cp -fr $EXTRA/* $DIRNAME -fi - -# Dirs to be copied as-is -for dir in data Docs include scripts share -do - print_debug "Copying $dir to $DIRNAME/" - cp -fr $dir $DIRNAME -done - -print_debug "Copying tests to $DIRNAME/examples/" -cp -fr tests $DIRNAME/examples - -print_debug "Copying sql-bench to $DIRNAME/bench" -mkdir $DIRNAME/bench -cp -fr sql-bench/* $DIRNAME/bench - -print_debug "Copying support-files to $DIRNAME" -cp support-files/* $DIRNAME - -# Files for bin -for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll -do - print_debug "Copying $i to $DIRNAME/bin" - cp $i $DIRNAME/bin -done - -# Files for include -for i in libmysql/libmysql.def libmysqld/libmysqld.def -do - print_debug "Copying $i to $DIRNAME/include" - cp $i $DIRNAME/include -done - -# Windows users are used to having dbug.h ? -cp include/my_dbug.h $DIRNAME/include/dbug.h - -# Libraries found in lib_release and lib_debug -for i in libmySQL.dll libmysql.lib zlib.lib mysqlclient.lib mysys.lib regex.lib strings.lib -do - print_debug "Copying lib_release/$i to $DIRNAME/lib/opt" - cp lib_release/$i $DIRNAME/lib/opt - print_debug "Copying lib_debug/$i to $DIRNAME/lib/debug" - cp lib_debug/$i $DIRNAME/lib/debug -done - -print_debug "Copying lib_release/mysys-max.lib to $DIRNAME/lib/opt" -cp lib_release/mysys-max.lib $DIRNAME/lib/opt - -# Embedded server -for i in libmysqld.dll libmysqld.lib libmysqld.exp -do - print_debug "Copying lib_release/$i to $DIRNAME/Embedded/DLL/release" - cp lib_release/$i $DIRNAME/Embedded/DLL/release - print_debug "Copying lib_debug/$i to $DIRNAME/Embedded/DLL/debug" - cp lib_debug/$i $DIRNAME/Embedded/DLL/debug -done - -# Static embedded -print_debug "Copying lib_release/mysqlserver.lib to $DIRNAME/Embedded/static/release" -cp lib_release/mysqlserver.lib $DIRNAME/Embedded/static/release - -# libmysqltest -for i in mytest.c mytest.dsp mytest.dsw mytest.exe -do - print_debug "Copying libmysqltest/release/$i to $DIRNAME/examples/libmysqltest" - cp libmysqltest/release/$i $DIRNAME/examples/libmysqltest -done - -print_debug "Copying README.txt" -cp README.txt $DIRNAME - -if [ -f MySQLEULA.txt ]; then - print_debug "Commercial version: copying MySQLEULA.txt" - cp MySQLEULA.txt $DIRNAME - rm $DIRNAME/Docs/COPYING -else - print_debug "GPL version: copying COPYING" - cp Docs/COPYING $DIRNAME -fi - -print_debug "Invoking zip to package the binary" -zip -r mysql$SUFFIX-$version-win-noinstall.zip $DIRNAME - -print_debug "Deleting intermediate directory" -rm -rf $DIRNAME -- cgit v1.2.1 From 0536bd6679accf8f168efe1b9d512db42ae5c433 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 26 Jul 2005 18:08:49 -0700 Subject: Increase allowed size of stored procedure bodies to 4GB, and produce a sensible error when that limit is exceeded. (Bug #11602) --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a3036b5c10b..383f8b80dc8 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -683,7 +683,7 @@ then c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," c_p="$c_p param_list blob DEFAULT '' NOT NULL," c_p="$c_p returns char(64) DEFAULT '' NOT NULL," - c_p="$c_p body blob DEFAULT '' NOT NULL," + c_p="$c_p body longblob DEFAULT '' NOT NULL," c_p="$c_p definer char(77) collate utf8_bin DEFAULT '' NOT NULL," c_p="$c_p created timestamp," c_p="$c_p modified timestamp," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index b93e0a47b1b..f67bab44514 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -426,7 +426,7 @@ CREATE TABLE IF NOT EXISTS proc ( security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, - body blob DEFAULT '' NOT NULL, + body longblob DEFAULT '' NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, @@ -477,6 +477,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY body longblob DEFAULT '' NOT NULL, MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', -- cgit v1.2.1 From d146cc9e2f168c9e9d25efee30ccd32b5dac0ba4 Mon Sep 17 00:00:00 2001 From: "reggie@fedora.(none)" <> Date: Thu, 4 Aug 2005 10:08:55 -0500 Subject: add support for vcproj and sln files (Visual Studio 2003) --- scripts/make_win_src_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index c79433f97c1..8183370f220 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -202,7 +202,7 @@ copy_dir_files() for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ - *.dat *.000001 *.require *.opt + *.vcproj *.sln *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -343,7 +343,9 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do unix_to_dos $v -- cgit v1.2.1 From 94722a380148be59f2cdad566b4a67e782acd1e0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 6 Aug 2005 03:10:35 +0200 Subject: make_win_src_distribution.sh: Added missing backslashes --- scripts/make_win_src_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8183370f220..0d2a8cdd5d7 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -343,8 +343,8 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT - -o -name "INSTALL*" -o -name LICENSE -o -name "README*" + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do -- cgit v1.2.1 From c2cb759003eabc85b24fbcd656782fe465e27f76 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 23 Aug 2005 16:37:21 -0700 Subject: Fix typo in mysql_fix_privilege_tables.sql (Bug #12705) --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index f67bab44514..45f3b8533b5 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -509,7 +509,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL + ) DEFAULT '' NOT NULL, DEFAULT CHARACTER SET utf8; # Correct the character set and collation -- cgit v1.2.1 From 2ef8b1e7de0c20db2c4311307c8ed8d7d4f1de0d Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 31 Aug 2005 10:23:29 -0700 Subject: Fix quoting of options passed to external commands by mysqld_multi. (Bug #11280) --- scripts/mysqld_multi.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index ba46fd6fa29..7fff4cbb731 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -289,8 +289,10 @@ sub start_mysqlds() } else { - $options[$j]=~ s/;/\\;/g; - $tmp.= " $options[$j]"; + # we single-quote the argument, but first convert single-quotes to + # '"'"' so they are passed through correctly + $options[$j]=~ s/'/'"'"'/g; + $tmp.= " '$options[$j]'"; } } if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) @@ -374,7 +376,12 @@ sub get_mysqladmin_options $mysqladmin_found= 0 if (!length($mysqladmin)); $com = "$mysqladmin"; $tmp = " -u $opt_user"; - $tmp.= defined($opt_password) ? " -p$opt_password" : ""; + if (defined($opt_password)) { + my $pw= $opt_password; + # Protect single quotes in password + $pw =~ s/'/'"'"'/g; + $tmp.= " -p'$pw'"; + } $tmp.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; for ($j = 0; defined($options[$j]); $j++) { -- cgit v1.2.1 From 0a2e013c9d9c2aebbdadbd88d2b37cf54dd93c80 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Thu, 1 Sep 2005 20:01:21 +0200 Subject: Add "MYSQL_BASE_VERSION" to the list of substituted variables in the "scripts" subdirectory. --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index a5e6b094bf6..3dd3e4fbbac 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -119,6 +119,7 @@ SUFFIXES = .sh -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -e 's!@''openssl_libs''@!@openssl_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ + -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \ -- cgit v1.2.1 From eced05c3cdd98d93af599745afd3077c4cb477fd Mon Sep 17 00:00:00 2001 From: "reggie@linux.site" <> Date: Tue, 6 Sep 2005 18:06:06 -0600 Subject: A few changes to fix compiling on Windows --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 0d2a8cdd5d7..e75dec55e82 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -266,7 +266,7 @@ make -C $SOURCE/ndb windoze # Input directories to be copied recursively # -for i in bdb innobase ndb extra/yassl +for i in bdb innobase ndb extra/yassl server-tools do copy_dir_dirs $i done -- cgit v1.2.1 From d859573bcfed09f9c3cd4fe99fe3dae2533a408f Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 20 Sep 2005 19:26:00 +0200 Subject: make_binary_distribution.sh: Include libz.a in distribution if built bundled --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index fbdbd998138..9c2ae9c42f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -169,7 +169,8 @@ for i in \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a do if [ -f $i ] then -- cgit v1.2.1 From 0cfed79ea5377460ce6035e0f6efc75e279d7bf0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 24 Sep 2005 02:42:38 +0200 Subject: Makefile.am: Revert to shell test script for test targets mysqltest.c: Windows pclose() returns error code in low byte mysql_config.sh: Remove -Xa -xstrconst from --cflags for Sun C++ --- scripts/mysql_config.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 16e50c044ca..15b45391ef8 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -105,9 +105,12 @@ embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_l embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about +# FIXME until we have a --cxxflags, we need to remove -Xa +# and -xstrconst to make --cflags usable for Sun Forte C++ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ - DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' + DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \ + Xa xstrconst do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option @@ -120,13 +123,13 @@ usage () { Usage: $0 [OPTIONS] Options: --cflags [$cflags] - --include [$include] + --include [$include] --libs [$libs] --libs_r [$libs_r] --socket [$socket] --port [$port] --version [$version] - --libmysqld-libs [$embedded_libs] + --libmysqld-libs [$embedded_libs] EOF exit 1 } @@ -136,13 +139,13 @@ if test $# -le 0; then usage; fi while test $# -gt 0; do case $1 in --cflags) echo "$cflags" ;; - --include) echo "$include" ;; + --include) echo "$include" ;; --libs) echo "$libs" ;; --libs_r) echo "$libs_r" ;; --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; - --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; + --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; *) usage ;; esac -- cgit v1.2.1 From 095efe48a5eee7e25d0cbed551c70c3d24bd3855 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 24 Sep 2005 15:51:45 +0200 Subject: Makefile.am, configure.in: Enable "make distcheck" to work --- scripts/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 27b42314273..30ba75c551d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -85,12 +85,13 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ + mysql_explain_log \ + mysql_tableinfo \ mysqld_multi \ make_win_src_distribution \ - make_win_binary_distribution \ mysql_create_system_tables -SUPERCLEANFILES = mysqlbug +DISTCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug mysqlbug: ${top_builddir}/config.status mysqlbug.sh -- cgit v1.2.1 From c794383e0997f93f4e63af420c1a58b8551952b0 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Tue, 27 Sep 2005 12:10:22 +0200 Subject: mysql.user.password doesn't need utf8 --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 383f8b80dc8..babf3a1c83f 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -123,7 +123,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," + c_u="$c_u Password binary(41) DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 45f3b8533b5..7dba854e313 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -156,9 +156,9 @@ alter table columns_priv comment='Column privileges'; ALTER TABLE user MODIFY Host char(60) NOT NULL default '', MODIFY User char(16) NOT NULL default '', - MODIFY Password char(41) NOT NULL default '', ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user + MODIFY Password binary(41) NOT NULL default '', MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -- cgit v1.2.1 From 5b79dbb2eb7caa07eed2cadd370bf5544501f8c8 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 28 Sep 2005 13:39:28 +0200 Subject: mysql_config.sh: Added -lz to link using libmysqld --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 15b45391ef8..5b35c0190a5 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -101,7 +101,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@ $client_libs" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about -- cgit v1.2.1 From b97a77e824ed38fed28b82c7fb5afcb9fefc18b3 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Fri, 30 Sep 2005 14:02:31 +0300 Subject: Fix for Bug#12629, "mysqld_multi produces syntax error". Quote here is unneccessary as it should all be handled in quote_opt_arg(). --- scripts/mysqld_multi.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 098cd894916..b2b85018d7a 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,7 +4,7 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.14"; +$VER="2.15"; $opt_config_file = undef(); $opt_example = 0; @@ -326,7 +326,6 @@ sub start_mysqlds() } else { - $options[$j]=~ s/;/\\;/g; $options[$j]= quote_opt_arg($options[$j]); $tmp.= " $options[$j]"; } -- cgit v1.2.1 From 21cf818a8db346fb6f87d4fa888dea311f23287b Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 30 Sep 2005 14:03:55 +0200 Subject: Many files: New VC7 project files des_key_file.cc: Visual C++ wants '"' for local include mysql.cc: Cast my_cgets() argument for VC6 and VC7 dummy.cpp: Added to convince VS .Net generate a lib for mysqlserver --- scripts/make_win_src_distribution.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 71d61b7a02d..15e9b106da8 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -199,11 +199,10 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ - README INSTALL* LICENSE *.inc *.test *.result \ - *.pem Moscow_leap des_key_file *.dat *.000001 \ - *.require *.opt - + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ + README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ + *.inc *.test *.result *.pem Moscow_leap des_key_file \ + *.vcproj *.sln *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -234,6 +233,7 @@ copy_dir_dirs() { find $arg -type d \ -and -not -path \*SCCS\* \ -and -not -path \*.deps\* \ + -and -not -path \*.libs\* \ -and -not -path \*autom4te.cache -print )|( while read v @@ -326,6 +326,8 @@ do $CP -R $i $BASE/$i fi fi + # But remove object files from destination + find $BASE/$i -type f -name \*.o | xargs rm -f done # @@ -339,7 +341,9 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do unix_to_dos $v -- cgit v1.2.1 From 95327abcc26414d69a3a06ae503872f6a710aabb Mon Sep 17 00:00:00 2001 From: "anozdrin@mysql.com" <> Date: Wed, 5 Oct 2005 01:08:22 +0400 Subject: Make mysql_fix_privilege_tables.sh not dependent on the current directory. --- scripts/mysql_fix_privilege_tables.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index d080b68b268..073964d4bde 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -97,9 +97,11 @@ fi # Find where 'mysql' command is located +dirname=`dirname "$0"` + if test -z "$bindir" then - for i in @bindir@ $basedir/bin client + for i in @bindir@ $basedir/bin "$dirname/../client" do if test -f $i/mysql then @@ -109,6 +111,13 @@ then done fi +if test -z "$bindir" +then + echo "Could not find MySQL command-line client (mysql)." + echo "Please use --basedir to specify the directory where MySQL is installed." + exit 1 +fi + cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$password" ; then cmd="$cmd --password=$password" @@ -128,7 +137,7 @@ fi # Find where first mysql_fix_privilege_tables.sql is located for i in $basedir/support-files $basedir/share $basedir/share/mysql \ - $basedir/scripts $pkgdatadir . ./scripts + $basedir/scripts $pkgdatadir . "$dirname" do if test -f $i/$file then -- cgit v1.2.1 From 52181cc810ecf3d2103d7782055c14b7157aabcb Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Thu, 6 Oct 2005 18:00:23 +0200 Subject: make_binary_distribution.sh: Replaced --machine with --platform General code cleanup --- scripts/make_binary_distribution.sh | 220 +++++++++++++++++------------------- 1 file changed, 102 insertions(+), 118 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3b8cc1ca12a..28db9eb249d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -1,54 +1,50 @@ #!/bin/sh -# The default path should be /usr/local -# Get some info from configure -# chmod +x ./scripts/setsomevars +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-....{tar.gz,zip}" +# +# The temporary directory path given to "--tmp=" has to be +# absolute and with no spaces. machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ version=@VERSION@ -export machine system version -SOURCE=`pwd` +SOURCE=`pwd` CP="cp -p" MV="mv" STRIP=1 DEBUG=0 SILENT=0 -MACHINE= +PLATFORM="$system-$machine" TMP=/tmp SUFFIX="" NDBCLUSTER= -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=;;"` ;; - --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; - --silent) SILENT=1 ;; - --with-ndbcluster) NDBCLUSTER=1 ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} - -parse_arguments "$@" - -#make +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=;;"` ;; + --no-strip) STRIP=0 ;; + --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; + --silent) SILENT=1 ;; + --with-ndbcluster) NDBCLUSTER=1 ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac +done -# This should really be integrated with automake and not duplicate the +# FIXME This should really be integrated with automake and not duplicate the # installation list. BASE=$TMP/my_dist$SUFFIX if [ -d $BASE ] ; then - rm -r -f $BASE + rm -rf $BASE fi BS="" @@ -77,23 +73,26 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -for i in ChangeLog \ - Docs/mysql.info -do - if [ -f $i ] - then - $CP $i $BASE/docs - fi -done +# Copy files if they exists, warn for those that don't +copyfileto() +{ + destdir=$1 + shift + for i ; do + if [ -f $i ] ; then + $CP $i $destdir + elif [ -d $i ] ; then + echo "Warning: Will not copy directory \"$i\"" + else + echo "Warning: Listed file not found \"$i\"" + fi + done +} + +copyfileto $BASE/docs ChangeLog Docs/mysql.info -for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ +copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW -do - if [ -f $i ] - then - $CP $i $BASE - fi -done # Non platform-specific bin dir files: BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ @@ -135,45 +134,27 @@ else "; fi -for i in $BIN_FILES -do - if [ -f $i ] - then - $CP $i $BASE/bin - fi -done +copyfileto $BASE/bin $BIN_FILES if [ x$STRIP = x1 ] ; then strip $BASE/bin/* fi # Copy not binary files -for i in sql/mysqld.sym.gz -do - if [ -f $i ] - then - $CP $i $BASE/bin - fi -done +copyfileto $BASE/bin sql/mysqld.sym.gz if [ $BASE_SYSTEM = "netware" ] ; then - $CP -r netware/*.pl $BASE/scripts + $CP netware/*.pl $BASE/scripts $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl fi -for i in \ +copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \ libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ libmysqld/libmysqld.a netware/libmysql.imp -do - if [ -f $i ] - then - $CP $i $BASE/lib - fi -done # convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then @@ -184,7 +165,8 @@ if [ $BASE_SYSTEM = "netware" ] ; then done fi -$CP config.h include/* $BASE/include +copyfileto $BASE/include config.h include/* + rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h if [ $BASE_SYSTEM != "netware" ] ; then rm -f $BASE/include/config-netware.h @@ -199,45 +181,52 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi fi -$CP support-files/* $BASE/support-files -$CP scripts/*.sql $BASE/share +copyfileto $BASE/support-files support-files/* + +copyfileto $BASE/share scripts/*.sql $CP -r sql/share/* $MYSQL_SHARE rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD -for i in mysql-test/mysql-test-run mysql-test/install_test_db \ +copyfileto $BASE/mysql-test \ + mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ netware/mysql_test_run.nlm netware/install_test_db.ncf -do - if [ -f $i ] - then - $CP $i $BASE/mysql-test - fi -done $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ + $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data -$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi \ + mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* - $CP scripts/* $BASE/bin - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server + copyfileto $BASE/bin scripts/* + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ + ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ + @HOSTNAME@ \@pkgdatadir\@ ./support-files \ + < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ + \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \ + \@HOSTNAME\@ @HOSTNAME@ \ + < support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure + chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ + $BASE/support-files/mysql.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/bin/*.sql fi -rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh - +rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ + $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ + $BASE/bin/setsomevars $BASE/support-files/Makefile* \ + $BASE/support-files/*.sh # # Copy system dependent files @@ -245,8 +234,10 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ if [ $BASE_SYSTEM = "netware" ] ; then echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ + >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ + > $BASE/bin/test_db.sql # cp ./netware/static_init_db.sql ./netware/init_db.sql # ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi @@ -271,9 +262,9 @@ fi (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) # Clean up if we did this from a bk tree -if [ -d $BASE/sql-bench/SCCS ] ; then - find $BASE/share -name SCCS -print | xargs rm -r -f - find $BASE/sql-bench -name SCCS -print | xargs rm -r -f +if [ -d $BASE/sql-bench/SCCS ] ; then + find $BASE/share -name SCCS -print | xargs rm -rf + find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi # NDB Cluster @@ -288,36 +279,29 @@ if [ x$NDBCLUSTER = x1 ]; then rm -rf $BASE/ndb-stage fi -# Use the override --machine if present -if [ -n "$MACHINE" ] ; then - machine=$MACHINE -fi - # Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$PLATFORM$SUFFIX # Print the platform name for build logs -echo "PLATFORM NAME: $system-$machine" +echo "PLATFORM NAME: $PLATFORM" BASE2=$TMP/$NEW_NAME -rm -r -f $BASE2 +rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 # # If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a # -if test "@GXX@" = "yes" +if [ x"@GXX@" = x"yes" ] then - cd $BASE/lib gcclib=`@CC@ --print-libgcc-file` - if test $? -ne 0 + if [ $? -ne 0 ] then print "Warning: Couldn't find libgcc.a!" else - $CP $gcclib libmygcc.a + $CP $gcclib $BASE/lib/libmygcc.a fi - cd $SOURCE fi #if we are debugging, do not do tar/gz @@ -328,7 +312,9 @@ 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' ` +PATH_DIRS=`echo $PATH | \ + sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` + which_1 () { for cmd @@ -337,7 +323,7 @@ which_1 () do for file in $d/$cmd do - if test -x $file -a ! -d $file + if [ -x $file -a ! -d $file ] then echo $file exit 0 @@ -353,38 +339,36 @@ if [ $BASE_SYSTEM != "netware" ] ; then # # Create the result tar file # - + tar=`which_1 gnutar gtar` - if test "$?" = "1" -o "$tar" = "" + if [ "$?" = "1" -o x"$tar" = x"" ] then tar=tar fi - + echo "Using $tar to create archive" - cd $TMP - + OPT=cvf if [ x$SILENT = x1 ] ; then OPT=cf fi - - $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME - cd $SOURCE - echo "Compressing archive" + + echo "Creating and compressing archive" rm -f $NEW_NAME.tar.gz - gzip -9 $NEW_NAME.tar + (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz echo "$NEW_NAME.tar.gz created" + else # # Create a zip file for NetWare users # - cd $TMP - if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi - zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + rm -f $NEW_NAME.zip + (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) echo "$NEW_NAME.zip created" fi + echo "Removing temporary directory" -rm -r -f $BASE +rm -rf $BASE -- cgit v1.2.1 From 87016b438ccee0bec2de2c0b465b2e826eb65019 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Thu, 6 Oct 2005 22:57:13 +0200 Subject: make_binary_distribution.sh: Reintroduced --machine Better sh compatibility, "for i ; do" is not portable --- scripts/make_binary_distribution.sh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 28db9eb249d..78842e7d9cf 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -17,10 +17,11 @@ MV="mv" STRIP=1 DEBUG=0 SILENT=0 -PLATFORM="$system-$machine" +MACHINE="" +PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER= +NDBCLUSTER="" for arg do case "$arg" in @@ -28,6 +29,7 @@ for arg do --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; + --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; @@ -38,6 +40,16 @@ for arg do esac done +if [ x"$MACHINE" != x"" ] ; then + machine=$MACHINE +fi + +if [ x"$PLATFORM" != x"" ] ; then + platform="$PLATFORM" +else + platform="$system-$machine" +fi + # FIXME This should really be integrated with automake and not duplicate the # installation list. @@ -78,7 +90,8 @@ copyfileto() { destdir=$1 shift - for i ; do + for i + do if [ -f $i ] ; then $CP $i $destdir elif [ -d $i ] ; then @@ -293,11 +306,9 @@ BASE=$BASE2 # If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a # -if [ x"@GXX@" = x"yes" ] -then +if [ x"@GXX@" = x"yes" ] ; then gcclib=`@CC@ --print-libgcc-file` - if [ $? -ne 0 ] - then + if [ $? -ne 0 ] ; then print "Warning: Couldn't find libgcc.a!" else $CP $gcclib $BASE/lib/libmygcc.a @@ -323,8 +334,7 @@ which_1 () do for file in $d/$cmd do - if [ -x $file -a ! -d $file ] - then + if [ -x $file -a ! -d $file ] ; then echo $file exit 0 fi @@ -341,8 +351,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then # tar=`which_1 gnutar gtar` - if [ "$?" = "1" -o x"$tar" = x"" ] - then + if [ "$?" = "1" -o x"$tar" = x"" ] ; then tar=tar fi -- cgit v1.2.1 From ae62a588179d8a80c2093ff4100b89c1898cb5ff Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 7 Oct 2005 01:56:11 +0200 Subject: make_binary_distribution.sh: Corrected platform name output Services.cpp: Dont print null address (back port from 5.0) --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 78842e7d9cf..0ab26f33c53 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -293,10 +293,10 @@ if [ x$NDBCLUSTER = x1 ]; then fi # Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$PLATFORM$SUFFIX +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX # Print the platform name for build logs -echo "PLATFORM NAME: $PLATFORM" +echo "PLATFORM NAME: $platform" BASE2=$TMP/$NEW_NAME rm -rf $BASE2 -- cgit v1.2.1 From 33f38f7ed85a7be28017d0e0cf776d774bae19dc Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Fri, 7 Oct 2005 13:08:07 +0200 Subject: make_binary_distribution.sh: Copy zlib.a and valgrind.supp if exists Copy disabled.def --- scripts/make_binary_distribution.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0ab26f33c53..d622dfed9d3 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -167,7 +167,8 @@ copyfileto $BASE/lib \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a # convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then @@ -204,10 +205,12 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD copyfileto $BASE/mysql-test \ mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib +$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ $BASE/mysql-test/std_data -- cgit v1.2.1 From 8782f5a0e3577ae515e0e77503a0cd86fc95dfe4 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Tue, 11 Oct 2005 21:16:08 +0200 Subject: - added Docs/manual.chm to the windows source distribution (BUG#13899) --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 0800fec1ac6..f863e5385d4 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -275,7 +275,7 @@ cd $SOURCE for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ - Docs/INSTALL-BINARY + Docs/INSTALL-BINARY Docs/manual.chm do print_debug "Copying file '$i'" -- cgit v1.2.1 From 94ea4f188a91d64c7741021e84a10d4f0a6d7121 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 12 Oct 2005 22:49:33 +0200 Subject: make_binary_distribution.sh: Copy *.cnf files in mysql-test/std_data/ Makefile.am: Added std_data/*.cnf to copy ndb config --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1354117db13..a3e993a25cf 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -232,6 +232,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -- cgit v1.2.1 From 39b0712cf76c1551ecbb4d051629fb76c72cf7df Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 13 Oct 2005 19:16:19 +0500 Subject: type_binary.result, type_binary.test: new file mysql_fix_privilege_tables.sql, mysql_create_system_tables.sh: Adding true BINARY/VARBINARY: fixing "password" type, not to be 0x00-padding. Many files: Adding true BINARY/VARBINARY: fixing tests not to output 0x00 bytes. Adding true BINARY/VARBINARY: new pad_char structure member. ctype-bin.c: Adding true BINARY/VARBINARY: new pad_char structure member. New strnxfrm, with two trailing length bytes. field.cc: Adding true BINARY/VARBINARY. --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index babf3a1c83f..54f0ef230ad 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -123,7 +123,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password binary(41) DEFAULT '' NOT NULL," + c_u="$c_u Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 7dba854e313..d1b0c35266e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -158,7 +158,7 @@ ALTER TABLE user MODIFY User char(16) NOT NULL default '', ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user - MODIFY Password binary(41) NOT NULL default '', + MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -- cgit v1.2.1 From 5dad17161862f10f41e29d22cc362216c906e44a Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 13 Oct 2005 17:21:14 +0300 Subject: Some Netware related fixes and fixes for Metrowerks compiler. --- scripts/make_binary_distribution.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index d622dfed9d3..c00ba1c6f57 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -254,8 +254,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ > $BASE/bin/test_db.sql -# cp ./netware/static_init_db.sql ./netware/init_db.sql -# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # -- cgit v1.2.1 From 63ac3040a88079cc61728631043b18d535efe152 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Fri, 14 Oct 2005 08:45:41 +0300 Subject: Small fixes for Netware. --- scripts/make_binary_distribution.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index dea41f57e6b..750c98c80e2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -275,8 +275,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then >> $BASE/bin/init_db.sql sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ > $BASE/bin/test_db.sql - sh ./scripts/mysql_create_system_tables.sh real >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test > $BASE/bin/test_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # -- cgit v1.2.1 From 85ab53357b005852b51c3b405b9c01cbf6214f5a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 16 Oct 2005 06:49:19 +0200 Subject: thread_registry.h, thread_registry.cc: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX Makefile.am: Preserve executable mode on scripts make_binary_distribution.sh: Copy *.imtest files --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 750c98c80e2..5767728fe4f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -234,7 +234,8 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \ +$CP mysql-test/t/*.test mysql-test/t/*.imtest \ + mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -- cgit v1.2.1 From 1d9bfbf7d293d38e5137205c30e0eeff09c9d229 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 31 Oct 2005 11:15:44 -0800 Subject: Handle decision to use mysqld-max over mysqld within mysqld_safe even when --ledir option is specified. (Bug #13774) --- scripts/mysqld_safe.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d6585f4a552..6ce4c1e0da8 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -11,6 +11,7 @@ # executing mysqld_safe KILL_MYSQLD=1; +MYSQLD= trap '' 1 2 3 15 # we shouldn't let anyone kill us @@ -130,14 +131,6 @@ fi 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 -then - MYSQLD=mysqld-max -else - MYSQLD=mysqld -fi - # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= @@ -176,6 +169,16 @@ then chown $user $mysql_unix_port_dir fi +# Use the mysqld-max binary by default if the user doesn't specify a binary +if test -z "$MYSQLD" +then + if test -x $ledir/mysqld-max + then + MYSQLD=mysqld-max + else + MYSQLD=mysqld + fi +fi if test ! -x $ledir/$MYSQLD then -- cgit v1.2.1 From 6894cbc9ebace4839dd1070479df423cf29a5bac Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 31 Oct 2005 15:56:52 -0800 Subject: Fix harmless typo in mysql_fix_privilege_tables.sql (Bug #14469) --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 0d7d32fd6a9..a72bd2799aa 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -29,7 +29,7 @@ ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,a ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ---- Fix privileges for old tables +-- Fix privileges for old tables UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; -- cgit v1.2.1 From 3791197f0d7121b31cb51583f7691db4fd86b425 Mon Sep 17 00:00:00 2001 From: "svoj@poseidon.ndb.mysql.com" <> Date: Sun, 6 Nov 2005 13:13:06 +0100 Subject: WL#2575 - Fulltext: Parser plugin for FTS WL#2763 - MySQL plugin interface: step 1 Manual merge from CNET tree. --- scripts/mysql_create_system_tables.sh | 22 ++++++++++++++++++++-- scripts/mysql_fix_privilege_tables.sql | 6 ++++++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 54f0ef230ad..c6deb642edf 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -39,8 +39,8 @@ c_hc="" c_hr="" c_hk="" i_ht="" -c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" -i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" +c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" c_pl="" +i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" i_pl="" c_p="" c_pp="" # Check for old tables @@ -202,6 +202,21 @@ then c_f="$c_f comment='User defined functions';" fi +if test ! -f $mdata/plugin.frm +then + if test "$1" = "verbose" ; then + echo "Preparing plugin table" 1>&2; + fi + + c_pl="$c_pl CREATE TABLE plugin (" + c_pl="$c_pl name char(64) binary DEFAULT '' NOT NULL," + c_pl="$c_pl dl char(128) DEFAULT '' NOT NULL," + c_pl="$c_pl PRIMARY KEY (name)" + c_pl="$c_pl ) engine=MyISAM" + c_pl="$c_pl CHARACTER SET utf8 COLLATE utf8_bin" + c_pl="$c_pl comment='MySQL plugins';" +fi + if test ! -f $mdata/tables_priv.frm then if test "$1" = "verbose" ; then @@ -741,6 +756,9 @@ $i_u $c_f $i_f +$c_pl +$i_pl + $c_t $c_c diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9e45766c6d2..bc20e698376 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -19,6 +19,12 @@ CREATE TABLE IF NOT EXISTS func ( PRIMARY KEY (name) ) CHARACTER SET utf8 COLLATE utf8_bin; +CREATE TABLE IF NOT EXISTS plugin ( + name char(64) binary DEFAULT '' NOT NULL, + dl char(128) DEFAULT '' NOT NULL, + PRIMARY KEY (name) +) CHARACTER SET utf8 COLLATE utf8_bin; + ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -- Detect whether or not we had the Grant_priv column -- cgit v1.2.1 From bb742ae0fa52f2d123fef89a8387029a1a62026d Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 10 Nov 2005 17:05:36 -0800 Subject: Don't try to mysqlhotcopy the INFORMATION_SCHEMA database. (Bug #14610) --- scripts/mysqlhotcopy.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 1c5cd6a4faf..bf53aa78e15 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -252,6 +252,7 @@ if ( defined $opt{regexp} ) { my $sth_dbs = $dbh->prepare("show databases"); $sth_dbs->execute; while ( my ($db_name) = $sth_dbs->fetchrow_array ) { + next if $db_name =~ m/^information_schema$/i; push @db_desc, { 'src' => $db_name, 't_regex' => $t_regex } if ( $db_name =~ m/$opt{regexp}/o ); } } -- cgit v1.2.1 From ebb6552b1c19472532ad50e61a56c36db60a5c97 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 11 Nov 2005 18:48:53 +0100 Subject: scripts/make_binary_distribution.sh Adapt to the directory hierarchy change in 5.1, "ndb" -> "storage/ndb". --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 5767728fe4f..ea78133cc5e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -308,7 +308,7 @@ fi # NDB Cluster if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) + ( cd storage/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. -- cgit v1.2.1 From 7120d43c36c610e07494050285c0569d5c463ebe Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Mon, 5 Dec 2005 11:45:04 +0100 Subject: WL#1034 updated - split into several files - forbid parallel execution (before analyse is done how to make it possible) because the same sp_head instance cannot be executed in parallel - added GPL headers - changed EVENT_ACL to be per DB variable - fixed minor problems --- scripts/mysql_fix_privilege_tables.sql | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index f8f10438505..2949049afe8 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -526,3 +526,41 @@ ALTER TABLE proc MODIFY db char(77) collate utf8_bin DEFAULT '' NOT NULL, MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; + +# +# EVENT table +# + + +CREATE TABLE event ( + 'db' VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + 'name' VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + 'body' longblob NOT NULL, + 'definer' VARCHAR(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + 'execute_at' DATETIME default NULL, + 'transient_expression' int(11) default NULL, + 'interval_type' ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK', + 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR', + 'DAY_MINUTE','DAY_SECOND', + 'HOUR_MINUTE','HOUR_SECOND', + 'MINUTE_SECOND','DAY_MICROSECOND', + 'HOUR_MICROSECOND','MINUTE_MICROSECOND', + 'SECOND_MICROSECOND') default NULL, + 'created' TIMESTAMP NOT NULL default '0000-00-00 00:00:00', + 'modified' TIMESTAMP NOT NULL default '0000-00-00 00:00:00', + 'last_executed' DATETIME default NULL, + 'starts' DATETIME default NULL, + 'ends' DATETIME default NULL, + 'status' ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + 'on_completion' ENUM('DROP','PRESERVE') NOT NULL default 'DROP', + 'comment' varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + PRIMARY KEY ('db','name') +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; + + +# +# EVENT privilege +# + +ALTER TABLE mysql.user add Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_user_priv; +ALTER TABLE mysql.db add Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -- cgit v1.2.1 From cf57f12407a1fdb768ef42df27f103590e317993 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 11 Dec 2005 09:21:13 +0100 Subject: make_win_src_distribution.sh: Removed Visual Studio 6 project files, as they are not maintained --- scripts/make_win_src_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2e93ebcb007..2e312e0c3cf 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -199,7 +199,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ *.vcproj *.sln *.dat *.000001 *.require *.opt @@ -340,7 +340,7 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # # Search the tree for plain text files and adapt the line end marker # -find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ +find $BASE \( -name "*.cnf" -o -name "*.ini" \ -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ -- cgit v1.2.1 From 32466b14fbc46fe5e8c542e45911f0480d6a33c0 Mon Sep 17 00:00:00 2001 From: "jani@a193-229-222-105.elisa-laajakaista.fi" <> Date: Tue, 13 Dec 2005 18:30:10 +0200 Subject: Minor Netware specific changes. --- scripts/make_binary_distribution.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c00ba1c6f57..3c16937e158 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -177,6 +177,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then libname=`basename $i .a` $MV $i $BASE/lib/$libname.lib done + rm -f $BASE/lib/*.la fi copyfileto $BASE/include config.h include/* @@ -266,6 +267,9 @@ if [ $BASE_SYSTEM = "netware" ] ; then $BASE/support-files/mysql*.spec \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ + $BASE/support-files/build-tags \ + $BASE/support-files/MySQL-shared-compat.spec \ + $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY \ $BASE/MySQLEULA.txt else -- cgit v1.2.1 From 533180d76c81db1e396d14b43bed9f42495c78c5 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Thu, 15 Dec 2005 14:12:28 +0100 Subject: WL#1034 update - fix EVENT_ACL problem that GRANT ALL on some_db.* to someone@somewhere did not get to mysql.db - fix crash when the following is executed : CREATE EVENT P() CREATE EVENT E ON SCHEDULER 1 SECOND DO ROLLBACK; (creation works as well as calling P() which creates the event). --- scripts/mysql_fix_privilege_tables.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 2949049afe8..255f83e473e 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -562,5 +562,6 @@ CREATE TABLE event ( # EVENT privilege # -ALTER TABLE mysql.user add Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_user_priv; -ALTER TABLE mysql.db add Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE mysql.user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +ALTER TABLE mysql.db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; + -- cgit v1.2.1 From 5ec6c5f2c6d7711e4a65f6f6ebf05e674b45357f Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Fri, 16 Dec 2005 13:01:46 +0100 Subject: WL #1034 update - varchar -> char - transient_expression -> interval_value - interval_type -> interval_field --- scripts/mysql_fix_privilege_tables.sql | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 255f83e473e..58be425ebf2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -533,28 +533,28 @@ ALTER TABLE proc MODIFY db CREATE TABLE event ( - 'db' VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - 'name' VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - 'body' longblob NOT NULL, - 'definer' VARCHAR(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - 'execute_at' DATETIME default NULL, - 'transient_expression' int(11) default NULL, - 'interval_type' ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK', + db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + name char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + body longblob NOT NULL, + definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + execute_at DATETIME default NULL, + interval_value int(11) default NULL, + interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK', 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR', 'DAY_MINUTE','DAY_SECOND', 'HOUR_MINUTE','HOUR_SECOND', 'MINUTE_SECOND','DAY_MICROSECOND', 'HOUR_MICROSECOND','MINUTE_MICROSECOND', 'SECOND_MICROSECOND') default NULL, - 'created' TIMESTAMP NOT NULL default '0000-00-00 00:00:00', - 'modified' TIMESTAMP NOT NULL default '0000-00-00 00:00:00', - 'last_executed' DATETIME default NULL, - 'starts' DATETIME default NULL, - 'ends' DATETIME default NULL, - 'status' ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', - 'on_completion' ENUM('DROP','PRESERVE') NOT NULL default 'DROP', - 'comment' varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - PRIMARY KEY ('db','name') + created TIMESTAMP NOT NULL, + modified TIMESTAMP NOT NULL, + last_executed DATETIME default NULL, + starts DATETIME default NULL, + ends DATETIME default NULL, + status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', + comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; -- cgit v1.2.1 From 2205d1b8d56932dd5b3ede359b56a684f296ca5b Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 19 Dec 2005 01:12:11 +0100 Subject: mysql.spec.sh, make_binary_distribution.sh, Makefile.am, mysql.sln: Added "client/mysqlslap" mysqlslap.vcproj, mysqlslap.def: new file --- scripts/make_binary_distribution.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 87b09773823..dcd0b948694 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -132,6 +132,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqlslap$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ client/mysqlbinlog$BS \ @@ -153,6 +154,7 @@ else client/mysqltestmanagerc \ client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ + client/.libs/mysqlslap \ client/.libs/mysqldump client/.libs/mysqlimport \ client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ -- cgit v1.2.1 From 2a29c3290890ddd5079f5f00649373aa1300d4e2 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Tue, 3 Jan 2006 14:36:31 +0100 Subject: Test files in new subdirectory "mysql-test/extra" need to be propagated into binary distribution. --- scripts/make_binary_distribution.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index dcd0b948694..f1ed07382b6 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -92,7 +92,9 @@ esac mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ + $BASE/mysql-test/extra \ + $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ @@ -242,6 +244,8 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r +$CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests +$CP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From 8241a5a8e89af766c43024c4920a1b5102948aed Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Wed, 4 Jan 2006 10:36:49 +0100 Subject: cleanup --- scripts/mysql_create_system_tables.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index c6deb642edf..2529eaf1937 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -229,7 +229,7 @@ then c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," - c_t="$c_t Timestamp timestamp(14)," + c_t="$c_t Timestamp timestamp," c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," @@ -251,7 +251,7 @@ then c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c Timestamp timestamp(14)," + c_c="$c_c Timestamp timestamp," c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c ) engine=MyISAM" @@ -273,7 +273,7 @@ then c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL," c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_pp="$c_pp Timestamp timestamp(14)," + c_pp="$c_pp Timestamp timestamp," c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type)," c_pp="$c_pp KEY Grantor (Grantor)" c_pp="$c_pp ) engine=MyISAM" @@ -743,7 +743,7 @@ fi cat << END_OF_DATA use mysql; -set table_type=myisam; +set storage_engine=myisam; $c_d $i_d -- cgit v1.2.1 From 71eb7d7ec972d3c05446d61b4674edeede585985 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Wed, 11 Jan 2006 18:09:05 +0100 Subject: WL #1034 (Internal CRON) pre-push updates - various fixes of test cases (hopefully the last pre-push update before the push) --- scripts/mysql_create_system_tables.sh | 31 +++++++++++++++++++++++++++++++ scripts/mysql_fix_privilege_tables.sql | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 2529eaf1937..6e0ff3b6389 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -741,6 +741,35 @@ then c_p="$c_p comment='Stored Procedures';" fi + +if test ! -f $mdata/event.frm +then + c_ev="$c_ev CREATE TABLE event (" + c_ev="$c_ev db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev name char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev body longblob NOT NULL," + c_ev="$c_ev definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev execute_at DATETIME default NULL," + c_ev="$c_ev interval_value int(11) default NULL," + c_ev="$c_ev interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK'," + c_ev="$c_ev 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR'," + c_ev="$c_ev 'DAY_MINUTE','DAY_SECOND'," + c_ev="$c_ev 'HOUR_MINUTE','HOUR_SECOND'," + c_ev="$c_ev 'MINUTE_SECOND','DAY_MICROSECOND'," + c_ev="$c_ev 'HOUR_MICROSECOND','MINUTE_MICROSECOND'," + c_ev="$c_ev 'SECOND_MICROSECOND') default NULL," + c_ev="$c_ev created TIMESTAMP NOT NULL," + c_ev="$c_ev modified TIMESTAMP NOT NULL," + c_ev="$c_ev last_executed DATETIME default NULL," + c_ev="$c_ev starts DATETIME default NULL," + c_ev="$c_ev ends DATETIME default NULL," + c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," + c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," + c_ev="$c_ev comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev PRIMARY KEY (db,name)" + c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" +fi + cat << END_OF_DATA use mysql; set storage_engine=myisam; @@ -781,5 +810,7 @@ $i_tzls $c_p $c_pp +$c_ev + END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 58be425ebf2..af995836c0c 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -562,6 +562,6 @@ CREATE TABLE event ( # EVENT privilege # -ALTER TABLE mysql.user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; -ALTER TABLE mysql.db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; -- cgit v1.2.1 From 9f82755b8195c7eff97c6b7eeafcb74b7c0f4b60 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Thu, 12 Jan 2006 12:06:13 +0100 Subject: WL #1034 (Internal CRON) post-push fix - add Event_priv to db and host tables --- scripts/mysql_create_system_tables.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 6e0ff3b6389..b114e8edeea 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -72,6 +72,7 @@ then c_d="$c_d Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" @@ -150,6 +151,7 @@ then c_u="$c_u Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," -- cgit v1.2.1 From 570db081054b9097754918feec06e19b2bdc3cd5 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Thu, 12 Jan 2006 14:17:00 +0100 Subject: WL #1034 (Internal CRON) post-push fixes. fix INSERT/REPLACE statements so test suite runs again. The question is why we have 2 parallel universes - 2 different ways to start the test suite, a shell and perl version. One more case where redundancy makes life nightmare. --- scripts/mysql_create_system_tables.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index b114e8edeea..5fad3222682 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -79,8 +79,8 @@ then c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');" + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y');" fi if test ! -f $mdata/host.frm @@ -167,22 +167,22 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi -- cgit v1.2.1 From 4b731ddfb47cb56bec07a2eded106efc1aa4e532 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Thu, 12 Jan 2006 19:51:02 +0100 Subject: wl2325 wl2324 --- scripts/mysql_create_system_tables.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5fad3222682..a90dfacabbd 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -813,6 +813,8 @@ $c_p $c_pp $c_ev +CREATE DATABASE IF NOT EXISTS cluster_replication; +CREATE TABLE IF NOT EXISTS cluster_replication.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; END_OF_DATA -- cgit v1.2.1 From 3eba9695d0340a9b8a618faf77b50c8f3bd92eb9 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Fri, 13 Jan 2006 12:44:15 +0100 Subject: WL #1034 (Internal CRON) - initialize a variable in a shell scrip --- scripts/mysql_create_system_tables.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5fad3222682..03c148267fd 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -42,6 +42,7 @@ i_ht="" c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" c_pl="" i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" i_pl="" c_p="" c_pp="" +c_ev= "" # Check for old tables if test ! -f $mdata/db.frm -- cgit v1.2.1 From 9d4562e5fe6f3485bf8b0e34a04122538e5ab127 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 13 Jan 2006 16:25:20 +0100 Subject: extra/comp_err.c + scripts/mysqld_multi.sh : Copyright string fixes (bug#16106) --- scripts/mysqld_multi.sh | 3 --- 1 file changed, 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index b75aa1a7c31..21439650ef3 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -624,9 +624,6 @@ sub usage print < Date: Fri, 13 Jan 2006 22:09:48 +0100 Subject: Windows/Visual Studio 2003 fixes for the 5.1.5 release. --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 065c7d06d24..2f2d6bb393e 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -249,7 +249,7 @@ copy_dir_dirs() { # Input directories to be copied # -for i in client dbug extra storage/heap include \ +for i in client dbug extra storage/heap include storage/archive \ libmysql libmysqld storage/myisam \ storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib -- cgit v1.2.1 From ce2eb6d8cb1dfb99002d006e0eeec3e3ef84fb80 Mon Sep 17 00:00:00 2001 From: "cps@outpost.site" <> Date: Thu, 19 Jan 2006 05:56:06 +0300 Subject: WL1019: complete patch. Reapplied patch to the clean tree to get rid of multiple typos in CS comments and unify the patch. --- scripts/mysql_create_system_tables.sh | 25 +++++++++++++++++++++++ scripts/mysql_fix_privilege_tables.sql | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a90dfacabbd..eeb3e30e19a 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -42,6 +42,7 @@ i_ht="" c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" c_pl="" i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" i_pl="" c_p="" c_pp="" +c_gl="" c_sl="" # Check for old tables if test ! -f $mdata/db.frm @@ -354,6 +355,7 @@ then c_hr="$c_hr comment='keyword-topic relation';" fi + if test ! -f $mdata/time_zone_name.frm then if test "$1" = "verbose" ; then @@ -744,6 +746,27 @@ then fi +if test ! -f $mdata/general_log.frm +then + if test "$1" = "verbose" ; then + echo "Preparing general_log table" 1>&2; + fi + c_gl="$c_gl CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END; +CALL create_general_log_table(); +DROP PROCEDURE create_general_log_table;" +fi + + +if test ! -f $mdata/slow_log.frm +then + if test "$1" = "verbose" ; then + echo "Preparing slow_log table" 1>&2; + fi + c_sl="$c_sl CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END; +CALL create_slow_log_table(); +DROP PROCEDURE create_slow_log_table;" +fi + if test ! -f $mdata/event.frm then c_ev="$c_ev CREATE TABLE event (" @@ -812,6 +835,8 @@ $i_tzls $c_p $c_pp +$c_gl +$c_sl $c_ev CREATE DATABASE IF NOT EXISTS cluster_replication; CREATE TABLE IF NOT EXISTS cluster_replication.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index af995836c0c..d33339e4128 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -527,6 +527,42 @@ ALTER TABLE proc MODIFY db MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; +-- +-- Create missing log tables (5.1) +-- + +delimiter // +CREATE PROCEDURE create_log_tables() +BEGIN + DECLARE is_csv_enabled int DEFAULT 0; + SELECT @@have_csv = 'YES' INTO is_csv_enabled; + IF (is_csv_enabled) THEN + CREATE TABLE IF NOT EXISTS general_log ( + event_time TIMESTAMP NOT NULL, + user_host MEDIUMTEXT, + thread_id INTEGER, + server_id INTEGER, + command_type VARCHAR(64), + argument MEDIUMTEXT + ) engine=CSV CHARACTER SET utf8 comment='General log'; + CREATE TABLE IF NOT EXISTS slow_log ( + start_time TIMESTAMP NOT NULL, + user_host MEDIUMTEXT NOT NULL, + query_time TIME NOT NULL, + lock_time TIME NOT NULL, + rows_sent INTEGER NOT NULL, + rows_examined INTEGER NOT NULL, + db VARCHAR(512), + last_insert_id INTEGER, + insert_id INTEGER, + server_id INTEGER, + sql_text MEDIUMTEXT NOT NULL + ) engine=CSV CHARACTER SET utf8 comment='Slow log'; + END IF; +END// +delimiter ; +CALL create_log_tables(); +DROP PROCEDURE create_log_tables; # # EVENT table # -- cgit v1.2.1 From de24c22289fbe17a72ffb3395d58b26ad86a51b6 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Mon, 23 Jan 2006 22:09:53 +0100 Subject: fix for bug #16401 Events: mysql.event.comment is varchar(64) --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index d33339e4128..360e8534773 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -589,7 +589,7 @@ CREATE TABLE event ( ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', - comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; -- cgit v1.2.1 From 781820c028ee3734030f21011acf4a1015b0ae75 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Tue, 24 Jan 2006 15:50:04 +0100 Subject: excess space caused "../scripts/mysql_create_system_tables: line 46: : command not found" when I ran mysql-test-run --- scripts/mysql_create_system_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 9525e48f204..82dfd55aa32 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -43,7 +43,7 @@ c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" c_pl="" i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" i_pl="" c_p="" c_pp="" c_gl="" c_sl="" -c_ev= "" +c_ev="" # Check for old tables if test ! -f $mdata/db.frm -- cgit v1.2.1 From e25c4f37c6de4ea2f363ff10e5a4e4f58e9408cb Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Wed, 25 Jan 2006 18:21:22 -0800 Subject: Add storage/example to make_win_src_distribution --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2f2d6bb393e..b58c32ca741 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -250,7 +250,7 @@ copy_dir_dirs() { # for i in client dbug extra storage/heap include storage/archive \ - libmysql libmysqld storage/myisam \ + libmysql libmysqld storage/myisam storage/example \ storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib do -- cgit v1.2.1 From 48668d7cc41778ca3de5912bb8867493476ced75 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Thu, 26 Jan 2006 20:30:12 +0100 Subject: fix for bug #16401 Events: mysql.event.comment is varchar(64) missed that one in the previos commit --- scripts/mysql_create_system_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 82dfd55aa32..2822cef18ac 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -791,7 +791,7 @@ then c_ev="$c_ev ends DATETIME default NULL," c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," - c_ev="$c_ev comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," c_ev="$c_ev PRIMARY KEY (db,name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi -- cgit v1.2.1 From 899fc2653dad3887b345a3ef351c762a75dd7fd3 Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Mon, 30 Jan 2006 13:09:08 +0100 Subject: Windows compile fixes in preparation for 5.1.6 beta. --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2f2d6bb393e..12237795a8f 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -249,7 +249,7 @@ copy_dir_dirs() { # Input directories to be copied # -for i in client dbug extra storage/heap include storage/archive \ +for i in client dbug extra storage/heap include storage/archive storage/example \ libmysql libmysqld storage/myisam \ storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib -- cgit v1.2.1 From d847ac54caf4853d757c1f96a60b15cd2a338073 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Mon, 30 Jan 2006 13:15:23 +0100 Subject: fix for bug#16642 (Events: No INFORMATION_SCHEMA.EVENTS table) post-review change - use pointer instead of copy on the stack. WL#1034 (Internal CRON) This patch adds INFORMATION_SCHEMA.EVENTS table with the following format: EVENT_CATALOG - MYSQL_TYPE_STRING (Always NULL) EVENT_SCHEMA - MYSQL_TYPE_STRING (the database) EVENT_NAME - MYSQL_TYPE_STRING (the name) DEFINER - MYSQL_TYPE_STRING (user@host) EVENT_BODY - MYSQL_TYPE_STRING (the body from mysql.event) EVENT_TYPE - MYSQL_TYPE_STRING ("ONE TIME" | "RECURRING") EXECUTE_AT - MYSQL_TYPE_TIMESTAMP (set for "ONE TIME" otherwise NULL) INTERVAL_VALUE - MYSQL_TYPE_LONG (set for RECURRING otherwise NULL) INTERVAL_FIELD - MYSQL_TYPE_STRING (set for RECURRING otherwise NULL) SQL_MODE - MYSQL_TYPE_STRING (for now NULL) STARTS - MYSQL_TYPE_TIMESTAMP (starts from mysql.event) ENDS - MYSQL_TYPE_TIMESTAMP (ends from mysql.event) STATUS - MYSQL_TYPE_STRING (ENABLED | DISABLED) ON_COMPLETION - MYSQL_TYPE_STRING (NOT PRESERVE | PRESERVE) CREATED - MYSQL_TYPE_TIMESTAMP LAST_ALTERED - MYSQL_TYPE_TIMESTAMP LAST_EXECUTED - MYSQL_TYPE_TIMESTAMP EVENT_COMMENT - MYSQL_TYPE_STRING SQL_MODE is NULL for now, because the value is still not stored in mysql.event . Support will be added as a fix for another bug. This patch also adds SHOW [FULL] EVENTS [FROM db] [LIKE pattern] 1. SHOW EVENTS shows always only the events on the same user, because the PK of mysql.event is (definer, db, name) several users may have event with the same name -> no information disclosure. 2. SHOW FULL EVENTS - shows the events (in the current db as SHOW EVENTS) of all users. The user has to have PROCESS privilege, if not then SHOW FULL EVENTS behave like SHOW EVENTS. 3. If [FROM db] is specified then this db is considered. 4. Event names can be filtered with LIKE pattern. SHOW EVENTS returns table with the following columns, which are subset of the data which is returned by SELECT * FROM I_S.EVENTS Db Name Definer Type Execute at Interval value Interval field Starts Ends Status --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index eeb3e30e19a..d86eb22e04d 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -791,7 +791,7 @@ then c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," c_ev="$c_ev comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," - c_ev="$c_ev PRIMARY KEY (db,name)" + c_ev="$c_ev PRIMARY KEY (definer, db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index d33339e4128..93bceecb38f 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -600,4 +600,6 @@ CREATE TABLE event ( ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +ALTER TABLE event DROP PRIMARY KEY; +ALTER TABLE event ADD PRIMARY KEY(definer, db, name); -- cgit v1.2.1 From 2a60c11fef216414a05b0f445043f7854e676703 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Tue, 31 Jan 2006 16:01:27 +0100 Subject: partial fix for bug#16407 (sql_mode not regarded) add sql_mode to mysql.event WL#1034 (Internal CRON) --- scripts/mysql_create_system_tables.sh | 32 +++++++++++++++++ scripts/mysql_fix_privilege_tables.sql | 64 ++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 385e04a4cc2..4b4424299a8 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -791,6 +791,38 @@ then c_ev="$c_ev ends DATETIME default NULL," c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," + c_ev="$c_ev sql_mode set(" + c_ev="$c_ev 'REAL_AS_FLOAT'," + c_ev="$c_ev 'PIPES_AS_CONCAT'," + c_ev="$c_ev 'ANSI_QUOTES'," + c_ev="$c_ev 'IGNORE_SPACE'," + c_ev="$c_ev 'NOT_USED'," + c_ev="$c_ev 'ONLY_FULL_GROUP_BY'," + c_ev="$c_ev 'NO_UNSIGNED_SUBTRACTION'," + c_ev="$c_ev 'NO_DIR_IN_CREATE'," + c_ev="$c_ev 'POSTGRESQL'," + c_ev="$c_ev 'ORACLE'," + c_ev="$c_ev 'MSSQL'," + c_ev="$c_ev 'DB2'," + c_ev="$c_ev 'MAXDB'," + c_ev="$c_ev 'NO_KEY_OPTIONS'," + c_ev="$c_ev 'NO_TABLE_OPTIONS'," + c_ev="$c_ev 'NO_FIELD_OPTIONS'," + c_ev="$c_ev 'MYSQL323'," + c_ev="$c_ev 'MYSQL40'," + c_ev="$c_ev 'ANSI'," + c_ev="$c_ev 'NO_AUTO_VALUE_ON_ZERO'," + c_ev="$c_ev 'NO_BACKSLASH_ESCAPES'," + c_ev="$c_ev 'STRICT_TRANS_TABLES'," + c_ev="$c_ev 'STRICT_ALL_TABLES'," + c_ev="$c_ev 'NO_ZERO_IN_DATE'," + c_ev="$c_ev 'NO_ZERO_DATE'," + c_ev="$c_ev 'INVALID_DATES'," + c_ev="$c_ev 'ERROR_FOR_DIVISION_BY_ZERO'," + c_ev="$c_ev 'TRADITIONAL'," + c_ev="$c_ev 'NO_AUTO_CREATE_USER'," + c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" + c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," c_ev="$c_ev PRIMARY KEY (definer, db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index c8014127085..853ce6068d3 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -589,6 +589,38 @@ CREATE TABLE event ( ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', + sql_mode set( + 'REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' + ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -602,4 +634,36 @@ ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(definer, db, name); +ALTER TABLE proc MODIFY sql_mode + set('REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' + ) DEFAULT '' NOT NULL; -- cgit v1.2.1 From edf0185e4bf5431ec2480ace6d161513a69eac74 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Tue, 31 Jan 2006 17:10:44 +0100 Subject: post-push fix --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 853ce6068d3..d7fad130603 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -634,7 +634,7 @@ ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(definer, db, name); -ALTER TABLE proc MODIFY sql_mode +ALTER TABLE event ADD sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', -- cgit v1.2.1 From 64e09bad662913a309cde728b16cbf3d3d0b1738 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Tue, 31 Jan 2006 23:29:03 +0100 Subject: sql_mode should be after on_completion and before comment partial fix for bug #16407 WL#1034 (Internal CRON) --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index d7fad130603..547a4db4d86 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -665,5 +665,5 @@ ALTER TABLE event ADD sql_mode 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL; + ) DEFAULT '' NOT NULL AFTER on_completion; -- cgit v1.2.1 From 0a1f7e921bb08a2f2119f59259278170222fb65e Mon Sep 17 00:00:00 2001 From: "anozdrin@mysql.com" <> Date: Wed, 1 Feb 2006 13:28:45 +0300 Subject: Fix for BUG#9412: Triggers: should have trigger privilege. Implement table-level TRIGGER privilege to control access to triggers. Before this path global SUPER privilege was used for this purpose, that was the big security problem. In details, before this patch SUPER privilege was required: - for the user at CREATE TRIGGER time to create a new trigger; - for the user at DROP TRIGGER time to drop the existing trigger; - for the definer at trigger activation time to execute the trigger (if the definer loses SUPER privilege, all its triggers become unavailable); This patch changes the behaviour in the following way: - TRIGGER privilege on the subject table for trigger is required: - for the user at CREATE TRIGGER time to create a new trigger; - for the user at DROP TRIGGER time to drop the existing trigger; - for the definer at trigger activation time to execute the trigger (if the definer loses TRIGGER privilege on the subject table, all its triggers on this table become unavailable). - SUPER privilege is still required: - for the user at CREATE TRIGGER time to explicitly set the trigger definer to the user other than CURRENT_USER(). When the server works with database of the previous version (w/o TRIGGER privilege), or if the database is being upgraded from the previous versions, TRIGGER privilege is granted to whose users, who have CREATE privilege. --- scripts/mysql_create_system_tables.sh | 21 ++++++++++++--------- scripts/mysql_fix_privilege_tables.sql | 9 +++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 4b4424299a8..94450d23f1e 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -75,14 +75,15 @@ then c_d="$c_d Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" c_d="$c_d comment='Database privileges';" - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y');" + i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); + INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');" fi if test ! -f $mdata/host.frm @@ -111,6 +112,7 @@ then c_h="$c_h Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h ) engine=MyISAM" c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" @@ -154,6 +156,7 @@ then c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," @@ -169,22 +172,22 @@ then if test "$1" = "test" then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('$hostname','');" else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" if test "$windows" = "0" then i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi @@ -234,7 +237,7 @@ then c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 547a4db4d86..73b4ce32640 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -667,3 +667,12 @@ ALTER TABLE event ADD sql_mode 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; +-- +-- TRIGGER privilege +-- + +SET @hadTriggerPriv := 0; +SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%'; + +ALTER TABLE user add Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -- cgit v1.2.1 From 5845476009a4e93b12a4c248b6038a06d96fb40e Mon Sep 17 00:00:00 2001 From: "dlenev@mysql.com" <> Date: Thu, 2 Feb 2006 13:36:07 +0300 Subject: Yet another addition to the fix for BUG#9412 "Triggers: should have trigger privilege". Corrected addition of TRIGGER privilege by "mysql_fix_privilege_tables" script. Problem with it should have been caught by system_mysql_db/system_mysql_db_fix tests but they were disabled. Enabled them back. --- scripts/mysql_fix_privilege_tables.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 73b4ce32640..0fbaf7bec8a 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -674,5 +674,9 @@ ALTER TABLE event ADD sql_mode SET @hadTriggerPriv := 0; SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%'; -ALTER TABLE user add Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE user ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Event_priv; +ALTER TABLE host ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -- cgit v1.2.1 From 2dcc483e6c57c42a70b2bcc7222a7733af8fbb01 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Thu, 2 Feb 2006 16:22:31 +0200 Subject: Several Netware specific fixes. --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f1ed07382b6..2f59c3e1d4c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -129,8 +129,8 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ -- cgit v1.2.1 From 9f243de9c9ebae0717983ecdbd204606ee91a6a9 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Tue, 7 Feb 2006 17:42:04 +0100 Subject: scripts/make_binary_distribution.sh : Adaption of the 5.1.6 build clone to the new "storage" directory layer, already done in the general tree by Jani. --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f1ed07382b6..2f59c3e1d4c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -129,8 +129,8 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ -- cgit v1.2.1 From 181235d03b426766903fe72d5d0ece2b5a09261d Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Tue, 7 Feb 2006 19:06:55 +0100 Subject: scripts/make_binary_distribution.sh : Care about the debug server in the 5.1 packages. --- scripts/make_binary_distribution.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2f59c3e1d4c..b3dfc53f716 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -131,7 +131,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ + sql/mysqld$BS sql/mysqld-debug$BS sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqlslap$BS \ @@ -173,8 +173,9 @@ if [ x$STRIP = x1 ] ; then strip $BASE/bin/* fi -# Copy not binary files -copyfileto $BASE/bin sql/mysqld.sym.gz +# Obsolete, starting from 5.1.6-beta +# # Copy not binary files +# copyfileto $BASE/bin sql/mysqld.sym.gz if [ $BASE_SYSTEM = "netware" ] ; then $CP netware/*.pl $BASE/scripts @@ -304,11 +305,12 @@ else rm -f $BASE/README.NW fi -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -# To be removed in MySQL 4.1 -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi +# Dropped with 5.1.6-beta +# # Make safe_mysqld a symlink to mysqld_safe for backwards portability +# # To be removed in MySQL 4.1 +# if [ $BASE_SYSTEM != "netware" ] ; then +# (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +# fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then -- cgit v1.2.1 From eec5726806c914e6c4a8e545f72bb19cd7d47132 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 12 Feb 2006 01:33:43 +0100 Subject: make_binary_distribution.sh: print => echo in shell script --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0236d8b8bfe..f372762c05d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -279,7 +279,7 @@ then gcclib=`@CC@ --print-libgcc-file` if test $? -ne 0 then - print "Warning: Couldn't find libgcc.a!" + echo "Warning: Couldn't find libgcc.a!" else $CP $gcclib libmygcc.a fi -- cgit v1.2.1 From 0a5a30bef3c4c539cdf458dd359b04e742b644e3 Mon Sep 17 00:00:00 2001 From: "brian@zim.tangent.org" <> Date: Sun, 12 Feb 2006 13:26:30 -0800 Subject: This patch removes the remaining TYPE= code from MySQL. It cleans up a number of tests where it was being called still (and failing). Also I cleaned up all of the extra scripts so that they now work. --- scripts/fill_func_tables.sh | 6 +++--- scripts/mysql_convert_table_format.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh index 203c730dd9a..83501886d88 100644 --- a/scripts/fill_func_tables.sh +++ b/scripts/fill_func_tables.sh @@ -140,7 +140,7 @@ print " max_args tinyint,"; print " date_created datetime not null,"; print " last_modified timestamp not null,"; print " primary key (func_id)"; -print ") type=myisam;\n\n"; +print ") ENGINE=MYISAM;\n\n"; print "DROP TABLE IF EXISTS function_category_name;\n"; print "CREATE TABLE function_category_name ("; @@ -150,14 +150,14 @@ print " url char(128) not null,"; print " date_created datetime not null,"; print " last_modified timestamp not null,"; print " primary key (cat_id)"; -print ") type=myisam;\n\n"; +print ") ENGINE=MYISAM;\n\n"; print "DROP TABLE IF EXISTS function_category;\n"; print "CREATE TABLE function_category ("; print " cat_id smallint unsigned not null references function_category_name,"; print " func_id int unsigned not null references function,"; print " primary key (cat_id, func_id)"; -print ") type=myisam;\n\n"; +print ") ENGINE=MYISAM;\n\n"; print "DELETE FROM function_category_name;\n"; print "DELETE FROM function_category;\n"; diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index c1955e632fb..4b68d6c5039 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -69,7 +69,7 @@ foreach $table (@ARGV) } } print "converting $table\n" if ($opt_verbose); - if (!$dbh->do("ALTER TABLE $table type=$opt_type")) + if (!$dbh->do("ALTER TABLE $table ENGINE=$opt_type")) { print STDERR "Can't convert $table: Error $DBI::errstr\n"; exit(1) if (!$opt_force); @@ -114,7 +114,7 @@ Conversion of a MySQL tables to other table types. --socket='/path/to/socket' Socket to connect with. ---type='table-type' +--ENGINE='table-type' Converts tables to the given table type (Default: $opt_type) MySQL 3.23 supports at least the BDB, ISAM and MYISAM types. -- cgit v1.2.1 From 053d90a2349964e977ccb2a8aecfd339695fa38d Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Fri, 17 Feb 2006 10:52:32 +0400 Subject: WL#2645 (CHECK TABLE FOR UPGRADE) necessary implementation in the server mysql_upgrade script added --- scripts/Makefile.am | 3 + scripts/mysql_upgrade.sh | 185 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 scripts/mysql_upgrade.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 394e24c7c32..0f68b484f41 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,6 +32,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ + mysql_upgrade \ mysqld_multi \ mysql_create_system_tables @@ -59,6 +60,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ + mysql_upgrade.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh @@ -87,6 +89,7 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ + mysql_upgrade \ mysqld_multi \ make_win_src_distribution \ mysql_create_system_tables diff --git a/scripts/mysql_upgrade.sh b/scripts/mysql_upgrade.sh new file mode 100644 index 00000000000..db5dc6a9516 --- /dev/null +++ b/scripts/mysql_upgrade.sh @@ -0,0 +1,185 @@ +#!/bin/sh +# Copyright (C) 2002-2003 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file. + +# Runs mysqlcheck --check-upgrade in case it has not been done on this +# major MySQL version + +# This script should always be run when upgrading from one major version +# to another (ie: 4.1 -> 5.0 -> 5.1) + +# +# Note that in most cases one have to use '--password' as +# arguments as these needs to be passed on to the mysqlcheck command + + +user=root + +case "$1" in + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; +esac + +parse_arguments() { + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg do + case "$arg" in + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --ldata=*|--data=*|--datadir=*) DATADIR=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --force) force=1 ;; + --verbose) verbose=1 ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.=-]\),\\\\\1,g'` + fi + ;; + esac + done +} + +# +# Find where my_print_defaults is +# + +find_my_print_defaults () { + if test -x ./bin/my_print_defaults + then + print_defaults="./bin/my_print_defaults" + elif test -x ./extra/my_print_defaults + then + print_defaults="./extra/my_print_defaults" + elif test -x @bindir@/my_print_defaults + then + print_defaults="@bindir@/my_print_defaults" + elif test -x @bindir@/mysql_print_defaults + then + print_defaults="@bindir@/mysql_print_defaults" + else + print_defaults="my_print_defaults" + fi +} + +find_my_print_defaults + +# Get first arguments from the my.cfg file, groups [mysqld] and +# [mysql_upgrade], and then merge with the command line arguments + +args= +DATADIR= +bindir= +MY_BASEDIR_VERSION= +verbose=0 +force=0 + +parse_arguments `$print_defaults $defaults mysqld mysql_upgrade` +parse_arguments PICK-ARGS-FROM-ARGV "$@" + +# +# Try to find where binaries are installed +# + +MY_PWD=`pwd` +# Check for the directories we would expect from a binary release install +if test -z "$MY_BASEDIR_VERSION" +then + if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + bindir="$MY_BASEDIR_VERSION/bin" + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + bindir="$MY_BASEDIR_VERSION/bin" +# Since we didn't find anything, used the compiled-in defaults + else + MY_BASEDIR_VERSION=@prefix@ + bindir=@bindir@ + fi +else + bindir="$MY_BASEDIR_VERSION/bin" +fi + +# +# Try to find the data directory +# + +if test -z "$DATADIR" +then + # Try where the binary installs put it + if test -d $MY_BASEDIR_VERSION/data/mysql + then + DATADIR=$MY_BASEDIR_VERSION/data + # Next try where the source installs put it + elif test -d $MY_BASEDIR_VERSION/var/mysql + then + DATADIR=$MY_BASEDIR_VERSION/var + # Or just give up and use our compiled-in default + else + DATADIR=@localstatedir@ + fi +fi + +if test ! -x "$bindir/mysqlcheck" +then + echo "Can't find program '$bindir/mysqlcheck'" + echo "Please restart with --basedir=mysql-install-directory" + exit 1 +fi + +if test ! -f "$DATADIR/mysql/user.frm" +then + echo "Can't find data directory. Please restart with --datadir=path-to-data-dir" + exit 1 +fi + +CHECK_FILE=$DATADIR/mysql_upgrade.info + +if test -f $CHECK_FILE -a $force = 0 +then + version=`cat $CHECK_FILE` + if test "$version" = "@MYSQL_BASE_VERSION@" + then + if test $verbose = 1 + then + echo "mysql_upgrade already done for this version" + fi + $bindir/mysql_fix_privilege_tables --silent $args + exit 0 + fi +fi + +# +# Run the upgrade +# + +check_args="--check-upgrade --all-databases --auto-repair --user=$user" + +if test $verbose = 1 +then + echo "Running $bindir/mysqlcheck $args $check_args" +fi + +$bindir/mysqlcheck $check_args $args +if [ $? = 0 ] +then + # Remember base version so that we don't run this script again on the + # same base version + echo "@MYSQL_BASE_VERSION@" > $CHECK_FILE +fi + +$bindir/mysql_fix_privilege_tables --silent --user=$user $args -- cgit v1.2.1 From 0611ea322271c99d2b5cc7640eea48773942174a Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 17 Feb 2006 14:14:56 +0100 Subject: Surprising change: "mysqld-max" is resurrected in 5.1, but in a common package. --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 03c2c6d3154..58ee5a73474 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -131,7 +131,8 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysqld-debug$BS sql/mysql_tzinfo_to_sql$BS \ + sql/mysqld$BS sql/mysqld-debug$BS sql/mysqld-max$BS \ + sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqlslap$BS \ -- cgit v1.2.1 From 9aca849da186e491766cb1b3f3b5defe9f1daa1c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 18 Feb 2006 04:23:24 +0100 Subject: Makefile.am: Add an extra -lpthread before first -lc, to solve link problems when statically linking with glibc 2.2.5 make_win_src_distribution.sh: Added copying of the include/mysql directory --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 8f2a4d809df..2eef553bca8 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -250,7 +250,7 @@ copy_dir_dirs() { # for i in client dbug extra storage/heap include storage/archive storage/example \ - libmysql libmysqld storage/myisam storage/example \ + include/mysql libmysql libmysqld storage/myisam storage/example \ storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib do -- cgit v1.2.1 From a50023d772471e63e823d276619e5d11c1420e15 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 18 Feb 2006 08:46:18 +0100 Subject: mysqlimport.c: Handle case where there is no snprintf() libmysql.vcproj, mysqlclient.vcproj: Added __WIN__ symbol, needed when compiling dbug.c dbug.vcproj: Changed __WIN32__ to __WIN__ dbug.c: Added Windows specific code to handle TIMESTAMP_ON log line format make_win_src_distribution.sh: Copy plugin directory recursively dbug.vcproj: Define __WIN__ for all targets --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2eef553bca8..893ae6c188a 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -266,7 +266,7 @@ make -C $SOURCE/storage/ndb windoze # Input directories to be copied recursively # -for i in storage/bdb storage/innobase storage/ndb extra/yassl server-tools +for i in storage/bdb storage/innobase storage/ndb extra/yassl server-tools plugin do copy_dir_dirs $i done -- cgit v1.2.1 From 70fdbff94ffb12a784474652d03ee2c46422d582 Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Sat, 18 Feb 2006 14:55:31 +0400 Subject: --help option added to mysql_upgrade script --- scripts/mysql_upgrade.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_upgrade.sh b/scripts/mysql_upgrade.sh index db5dc6a9516..ed52f5126ce 100644 --- a/scripts/mysql_upgrade.sh +++ b/scripts/mysql_upgrade.sh @@ -39,6 +39,7 @@ parse_arguments() { --ldata=*|--data=*|--datadir=*) DATADIR=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --force) force=1 ;; --verbose) verbose=1 ;; + --help) help_option=1 ;; *) if test -n "$pick_args" then @@ -84,10 +85,27 @@ bindir= MY_BASEDIR_VERSION= verbose=0 force=0 +help_option=0 parse_arguments `$print_defaults $defaults mysqld mysql_upgrade` parse_arguments PICK-ARGS-FROM-ARGV "$@" +if test $help_option = 1 +then + echo "MySQL utility script to upgrade database to the current server version" + echo "" + echo "It takes the following arguments:" + echo " --basedir Specifies the directory where MySQL is installed" + echo " --user user for database login if not current user" + echo " --datadir data directory" + echo " --force keep process ignoring errors" + echo " --verbose give more output about the process" + echo " --help Show this help message" + echo "" + + exit 0 +fi + # # Try to find where binaries are installed # -- cgit v1.2.1 From 796489ea1e771279eade2e923da6ea2734256812 Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Mon, 20 Feb 2006 14:26:32 +0400 Subject: Messgges corrected in mysql_upgrade script --- scripts/mysql_upgrade.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_upgrade.sh b/scripts/mysql_upgrade.sh index ed52f5126ce..c9f375b6c5b 100644 --- a/scripts/mysql_upgrade.sh +++ b/scripts/mysql_upgrade.sh @@ -95,12 +95,12 @@ then echo "MySQL utility script to upgrade database to the current server version" echo "" echo "It takes the following arguments:" - echo " --basedir Specifies the directory where MySQL is installed" - echo " --user user for database login if not current user" - echo " --datadir data directory" - echo " --force keep process ignoring errors" - echo " --verbose give more output about the process" echo " --help Show this help message" + echo " --basedir Specifies the directory where MySQL is installed" + echo " --datadir Specifies the data directory" + echo " --force Mysql_upgrade.info file will be ignored" + echo " --user Username for server login if not current user" + echo " --verbose Display more output about the process" echo "" exit 0 -- cgit v1.2.1 From 5ac46bb961ed438e8304374bf27acfecabdabac1 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Fri, 24 Feb 2006 00:29:50 +0100 Subject: fix for bug #16400 --- scripts/mysql_fix_privilege_tables.sh | 6 +----- scripts/mysql_fix_privilege_tables.sql | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 073964d4bde..8c0c539f3f2 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -163,11 +163,7 @@ s_echo() } s_echo "This script updates all the mysql privilege tables to be usable by" -s_echo "MySQL 4.0 and above." -s_echo "" -s_echo "This is needed if you want to use the new GRANT functions," -s_echo "CREATE AGGREGATE FUNCTION, stored procedures, or" -s_echo "more secure passwords in 4.1" +s_echo "MySQL 5.1 and above." s_echo "" if test $verbose = 1 diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 0fbaf7bec8a..0d45728dda3 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -630,6 +630,9 @@ CREATE TABLE event ( # EVENT privilege # +SET @hadEventPriv := 0; +SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; + ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE event DROP PRIMARY KEY; @@ -667,6 +670,8 @@ ALTER TABLE event ADD sql_mode 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; +UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; + -- -- TRIGGER privilege -- -- cgit v1.2.1 From 82b77cdd901bb36d4be23456bc0c5d171a29e3f7 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Fri, 24 Feb 2006 18:34:15 +0200 Subject: Fixes to embedded server to be able to run tests with it (Needed for "list of pushes" web page and autopush) --- scripts/mysql_fix_privilege_tables.sql | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index ed0f9a6c68f..41d468fd3cf 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -521,3 +521,9 @@ ALTER TABLE proc MODIFY db char(77) collate utf8_bin DEFAULT '' NOT NULL, MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; + +# Activate the new, possible modified privilege tables +# This should not be needed, but gives us some extra testing that the above +# changes was correct + +flush privileges; -- cgit v1.2.1 From df6bb1994ba5fde5222a2170f6d4d21fa7996188 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 1 Mar 2006 13:31:21 +0100 Subject: Bug #17805 Cluster_replication database should be renamed to just cluster --- scripts/mysql_create_system_tables.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 94450d23f1e..287a83fbc99 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -874,8 +874,8 @@ $c_pp $c_gl $c_sl $c_ev -CREATE DATABASE IF NOT EXISTS cluster_replication; -CREATE TABLE IF NOT EXISTS cluster_replication.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +CREATE DATABASE IF NOT EXISTS cluster; +CREATE TABLE IF NOT EXISTS cluster.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; END_OF_DATA -- cgit v1.2.1 From 24e959f348eeedcf820aee7dbbc0cb24fe8a54b1 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 1 Mar 2006 21:10:30 +0100 Subject: Bug#17368 General log and slow query log don't work - Add "storage/csv" to directories to be copied --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 893ae6c188a..22c0ea7c839 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -249,7 +249,7 @@ copy_dir_dirs() { # Input directories to be copied # -for i in client dbug extra storage/heap include storage/archive storage/example \ +for i in client dbug extra storage/heap include storage/archive storage/csv \ include/mysql libmysql libmysqld storage/myisam storage/example \ storage/myisammrg mysys regex sql strings sql-common sql/examples \ tools vio zlib -- cgit v1.2.1 From 550e73cc6e451312a2e24ffde119c90b5e63935a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Thu, 2 Mar 2006 22:53:38 +0100 Subject: mysql-test-run.pl: Try find in order 'mysqld-nt', 'mysqld', 'mysqld-debug' and 'mysqld-max' mysqld_safe.sh: Don't try 'mysqld-max' before 'mysqld' if no server given, bug#17861 --- scripts/mysqld_safe.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a584c384712..83bc8ce8954 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -213,15 +213,10 @@ then chown $user $mysql_unix_port_dir fi -# Use the mysqld-max binary by default if the user doesn't specify a binary +# If the user doesn't specify a binary, we assume name "mysqld" if test -z "$MYSQLD" then - if test -x $ledir/mysqld-max - then - MYSQLD=mysqld-max - else - MYSQLD=mysqld - fi + MYSQLD=mysqld fi if test ! -x $ledir/$MYSQLD -- cgit v1.2.1 From 531ad766ed334667aff8901e9d26dbbe039b01d7 Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Fri, 24 Mar 2006 17:45:52 +0100 Subject: fix for bug#16415 Events names are case sensitive --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 287a83fbc99..a401e1d0159 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -775,7 +775,7 @@ if test ! -f $mdata/event.frm then c_ev="$c_ev CREATE TABLE event (" c_ev="$c_ev db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," - c_ev="$c_ev name char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev name char(64) CHARACTER SET utf8 NOT NULL default ''," c_ev="$c_ev body longblob NOT NULL," c_ev="$c_ev definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," c_ev="$c_ev execute_at DATETIME default NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 478d6b48c73..5b3cab16db2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -671,6 +671,7 @@ ALTER TABLE event ADD sql_mode ) DEFAULT '' NOT NULL AFTER on_completion; UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; +ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; -- -- TRIGGER privilege -- cgit v1.2.1 From 5ff0851d4ec97311601f507a1f7afc72d65d5512 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 27 Mar 2006 06:44:45 +0200 Subject: make_binary_distribution.sh: Split cp operations, to avoid shell limit on number of args mysql-test-run.pl: Removed obsolete way of cleaning up after test failure .del-drop-on-restart.inc~ef1715ddbebc3102: Delete: mysql-test/include/drop-on-restart.inc --- scripts/make_binary_distribution.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 58ee5a73474..c4a5345445d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -241,9 +241,10 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test mysql-test/t/*.imtest \ - mysql-test/t/*.disabled mysql-test/t/*.opt \ - mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +$CP mysql-test/t/*.test $BASE/mysql-test/t +$CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t +$CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t +$CP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r $CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests -- cgit v1.2.1 From 35ae639477b6ecb0d31aec590b0e405627f25cf5 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 27 Mar 2006 19:25:25 +0200 Subject: mysql_config.sh: We are not to control what malloc package others are to use, remove -lmtmalloc from --libs(_r), bug#18322 --- scripts/mysql_config.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 5b35c0190a5..caf8708c6a0 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -91,18 +91,15 @@ socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' -# Create options - -libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" +# Create options +# We intentionally add a space to the beginning of lib strings, simplifies replace later +libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" -libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" +embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" -libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" -embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about # FIXME until we have a --cxxflags, we need to remove -Xa @@ -118,6 +115,20 @@ do done cflags=`echo "$cflags"|sed -e 's/ *\$//'` +# Same for --libs(_r) +for remove in lmtmalloc +do + # We know the strings starts with a space + libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` + libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"` + embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"` +done + +# Strip trailing and ending space if any, and '+' (FIXME why?) +libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` + usage () { cat < Date: Mon, 27 Mar 2006 23:04:44 +0200 Subject: mysql_config.sh: Remove Solaris -xc99=none C option as C++ compiler can't handle it --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index caf8708c6a0..4d732485b1d 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -107,7 +107,7 @@ include="-I$pkgincludedir" for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \ - Xa xstrconst + Xa xstrconst "xc99=none" do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option -- cgit v1.2.1 From 67f2b0f3bc1a074609ee2f8470bf24dd926e73a7 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 29 Mar 2006 14:59:53 +0200 Subject: mysql_config.sh: If installed, search built in lib path first, bug#13158 --- scripts/mysql_config.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 4d732485b1d..84ff518c381 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -82,10 +82,15 @@ basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` ldata='@localstatedir@' execdir='@libexecdir@' bindir='@bindir@' + +# If installed, search for the compiled in directory first (might be "lib64") pkglibdir='@pkglibdir@' -fix_path pkglibdir lib/mysql lib +pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` +fix_path pkglibdir $pkglibdir_rel lib/mysql lib + pkgincludedir='@pkgincludedir@' fix_path pkgincludedir include/mysql include + version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' -- cgit v1.2.1 From 6ce9c90db9340bdad0ba0aaa4f01e85b5409ba17 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 29 Mar 2006 23:51:23 +0200 Subject: mysqld_safe.sh: Added --help option, bug#16392 acinclude.m4: Use "$shrext_cmds" when testing if shared library exists, bug#16332 --- scripts/mysqld_safe.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 6ce4c1e0da8..c655910dc2c 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -24,6 +24,31 @@ case "$1" in ;; esac +usage () { + cat < Date: Mon, 3 Apr 2006 03:37:43 +0200 Subject: mysql_install_db.sh, MySQLEULA.txt, mysql_install_db.c: Changed web address order.mysql.com to shop.mysql.com --- scripts/mysql_install_db.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0b3742638f5..6aaeefaec17 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,3 +1,4 @@ + #!/bin/sh # Copyright (C) 2002-2004 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. @@ -397,7 +398,7 @@ then echo echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" - echo "Support MySQL by buying support/licenses at https://order.mysql.com" + echo "Support MySQL by buying support/licenses at http://shop.mysql.com" echo exit 0 else -- cgit v1.2.1 From 41923d3bb1eb85a4aa0de34e0c9edf3b48d17bbb Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 10 Apr 2006 14:15:02 +0200 Subject: mysql-test-run.pl: Added --ndbcluster_port for backward compatibility make_win_src_distribution.sh: Updated to reflect 5.1 changes --- scripts/make_win_src_distribution.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 22c0ea7c839..f9008bdfeae 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -184,7 +184,7 @@ rm -r -f "$BASE/share/Makefile" rm -r -f "$BASE/share/Makefile.in" rm -r -f "$BASE/share/Makefile.am" -mkdir $BASE/Docs $BASE/extra $BASE/include $BASE/storage +mkdir $BASE/Docs $BASE/extra $BASE/include # # Copy directory files @@ -251,7 +251,7 @@ copy_dir_dirs() { for i in client dbug extra storage/heap include storage/archive storage/csv \ include/mysql libmysql libmysqld storage/myisam storage/example \ - storage/myisammrg mysys regex sql strings sql-common sql/examples \ + storage/myisammrg mysys regex sql strings sql-common \ tools vio zlib do copy_dir_files $i @@ -260,7 +260,7 @@ done # # Create project files for ndb # -make -C $SOURCE/storage/ndb windoze +#make -C $SOURCE/storage/ndb windoze # # Input directories to be copied recursively @@ -298,8 +298,6 @@ do fi done -cp extra/sql_state.h extra/mysqld_error.h $BASE/include - # # support files # @@ -350,8 +348,6 @@ find $BASE \( -name "*.cnf" -o -name "*.ini" \ do unix_to_dos $v done -# File extension '.txt' matches too many other files, error messages etc. -unix_to_dos $BASE/Docs/*.txt mv $BASE/README $BASE/README.txt -- cgit v1.2.1 From 276109b155b017a509801b19f76d81feca460707 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 11 Apr 2006 18:54:24 -0700 Subject: Remove old cruft from the tree: mysqltestmanager, mysql_test_run_new, and various stuff in Docs/. Also move the certificates used for testing into mysql-test/std_data from the top-level SSL directory (now gone). --- scripts/make_binary_distribution.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c4a5345445d..4bba4c2420e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -154,14 +154,11 @@ if [ $BASE_SYSTEM = "netware" ] ; then # For all other platforms: else BIN_FILES="$BIN_FILES \ - client/mysqltestmanagerc \ - client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ client/.libs/mysqlslap \ client/.libs/mysqldump client/.libs/mysqlimport \ client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ - client/.libs/mysqltestmanager-pwgen tools/.libs/mysqltestmanager \ + client/.libs/mysqlbinlog \ tests/.libs/mysql_client_test \ libmysqld/examples/.libs/mysql_client_test_embedded \ libmysqld/examples/.libs/mysqltest_embedded \ -- cgit v1.2.1 From aa80bf659b382b163bd91f58bd3d2f68a174fad6 Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Wed, 12 Apr 2006 16:54:00 +0500 Subject: mysql_upgrade.sh removed. client/mysql_upgrade bunary should be used instead --- scripts/Makefile.am | 3 - scripts/mysql_upgrade.sh | 203 ----------------------------------------------- 2 files changed, 206 deletions(-) delete mode 100644 scripts/mysql_upgrade.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5d4d8863f98..56a2d4a7bc6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -31,7 +31,6 @@ bin_SCRIPTS = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysql_explain_log \ - mysql_upgrade \ mysqld_multi \ mysql_create_system_tables @@ -58,7 +57,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqldumpslow.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ - mysql_upgrade.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh @@ -87,7 +85,6 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ - mysql_upgrade \ mysqld_multi \ make_win_src_distribution \ mysql_create_system_tables diff --git a/scripts/mysql_upgrade.sh b/scripts/mysql_upgrade.sh deleted file mode 100644 index c9f375b6c5b..00000000000 --- a/scripts/mysql_upgrade.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/sh -# Copyright (C) 2002-2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. - -# Runs mysqlcheck --check-upgrade in case it has not been done on this -# major MySQL version - -# This script should always be run when upgrading from one major version -# to another (ie: 4.1 -> 5.0 -> 5.1) - -# -# Note that in most cases one have to use '--password' as -# arguments as these needs to be passed on to the mysqlcheck command - - -user=root - -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac - -parse_arguments() { - # We only need to pass arguments through to the server if we don't - # handle them here. So, we collect unrecognized options (passed on - # the command line) into the args variable. - pick_args= - if test "$1" = PICK-ARGS-FROM-ARGV - then - pick_args=1 - shift - fi - - for arg do - case "$arg" in - --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --ldata=*|--data=*|--datadir=*) DATADIR=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --force) force=1 ;; - --verbose) verbose=1 ;; - --help) help_option=1 ;; - *) - if test -n "$pick_args" - then - # This sed command makes sure that any special chars are quoted, - # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.=-]\),\\\\\1,g'` - fi - ;; - esac - done -} - -# -# Find where my_print_defaults is -# - -find_my_print_defaults () { - if test -x ./bin/my_print_defaults - then - print_defaults="./bin/my_print_defaults" - elif test -x ./extra/my_print_defaults - then - print_defaults="./extra/my_print_defaults" - elif test -x @bindir@/my_print_defaults - then - print_defaults="@bindir@/my_print_defaults" - elif test -x @bindir@/mysql_print_defaults - then - print_defaults="@bindir@/mysql_print_defaults" - else - print_defaults="my_print_defaults" - fi -} - -find_my_print_defaults - -# Get first arguments from the my.cfg file, groups [mysqld] and -# [mysql_upgrade], and then merge with the command line arguments - -args= -DATADIR= -bindir= -MY_BASEDIR_VERSION= -verbose=0 -force=0 -help_option=0 - -parse_arguments `$print_defaults $defaults mysqld mysql_upgrade` -parse_arguments PICK-ARGS-FROM-ARGV "$@" - -if test $help_option = 1 -then - echo "MySQL utility script to upgrade database to the current server version" - echo "" - echo "It takes the following arguments:" - echo " --help Show this help message" - echo " --basedir Specifies the directory where MySQL is installed" - echo " --datadir Specifies the data directory" - echo " --force Mysql_upgrade.info file will be ignored" - echo " --user Username for server login if not current user" - echo " --verbose Display more output about the process" - echo "" - - exit 0 -fi - -# -# Try to find where binaries are installed -# - -MY_PWD=`pwd` -# Check for the directories we would expect from a binary release install -if test -z "$MY_BASEDIR_VERSION" -then - if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld - then - MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are - bindir="$MY_BASEDIR_VERSION/bin" - # Check for the directories we would expect from a source install - elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld - then - MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are - bindir="$MY_BASEDIR_VERSION/bin" -# Since we didn't find anything, used the compiled-in defaults - else - MY_BASEDIR_VERSION=@prefix@ - bindir=@bindir@ - fi -else - bindir="$MY_BASEDIR_VERSION/bin" -fi - -# -# Try to find the data directory -# - -if test -z "$DATADIR" -then - # Try where the binary installs put it - if test -d $MY_BASEDIR_VERSION/data/mysql - then - DATADIR=$MY_BASEDIR_VERSION/data - # Next try where the source installs put it - elif test -d $MY_BASEDIR_VERSION/var/mysql - then - DATADIR=$MY_BASEDIR_VERSION/var - # Or just give up and use our compiled-in default - else - DATADIR=@localstatedir@ - fi -fi - -if test ! -x "$bindir/mysqlcheck" -then - echo "Can't find program '$bindir/mysqlcheck'" - echo "Please restart with --basedir=mysql-install-directory" - exit 1 -fi - -if test ! -f "$DATADIR/mysql/user.frm" -then - echo "Can't find data directory. Please restart with --datadir=path-to-data-dir" - exit 1 -fi - -CHECK_FILE=$DATADIR/mysql_upgrade.info - -if test -f $CHECK_FILE -a $force = 0 -then - version=`cat $CHECK_FILE` - if test "$version" = "@MYSQL_BASE_VERSION@" - then - if test $verbose = 1 - then - echo "mysql_upgrade already done for this version" - fi - $bindir/mysql_fix_privilege_tables --silent $args - exit 0 - fi -fi - -# -# Run the upgrade -# - -check_args="--check-upgrade --all-databases --auto-repair --user=$user" - -if test $verbose = 1 -then - echo "Running $bindir/mysqlcheck $args $check_args" -fi - -$bindir/mysqlcheck $check_args $args -if [ $? = 0 ] -then - # Remember base version so that we don't run this script again on the - # same base version - echo "@MYSQL_BASE_VERSION@" > $CHECK_FILE -fi - -$bindir/mysql_fix_privilege_tables --silent --user=$user $args -- cgit v1.2.1 From 55727ef6d0db4b5aec48223f9618c2da3d36f989 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Apr 2006 10:34:46 -0700 Subject: Remove sql-bench from the server repository -- it is being maintained in a distinct mysql-bench repository. Also add a new --benchdir option to mysql-test-run.pl so the location of the mysql-bench repository can be specified. The default location is adjacent to the source tree. --- scripts/make_binary_distribution.sh | 15 +++------------ scripts/make_win_src_distribution.sh | 2 +- scripts/mysql_install_db.sh | 3 --- 3 files changed, 4 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4bba4c2420e..aa29d48d50d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -97,7 +97,7 @@ mkdir $BASE $BASE/bin $BASE/docs \ $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ + mkdir $BASE/share/mysql $BASE/tests $BASE/man \ $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test chmod o-rwx $BASE/data $BASE/data/* @@ -263,8 +263,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ $BASE/support-files/mysql.server $BASE/configure - $CP -r sql-bench/* $BASE/sql-bench - rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la + rm -f $BASE/lib/*.la rm -f $BASE/bin/*.sql fi @@ -304,17 +303,9 @@ else rm -f $BASE/README.NW fi -# Dropped with 5.1.6-beta -# # Make safe_mysqld a symlink to mysqld_safe for backwards portability -# # To be removed in MySQL 4.1 -# if [ $BASE_SYSTEM != "netware" ] ; then -# (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -# fi - # Clean up if we did this from a bk tree -if [ -d $BASE/sql-bench/SCCS ] ; then +if [ -d $BASE/share/SCCS ] ; then find $BASE/share -name SCCS -print | xargs rm -rf - find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi # NDB Cluster diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index f9008bdfeae..b070e30c5c7 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -314,7 +314,7 @@ done # Raw dirs from source tree # -for i in scripts sql-bench mysql-test SSL tests +for i in scripts mysql-test SSL tests do print_debug "Copying directory '$i'" if [ -d $i ] diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c05fda745b0..865ab3e6db4 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -262,9 +262,6 @@ then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" echo - echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" - echo "cd sql-bench ; perl run-all-tests" - echo fi echo "Please report any problems with the @scriptdir@/mysqlbug script!" echo -- cgit v1.2.1 From ed2432494ff892eb255a75a5bc9460afc9e03ec7 Mon Sep 17 00:00:00 2001 From: "igreenhoe@mysql.com" <> Date: Mon, 17 Apr 2006 19:57:50 -0700 Subject: Fix for bug #17353. --- scripts/mysqld_safe.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a584c384712..02a961dc3ec 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -321,10 +321,13 @@ then ulimit -n $open_files args="--open-files-limit=$open_files $args" fi - if test -n "$core_file_size" - then - ulimit -c $core_file_size - fi +fi + +# Try to set the core file size (even if we aren't root) because many systems +# don't specify a hard limit on core file size. +if test -n "$core_file_size" +then + ulimit -c $core_file_size fi # -- cgit v1.2.1 From c104ea0960d36cd5b79fd9edc2681dc89f84d4a9 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Mon, 17 Apr 2006 20:01:07 -0700 Subject: Delete unused (and unmaintained) scripts. --- scripts/mysql_prepare_privilege_tables_for_5.sql | 53 -------- scripts/mysqld_safe-watch.sh | 150 ----------------------- 2 files changed, 203 deletions(-) delete mode 100644 scripts/mysql_prepare_privilege_tables_for_5.sql delete mode 100644 scripts/mysqld_safe-watch.sh (limited to 'scripts') diff --git a/scripts/mysql_prepare_privilege_tables_for_5.sql b/scripts/mysql_prepare_privilege_tables_for_5.sql deleted file mode 100644 index a9b6d43aee0..00000000000 --- a/scripts/mysql_prepare_privilege_tables_for_5.sql +++ /dev/null @@ -1,53 +0,0 @@ - -use mysql; - --- --- merging `host` table and `db` --- - -UPDATE IGNORE host SET Host='%' WHERE Host=''; -DELETE FROM host WHERE Host=''; - -INSERT IGNORE INTO db (User, Host, Select_priv, Insert_priv, Update_priv, - Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, - Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv) - SELECT d.User, h.Host, - (d.Select_priv = 'Y' || h.Select_priv = 'Y') + 1, - (d.Insert_priv = 'Y' || h.Select_priv = 'Y') + 1, - (d.Update_priv = 'Y' || h.Update_priv = 'Y') + 1, - (d.Delete_priv = 'Y' || h.Delete_priv = 'Y') + 1, - (d.Create_priv = 'Y' || h.Create_priv = 'Y') + 1, - (d.Drop_priv = 'Y' || h.Drop_priv = 'Y') + 1, - (d.Grant_priv = 'Y' || h.Grant_priv = 'Y') + 1, - (d.References_priv = 'Y' || h.References_priv = 'Y') + 1, - (d.Index_priv = 'Y' || h.Index_priv = 'Y') + 1, - (d.Alter_priv = 'Y' || h.Alter_priv = 'Y') + 1, - (d.Create_tmp_table_priv = 'Y' || h.Create_tmp_table_priv = 'Y') + 1, - (d.Lock_tables_priv = 'Y' || h.Lock_tables_priv = 'Y') + 1 - FROM db d, host h WHERE d.Host = ''; - -UPDATE IGNORE db SET Host='%' WHERE Host = ''; -DELETE FROM db WHERE Host=''; - -TRUNCATE TABLE host; - --- --- Adding missing users to `user` table --- --- note that invalid password causes the user to be skipped during the --- load of grand tables (at mysqld startup) thus three following inserts --- do not affect anything - -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM db; -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM tables_priv; -INSERT IGNORE user (User, Host, Password) SELECT User, Host, "*" FROM columns_priv; - -SELECT DISTINCT -"There are user accounts with the username 'PUBLIC'. In the SQL-1999 -(or later) standard this name is reserved for PUBLIC role and can -not be used as a valid user name. Consider renaming these accounts before -upgrading to MySQL-5.0. -These accounts are:" x -FROM user WHERE user='PUBLIC'; -SELECT CONCAT(user,'@',host) FROM user WHERE user='PUBLIC'; - diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh deleted file mode 100644 index c59b3b2614d..00000000000 --- a/scripts/mysqld_safe-watch.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB -# This file is public domain and comes with NO WARRANTY of any kind -# -# scripts to start the MySQL demon and restart it if it dies unexpectedly -# -# This should be executed in the MySQL base directory if you are using a -# binary installation that has other paths than you are using. -# -# mysql.server works by first doing a cd to the base directory and from there -# executing mysqld_safe - -# Check if we are starting this relative (for the binary release) -if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./bin/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is - DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are - ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are -# Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld -then - MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is - DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are -else - MY_BASEDIR_VERSION=/usr/local/mysql - DATADIR=/usr/local/mysql/var - ledir=/usr/local/mysql/libexec -fi - -hostname=`@HOSTNAME@` -pidfile=$DATADIR/$hostname.pid -log=$DATADIR/$hostname.log -err=$DATADIR/$hostname.err -lockfile=$DATADIR/$hostname.lock - -# -# If there exists an old pid file, check if the demon is already running -# Note: The switches to 'ps' may depend on your operating system - -if test -f $pidfile -then - PID=`cat $pidfile` - if /bin/kill -0 $PID - then - if /bin/ps -p $PID | grep mysqld > /dev/null - then # The pid contains a mysqld process - echo "A mysqld process already exists" - echo "A mysqld process already exists at " `date` >> $log - exit 1; - fi - fi - rm -f $pidfile - if test -f $pidfile - then - echo "Fatal error: Can't remove the pid file: $pidfile" - echo "Fatal error: Can't remove the pid file: $pidfile at " `date` >> $log - echo "Please remove it manually and start $0 again" - echo "mysqld demon not started" - exit 1; - fi -fi - -echo "Starting mysqld demon with databases from $DATADIR" - -#Default communication ports -#MYSQL_TCP_PORT=3306 -if test -z "$MYSQL_UNIX_PORT" -then - MYSQL_UNIX_PORT="/tmp/mysql.sock" - export MYSQL_UNIX_PORT -fi -#export MYSQL_TCP_PORT - -# Does this work on all systems? -#if type ulimit | grep "shell builtin" > /dev/null -#then -# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems -#fi - -echo "mysqld started on " `date` >> $log -bin/zap -f $lockfile < /dev/null > /dev/null 2>&1 -rm -f $lockfile -$MY_BASEDIR_VERSION/bin/watchdog_mysqld $lockfile $pidfile $MY_BASEDIR_VERSION/bin $DATADIR 3 10 >> $err 2>&1 & -restart_pid=$! - -while true -do - rm -f $MYSQL_UNIX_PORT $pidfile # Some extra safety - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - if test "$#" -eq 0 - then - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking >> $err 2>&1 & - else - nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking "$@" >> $err 2>&1 & - fi - pid=$! - rm -f $lockfile - wait $pid; - - lockfile -1 -r10 $lockfile >/dev/null 2>&1 - rm -f $lockfile - if test ! -f $pidfile # This is removed if normal shutdown - then - break; - fi - if true - then - # Test if one proces was hanging. - # This is only a fix for Linux (running as base 3 mysqld processes) - # but should work for the rest of the servers. - # The only thing is ps x => redhat 5 gives warnings when using ps -x. - # kill -9 is used or the proces won't react on the kill. - numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld` - echo -e "\nNumber of processes running now: $numofproces" | tee -a $log - I=1 - while test "$I" -le "$numofproces" - do - PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1` - for T in $PROC - do - break - done - # echo "TEST $I - $T **" - if kill -9 $T - then - echo "mysqld proces hanging, pid $T - killed" | tee -a $log - else - break - fi - I=`expr $I + 1` - done - fi - echo "mysqld restarted" | tee -a $log - # Check all tables and repair any wrong tables. - $MY_BASEDIR_VERSION/bin/isamchk -sf $DATADIR/*/*.ISM >> $err 2>&1 -done -if test $restart_pid -gt 0 -then - kill $restart_pid > /dev/null 2>&1 - sleep 1; - kill -9 $restart_pid > /dev/null 2>&1 -fi - -echo -n "mysqld ended on " `date` >> $log -echo "mysqld demon ended" -- cgit v1.2.1 From bc89c92c3779948968f058c46ea8ec98117f50d1 Mon Sep 17 00:00:00 2001 From: "tim@siva.hindu.god" <> Date: Wed, 10 May 2006 11:33:36 -0600 Subject: Bug #6061 mysql-log-rotate script - error logging doesn't use new file - Fix mysqld_safe so that it always passes correct --log-error argument to mysqld - A few other minor clean-ups to mysqld_safe --- scripts/mysqld_safe.sh | 68 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 83bc8ce8954..744a4791307 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -31,7 +31,6 @@ Usage: $0 [OPTIONS] --defaults-file=FILE Use the specified defaults file --defaults-extra-file=FILE Also use defaults from the specified file --ledir=DIRECTORY Look for mysqld in the specified directory - --log-error=FILE Log errors to the specified log file --open-files-limit=LIMIT Limit the number of open files --core-file-size=LIMIT Limit core files to the specified size --timezone=TZ Set the system timezone @@ -46,6 +45,11 @@ EOF exit 1 } +shell_quote_string() { + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + echo "$1" | sed -e 's,\([^a-zA-Z0-9/_.=-]\),\\\1,g' +} parse_arguments() { # We only need to pass arguments through to the server if we don't @@ -69,14 +73,14 @@ parse_arguments() { --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; - # these two might have been set in a [mysqld_safe] section of my.cnf + # these might have been set in a [mysqld_safe] section of my.cnf # they are added to mysqld command line to override settings from my.cnf + --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; --socket=*) mysql_unix_port=`echo "$arg" | sed -e "s;--socket=;;"` ;; --port=*) mysql_tcp_port=`echo "$arg" | sed -e "s;--port=;;"` ;; # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; @@ -97,9 +101,7 @@ parse_arguments() { *) if test -n "$pick_args" then - # This sed command makes sure that any special chars are quoted, - # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + append_arg_to_args "$arg" fi ;; esac @@ -194,6 +196,10 @@ else print_defaults="my_print_defaults" fi +append_arg_to_args () { + args="$args "`shell_quote_string "$1"` +} + args= SET_USER=2 parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` @@ -239,15 +245,39 @@ else * ) pid_file="$DATADIR/$pid_file" ;; esac fi -test -z "$err_log" && err_log=$DATADIR/`@HOSTNAME@`.err +append_arg_to_args "--pid-file=$pid_file" + +if [ -n "$err_log" ] +then + # mysqld adds ".err" if there is no extension on the --log-err + # argument; must match that here, or mysqld_safe will write to a + # different log file than mysqld + + # mysqld does not add ".err" to "--log-error=foo."; it considers a + # trailing "." as an extension + if expr "$err_log" : '.*\.[^/]*$' > /dev/null + then + : + else + err_log="$err_log".err + fi + + case "$err_log" in + /* ) ;; + * ) err_log="$DATADIR/$err_log" ;; + esac +else + err_log=$DATADIR/`@HOSTNAME@`.err +fi +append_arg_to_args "--log-error=$err_log" if test -n "$mysql_unix_port" then - args="--socket=$mysql_unix_port $args" + append_arg_to_args "--socket=$mysql_unix_port" fi if test -n "$mysql_tcp_port" then - args="--port=$mysql_tcp_port $args" + append_arg_to_args "--port=$mysql_tcp_port" fi if test $niceness -eq 0 @@ -314,7 +344,7 @@ then if test -n "$open_files" then ulimit -n $open_files - args="--open-files-limit=$open_files $args" + append_arg_to_args "--open-files-limit=$open_files" fi if test -n "$core_file_size" then @@ -372,12 +402,18 @@ echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log while true do rm -f $safe_mysql_unix_port $pid_file # Some extra safety - if test -z "$args" - then - $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ >> $err_log 2>&1 - else - eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file @MYSQLD_DEFAULT_SWITCHES@ $args >> $err_log 2>&1" - fi + + cmd="$NOHUP_NICENESS" + + for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ + "--datadir=$DATADIR" "$USER_OPTION" + do + cmd="$cmd "`shell_quote_string "$i"` + done + cmd="$cmd $args >> "`shell_quote_string "$err_log"`" 2>&1" + #echo "Running mysqld: [$cmd]" + eval "$cmd" + if test ! -f $pid_file # This is removed if normal shutdown then echo "STOPPING server from pid file $pid_file" -- cgit v1.2.1 From e9d96153e1c4587c6a64be6a45ea61529a569a73 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 23 May 2006 00:50:39 +0200 Subject: make_sharedlib_distribution.sh: Solaris sh don't like {..} in file matching --- scripts/make_sharedlib_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh index fbc945e445a..c475d0e14a4 100644 --- a/scripts/make_sharedlib_distribution.sh +++ b/scripts/make_sharedlib_distribution.sh @@ -45,9 +45,11 @@ fi mkdir -p $BASE/lib for i in \ - libmysql/.libs/libmysqlclient.s{l,o}* \ + libmysql/.libs/libmysqlclient.so* \ + libmysql/.libs/libmysqlclient.sl* \ libmysql/.libs/libmysqlclient*.dylib \ - libmysql_r/.libs/libmysqlclient_r.s{l,o}* \ + libmysql_r/.libs/libmysqlclient_r.so* \ + libmysql_r/.libs/libmysqlclient_r.sl* \ libmysql_r/.libs/libmysqlclient_r*.dylib do if [ -f $i ] -- cgit v1.2.1 From ca63edc88b2f56a3a50f2f2e70ef8e0589e08360 Mon Sep 17 00:00:00 2001 From: "brian@zim.(none)" <> Date: Tue, 23 May 2006 17:26:56 -0700 Subject: Removing mysql_explain_log from 5.1 --- scripts/Makefile.am | 3 - scripts/make_binary_distribution.sh | 2 +- scripts/mysql_explain_log.sh | 392 ------------------------------------ 3 files changed, 1 insertion(+), 396 deletions(-) delete mode 100644 scripts/mysql_explain_log.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 56a2d4a7bc6..af3cbc19cb5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -30,7 +30,6 @@ bin_SCRIPTS = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysql_explain_log \ mysqld_multi \ mysql_create_system_tables @@ -55,7 +54,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ - mysql_explain_log.sh \ mysqld_multi.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh @@ -83,7 +81,6 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ make_win_src_distribution \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index aa29d48d50d..1b071a294ed 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -148,7 +148,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ if [ $BASE_SYSTEM = "netware" ] ; then BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/init_db.sql netware/test_db.sql$BS \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; # For all other platforms: diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh deleted file mode 100644 index 973d9e8a363..00000000000 --- a/scripts/mysql_explain_log.sh +++ /dev/null @@ -1,392 +0,0 @@ -#!@PERL@ -w -use strict; -use DBI; - -use Getopt::Long; -$Getopt::Long::ignorecase=0; - -print "explain_log provided by http://www.mobile.de\n"; -print "=========== ================================\n"; - -my $Param={}; - -$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(); -} -else { - $Param->{UpdateCount} = 0; - $Param->{SelectCount} = 0; - $Param->{IdxUseCount} = 0; - $Param->{LineCount} = 0; - - $Param->{Init} = 0; - $Param->{Field} = 0; - $Param->{Refresh} = 0; - $Param->{QueryCount} = 0; - $Param->{Statistics} =0; - - $Param->{Query} = undef; - $Param->{ALL} = undef ; - $Param->{Comment} = undef ; - - @{$Param->{Rows}} = (qw|possible_keys key type|); - - if ($Param->{ViewDate}) { - $Param->{View} = 0; - } - else { - $Param->{View} = 1; - } - - #print "Date=$Param->{ViewDate}, host=$Param->{host}, user=$Param->{user}, password=$Param->{password}\n"; - - $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"; - } - else { - $Param->{Start} = time; - while() { - $Param->{LineCount} ++ ; - - if ($Param->{ViewDate} ) { - if (m/^(\d{6})\s+\d{1,2}:\d\d:\d\d\s.*$/) { # get date - #print "# $1 #\n"; - if ($1 == $Param->{ViewDate}) { - $Param->{View} = 1; - } - else { - $Param->{View} = 0; - } - } - } - if ($Param->{View} ) { - #print "->>>$_"; - - if (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+$/i) { # get connection ID($2) and database($3) - #print "\n <<<<<<<<<<<<<<<<<<----------------------------<<<<<<<<<<<<<<<< \n"; - #print "Connect \n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Change user .*\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Quit\s+$/i) { # remove connection ID($2) and querystring - #print "Q-$1--$2--------\n"; - RunQuery($Param); - delete $Param->{CID}->{$2} ; - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(select.+)$/i) { # get connection ID($2) and querystring - #print "S1-$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $s = "$3"; - $s =~ s/from\s/from $Param->{DB}./i; - $Param->{Query}="EXPLAIN $s"; - - #$s =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - #print "-- $Param->{tab} -- $s --\n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(update.+)$/i) { # get connection ID($2) and querystring - #print "S2--$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $ud = $3; - $ud =~ m/^update\s+(\w+).+(where.+)$/i; - $Param->{Query} ="EXPLAIN SELECT * FROM $1 $2"; - $Param->{Query} =~ s/from\s/from $Param->{DB}./i; - - #$Param->{Query} =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Statistics\s+(.*)$/i) { # get connection ID($2) and info? - $Param->{Statistics} ++; - #print "Statistics--$1--$2--$3------\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(.+)$/i) { # get connection ID($2) - $Param->{QueryCount} ++; - #print "Query-NULL $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Refresh\s+(.+)$/i) { # get connection ID($2) - $Param->{Refresh} ++; - #print "Refresh\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Init\s+(.+)$/i) { # get connection ID($2) - $Param->{Init} ++; - #print "Init $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Field\s+(.+)$/i) { # get connection ID($2) - $Param->{Field} ++; - #print "Field $3\n"; - RunQuery($Param); - } - - elsif (m/^\s+(.+)$/ ) { # command could be some lines ... - #print "multi-lined ($1)\n"; - my ($A)=$1; - chomp $A; - $Param->{Query} .= " $1"; - #print "multi-lined ($1)<<$Param->{Query}>>\n"; - } - - - } - - } - - $Param->{dbh}->disconnect(); - - if (1 == 0) { - print "\nunclosed handles----------------------------------------\n"; - my $count=0; - foreach (sort keys %{$Param->{CID}}) { - print "$count | $_ : $Param->{CID}->{$_} \n"; - $count ++; - } - } - - print "\nIndex usage ------------------------------------\n"; - foreach my $t (sort keys %{$Param->{Data}}) { - print "\nTable\t$t: ---\n"; - foreach my $k (sort keys %{$Param->{Data}->{$t}}) { - print " count\t$k:\n"; - my %h = %{$Param->{Data}->{$t}->{$k}}; - foreach (sort {$h{$a} <=> $h{$b}} keys %h) { - print " $Param->{Data}->{$t}->{$k}->{$_}\t$_\n"; - } - } - } - - $Param->{AllCount}=0; - print "\nQueries causing table scans -------------------\n\n"; - foreach (@{$Param->{ALL}}) { - $Param->{AllCount} ++; - print "$_\n"; - } - print "Sum: $Param->{AllCount} table scans\n"; - - print "\nSummary ---------------------------------------\n\n"; - print "Select: \t$Param->{SelectCount} queries\n"; - print "Update: \t$Param->{UpdateCount} queries\n"; - print "\n"; - - print "Init: \t$Param->{Init} times\n"; - print "Field: \t$Param->{Field} times\n"; - print "Refresh: \t$Param->{Refresh} times\n"; - print "Query: \t$Param->{QueryCount} times\n"; - print "Statistics:\t$Param->{Statistics} times\n"; - print "\n"; - - print "Logfile: \t$Param->{LineCount} lines\n"; - print "Started: \t".localtime($Param->{Start})."\n"; - print "Finished: \t".localtime(time)."\n"; - - } -} - - -########################################################################### -# -# -# -sub RunQuery { - my $Param = shift ; - - if (defined $Param->{Query}) { - if (defined $Param->{DB} ) { - - $Param->{Query} =~ m/from\s+(\w+[.]\w+|\w+)/i; - $Param->{tab} =$1; - #print "||$Param->{tab} -- $Param->{Query}\n"; - - my $sth=$Param->{dbh}->prepare("USE $Param->{DB}"); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->finish(); - - $sth=$Param->{dbh}->prepare($Param->{Query}); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - #print "$Param->{Query}\n"; - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "[$Param->{LineCount}]<<$Param->{Query}>>\n";} - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - my $row = undef; - while ($row = $sth->fetchrow_hashref()) { - $Param->{SelectCount} ++; - - if (defined $row->{Comment}) { - push (@{$Param->{Comment}}, "$row->{Comment}; $_; $Param->{DB}; $Param->{Query}"); - } - foreach (@{$Param->{Rows}}) { - if (defined $row->{$_}) { - #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { - if ($row->{type} eq 'ALL') { - push (@{$Param->{ALL}}, "$Param->{Query}"); - #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; - } - $Param->{IdxUseCount} ++; - $Param->{Data}->{$Param->{tab}}->{$_}->{$row->{$_}} ++; - } - } - } - } - } - } - } - $sth->finish(); - } - $Param->{Query} = undef ; - } -} - -########################################################################### -# -# -# -sub ShowOptions { - print <, http://www.mobile.de - Dennis Haney (Added socket support) - -=head1 RECRUITING - -If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de -and send me an email with your resume (you must be speaking German!). - -=head1 SEE ALSO - -mysql documentation - -=cut -- cgit v1.2.1 From b4752351f2b5e549f2443a1485311896c5fbd28d Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Mon, 29 May 2006 10:39:45 +0200 Subject: Fix for bug #17394 - Events namespace is wrong --- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 5b3cab16db2..f3c0c7f13be 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -570,7 +570,7 @@ DROP PROCEDURE create_log_tables; CREATE TABLE event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - name char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, @@ -636,7 +636,7 @@ SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE event DROP PRIMARY KEY; -ALTER TABLE event ADD PRIMARY KEY(definer, db, name); +ALTER TABLE event ADD PRIMARY KEY(db, name); ALTER TABLE event ADD sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', -- cgit v1.2.1 From 4f2e784ac29f66558cd13a2f3b709eeb9e709214 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 29 May 2006 20:09:22 +0200 Subject: make_win_src_distribution.sh: Convert to DOS EOL if dsp/dsw is in package --- scripts/make_win_src_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 2e312e0c3cf..b9b39f1b02f 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -343,6 +343,7 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp find $BASE \( -name "*.cnf" -o -name "*.ini" \ -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.dsp" -o -name "*.dsw" \ -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do -- cgit v1.2.1 From 04441d04b1e5a562057627337001511eb5ef0a66 Mon Sep 17 00:00:00 2001 From: "jani@ua141d10.elisa.omakaista.fi" <> Date: Wed, 31 May 2006 14:55:28 +0300 Subject: Merge from 5.0 to 5.1. Third part with fixes. --- scripts/mysql_create_system_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a401e1d0159..69ea8e3d004 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -827,7 +827,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," - c_ev="$c_ev PRIMARY KEY (definer, db, name)" + c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi -- cgit v1.2.1 From eadd3510314e55f878b0b74b503acc87471e46b8 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 17 Jun 2006 03:04:43 +0200 Subject: make_win_src_distribution.sh: Include "sql_yacc.yy" for completeness (bug#20387) --- scripts/make_win_src_distribution.sh | 49 ++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b9b39f1b02f..028986b1fe3 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -1,11 +1,14 @@ #!/bin/sh +# Terminate loudly on error, we don't want partial package +set -e +trap "echo '*** script failed ***'" 0 + # # Script to create a Windows src package # version=@VERSION@ -export version CP="cp -p" DEBUG=0 @@ -199,7 +202,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.yy \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ *.vcproj *.sln *.dat *.000001 *.require *.opt @@ -260,7 +263,7 @@ done # # Create project files for ndb # -make -C $SOURCE/ndb windoze +make -C $SOURCE/ndb windoze || true # # Input directories to be copied recursively @@ -334,8 +337,17 @@ done # Fix some windows files to avoid compiler warnings # -./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new -mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp +if [ -x extra/replace ] ; then + ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | \ + sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' \ + > $BASE/sql/sql_yacc.cpp-new + mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp +else + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "extra/replace" not built, can not filter "sql_yacc.ccp"' + echo 'WARNING: to reduce the number of warnings when building' + fi +fi # # Search the tree for plain text files and adapt the line end marker @@ -349,8 +361,6 @@ find $BASE \( -name "*.cnf" -o -name "*.ini" \ do unix_to_dos $v done -# File extension '.txt' matches too many other files, error messages etc. -unix_to_dos $BASE/Docs/*.txt mv $BASE/README $BASE/README.txt @@ -358,19 +368,23 @@ mv $BASE/README $BASE/README.txt # Clean up if we did this from a bk tree # -if [ -d $BASE/SSL/SCCS ] -then - find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f -fi -find $BASE/ -type d -name .deps -printf " \"%p\"" | xargs rm -r -f -find $BASE/ -type d -name .libs -printf " \"%p\"" | xargs rm -r -f +find $BASE -type d \( -name SCCS -o -name .deps -o -name .libs \) -print0 | \ +xargs -0 rm -r -f rm -r -f "$BASE/mysql-test/var" # # Initialize the initial data directory # -if [ -f scripts/mysql_install_db ]; then +if [ ! -f scripts/mysql_install_db ] ; then + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "scripts/mysql_install_db" is not built, can not initiate databases' + fi +elif [ ! -f extra/my_print_defaults ]; then + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "extra/my_print_defaults" is not built, can not initiate databases' + fi +else print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data if test "$?" = 1 @@ -451,7 +465,7 @@ set_tarzip_options() OPT=cvf EXT=".tar" NEED_COMPRESS=1 - if [ "$SILENT" = "1" ] ; then + if [ "$DEBUG" = "0" ] ; then OPT=cf fi else @@ -460,7 +474,7 @@ set_tarzip_options() OPT="-r" EXT=".zip" NEED_COMPRESS=0 - if [ "$SILENT" = "1" ] ; then + if [ "$DEBUG" = "0" ] ; then OPT="$OPT -q" fi fi @@ -523,4 +537,7 @@ fi print_debug "Removing temporary directory" rm -r -f $BASE +# No need to report anything if we got here +trap "" 0 + # End of script -- cgit v1.2.1 From 1b7d4cacfbaa9f69bc2ce92261c86287168e3638 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 17 Jun 2006 10:44:52 +0200 Subject: make_win_src_distribution.sh: Don't try copy non existing extra/{sql_state,mysqld_error}.h --- scripts/make_win_src_distribution.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 9c3aa6c9b4c..6ad8d4f1f9b 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -301,8 +301,6 @@ do fi done -cp extra/sql_state.h extra/mysqld_error.h $BASE/include - # # support files # -- cgit v1.2.1 From 6783fc830fabab40912463f758480f34c03a13a6 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sat, 17 Jun 2006 11:33:34 +0200 Subject: make_win_src_distribution.sh: Make output less verbose Make temporary directory name unique Remove temporary directory on interrupt --- scripts/make_win_src_distribution.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 028986b1fe3..4e5cc2ada46 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -77,7 +77,7 @@ show_usage() 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 " --silent Show no progress information" echo " --tar Create tar.gz package" echo " --zip Create zip package" echo " --help Show this help message" @@ -143,10 +143,11 @@ unix_to_dos() # Create a tmp dest directory to copy files # -BASE=$TMP/my_win_dist$SUFFIX +BASE=$TMP/my_win_dist$SUFFIX.$$ +trap "rm -r -f $BASE; echo '*** interrupted ***'; exit 1" 1 2 3 13 15 if [ -d $BASE ] ; then - print_debug "Destination directory '$BASE' already exists, deleting it" + echo "WARNING: Destination directory '$BASE' already exists, deleting it" rm -r -f $BASE fi @@ -462,21 +463,15 @@ set_tarzip_options() if [ "$arg" = "tar" ]; then ZIPFILE1=gnutar ZIPFILE2=gtar - OPT=cvf + OPT=cf EXT=".tar" NEED_COMPRESS=1 - if [ "$DEBUG" = "0" ] ; then - OPT=cf - fi else ZIPFILE1=zip ZIPFILE2="" - OPT="-r" + OPT="-r -q" EXT=".zip" NEED_COMPRESS=0 - if [ "$DEBUG" = "0" ] ; then - OPT="$OPT -q" - fi fi done } -- cgit v1.2.1 From 34d82f0bc63de81029a19d538c3e533d7e3b9418 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Tue, 20 Jun 2006 12:24:12 +0200 Subject: make_win_src_distribution.sh: Removed reference to missing "tools" directory mysql.spec.sh: Changed flag --with-yassl => --with-ssl Reverted accidental removal of the "make" call :-) Configure --with-embedded-server Corrected path to "libtool" command Corrected path to "libmysqld.a" Removed references to "safe_mysqld" --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index f7c1f19ebc9..27c8b6b7e91 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -256,7 +256,7 @@ copy_dir_dirs() { for i in client dbug extra storage/heap include storage/archive storage/csv \ include/mysql libmysql libmysqld storage/myisam storage/example \ storage/myisammrg mysys regex sql strings sql-common \ - tools vio zlib + vio zlib do copy_dir_files $i done -- cgit v1.2.1 From 7d83b7e48a83ad37b18dad3ac1f2cc6e0318fd94 Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Thu, 22 Jun 2006 14:28:05 +0200 Subject: Improved fix for bug#18516 (also 19353): 1) Rename the old shell tool "mysql_upgrade", to avoid a name collision. 2) Improve the spec file, to explicitly use a temporary socket. --- scripts/Makefile.am | 6 +- scripts/mysql_upgrade.sh | 203 ----------------------------------------- scripts/mysql_upgrade_shell.sh | 203 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 206 insertions(+), 206 deletions(-) delete mode 100644 scripts/mysql_upgrade.sh create mode 100644 scripts/mysql_upgrade_shell.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 0f68b484f41..a339ebc5b8f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,7 +32,7 @@ bin_SCRIPTS = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ - mysql_upgrade \ + mysql_upgrade_shell \ mysqld_multi \ mysql_create_system_tables @@ -60,7 +60,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_explain_log.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ - mysql_upgrade.sh \ + mysql_upgrade_shell.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh @@ -89,7 +89,7 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysql_explain_log \ mysql_tableinfo \ - mysql_upgrade \ + mysql_upgrade_shell \ mysqld_multi \ make_win_src_distribution \ mysql_create_system_tables diff --git a/scripts/mysql_upgrade.sh b/scripts/mysql_upgrade.sh deleted file mode 100644 index c9f375b6c5b..00000000000 --- a/scripts/mysql_upgrade.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/sh -# Copyright (C) 2002-2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. - -# Runs mysqlcheck --check-upgrade in case it has not been done on this -# major MySQL version - -# This script should always be run when upgrading from one major version -# to another (ie: 4.1 -> 5.0 -> 5.1) - -# -# Note that in most cases one have to use '--password' as -# arguments as these needs to be passed on to the mysqlcheck command - - -user=root - -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac - -parse_arguments() { - # We only need to pass arguments through to the server if we don't - # handle them here. So, we collect unrecognized options (passed on - # the command line) into the args variable. - pick_args= - if test "$1" = PICK-ARGS-FROM-ARGV - then - pick_args=1 - shift - fi - - for arg do - case "$arg" in - --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --ldata=*|--data=*|--datadir=*) DATADIR=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --force) force=1 ;; - --verbose) verbose=1 ;; - --help) help_option=1 ;; - *) - if test -n "$pick_args" - then - # This sed command makes sure that any special chars are quoted, - # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.=-]\),\\\\\1,g'` - fi - ;; - esac - done -} - -# -# Find where my_print_defaults is -# - -find_my_print_defaults () { - if test -x ./bin/my_print_defaults - then - print_defaults="./bin/my_print_defaults" - elif test -x ./extra/my_print_defaults - then - print_defaults="./extra/my_print_defaults" - elif test -x @bindir@/my_print_defaults - then - print_defaults="@bindir@/my_print_defaults" - elif test -x @bindir@/mysql_print_defaults - then - print_defaults="@bindir@/mysql_print_defaults" - else - print_defaults="my_print_defaults" - fi -} - -find_my_print_defaults - -# Get first arguments from the my.cfg file, groups [mysqld] and -# [mysql_upgrade], and then merge with the command line arguments - -args= -DATADIR= -bindir= -MY_BASEDIR_VERSION= -verbose=0 -force=0 -help_option=0 - -parse_arguments `$print_defaults $defaults mysqld mysql_upgrade` -parse_arguments PICK-ARGS-FROM-ARGV "$@" - -if test $help_option = 1 -then - echo "MySQL utility script to upgrade database to the current server version" - echo "" - echo "It takes the following arguments:" - echo " --help Show this help message" - echo " --basedir Specifies the directory where MySQL is installed" - echo " --datadir Specifies the data directory" - echo " --force Mysql_upgrade.info file will be ignored" - echo " --user Username for server login if not current user" - echo " --verbose Display more output about the process" - echo "" - - exit 0 -fi - -# -# Try to find where binaries are installed -# - -MY_PWD=`pwd` -# Check for the directories we would expect from a binary release install -if test -z "$MY_BASEDIR_VERSION" -then - if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld - then - MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are - bindir="$MY_BASEDIR_VERSION/bin" - # Check for the directories we would expect from a source install - elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld - then - MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are - bindir="$MY_BASEDIR_VERSION/bin" -# Since we didn't find anything, used the compiled-in defaults - else - MY_BASEDIR_VERSION=@prefix@ - bindir=@bindir@ - fi -else - bindir="$MY_BASEDIR_VERSION/bin" -fi - -# -# Try to find the data directory -# - -if test -z "$DATADIR" -then - # Try where the binary installs put it - if test -d $MY_BASEDIR_VERSION/data/mysql - then - DATADIR=$MY_BASEDIR_VERSION/data - # Next try where the source installs put it - elif test -d $MY_BASEDIR_VERSION/var/mysql - then - DATADIR=$MY_BASEDIR_VERSION/var - # Or just give up and use our compiled-in default - else - DATADIR=@localstatedir@ - fi -fi - -if test ! -x "$bindir/mysqlcheck" -then - echo "Can't find program '$bindir/mysqlcheck'" - echo "Please restart with --basedir=mysql-install-directory" - exit 1 -fi - -if test ! -f "$DATADIR/mysql/user.frm" -then - echo "Can't find data directory. Please restart with --datadir=path-to-data-dir" - exit 1 -fi - -CHECK_FILE=$DATADIR/mysql_upgrade.info - -if test -f $CHECK_FILE -a $force = 0 -then - version=`cat $CHECK_FILE` - if test "$version" = "@MYSQL_BASE_VERSION@" - then - if test $verbose = 1 - then - echo "mysql_upgrade already done for this version" - fi - $bindir/mysql_fix_privilege_tables --silent $args - exit 0 - fi -fi - -# -# Run the upgrade -# - -check_args="--check-upgrade --all-databases --auto-repair --user=$user" - -if test $verbose = 1 -then - echo "Running $bindir/mysqlcheck $args $check_args" -fi - -$bindir/mysqlcheck $check_args $args -if [ $? = 0 ] -then - # Remember base version so that we don't run this script again on the - # same base version - echo "@MYSQL_BASE_VERSION@" > $CHECK_FILE -fi - -$bindir/mysql_fix_privilege_tables --silent --user=$user $args diff --git a/scripts/mysql_upgrade_shell.sh b/scripts/mysql_upgrade_shell.sh new file mode 100644 index 00000000000..c9f375b6c5b --- /dev/null +++ b/scripts/mysql_upgrade_shell.sh @@ -0,0 +1,203 @@ +#!/bin/sh +# Copyright (C) 2002-2003 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file. + +# Runs mysqlcheck --check-upgrade in case it has not been done on this +# major MySQL version + +# This script should always be run when upgrading from one major version +# to another (ie: 4.1 -> 5.0 -> 5.1) + +# +# Note that in most cases one have to use '--password' as +# arguments as these needs to be passed on to the mysqlcheck command + + +user=root + +case "$1" in + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; +esac + +parse_arguments() { + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg do + case "$arg" in + --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --ldata=*|--data=*|--datadir=*) DATADIR=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --force) force=1 ;; + --verbose) verbose=1 ;; + --help) help_option=1 ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.=-]\),\\\\\1,g'` + fi + ;; + esac + done +} + +# +# Find where my_print_defaults is +# + +find_my_print_defaults () { + if test -x ./bin/my_print_defaults + then + print_defaults="./bin/my_print_defaults" + elif test -x ./extra/my_print_defaults + then + print_defaults="./extra/my_print_defaults" + elif test -x @bindir@/my_print_defaults + then + print_defaults="@bindir@/my_print_defaults" + elif test -x @bindir@/mysql_print_defaults + then + print_defaults="@bindir@/mysql_print_defaults" + else + print_defaults="my_print_defaults" + fi +} + +find_my_print_defaults + +# Get first arguments from the my.cfg file, groups [mysqld] and +# [mysql_upgrade], and then merge with the command line arguments + +args= +DATADIR= +bindir= +MY_BASEDIR_VERSION= +verbose=0 +force=0 +help_option=0 + +parse_arguments `$print_defaults $defaults mysqld mysql_upgrade` +parse_arguments PICK-ARGS-FROM-ARGV "$@" + +if test $help_option = 1 +then + echo "MySQL utility script to upgrade database to the current server version" + echo "" + echo "It takes the following arguments:" + echo " --help Show this help message" + echo " --basedir Specifies the directory where MySQL is installed" + echo " --datadir Specifies the data directory" + echo " --force Mysql_upgrade.info file will be ignored" + echo " --user Username for server login if not current user" + echo " --verbose Display more output about the process" + echo "" + + exit 0 +fi + +# +# Try to find where binaries are installed +# + +MY_PWD=`pwd` +# Check for the directories we would expect from a binary release install +if test -z "$MY_BASEDIR_VERSION" +then + if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld + then + MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are + bindir="$MY_BASEDIR_VERSION/bin" + # Check for the directories we would expect from a source install + elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld + then + MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are + bindir="$MY_BASEDIR_VERSION/bin" +# Since we didn't find anything, used the compiled-in defaults + else + MY_BASEDIR_VERSION=@prefix@ + bindir=@bindir@ + fi +else + bindir="$MY_BASEDIR_VERSION/bin" +fi + +# +# Try to find the data directory +# + +if test -z "$DATADIR" +then + # Try where the binary installs put it + if test -d $MY_BASEDIR_VERSION/data/mysql + then + DATADIR=$MY_BASEDIR_VERSION/data + # Next try where the source installs put it + elif test -d $MY_BASEDIR_VERSION/var/mysql + then + DATADIR=$MY_BASEDIR_VERSION/var + # Or just give up and use our compiled-in default + else + DATADIR=@localstatedir@ + fi +fi + +if test ! -x "$bindir/mysqlcheck" +then + echo "Can't find program '$bindir/mysqlcheck'" + echo "Please restart with --basedir=mysql-install-directory" + exit 1 +fi + +if test ! -f "$DATADIR/mysql/user.frm" +then + echo "Can't find data directory. Please restart with --datadir=path-to-data-dir" + exit 1 +fi + +CHECK_FILE=$DATADIR/mysql_upgrade.info + +if test -f $CHECK_FILE -a $force = 0 +then + version=`cat $CHECK_FILE` + if test "$version" = "@MYSQL_BASE_VERSION@" + then + if test $verbose = 1 + then + echo "mysql_upgrade already done for this version" + fi + $bindir/mysql_fix_privilege_tables --silent $args + exit 0 + fi +fi + +# +# Run the upgrade +# + +check_args="--check-upgrade --all-databases --auto-repair --user=$user" + +if test $verbose = 1 +then + echo "Running $bindir/mysqlcheck $args $check_args" +fi + +$bindir/mysqlcheck $check_args $args +if [ $? = 0 ] +then + # Remember base version so that we don't run this script again on the + # same base version + echo "@MYSQL_BASE_VERSION@" > $CHECK_FILE +fi + +$bindir/mysql_fix_privilege_tables --silent --user=$user $args -- cgit v1.2.1 From 671a1be31bd701202c6ddb48cb4538562780741e Mon Sep 17 00:00:00 2001 From: "joerg@mysql.com" <> Date: Fri, 23 Jun 2006 12:17:11 +0200 Subject: The binary "mysql_upgrade" must be included in the distribution. (bug#18516 + 19353) --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 36c941ef6aa..74b1993882e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -134,7 +134,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS \ + client/mysqlbinlog$BS client/mysql_upgrade$BS \ tests/mysql_client_test$BS \ libmysqld/examples/mysql_client_test_embedded$BS \ libmysqld/examples/mysqltest_embedded$BS \ -- cgit v1.2.1 From b5bdc178afe3499c5608799ae14570798e0bc918 Mon Sep 17 00:00:00 2001 From: "igor@rurik.mysql.com" <> Date: Fri, 23 Jun 2006 18:21:34 -0700 Subject: Fixed some dsp files. Fixed make_win_src_distribution.sh to return back dsp files for yassl. --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index c677db6a537..d9333540ab8 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -203,7 +203,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.yy \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.yy *dsp *.dsw \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ *.vcproj *.sln *.dat *.000001 *.require *.opt -- cgit v1.2.1 From b6e89c2b1e25a661445d165650d348b06db639ff Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Sun, 25 Jun 2006 10:25:00 +0200 Subject: .del-make_win_src_distribution.sh~f80d8fca44e4e5f1: Delete: scripts/make_win_src_distribution.sh Makefile.am: Unix and Windows now shares source package --- scripts/Makefile.am | 5 +- scripts/make_win_src_distribution.sh | 538 ----------------------------------- 2 files changed, 1 insertion(+), 542 deletions(-) delete mode 100644 scripts/make_win_src_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index af3cbc19cb5..7cd89eee952 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -34,12 +34,10 @@ bin_SCRIPTS = @server_scripts@ \ mysql_create_system_tables noinst_SCRIPTS = make_binary_distribution \ - make_sharedlib_distribution \ - make_win_src_distribution + make_sharedlib_distribution EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ - make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ @@ -83,7 +81,6 @@ CLEANFILES = @server_scripts@ \ mysqldumpslow \ mysql_tableinfo \ mysqld_multi \ - make_win_src_distribution \ mysql_create_system_tables DISTCLEANFILES = mysqlbug diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh deleted file mode 100644 index 27c8b6b7e91..00000000000 --- a/scripts/make_win_src_distribution.sh +++ /dev/null @@ -1,538 +0,0 @@ -#!/bin/sh - -# Terminate loudly on error, we don't want partial package -set -e -trap "echo '*** script failed ***'" 0 - -# -# Script to create a Windows src package -# - -version=@VERSION@ -CP="cp -p" - -DEBUG=0 -SILENT=0 -SUFFIX="" -DIRNAME="" -OUTTAR="0" -OUTZIP="0" - -# -# An "abort" function taking a variable number of strings (one per line) -# - -abort() -{ - for line - do - echo "$line" - done - exit 1 -} - - -# -# This script must run from MySQL top directory -# - -if [ ! -f scripts/make_win_src_distribution ]; then - abort "ERROR : You must run this script from the MySQL top-level directory" -fi -SOURCE=`pwd` - -# -# Check for source compilation/configuration -# - -if [ ! -f sql/sql_yacc.cc ]; then - abort "ERROR : Sorry, you must run this script after the complete build," \ - " hope you know what you are trying to do !!" -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 Show no progress information" - echo " --tar Create tar.gz package" - echo " --zip Create zip package" - echo " --help Show this help message" - - exit 0 -} - -# -# Parse the input arguments -# - -parse_arguments() { - for arg do - case "$arg" in - --add-tar) ADDTAR=1 ;; - --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 ;; - --zip) OUTZIP=1 ;; - --help) show_usage ;; - *) abort "Unknown argument '$arg'" - ;; - 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 - - -# -# Convert argument file from unix to DOS text -# - -unix_to_dos() -{ - for arg do - print_debug "Replacing LF -> CRLF from '$arg'" - - awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done -} - - -# -# Create a tmp dest directory to copy files -# - -BASE=$TMP/my_win_dist$SUFFIX.$$ -trap "rm -r -f $BASE; echo '*** interrupted ***'; exit 1" 1 2 3 13 15 - -if [ -d $BASE ] ; then - echo "WARNING: Destination directory '$BASE' already exists, deleting it" - rm -r -f $BASE -fi - -$CP -r $SOURCE/VC++Files $BASE -# This includes an implicit 'mkdir $BASE' ! - -# -# Process version tags in InstallShield files -# - -vreplace() -{ - for arg do - unix_to_dos $arg - cat $arg | sed -e 's!@''VERSION''@!@VERSION@!' > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done -} - -if test -d $BASE/InstallShield -then - for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic - do - cd $BASE/InstallShield/$d/String\ Tables/0009-English - vreplace value.shl - cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent - vreplace infolist.txt - done -fi - -# -# 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" - -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 *.hpp *.yy \ - README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ - *.inc *.test *.result *.pem Moscow_leap des_key_file \ - *.vcproj *.sln *.dat *.000001 *.require *.opt - 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 - - cd $SOURCE - ( - find $arg -type d \ - -and -not -path \*SCCS\* \ - -and -not -path \*.deps\* \ - -and -not -path \*.libs\* \ - -and -not -path \*autom4te.cache -print - )|( - while read v - do - copy_dir_files $v - done - ) - - done -} - -# -# Input directories to be copied -# - -for i in client dbug extra storage/heap include storage/archive storage/csv \ - include/mysql libmysql libmysqld storage/myisam storage/example \ - storage/myisammrg mysys regex sql strings sql-common \ - vio zlib -do - copy_dir_files $i -done - -# -# Create project files for ndb -# -#make -C $SOURCE/storage/ndb windoze || true - -# -# Input directories to be copied recursively -# - -for i in storage/bdb storage/innobase storage/ndb extra/yassl server-tools plugin -do - copy_dir_dirs $i -done - -# -# Create dummy innobase configure header -# - -if [ -f $BASE/storage/innobase/ib_config.h ]; then - rm -f $BASE/storage/innobase/ib_config.h -fi -touch $BASE/storage/innobase/ib_config.h - - -# -# Copy miscellaneous files -# - -cd $SOURCE -for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ - INSTALL-SOURCE INSTALL-WIN \ - INSTALL-WIN-SOURCE \ - Docs/INSTALL-BINARY Docs/manual.chm -do - print_debug "Copying file '$i'" - if [ -f $i ] - then - $CP $i $BASE/$i - fi -done - -# -# support files -# -mkdir $BASE/support-files - -# Rename the cnf files to .ini -for i in support-files/*.cnf -do - i=`echo $i | sed 's/.cnf$//g'` - cp $i.cnf $BASE/$i.ini -done - -# -# Raw dirs from source tree -# - -for i in scripts mysql-test SSL tests -do - print_debug "Copying directory '$i'" - if [ -d $i ] - then - if [ -d $BASE/$i ] - then - $CP -R $i $BASE - else - $CP -R $i $BASE/$i - fi - fi - # But remove object files from destination - find $BASE/$i -type f -name \*.o | xargs rm -f -done - -# -# Fix some windows files to avoid compiler warnings -# - -if [ -x extra/replace ] ; then - ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | \ - sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' \ - > $BASE/sql/sql_yacc.cpp-new - mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp -else - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "extra/replace" not built, can not filter "sql_yacc.ccp"' - echo 'WARNING: to reduce the number of warnings when building' - fi -fi - -# -# Search the tree for plain text files and adapt the line end marker -# -find $BASE \( -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ - -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ - -o -name "*.dsp" -o -name "*.dsw" \ - -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ -| while read v - do - unix_to_dos $v - done - -mv $BASE/README $BASE/README.txt - -# -# Clean up if we did this from a bk tree -# - -find $BASE -type d \( -name SCCS -o -name .deps -o -name .libs \) -print0 | \ -xargs -0 rm -r -f -rm -r -f "$BASE/mysql-test/var" - -# -# Initialize the initial data directory -# - -if [ ! -f scripts/mysql_install_db ] ; then - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "scripts/mysql_install_db" is not built, can not initiate databases' - fi -elif [ ! -f extra/my_print_defaults ]; then - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "extra/my_print_defaults" is not built, can not initiate databases' - fi -else - print_debug "Initializing the 'data' directory" - scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data - if test "$?" = 1 - then - exit 1; - fi -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 -# - -if [ "$OUTTAR" = "0" ]; then - if [ "$OUTZIP" = "0" ]; then - OUTZIP=1 - fi -fi - -set_tarzip_options() -{ - for arg - do - if [ "$arg" = "tar" ]; then - ZIPFILE1=gnutar - ZIPFILE2=gtar - OPT=cf - EXT=".tar" - NEED_COMPRESS=1 - else - ZIPFILE1=zip - ZIPFILE2="" - OPT="-r -q" - EXT=".zip" - NEED_COMPRESS=0 - fi - done -} - - -# -# Create the archive -# -create_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 - - if [ "$SILENT" = "0" ] ; then - echo "$NEW_NAME$EXT created successfully !!" - fi -} - -if [ "$OUTTAR" = "1" ]; then - set_tarzip_options 'tar' - - 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_archive -fi - -if [ "$OUTZIP" = "1" ]; then - set_tarzip_options 'zip' - - tar=`which_1 $ZIPFILE1 $ZIPFILE2` - if test "$?" = "1" -o "$tar" = "" - then - echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" - fi - - create_archive -fi - -print_debug "Removing temporary directory" -rm -r -f $BASE - -# No need to report anything if we got here -trap "" 0 - -# End of script -- cgit v1.2.1 From c36dd286769f0a7aa9ee253afbd133f9a114c0b2 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Mon, 26 Jun 2006 23:44:17 +0200 Subject: make_sharedlib_distribution.sh: For compatibility, don't use {..,..} in pattern matching make_binary_distribution.sh: Added .dylib and .sl as shared library extensions --- scripts/make_binary_distribution.sh | 18 ++++++++++++++---- scripts/make_sharedlib_distribution.sh | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f372762c05d..396c4f83bac 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -154,11 +154,21 @@ if [ $BASE_SYSTEM = "netware" ] ; then fi for i in \ - libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \ - libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \ - libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ + libmysql/.libs/libmysqlclient.a \ + libmysql/.libs/libmysqlclient.so* \ + libmysql/.libs/libmysqlclient.sl* \ + libmysql/.libs/libmysqlclient*.dylib \ + libmysql/libmysqlclient.* \ + libmysql_r/.libs/libmysqlclient_r.a \ + libmysql_r/.libs/libmysqlclient_r.so* \ + libmysql_r/.libs/libmysqlclient_r.sl* \ + libmysql_r/.libs/libmysqlclient_r*.dylib \ + libmysql_r/libmysqlclient_r.* \ + libmysqld/.libs/libmysqld.a \ + libmysqld/.libs/libmysqld.so* \ + libmysqld/.libs/libmysqld.sl* \ + libmysqld/.libs/libmysqld*.dylib \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ - libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ libmysqld/libmysqld.a netware/libmysql.imp do if [ -f $i ] diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh index fbc945e445a..c475d0e14a4 100644 --- a/scripts/make_sharedlib_distribution.sh +++ b/scripts/make_sharedlib_distribution.sh @@ -45,9 +45,11 @@ fi mkdir -p $BASE/lib for i in \ - libmysql/.libs/libmysqlclient.s{l,o}* \ + libmysql/.libs/libmysqlclient.so* \ + libmysql/.libs/libmysqlclient.sl* \ libmysql/.libs/libmysqlclient*.dylib \ - libmysql_r/.libs/libmysqlclient_r.s{l,o}* \ + libmysql_r/.libs/libmysqlclient_r.so* \ + libmysql_r/.libs/libmysqlclient_r.sl* \ libmysql_r/.libs/libmysqlclient_r*.dylib do if [ -f $i ] -- cgit v1.2.1 From 578fee6990e57877147c5a35ea70714630cbe5cf Mon Sep 17 00:00:00 2001 From: "iggy@mysql.com" <> Date: Tue, 27 Jun 2006 18:07:23 -0400 Subject: Bug#19298 mysqld_safe still uses obsolete --skip-locking parameter --- scripts/mysqld_safe-watch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh index c59b3b2614d..c837ba9a118 100644 --- a/scripts/mysqld_safe-watch.sh +++ b/scripts/mysqld_safe-watch.sh @@ -93,10 +93,10 @@ do if test "$#" -eq 0 then nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking >> $err 2>&1 & + --skip-external-locking >> $err 2>&1 & else nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR \ - --skip-locking "$@" >> $err 2>&1 & + --skip-external-locking "$@" >> $err 2>&1 & fi pid=$! rm -f $lockfile -- cgit v1.2.1 From 5b1c92244cffeace654adf05957830cb92956c97 Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Fri, 30 Jun 2006 15:15:20 +0200 Subject: Add a script scripts/make_win_bin_dist, used to generate a Windows binary disctribution for Falcon. --- scripts/Makefile.am | 3 +- scripts/make_win_bin_dist | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100755 scripts/make_win_bin_dist (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index af3cbc19cb5..c51c63a1bfe 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -60,7 +60,8 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug + mysqlbug \ + make_win_bin_dist dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist new file mode 100755 index 00000000000..cebcccb56f4 --- /dev/null +++ b/scripts/make_win_bin_dist @@ -0,0 +1,116 @@ +#! /bin/sh + +NOINST_NAME=$1 + +mkdir $NOINST_NAME +mkdir $NOINST_NAME/bin +cp client/release/*.exe $NOINST_NAME/bin/ +cp extra/release/*.exe $NOINST_NAME/bin/ +mv $NOINST_NAME/bin/comp_err.exe $NOINST_NAME/bin/comp-err.exe +cp storage/myisam/release/*.exe $NOINST_NAME/bin/ +cp server-tools/instance-manager/release/*.exe $NOINST_NAME/bin/ +cp tests/release/*.exe $NOINST_NAME/bin/ +cp libmysql/release/*.exe $NOINST_NAME/bin/ +cp libmysql/release/libmysql.dll $NOINST_NAME/bin/ + +cp sql/release/mysqld.exe $NOINST_NAME/bin/mysqld.exe +cp sql/debug/mysqld.exe $NOINST_NAME/bin/mysqld-debug.exe +# For Pro/Classic builds, do this instead: +# cp sql/release/mysqld.exe $NOINST_NAME/bin/mysqld-nt.exe +# cp sql/debug/mysqld.exe $NOINST_NAME/bin/mysqld-debug.exe + +cp COPYING EXCEPTIONS-CLIENT $NOINST_NAME/ +cp -dpR win/data $NOINST_NAME/data +mkdir $NOINST_NAME/Docs +cp Docs/INSTALL-BINARY Docs/manual.chm ChangeLog COPYING $NOINST_NAME/Docs/ + +# These will be filled in when we enable embedded. +mkdir -p $NOINST_NAME/Embedded/DLL/debug $NOINST_NAME/Embedded/DLL/release $NOINST_NAME/Embedded/static/release + +mkdir -p $NOINST_NAME/examples/libmysqltest/debug $NOINST_NAME/examples/libmysqltest/release +cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/release/myTest.exe $NOINST_NAME/examples/libmysqltest/ +cp libmysql/debug/myTest.exe $NOINST_NAME/examples/libmysqltest/debug/ +cp libmysql/release/myTest.exe $NOINST_NAME/examples/libmysqltest/release/ + +mkdir -p $NOINST_NAME/examples/tests +cp tests/*.res tests/*.tst tests/*.pl tests/*.c $NOINST_NAME/examples/tests/ + +mkdir -p $NOINST_NAME/include +cp include/conf*.h \ + include/mysql*.h \ + include/errmsg.h \ + include/my_alloc.h \ + include/my_getopt.h \ + include/my_sys.h \ + include/my_list.h \ + include/my_pthread.h \ + include/my_dbug.h \ + include/m_string.h \ + include/m_ctype.h \ + include/my_global.h \ + include/typelib.h $NOINST_NAME/include/ +cp libmysql/libmysql.def $NOINST_NAME/include/ +cp libmysqld/libmysqld.def $NOINST_NAME/include/ + +mkdir -p $NOINST_NAME/lib/debug $NOINST_NAME/lib/opt +cp libmysql/debug/libmysql.dll \ + libmysql/debug/libmysql.lib \ + client/debug/mysqlclient.lib \ + mysys/debug/mysys.lib \ + regex/debug/regex.lib \ + strings/debug/strings.lib \ + zlib/debug/zlib.lib $NOINST_NAME/lib/debug/ +cp libmysql/release/libmysql.dll \ + libmysql/release/libmysql.lib \ + client/release/mysqlclient.lib \ + regex/release/regex.lib \ + strings/release/strings.lib \ + zlib/release/zlib.lib $NOINST_NAME/lib/opt/ +cp mysys/release/mysys.lib $NOINST_NAME/lib/opt/mysys_tls.lib + +cp support-files/my-*.ini $NOINST_NAME/ + +mkdir -p $NOINST_NAME/mysql-test/include $NOINST_NAME/mysql-test/lib \ + $NOINST_NAME/mysql-test/r $NOINST_NAME/mysql-test/std_data \ + $NOINST_NAME/mysql-test/t $NOINST_NAME/mysql-test/extra +cp mysql-test/mysql-test-run.pl $NOINST_NAME/mysql-test/ +cp mysql-test/README $NOINST_NAME/mysql-test/ +cp mysql-test/install_test_db.sh $NOINST_NAME/mysql-test/install_test_db +cp mysql-test/include/*.inc $NOINST_NAME/mysql-test/include/ +cp mysql-test/lib/*.pl $NOINST_NAME/mysql-test/lib/ +cp mysql-test/lib/*.sql $NOINST_NAME/mysql-test/lib/ +cp mysql-test/r/*.require $NOINST_NAME/mysql-test/r/ +# Need this trick, or we get "argument list too long". +ABS_DST=`pwd`/$NOINST_NAME +(cd mysql-test/r/ && cp *.result $ABS_DST/mysql-test/r/) +cp mysql-test/std_data/* $NOINST_NAME/mysql-test/std_data/ +cp mysql-test/t/*.disabled $NOINST_NAME/mysql-test/t/ +cp mysql-test/t/*.opt $NOINST_NAME/mysql-test/t/ +cp mysql-test/t/*.sh $NOINST_NAME/mysql-test/t/ +cp mysql-test/t/*.slave-mi $NOINST_NAME/mysql-test/t/ +cp mysql-test/t/*.sql $NOINST_NAME/mysql-test/t/ +cp mysql-test/t/*.def $NOINST_NAME/mysql-test/t/ +(cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/) +cp -dpR mysql-test/extra/* $NOINST_NAME/mysql-test/extra/ + +# This copies in the unsubstituted scripts (containing @VAR@), but that seems +# rather better than substituting random Unix paths and architecture names +# from the Unix bootstrap host. Not sure what the point is of including these +# shell scripts in the Windows packaging in any case. +mkdir -p $NOINST_NAME/scripts +for i in `cd scripts && ls`; do \ + if echo $i | grep -q '\.sh'; then \ + cp scripts/$i $NOINST_NAME/scripts/`echo $i | sed -e 's/\.sh$//'`; \ + else if [ $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ + : ; \ + else \ + cp scripts/$i $NOINST_NAME/scripts/$i; \ + fi; fi; \ +done + +cp -dpR sql/share $NOINST_NAME/ +cp -dpR sql-bench $NOINST_NAME/ +rm -f $NOINST_NAME/sql-bench/*.sh $NOINST_NAME/sql-bench/Makefile* + +zip -r $NOINST_NAME.zip $NOINST_NAME +rm -Rf $NOINST_NAME -- cgit v1.2.1 From d3eab1ca3574816e675eaa96bff6fdc2d2bb95c0 Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Thu, 13 Jul 2006 10:48:34 -0400 Subject: Bug #19779: mysql_explain_log documentation is outdated. --- scripts/mysql_explain_log.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index 973d9e8a363..fd468fdf091 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -1,5 +1,6 @@ -#!@PERL@ -w +#!@PERL@ use strict; +use warnings; use DBI; use Getopt::Long; @@ -58,7 +59,7 @@ else { } else { $Param->{Start} = time; - while() { + while(<>) { $Param->{LineCount} ++ ; if ($Param->{ViewDate} ) { @@ -317,6 +318,8 @@ Usage: $0 [OPTIONS] < LOGFILE -p=PASSWORD --socket=SOCKET mysqld socket file to connect -s=SOCKET +--printerror=1 enable error output +-e 1 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. @@ -331,7 +334,7 @@ __END__ =head1 NAME -explain_log.pl +mysql_explain_log Feed a mysqld general logfile (created with mysqld --log) back into mysql and collect statistics about index usage with EXPLAIN. @@ -348,7 +351,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] [--socket=/path/to/socket] < logfile +mysql_explain_log [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] < logfile --date=YYMMDD select only entrys of date @@ -370,21 +373,20 @@ explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] -s=SOCKET +--printerror=1 enable error output + +-e 1 + =head1 EXAMPLE -explain_log.pl --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log +mysql_explain_log --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log =head1 AUTHORS Stefan Nitz - Jan Willamowius , http://www.mobile.de + Jan Willamowius , http://www.willamowius.de Dennis Haney (Added socket support) -=head1 RECRUITING - -If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de -and send me an email with your resume (you must be speaking German!). - =head1 SEE ALSO mysql documentation -- cgit v1.2.1 From bd791a15ae7433d353bac675a04090a8b102dd0f Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Fri, 14 Jul 2006 15:22:16 -0400 Subject: Bug #20721: mysql_install_db first line is blank. Minor script changes for uniformity. --- scripts/fill_func_tables.sh | 11 ++++++++--- scripts/mysql_install_db.sh | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh index 459afee2fe1..b7bd3736392 100644 --- a/scripts/fill_func_tables.sh +++ b/scripts/fill_func_tables.sh @@ -1,7 +1,12 @@ -#!/usr/bin/perl +#!@PERL@ +# +# Copyright (C) 2003 MySQL AB +# For a more info consult the file COPYRIGHT distributed with this file. +# # fill_func_tables - parse ../Docs/manual.texi - -# Original version by vva +# +# Original version by Victor Vagin +# my $cat_name= ""; my $func_name= ""; diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5c2bca9a393..56a432db741 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,4 +1,3 @@ - #!/bin/sh # Copyright (C) 2002-2003 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. -- cgit v1.2.1 From d89f177377aa228cac2e4d255e816b9794a5add5 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Mon, 24 Jul 2006 14:31:37 +0200 Subject: Bug#21125 mysqldump: Problem with non-standard table names - The mysql-test/std_data/bug15328.cnf file was not copied to install or dist dir. --- scripts/make_win_src_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 4e5cc2ada46..742f6b9e994 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -206,7 +206,7 @@ copy_dir_files() for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.yy \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ - *.vcproj *.sln *.dat *.000001 *.require *.opt + *.vcproj *.sln *.dat *.000001 *.require *.opt *.cnf do if [ -f $i ] then -- cgit v1.2.1 From b14632494654fb0068e15722955832ffb540211c Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Wed, 26 Jul 2006 12:36:10 -0400 Subject: Bug #18777: Mysqlhotcopy does not copy all the direcories. --- scripts/mysqlhotcopy.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index f9e29e33195..b3ea9dc4035 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -262,6 +262,7 @@ my $hc_locks = ""; my $hc_tables = ""; my $num_tables = 0; my $num_files = 0; +my $raid_dir_regex = '[A-Za-z0-9]{2}'; foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; @@ -296,7 +297,7 @@ foreach my $rdb ( @db_desc ) { my @raid_dir = (); while ( defined( my $name = readdir DBDIR ) ) { - if ( $name =~ /^\d\d$/ && -d "$db_dir/$name" ) { + if ( $name =~ /^$raid_dir_regex$/ && -d "$db_dir/$name" ) { push @raid_dir, $name; } else { @@ -604,7 +605,7 @@ sub copy_files { # add recursive option for scp $cp.= " -r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/; - my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; + my @non_raid = map { "'$_'" } grep { ! m:/$raid_dir_regex/[^/]+$: } @$files; # add files to copy and the destination directory safe_system( $cp, @non_raid, "'$target'" ) if (@non_raid); @@ -797,7 +798,7 @@ sub get_raid_dirs { my %dirs = (); foreach my $f ( @$r_files ) { - if ( $f =~ m:^(\d\d)/: ) { + if ( $f =~ m:^($raid_dir_regex)/: ) { $dirs{$1} = 1; } } -- cgit v1.2.1 From c188a3bf0ae337b12696a0725af767ec16191f1e Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-4b4072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Fri, 28 Jul 2006 23:06:49 +0200 Subject: make_binary_distribution.sh: Man page for "mysqld" command move to section 8 (bug#21220) --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 396c4f83bac..ae24752d290 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -70,7 +70,7 @@ mkdir $BASE $BASE/bin $BASE/docs \ if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test + $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test chmod o-rwx $BASE/data $BASE/data/* fi @@ -198,6 +198,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 + $CP man/*.8 $BASE/man/man8 fi fi @@ -255,7 +256,6 @@ else fi # Make safe_mysqld a symlink to mysqld_safe for backwards portability -# To be removed in MySQL 4.1 (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) # Clean up if we did this from a bk tree -- cgit v1.2.1 From af443c2dd8bfcc937ae704ed4bb503ef02aaa578 Mon Sep 17 00:00:00 2001 From: "brian@zim.(none)" <> Date: Sun, 13 Aug 2006 22:28:41 -0700 Subject: Fixed warning message breakage. Fixed install breakage (my own fault) Edited exampled cnf to remove bdb references. --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 865ab3e6db4..10bf913b3a4 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" +--skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then -- cgit v1.2.1 From a560c3ee1fe7a905351932383f995c7891f99b44 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Mon, 14 Aug 2006 19:56:41 +0200 Subject: scripts/make_binary_distribution.sh : Drop the "max" server from 5.1 packages. --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index df07dd8ef9b..7bf0bcac82f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -131,7 +131,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysqld-debug$BS sql/mysqld-max$BS \ + sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ -- cgit v1.2.1 From 5686da41acda6bb6fbfc2b34a7645df6c24e7e77 Mon Sep 17 00:00:00 2001 From: "georg@lmy002.wdf.sap.corp" <> Date: Fri, 1 Sep 2006 14:34:37 +0200 Subject: Fixes for crashes and test failures --- scripts/make_win_bin_dist | 345 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100755 scripts/make_win_bin_dist (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist new file mode 100755 index 00000000000..cc75245e5d9 --- /dev/null +++ b/scripts/make_win_bin_dist @@ -0,0 +1,345 @@ +#!/bin/sh + +# Exit if failing to copy, we want exact specifications, not +# just "what happen to be built". +set -e + +# ---------------------------------------------------------------------- +# Read first argument that is the base name of the resulting TAR file. +# See usage() function below for a description on the arguments. +# +# NOTE: We will read the rest of the command line later on. +# NOTE: Pattern matching with "{..,..}" can't be used, not portable. +# ---------------------------------------------------------------------- + +# FIXME FIXME "debug", own build or handled here? +# FIXME FIXME add way to copy from other builds executables + +usage() +{ + echo < Date: Fri, 1 Sep 2006 16:55:35 +0200 Subject: included make_win_bin_dist (required for pushbuild) into distribution (make dist) --- scripts/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index a339ebc5b8f..dd4c133ff94 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -66,7 +66,8 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug + mysqlbug \ + make_win_bin_dist dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql -- cgit v1.2.1 From 871eeadc94c03abacf9c8d8b3b8f756752292b85 Mon Sep 17 00:00:00 2001 From: "hartmut@mysql.com/linux.site" <> Date: Fri, 15 Sep 2006 16:35:50 +0200 Subject: Add SSL specific linker flags to --libmysqld-libs (Bug #21239) --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 84ff518c381..fa25d7973eb 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -101,7 +101,7 @@ ldflags='@LDFLAGS@' libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" +embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@" cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -- cgit v1.2.1 From e826f7490e8d85b09da50d1a9f991f82e3e3d267 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-644072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Sun, 24 Sep 2006 00:41:20 +0200 Subject: mysql.spec.sh: Added "test" RPM package Install all binaries "make install" would make_binary_distribution.sh: Copy Cluster API headers into "/usr/include/mysql/storage/ndb/" (Bug#21955) --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7bf0bcac82f..c254a77e805 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -331,7 +331,8 @@ if [ x$NDBCLUSTER = x1 ]; then $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include + test -d $BASE/include/storage || mkdir $BASE/include/storage + $CP -r $BASE/ndb-stage@pkgincludedir@/storage/ndb $BASE/include/storage/ $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 rm -rf $BASE/ndb-stage fi -- cgit v1.2.1 From 878416e05497ce366a713ff44b4498da842e7688 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-644072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Mon, 25 Sep 2006 00:54:46 +0200 Subject: mysql_config.sh: Filter out plain -O and Sun C/C++ style optimization flags, -xO Filter out icc specific options from cflags/libs(_r) --- scripts/mysql_config.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 84ff518c381..1fcad16affb 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -97,11 +97,11 @@ port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' # Create options -# We intentionally add a space to the beginning of lib strings, simplifies replace later +# We intentionally add a space to the beginning and end of lib strings, simplifies replace later libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" -libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" +libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " +embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ " cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" @@ -111,8 +111,9 @@ include="-I$pkgincludedir" # and -xstrconst to make --cflags usable for Sun Forte C++ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ - DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' \ - Xa xstrconst "xc99=none" + DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ + Xa xstrconst "xc99=none" \ + unroll2 ip mp restrict do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option @@ -121,7 +122,7 @@ done cflags=`echo "$cflags"|sed -e 's/ *\$//'` # Same for --libs(_r) -for remove in lmtmalloc +for remove in lmtmalloc static-libcxa i-static do # We know the strings starts with a space libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` -- cgit v1.2.1 From 8692bb53a33bf29415d1d01681bafef4ddb00e5e Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-794072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Mon, 16 Oct 2006 02:07:50 +0200 Subject: make_binary_distribution.sh: Split copy of result files to avoid shell limit. Added copy of mysql-test/std_data/ndb_backup5{0,1}. configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. --- scripts/make_binary_distribution.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c254a77e805..81e7f22c1b8 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -93,6 +93,7 @@ mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ + $BASE/mysql-test/std_data/ndb_backup50 $BASE/mysql-test/std_data/ndb_backup51 \ $BASE/mysql-test/extra \ $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests @@ -249,12 +250,20 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data +$CP mysql-test/std_data/ndb_backup50/*.Data \ + mysql-test/std_data/ndb_backup50/*.ctl \ + mysql-test/std_data/ndb_backup50/*.log \ + $BASE/mysql-test/std_data/ndb_backup50 +$CP mysql-test/std_data/ndb_backup51/*.Data \ + mysql-test/std_data/ndb_backup51/*.ctl \ + mysql-test/std_data/ndb_backup51/*.log \ + $BASE/mysql-test/std_data/ndb_backup51 $CP mysql-test/t/*.test $BASE/mysql-test/t $CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t $CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t $CP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -$CP mysql-test/r/*.result mysql-test/r/*.require \ - $BASE/mysql-test/r +$CP mysql-test/r/*.result $BASE/mysql-test/r +$CP mysql-test/r/*.require $BASE/mysql-test/r $CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests $CP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests -- cgit v1.2.1 From 44e0587486e2f2a0d2245430092ab82b367cc3ba Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Tue, 17 Oct 2006 13:34:00 +0200 Subject: ndb - ndb_restore_compat Update make_binary_distribution.sh Make sure all files needed for testing are included --- scripts/make_binary_distribution.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 81e7f22c1b8..b05c899cb2f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -343,6 +343,8 @@ if [ x$NDBCLUSTER = x1 ]; then test -d $BASE/include/storage || mkdir $BASE/include/storage $CP -r $BASE/ndb-stage@pkgincludedir@/storage/ndb $BASE/include/storage/ $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 + $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup50 $BASE/mysql-test/std_data/. || exit 1 + $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup51 $BASE/mysql-test/std_data/. || exit 1 rm -rf $BASE/ndb-stage fi -- cgit v1.2.1 From 2f7b2611f78bf0158583a1eaaeaf249c5f65408b Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Tue, 17 Oct 2006 15:05:31 +0200 Subject: ndb - remove duplicate solution to ndb_restore_compat make_binary_distribution problem --- scripts/make_binary_distribution.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b05c899cb2f..9302745ceee 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -93,7 +93,6 @@ mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ - $BASE/mysql-test/std_data/ndb_backup50 $BASE/mysql-test/std_data/ndb_backup51 \ $BASE/mysql-test/extra \ $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests @@ -250,14 +249,6 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data -$CP mysql-test/std_data/ndb_backup50/*.Data \ - mysql-test/std_data/ndb_backup50/*.ctl \ - mysql-test/std_data/ndb_backup50/*.log \ - $BASE/mysql-test/std_data/ndb_backup50 -$CP mysql-test/std_data/ndb_backup51/*.Data \ - mysql-test/std_data/ndb_backup51/*.ctl \ - mysql-test/std_data/ndb_backup51/*.log \ - $BASE/mysql-test/std_data/ndb_backup51 $CP mysql-test/t/*.test $BASE/mysql-test/t $CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t $CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t @@ -335,8 +326,8 @@ fi # NDB Cluster if [ x$NDBCLUSTER = x1 ]; then - ( cd storage/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) + ( cd storage/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) + ( cd mysql-test ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. -- cgit v1.2.1 From 60104e1132a5b382f0bc2fcb66a8a82728ac8eb8 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-544072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Fri, 20 Oct 2006 20:18:44 +0200 Subject: make_win_bin_dist: Aligned script with updated 5.0 version --- scripts/make_win_bin_dist | 425 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 332 insertions(+), 93 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index cebcccb56f4..b200e5428be 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -1,41 +1,227 @@ -#! /bin/sh - -NOINST_NAME=$1 - -mkdir $NOINST_NAME -mkdir $NOINST_NAME/bin -cp client/release/*.exe $NOINST_NAME/bin/ -cp extra/release/*.exe $NOINST_NAME/bin/ -mv $NOINST_NAME/bin/comp_err.exe $NOINST_NAME/bin/comp-err.exe -cp storage/myisam/release/*.exe $NOINST_NAME/bin/ -cp server-tools/instance-manager/release/*.exe $NOINST_NAME/bin/ -cp tests/release/*.exe $NOINST_NAME/bin/ -cp libmysql/release/*.exe $NOINST_NAME/bin/ -cp libmysql/release/libmysql.dll $NOINST_NAME/bin/ - -cp sql/release/mysqld.exe $NOINST_NAME/bin/mysqld.exe -cp sql/debug/mysqld.exe $NOINST_NAME/bin/mysqld-debug.exe -# For Pro/Classic builds, do this instead: -# cp sql/release/mysqld.exe $NOINST_NAME/bin/mysqld-nt.exe -# cp sql/debug/mysqld.exe $NOINST_NAME/bin/mysqld-debug.exe - -cp COPYING EXCEPTIONS-CLIENT $NOINST_NAME/ -cp -dpR win/data $NOINST_NAME/data -mkdir $NOINST_NAME/Docs -cp Docs/INSTALL-BINARY Docs/manual.chm ChangeLog COPYING $NOINST_NAME/Docs/ - -# These will be filled in when we enable embedded. -mkdir -p $NOINST_NAME/Embedded/DLL/debug $NOINST_NAME/Embedded/DLL/release $NOINST_NAME/Embedded/static/release - -mkdir -p $NOINST_NAME/examples/libmysqltest/debug $NOINST_NAME/examples/libmysqltest/release -cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/release/myTest.exe $NOINST_NAME/examples/libmysqltest/ -cp libmysql/debug/myTest.exe $NOINST_NAME/examples/libmysqltest/debug/ -cp libmysql/release/myTest.exe $NOINST_NAME/examples/libmysqltest/release/ - -mkdir -p $NOINST_NAME/examples/tests -cp tests/*.res tests/*.tst tests/*.pl tests/*.c $NOINST_NAME/examples/tests/ - -mkdir -p $NOINST_NAME/include +#!/bin/sh + +# Exit if failing to copy, we want exact specifications, not +# just "what happen to be built". +set -e + +# ---------------------------------------------------------------------- +# Read first argument that is the base name of the resulting TAR file. +# See usage() function below for a description on the arguments. +# +# NOTE: We will read the rest of the command line later on. +# NOTE: Pattern matching with "{..,..}" can't be used, not portable. +# ---------------------------------------------------------------------- + +# FIXME FIXME "debug", own build or handled here? +# FIXME FIXME add way to copy from other builds executables + +usage() +{ + echo < Date: Sat, 21 Oct 2006 00:57:08 +0200 Subject: make_win_bin_dist: Copy udf examples and raid.h Create target "include" directory before copying files to it CMakeLists.txt: Only compile in bdb if configured configure.in: Raised version number to 5.0.27 --- scripts/make_win_bin_dist | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index cc75245e5d9..38e7ab88f22 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -144,8 +144,6 @@ fi # Copy data directory, readme files etc # ---------------------------------------------------------------------- -cp COPYING EXCEPTIONS-CLIENT $DESTDIR/ - # FIXME is there ever a data directory to copy? if [ -d win/data ] ; then cp -pR win/data $DESTDIR/data @@ -159,9 +157,13 @@ mkdir $DESTDIR/Docs cp Docs/INSTALL-BINARY $DESTDIR/Docs/ cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true cp ChangeLog $DESTDIR/Docs/ || /bin/true -cp COPYING $DESTDIR/Docs/ cp support-files/my-*.ini $DESTDIR/ +if [ -f COPYING ] ; then + cp COPYING EXCEPTIONS-CLIENT $DESTDIR/ + cp COPYING $DESTDIR/Docs/ +fi + # ---------------------------------------------------------------------- # These will be filled in when we enable embedded. Note that if no # argument is given, it is copied if exists, else a check is done. @@ -170,7 +172,8 @@ cp support-files/my-*.ini $DESTDIR/ copy_embedded() { mkdir -p $DESTDIR/Embedded/DLL/release \ - $DESTDIR/Embedded/static/release + $DESTDIR/Embedded/static/release \ + $DESTDIR/include cp libmysqld/libmysqld.def $DESTDIR/include/ cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/ cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/ @@ -211,6 +214,9 @@ fi mkdir -p $DESTDIR/examples/tests cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/ +mkdir -p $DESTDIR/examples/udf_example +cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/ + # ---------------------------------------------------------------------- # FIXME why not copy it all in "include"?! # ---------------------------------------------------------------------- @@ -228,6 +234,7 @@ cp include/conf*.h \ include/m_string.h \ include/m_ctype.h \ include/my_global.h \ + include/raid.h \ include/typelib.h $DESTDIR/include/ cp libmysql/libmysql.def $DESTDIR/include/ -- cgit v1.2.1 From 2459dd55f579fd627f7f37da3b9fe3e0269334c0 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Mon, 23 Oct 2006 10:56:13 +0200 Subject: Copy *.cnf file from std_data/ when doing a binary distribution --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b2eb9f3b727..d05c4427627 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -225,6 +225,7 @@ $CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi \ -- cgit v1.2.1 From 3d7a9bdd6b66f7e82bdf911482fc75162db825d3 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-634072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Tue, 7 Nov 2006 22:26:37 +0100 Subject: make_binary_distribution.sh: Added LICENSE.mysql, removed LICENSE.doc README.NW. Removed obselete section about MySQLEULA.txt and README.NW. README: Added reference to the EXCEPTIONS-CLIENT file. Changed reference to the commercial license file. Corrected references into chapters in the manual. .del-MySQLEULA.txt~4a1afd9284f9be5a: Delete: Docs/MySQLEULA.txt --- scripts/make_binary_distribution.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ae24752d290..5748c024387 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -85,7 +85,7 @@ do done for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW + EXCEPTIONS-CLIENT LICENSE.mysql LICENSE.doc do if [ -f $i ] then @@ -246,15 +246,6 @@ fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh -# -# Remove system dependent files -# -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/MySQLEULA.txt -else - rm -f $BASE/README.NW -fi - # Make safe_mysqld a symlink to mysqld_safe for backwards portability (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -- cgit v1.2.1 From 5d8525c6f7c0a4ac6dc24e717c6ebb74c5d6f6ba Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Tue, 14 Nov 2006 14:44:20 +0100 Subject: make_binary_distribution should of course also copy .test files from mysql-test/include --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f37e667dd86..6359eb009ce 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -224,6 +224,7 @@ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data -- cgit v1.2.1 From 3ebd031e00dd176528d2b82d7c58fa38b7d99716 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Wed, 15 Nov 2006 09:54:54 -0500 Subject: Bug#17700: mysql_fix_privilege_tables cannot handle a password \ with embedded spaces Problem: Original code written assuming password contains no spaces. Further, because of how sh interprets characters in variables, you cannot do the "simple solution". Solution: Move the "was a password provided" check to the end. This allows us to correctly quote the password argument when passed to the mysql client program. Addendum: Put this check inside of a shell fn to simplify the code. --- scripts/mysql_fix_privilege_tables.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 56807a81d7c..361affae247 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -120,9 +120,6 @@ then fi cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" -if test ! -z "$password" ; then - cmd="$cmd --password=$password" -fi if test ! -z "$port"; then cmd="$cmd --port=$port" fi @@ -178,11 +175,22 @@ then s_echo "" fi +run_cmd() { + # Password argument is added here to allow for spaces in password. + + if test ! -z "$password" + then + cat $sql_file | $cmd --password="$password" + else + cat $sql_file | $cmd + fi +} + if test $verbose = 0 then - cat $sql_file | $cmd > /dev/null 2>&1 + run_cmd > /dev/null 2>&1 else - cat $sql_file | $cmd > /dev/null + run_cmd > /dev/null fi if test $? = 0 then -- cgit v1.2.1 From b24d39c9e78195f10b66988cf0dba5939d0bd242 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Mon, 20 Nov 2006 15:37:22 -0500 Subject: Change collation for ALTER-omitted ENUMs from utf8_bin (where "y" and "Y" are different) to utf8_general_ci (where same). --- scripts/mysql_fix_privilege_tables.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 41d468fd3cf..ee92e4cf33b 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -179,6 +179,11 @@ ALTER TABLE user MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; ALTER TABLE db @@ -198,6 +203,11 @@ ALTER TABLE db MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE host MODIFY Host char(60) NOT NULL default '', @@ -215,6 +225,11 @@ ALTER TABLE host MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE func ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -- cgit v1.2.1 From 13b5e6275ac81900f3d6f5812e519369811b9204 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 21 Nov 2006 16:31:44 +0100 Subject: Add ALTER TABLE MODIFY statements in addition to the ALTER TABLE ADD for new columns to make sure they both exist and have the intended type --- scripts/mysql_fix_privilege_tables.sql | 42 ++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index ee92e4cf33b..3044e51a4fd 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -179,13 +179,9 @@ ALTER TABLE user MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + ALTER TABLE db MODIFY Host char(60) NOT NULL default '', MODIFY Db char(64) NOT NULL default '', @@ -203,12 +199,8 @@ ALTER TABLE db MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + ALTER TABLE host MODIFY Host char(60) NOT NULL default '', MODIFY Db char(64) NOT NULL default '', @@ -225,12 +217,8 @@ ALTER TABLE host MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + ALTER TABLE func ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE func @@ -265,15 +253,25 @@ SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; # Create VIEWs privileges (v5.0) # ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; +ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; # # Show VIEWs privileges (v5.0) # ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; # # Show/Create views table privileges (v5.0) @@ -295,18 +293,31 @@ SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; # Create PROCEDUREs privileges (v5.0) # ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; # # Alter PROCEDUREs privileges (v5.0) # ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; # # Assign create/alter routine privileges to people who have create privileges @@ -328,6 +339,7 @@ SET @hadCreateUserPriv:=0; SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' WHERE @hadCreateUserPriv = 0 AND (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); -- cgit v1.2.1 From 7673a2d415c1e681d7cffa307df2c56faa38337f Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 21 Nov 2006 17:44:43 +0100 Subject: Update mysql_fix_privilege_tables.sql to handle upgrade from 5.0 while retaining old upgrade behaviour. Add test for upgrade from 5.0.30 --- scripts/mysql_fix_privilege_tables.sql | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 3c23d35f91c..aea44e84fef 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -440,7 +440,7 @@ PRIMARY KEY TranTime (Transition_time) # -# Create proc table if it doesn't exists +# Create proc table if it does not exists # CREATE TABLE IF NOT EXISTS proc ( @@ -661,7 +661,11 @@ SET @hadEventPriv := 0; SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +ALTER TABLE user MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; + ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; + ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); ALTER TABLE event ADD sql_mode @@ -708,8 +712,14 @@ SET @hadTriggerPriv := 0; SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%'; ALTER TABLE user ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Event_priv; +ALTER TABLE user MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Event_priv; + ALTER TABLE host ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL; UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -- cgit v1.2.1 From f6682e2743d6b3cff53a6e6b1499b28f10fb3b92 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com/nosik.monty.fi" <> Date: Tue, 21 Nov 2006 22:32:58 +0200 Subject: Added --debug-info to most clients to detect memory leaks in mysql-test-run Moved .progress files into the log directory Moved 'cluster' database tables into the MySQL database, to not have 'cluster' beeing a reserved database name Fixed bug where mysqld got a core dump when trying to use a table created by MySQL 3.23 Fixed some compiler warnings Fixed small memory leak in libmysql Note that this doesn't changeset doesn't include the new mysqldump.c code required to run some tests. This will be added when I merge 5.0 to 5.1 --- scripts/mysql_create_system_tables.sh | 3 +- scripts/mysql_fix_privilege_tables.sql | 86 +++++++++++++++++----------------- 2 files changed, 45 insertions(+), 44 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 69ea8e3d004..a8e4fed5d27 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -874,8 +874,7 @@ $c_pp $c_gl $c_sl $c_ev -CREATE DATABASE IF NOT EXISTS cluster; -CREATE TABLE IF NOT EXISTS cluster.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index f3c0c7f13be..15ebef7d9c0 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,13 +1,13 @@ --- This script converts any old privilege tables to privilege tables suitable --- for this version of MySQL +# This script converts any old privilege tables to privilege tables suitable +# for this version of MySQL --- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" --- because these just mean that your tables are already up to date. --- This script is safe to run even if your tables are already up to date! +# You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +# because these just mean that your tables are already up to date. +# This script is safe to run even if your tables are already up to date! --- On unix, you should use the mysql_fix_privilege_tables script to execute --- this sql script. --- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' +# On unix, you should use the mysql_fix_privilege_tables script to execute +# this sql script. +# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' set storage_engine=MyISAM; @@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS plugin ( ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; --- Detect whether or not we had the Grant_priv column +# Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; @@ -35,14 +35,14 @@ ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,a ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; --- Fix privileges for old tables +# Fix privileges for old tables UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; --- --- The second alter changes ssl_type to new 4.0.2 format --- Adding columns needed by GRANT .. REQUIRE (openssl)" +# +# The second alter changes ssl_type to new 4.0.2 format +# Adding columns needed by GRANT .. REQUIRE (openssl)" ALTER TABLE user ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, @@ -51,9 +51,9 @@ ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL; ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; --- --- Create tables_priv and columns_priv if they don't exists --- +# +# Create tables_priv and columns_priv if they don't exists +# CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ) CHARACTER SET utf8 COLLATE utf8_bin; --- Fix collation of set fields +# Fix collation of set fields ALTER TABLE tables_priv modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; @@ -88,26 +88,26 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) CHARACTER SET utf8 COLLATE utf8_bin; --- Fix collation of set fields +# Fix collation of set fields ALTER TABLE columns_priv MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; --- --- Name change of Type -> Column_priv from MySQL 3.22.12 --- +# +# Name change of Type -> Column_priv from MySQL 3.22.12 +# ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; --- --- Add the new 'type' column to the func table. --- +# +# Add the new 'type' column to the func table. +# ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; --- --- Change the user,db and host tables to MySQL 4.0 format --- +# +# Change the user,db and host tables to MySQL 4.0 format +# # Detect whether we had Show_db_priv SET @hadShowDbPriv:=0; @@ -122,22 +122,22 @@ ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTE ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; --- Convert privileges so that users have similar privileges as before +# Convert privileges so that users have similar privileges as before UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; --- Add fields that can be used to limit number of questions and connections --- for some users. +# Add fields that can be used to limit number of questions and connections +# for some users. ALTER TABLE user ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; --- --- Add Create_tmp_table_priv and Lock_tables_priv to db and host --- +# +# Add Create_tmp_table_priv and Lock_tables_priv to db and host +# ALTER TABLE db ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, @@ -156,8 +156,8 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; --- Convert all tables to UTF-8 with binary collation --- and reset all char columns to correct width +# Convert all tables to UTF-8 with binary collation +# and reset all char columns to correct width ALTER TABLE user MODIFY Host char(60) NOT NULL default '', MODIFY User char(16) NOT NULL default '', @@ -385,7 +385,7 @@ Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) CHARACTER SET utf8 comment='Time zones'; --- Make enum field case-insensitive +# Make enum field case-insensitive ALTER TABLE time_zone MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; @@ -527,9 +527,9 @@ ALTER TABLE proc MODIFY db MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; --- --- Create missing log tables (5.1) --- +# +# Create missing log tables (5.1) +# delimiter // CREATE PROCEDURE create_log_tables() @@ -673,9 +673,9 @@ ALTER TABLE event ADD sql_mode UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; --- --- TRIGGER privilege --- +# +# TRIGGER privilege +# SET @hadTriggerPriv := 0; SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%'; @@ -687,6 +687,8 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; +CREATE TABLE IF NOT EXISTS binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From d89db5edf8bc49d1df9ddec7caa2d7f903378d7f Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 21 Nov 2006 21:39:37 +0100 Subject: When runnig from binary dist the .sql files are found in share/ directory --- scripts/mysql_fix_privilege_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 3044e51a4fd..28c9aced618 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -435,7 +435,7 @@ PRIMARY KEY TranTime (Transition_time) # -# Create proc table if it doesn't exists +# Create proc table if it does not exists # CREATE TABLE IF NOT EXISTS proc ( -- cgit v1.2.1 From 0a27881be523165d133edbb55f317b4e09926318 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 22 Nov 2006 09:52:31 +0100 Subject: Bug #20589 Missing some table level privileges after upgrade - Update comments to reflect correct version --- scripts/mysql_fix_privilege_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index a72bd2799aa..8e3d1845571 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,5 +1,5 @@ -- This script converts any old privilege tables to privilege tables suitable --- for MySQL 4.0. +-- for MySQL 4.1 -- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" -- because these just mean that your tables are already up to date. @@ -93,7 +93,7 @@ ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update', ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; -- --- Change the user,db and host tables to MySQL 4.0 format +-- Change the user,db and host tables to current format -- # Detect whether we had Show_db_priv -- cgit v1.2.1 From dcf0f346cf1c06d85b8d319396539bc1afad1bd4 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Wed, 29 Nov 2006 12:04:29 +0100 Subject: Bug#20589 Missing some table level privileges after upgrade - The table_priv column of table_privs table was altered to a enum type with fewer enums causing the SHOW/CREATE VIEW grants to be truncated. - Improved comments and moved all declarations for table_privs, column_privs and proc_privs to one section for each table making it easy to see hat alterations are performed on each table - Reduced the number of ALTER's slightly, but as this is an upgrade script we need to take all possibilites into account. --- scripts/mysql_fix_privilege_tables.sql | 139 ++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 61 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 287d51379e2..5709fb96793 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -46,9 +46,8 @@ ADD x509_subject BLOB NOT NULL; ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; -- --- Create tables_priv and columns_priv if they don't exists +-- tables_priv -- - CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, @@ -56,22 +55,38 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, - Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Table_priv set('Select','Insert','Update','Delete','Create', + 'Drop','Grant','References','Index','Alter') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ) CHARACTER SET utf8 COLLATE utf8_bin; --- Fix collation of set fields + ALTER TABLE tables_priv - modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, - modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -ALTER TABLE procs_priv ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE procs_priv - modify Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -ALTER TABLE procs_priv - add Routine_type enum('FUNCTION','PROCEDURE') COLLATE utf8_general_ci NOT NULL AFTER Routine_name; -ALTER TABLE procs_priv - modify Timestamp timestamp(14) AFTER Proc_priv; + ADD KEY Grantor (Grantor); + +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Table_priv set('Select','Insert','Update','Delete','Create', + 'Drop','Grant','References','Index','Alter', + 'Create View','Show view') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + COMMENT='Table privileges'; + +-- +-- columns_priv +-- CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, Db char(64) DEFAULT '' NOT NULL, @@ -82,16 +97,25 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) CHARACTER SET utf8 COLLATE utf8_bin; --- Fix collation of set fields -ALTER TABLE columns_priv - MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - --- -- Name change of Type -> Column_priv from MySQL 3.22.12 --- +ALTER TABLE columns_priv + CHANGE Type Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; -ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin, + COMMENT='Column privileges'; + +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Add the new 'type' column to the func table. @@ -142,14 +166,12 @@ ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; -alter table tables_priv add KEY Grantor (Grantor); + alter table db comment='Database privileges'; alter table host comment='Host privileges; Merged with database privileges'; alter table user comment='Users and global privileges'; alter table func comment='User defined functions'; -alter table tables_priv comment='Table privileges'; -alter table columns_priv comment='Column privileges'; -- Convert all tables to UTF-8 with binary collation -- and reset all char columns to correct width @@ -223,25 +245,6 @@ ALTER TABLE func ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE func MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; -ALTER TABLE columns_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Column_name char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv - MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -ALTER TABLE tables_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Grantor char(77) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv - MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, - MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; # # Detect whether we had Create_view_priv @@ -273,11 +276,6 @@ ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEF ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -# -# Show/Create views table privileges (v5.0) -# -ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - # # Assign create/show view privileges to people who have create provileges # @@ -344,22 +342,41 @@ UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' WHERE @hadCreateUserPriv = 0 AND (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); -# -# Create some possible missing tables -# +-- +-- procs_priv +-- CREATE TABLE IF NOT EXISTS procs_priv ( -Host char(60) binary DEFAULT '' NOT NULL, -Db char(64) binary DEFAULT '' NOT NULL, -User char(16) binary DEFAULT '' NOT NULL, -Routine_name char(64) binary DEFAULT '' NOT NULL, -Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, -Grantor char(77) DEFAULT '' NOT NULL, -Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, -Timestamp timestamp(14), -PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), -KEY Grantor (Grantor) + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Routine_name char(64) binary DEFAULT '' NOT NULL, + Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, + Grantor char(77) DEFAULT '' NOT NULL, + Proc_priv set('Execute','Alter Routine','Grant') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Timestamp timestamp(14), + PRIMARY KEY (Host, Db, User, Routine_name, Routine_type), + KEY Grantor (Grantor) ) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +ALTER TABLE procs_priv + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; + +ALTER TABLE procs_priv + MODIFY Proc_priv set('Execute','Alter Routine','Grant') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE procs_priv + ADD Routine_type enum('FUNCTION','PROCEDURE') + COLLATE utf8_general_ci NOT NULL AFTER Routine_name; + +ALTER TABLE procs_priv + MODIFY Timestamp timestamp(14) AFTER Proc_priv; + +-- +-- help_topic +-- CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name varchar(64) not null, -- cgit v1.2.1 From 23263db66eb19b6779c6bd8708e1c3b08692eebb Mon Sep 17 00:00:00 2001 From: "monty@mysql.com/narttu.mysql.fi" <> Date: Wed, 29 Nov 2006 22:51:09 +0200 Subject: Added back sql-bench directory, so that one can more easily run benchmarks on a server and add new benchmarks for new optimizations Fixed memory leak in _db_set() (Bug#24497 Valgrind warning: get_one_option) Don't call net_clear() on COM_QUIT. This avoids a warning from net_clear() after shutdown: "skipped ## bytes from file" BUG#21428: skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown" --- scripts/make_binary_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ddcea343609..8b09022c32f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -97,7 +97,7 @@ mkdir $BASE $BASE/bin $BASE/docs \ $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/man \ + mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test chmod o-rwx $BASE/data $BASE/data/* @@ -275,7 +275,8 @@ if [ $BASE_SYSTEM != "netware" ] ; then mv $BASE/support-files/binary-configure $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ $BASE/support-files/mysql.server $BASE/configure - rm -f $BASE/lib/*.la + $CP -r sql-bench/* $BASE/sql-bench + rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/bin/*.sql fi @@ -320,6 +321,7 @@ fi # Clean up if we did this from a bk tree if [ -d $BASE/share/SCCS ] ; then find $BASE/share -name SCCS -print | xargs rm -rf + find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi # NDB Cluster -- cgit v1.2.1 From cde79e4f79c978a4b21882da657e2799c3faf3c6 Mon Sep 17 00:00:00 2001 From: "mskold/marty@mysql.com/linux.site" <> Date: Fri, 1 Dec 2006 15:49:07 +0100 Subject: Changed mysql.apply_status, mysql.binlog_index, and mysql.schema to mysql.ndb_apply_status, mysql.ndb_binlog_index, and mysql.ndb_schema --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a8e4fed5d27..3b9d69e259b 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -874,7 +874,7 @@ $c_pp $c_gl $c_sl $c_ev -CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +CREATE TABLE IF NOT EXISTS mysql.ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 15ebef7d9c0..1a52ee1d51b 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -687,7 +687,7 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -CREATE TABLE IF NOT EXISTS binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above -- cgit v1.2.1 From a3e85cce4eac9fd29f783a76e88878647bae7177 Mon Sep 17 00:00:00 2001 From: "patg@radha.tangent.org" <> Date: Fri, 1 Dec 2006 19:47:45 -0500 Subject: WL# 3031 Backport of functionality in private 5.2 tree. Added new language to parser, new mysql.servers table and associated code to be used by the federated storage engine to allow central connection information per WL entry. --- scripts/mysql_create_system_tables.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a8e4fed5d27..d0a93f29008 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -192,6 +192,33 @@ then fi fi +# Check for old tables +if test ! -f $mdata/servers.frm +then + if test "$1" = "verbose" ; then + echo "Preparing servers table" 1>&2; + fi + + c_d="$c_d + +CREATE TABLE servers (" + c_d="$c_d Server_name char(64) NOT NULL," + c_d="$c_d Hostname char(64) NOT NULL," + c_d="$c_d Db char(64) NOT NULL," + c_d="$c_d Username char(64) NOT NULL," + c_d="$c_d Passwd char(64) NOT NULL," + c_d="$c_d Portnum INT(4)," + c_d="$c_d Sock char(64)," + c_d="$c_d Scheme char(64) NOT NULL," + c_d="$c_d Owner char(64) NOT NULL," + c_d="$c_d PRIMARY KEY (Server_name));" + + i_d="INSERT INTO servers VALUES + ('test','localhost','test','root','', 0, + '','mysql','root'); + " +fi + if test ! -f $mdata/func.frm then if test "$1" = "verbose" ; then -- cgit v1.2.1 From d72b71ef9f843d127a6bf17f190924dcbb5d1110 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Sat, 2 Dec 2006 23:16:47 +0100 Subject: mysql_install_db.sh: If --srcdir and --windows is given, check if error message file is in source or build tree (bug#24557) Makefile.am: Cleaned up "ali_check" target, to satisfy "distcleancheck" (bug#24557) mysql_install_db.sh: Added --srcdir=DIR option, used from top Makefile.am in dist-hook target, to find "fill_help_tables.sql" in VPATH build (bug#24557) Makefile.am: Work around problem with "distcleancheck", "sql_yacc.cc" might be in both the source and build tree. Call "mysql_install_db" with new option --srcdir, to enable the script to find all that is needed, if source and build directory is not the same (bug#24557) --- scripts/mysql_install_db.sh | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5d7933e5277..e43b586054e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -33,6 +33,7 @@ parse_arguments() { case "$arg" in --force) force=1 ;; --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --srcdir=*) srcdir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) # Note that the user will be passed to mysqld so that it runs @@ -78,6 +79,7 @@ ldata= execdir= bindir= basedir= +srcdir= force=0 verbose=0 fill_help_tables="" @@ -106,18 +108,24 @@ else fi # find fill_help_tables.sh -for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ -do - if test -f $i/fill_help_tables.sql - then - pkgdatadir=$i - fi -done - -if test -f $pkgdatadir/fill_help_tables.sql +if test -n "$srcdir" then - fill_help_tables=$pkgdatadir/fill_help_tables.sql + fill_help_tables=$srcdir/scripts/fill_help_tables.sql else + for i in $basedir/support-files $basedir/share $basedir/share/mysql \ + $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then + pkgdatadir=$i + fi + done + + fill_help_tables=$pkgdatadir/fill_help_tables.sql +fi + +if test ! -f $fill_help_tables +then echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir". exit 1; fi @@ -130,7 +138,13 @@ scriptdir=$bindir if test "$windows" = 1 then mysqld="./sql/mysqld" - mysqld_opt="--language=./sql/share/english" + if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys + then + langdir=$srcdir/sql/share/english + else + langdir=./sql/share/english + fi + mysqld_opt="--language=$langdir" scriptdir="./scripts" fi -- cgit v1.2.1 From 77965c013cc99c153121cd33e74b18eeae29168a Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Thu, 7 Dec 2006 15:02:32 +0100 Subject: BUG#24780 use --sysconfdir in scripts --- scripts/Makefile.am | 1 + scripts/mysqlaccess.sh | 6 +++--- scripts/mysqld_multi.sh | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 30ba75c551d..0f8e80b4efa 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -111,6 +111,7 @@ SUFFIXES = .sh -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ + -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 654b43a8a99..22e9d121f9a 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -462,8 +462,8 @@ MySQLaccess::Report::Print_Header(); if (-f "./$script_conf") { require "./$script_conf"; } - elsif (-f "/etc/$script_conf") { - require "/etc/$script_conf"; + elsif (-f "@sysconfdir@/$script_conf") { + require "@sysconfdir@/$script_conf"; } # **************************** @@ -929,7 +929,7 @@ sub MergeConfigFile { # ================================= sub MergeConfigFiles { my ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid $<; - MergeConfigFile("/etc/my.cnf"); + MergeConfigFile("@sysconfdir@/my.cnf"); MergeConfigFile("$dir/.my.cnf"); } diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 4a6f380494f..ce778c03206 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -429,9 +429,9 @@ sub find_groups } else { - if (-f "/etc/my.cnf" && -r "/etc/my.cnf") + if (-f "@sysconfdir@/my.cnf" && -r "@sysconfdir@/my.cnf") { - open(MY_CNF, ") && close(MY_CNF); + open(MY_CNF, "<@sysconfdir@/my.cnf") && (@tmp=) && close(MY_CNF); } for ($i = 0; ($line = shift @tmp); $i++) { @@ -658,7 +658,7 @@ sub example # (as per Linux/Unix standard). You may even replace the # /etc/init.d/mysql.server script with it. # -# Before using, you must create a my.cnf file either in /etc/my.cnf +# Before using, you must create a my.cnf file either in @sysconfdir@/my.cnf # or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups. # # The script can be found from support-files/mysqld_multi.server.sh -- cgit v1.2.1 From 0b41593db60e0670f27a76b8144e42e70e1589a8 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Fri, 8 Dec 2006 12:13:43 +0100 Subject: Fix problems with "make dist" and running from "binary dist" --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a6a2f1e3b49..ec1c6b70bb6 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -245,7 +245,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ - mysql-test/std_data/*.cnf \ + mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ -- cgit v1.2.1 From 98062f567d31516f61d720661f46ee447d66821d Mon Sep 17 00:00:00 2001 From: "patg@govinda.patg.net" <> Date: Fri, 8 Dec 2006 22:19:51 -0500 Subject: WL# 3031 Post-commit issues fixed * Test results for other tests fixed due to added error #s * Memory allocation/free issues found with running with valgrind * Fix to mysql-test-run shell script to run federated_server test (installs mysql.servers table properly) --- scripts/mysql_create_system_tables.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index d0a93f29008..28be2c95290 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -30,6 +30,7 @@ windows=$4 # Initialize variables c_d="" i_d="" +c_s="" i_s="" c_h="" i_h="" c_u="" i_u="" c_f="" i_f="" @@ -199,21 +200,21 @@ then echo "Preparing servers table" 1>&2; fi - c_d="$c_d - + c_s=" CREATE TABLE servers (" - c_d="$c_d Server_name char(64) NOT NULL," - c_d="$c_d Hostname char(64) NOT NULL," - c_d="$c_d Db char(64) NOT NULL," - c_d="$c_d Username char(64) NOT NULL," - c_d="$c_d Passwd char(64) NOT NULL," - c_d="$c_d Portnum INT(4)," - c_d="$c_d Sock char(64)," - c_d="$c_d Scheme char(64) NOT NULL," - c_d="$c_d Owner char(64) NOT NULL," - c_d="$c_d PRIMARY KEY (Server_name));" - - i_d="INSERT INTO servers VALUES + c_s="$c_s Server_name char(64) NOT NULL," + c_s="$c_s Host char(64) NOT NULL," + c_s="$c_s Db char(64) NOT NULL," + c_s="$c_s Username char(64) NOT NULL," + c_s="$c_s Password char(64) NOT NULL," + c_s="$c_s Port INT(4)," + c_s="$c_s Socket char(64)," + c_s="$c_s Wrapper char(64) NOT NULL," + c_s="$c_s Owner char(64) NOT NULL," + c_s="$c_s PRIMARY KEY (Server_name))" + c_s="$c_s comment='MySQL Foreign Servers table';" + + i_s="INSERT INTO servers VALUES ('test','localhost','test','root','', 0, '','mysql','root'); " @@ -876,6 +877,9 @@ $i_f $c_pl $i_pl +$c_s +$i_s + $c_t $c_c -- cgit v1.2.1 From b892f9adf84b43eaef3e85b63ba024bebf5a79ba Mon Sep 17 00:00:00 2001 From: "patg@radha.myhome.westell.com" <> Date: Mon, 11 Dec 2006 11:44:03 -0500 Subject: WL #3031 * New result files due to new error message/error numbers * Fixed system_mysql_db tests to work with servers table * Added UTF8 charset to table defs --- scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 1b4472f5baa..44fbb7183b9 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -212,7 +212,7 @@ CREATE TABLE servers (" c_s="$c_s Wrapper char(64) NOT NULL," c_s="$c_s Owner char(64) NOT NULL," c_s="$c_s PRIMARY KEY (Server_name))" - c_s="$c_s comment='MySQL Foreign Servers table';" + c_s="$c_s CHARACTER SET utf8 comment='MySQL Foreign Servers table';" i_s="INSERT INTO servers VALUES ('test','localhost','test','root','', 0, diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 37bd17c03d6..056761f3ad0 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -379,6 +379,22 @@ ALTER TABLE procs_priv ALTER TABLE procs_priv MODIFY Timestamp timestamp(14) AFTER Proc_priv; +-- +-- servers +-- +CREATE TABLE servers ( + Server_name char(64) NOT NULL DEFAULT '', + Host char(64) NOT NULL DEFAULT '', + Db char(64) NOT NULL DEFAULT '', + Username char(64) NOT NULL DEFAULT '', + Password char(64) NOT NULL DEFAULT '', + Port INT(4) NOT NULL DEFAULT '0', + Socket char(64) NOT NULL DEFAULT '', + Wrapper char(64) NOT NULL DEFAULT '', + Owner char(64) NOT NULL DEFAULT '', + PRIMARY KEY (Server_name)) + CHARACTER SET utf8 comment='MySQL Foreign Servers table'; + -- -- help_topic -- -- cgit v1.2.1 From 54e7d71477b673db69538219ab5419d1fda33283 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 14 Dec 2006 12:18:36 -0800 Subject: Change permissions on $mysql_unix_port_dir if we create it so that everyone can access it. --- scripts/mysqld_safe.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index c655910dc2c..c867d15a389 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -195,6 +195,7 @@ if [ ! -d $mysql_unix_port_dir ] then mkdir $mysql_unix_port_dir chown $user $mysql_unix_port_dir + chmod 755 $mysql_unix_port_dir fi # Use the mysqld-max binary by default if the user doesn't specify a binary -- cgit v1.2.1 From 905d9e848c39b28eb91864e41f0d56ac3213bcf8 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Fri, 15 Dec 2006 17:57:31 +0100 Subject: also include data files for varbinary test in binary distribution --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a6a2f1e3b49..9469cca875d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -243,6 +243,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ -- cgit v1.2.1 From 3da37d3fa2d1f5db00afbff25006821e19e7e2cd Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Fri, 15 Dec 2006 10:57:58 -0800 Subject: Added support for sensible-editor from Debian, instead of emacs. --- scripts/mysqlbug.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 6aed140b79d..880ab248a90 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -132,7 +132,13 @@ if test -z "$VISUAL" then if test -z "$EDITOR" then - EDIT=emacs + # Honor debian sensible-editor + if test -x "/usr/bin/sensible-editor" + then + EDIT=/usr/bin/sensible-editor + else + EDIT=emacs + fi else EDIT="$EDITOR" fi -- cgit v1.2.1 From 265370f5c3a324c7d063739d6c0b42c1a746dc1b Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Fri, 15 Dec 2006 12:34:36 -0800 Subject: Added /etc/mysql to my.cnf search path after /etc. bug #25104 --- scripts/mysqld_multi.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 2dcc8dc7bc4..6ac31a00c75 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -472,6 +472,14 @@ sub find_groups { $data[$i] = $line; } + if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf") + { + open(MY_CNF, ") && close(MY_CNF); + } + for (; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" && -r "$ENV{MYSQL_HOME}/my.cnf") { @@ -491,7 +499,7 @@ sub find_groups $data[$i] = $line; } } - chop @data; + chomp @data; # Make a list of the wanted group ids if (defined($raw_gids)) { -- cgit v1.2.1 From 373e280eb32cc78f9f5a55335d7a584832ffc1cd Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Fri, 15 Dec 2006 16:17:10 -0800 Subject: support /etc/mysql/my.cnf in mysqld_multi as well. --- scripts/mysqld_multi.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 4a6f380494f..b11dc7394bf 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -437,6 +437,14 @@ sub find_groups { $data[$i] = $line; } + if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf") + { + open(MY_CNF, ") && close(MY_CNF); + } + for (; ($line = shift @tmp); $i++) + { + $data[$i] = $line; + } if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") { open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); @@ -446,7 +454,7 @@ sub find_groups $data[$i] = $line; } } - chop @data; + chomp @data; # Make a list of the wanted group ids if (defined($raw_gids)) { -- cgit v1.2.1 From 09591de344344d0aaf28e11d794ed2c2fda4c5a3 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Mon, 18 Dec 2006 21:12:01 -0800 Subject: Search through options to find where the slow query log actually is. --- scripts/mysqldumpslow.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index ccb006f692d..ff82a35ec3f 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -40,6 +40,7 @@ unless (@ARGV) { warn "basedir=$basedir\n" if $opt{v}; my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; + my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0]; if (!$datadir or $opt{i}) { # determine the datadir from the instances section of /etc/my.cnf, if any my $instances = `my_print_defaults instances`; @@ -55,8 +56,13 @@ unless (@ARGV) { warn "datadir=$datadir\n" if $opt{v}; } - @ARGV = <$datadir/$opt{h}-slow.log>; - die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV; + if ( -f $slowlog ) { + @ARGV = ($slowlog); + die "Can't find '$slowlog'\n" unless @ARGV; + } else { + @ARGV = <$datadir/$opt{h}-slow.log>; + die "Can't find '$datadir/$opt{h}-slow.log'\n" unless @ARGV; + } } warn "\nReading mysql slow query log from @ARGV\n"; -- cgit v1.2.1 From 226a5c833f3084bc634996c70d47a1c0d9164e0d Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Sat, 23 Dec 2006 20:17:15 +0100 Subject: Many files: Changed header to GPL version 2 only --- scripts/Makefile.am | 3 +-- scripts/fill_help_tables.sh | 3 +-- scripts/mysql_config.sh | 3 +-- scripts/mysql_secure_installation.sh | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5f49620c975..585c8ca8655 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -2,8 +2,7 @@ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. +# the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index fc0c684c2dc..1a9f63e36d9 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -498,8 +498,7 @@ print < Date: Sun, 31 Dec 2006 01:02:27 +0100 Subject: my_strtoll10-x86.s: Corrected spelling in copyright text Makefile.am: Don't update the files from BitKeeper Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Many files: Added GPL copyright text Removed files: Docs/Support/colspec-fix.pl Docs/Support/docbook-fixup.pl Docs/Support/docbook-prefix.pl Docs/Support/docbook-split Docs/Support/make-docbook Docs/Support/make-makefile Docs/Support/test-make-manual Docs/Support/test-make-manual-de Docs/Support/xwf --- scripts/Makefile.am | 2 +- scripts/fill_func_tables.sh | 15 +++++++++++++-- scripts/fill_help_tables.sh | 17 ++++++++++++++--- scripts/make_binary_distribution.sh | 14 ++++++++++++++ scripts/make_sharedlib_distribution.sh | 15 +++++++++++++++ scripts/make_win_bin_dist | 14 ++++++++++++++ scripts/make_win_src_distribution.sh | 14 ++++++++++++++ scripts/mysql_config.sh | 2 +- scripts/mysql_convert_table_format.sh | 14 ++++++++++++++ scripts/mysql_create_system_tables.sh | 14 +++++++++++++- scripts/mysql_explain_log.sh | 15 +++++++++++++++ scripts/mysql_find_rows.sh | 17 ++++++++++++++--- scripts/mysql_fix_privilege_tables.sh | 15 +++++++++++++++ scripts/mysql_install_db.sh | 14 +++++++++++++- scripts/mysql_upgrade_shell.sh | 14 +++++++++++++- scripts/mysql_zap.sh | 15 +++++++++++++++ scripts/mysqlbug.sh | 15 +++++++++++++++ 17 files changed, 213 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 585c8ca8655..1fad4befe6e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# Copyright (C) 2000-2006 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh index ad5b7fbb521..f6554292a5d 100644 --- a/scripts/fill_func_tables.sh +++ b/scripts/fill_func_tables.sh @@ -1,7 +1,18 @@ #!@PERL@ -# # Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # fill_func_tables - parse ../Docs/manual.texi # diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 1a9f63e36d9..1dff7edd268 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -1,8 +1,19 @@ #!@PERL@ -# # Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + # This script generates the SQL statements required by mysql_install_db to # fill up the tables for the server-side online function help, which can be # invoked with "help " from the MySQL client. diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 9469cca875d..99bb9ea78a4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright (C) 2000-2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This is a script to create a TAR or ZIP binary distribution out of a # built source tree. The output file will be put at the top level of diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh index c475d0e14a4..f6669788233 100644 --- a/scripts/make_sharedlib_distribution.sh +++ b/scripts/make_sharedlib_distribution.sh @@ -1,4 +1,19 @@ #!/bin/sh +# Copyright (C) 2003-2004, 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + # The default path should be /usr/local # Get some info from configure diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 38e7ab88f22..211eea8a265 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Exit if failing to copy, we want exact specifications, not # just "what happen to be built". diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 6206ca64121..d6109772060 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright (C) 2003-2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Terminate loudly on error, we don't want partial package set -e diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index b47e7740c75..f094cb060b7 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# Copyright (C) 2000-2006 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index c1955e632fb..0c9ce3a67e0 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -1,4 +1,18 @@ #!@PERL@ +# Copyright (C) 2000-2002 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Convert given tables in a database to MYISAM diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 54f0ef230ad..1936ba6f6b6 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -1,6 +1,18 @@ #!/bin/sh # Copyright (C) 1997-2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This script writes on stdout SQL commands to generate all not # existing MySQL system tables. It also replaces the help tables with diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index fd468fdf091..ad23a42451f 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -1,4 +1,19 @@ #!@PERL@ +# Copyright (C) 2001-2003, 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + use strict; use warnings; use DBI; diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 91ffc326e16..77eacc8a9b4 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -1,4 +1,18 @@ #!@PERL@ +# Copyright (C) 2000, 2004 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA $version="1.02"; @@ -114,9 +128,6 @@ sub usage print < Date: Sun, 31 Dec 2006 02:29:11 +0100 Subject: Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Added GPL copyright text my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc: Changed copyright header formatting some plugin_example.c, daemon_example.c: Added "Copyright (C) 2006 MySQL AB" to GPL header --- scripts/make_win_bin_dist | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b200e5428be..b98e0667d56 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Exit if failing to copy, we want exact specifications, not # just "what happen to be built". -- cgit v1.2.1 From 0255a1c9c2155d7beeb76517d1a9770789960369 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Jan 2007 05:30:31 +0100 Subject: mysql_secure_installation.sh: Portable handling of "echo" without newline (bug#24605) check-cpu: In developer script safe to use "printf", not "echo -n" --- scripts/mysql_secure_installation.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 1c7ca34ad59..e42e83233c3 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -22,6 +22,16 @@ command=".mysql.$$" trap "interrupt" 2 rootpass="" +echo_n= +echo_c= + +set_echo_compat() { + case `echo "testing\c"`,`echo -n testing` in + *c*,-n*) echo_n= echo_c= ;; + *c*,*) echo_n=-n echo_c= ;; + *) echo_n= echo_c='\c' ;; + esac +} prepare() { touch $config $command @@ -45,7 +55,7 @@ get_root_password() { status=1 while [ $status -eq 1 ]; do stty -echo - echo -n "Enter current password for root (enter for none): " + echo $echo_n "Enter current password for root (enter for none): $echo_c" read password echo stty echo @@ -65,10 +75,10 @@ get_root_password() { set_root_password() { stty -echo - echo -n "New password: " + echo $echo_n "New password: $echo_c" read password1 echo - echo -n "Re-enter new password: " + echo $echo_n "Re-enter new password: $echo_c" read password2 echo stty echo @@ -173,6 +183,7 @@ cleanup() { # The actual script starts here prepare +set_echo_compat echo echo @@ -201,11 +212,11 @@ echo "root user without the proper authorisation." echo if [ $hadpass -eq 0 ]; then - echo -n "Set root password? [Y/n] " + echo $echo_n "Set root password? [Y/n] $echo_c" else echo "You already have a root password set, so you can safely answer 'n'." echo - echo -n "Change the root password? [Y/n] " + echo $echo_n "Change the root password? [Y/n] $echo_c" fi read reply @@ -232,7 +243,7 @@ echo "go a bit smoother. You should remove them before moving into a" echo "production environment." echo -echo -n "Remove anonymous users? [Y/n] " +echo $echo_n "Remove anonymous users? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then @@ -251,7 +262,7 @@ echo "Normally, root should only be allowed to connect from 'localhost'. This" echo "ensures that someone cannot guess at the root password from the network." echo -echo -n "Disallow root login remotely? [Y/n] " +echo $echo_n "Disallow root login remotely? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -270,7 +281,7 @@ echo "access. This is also intended only for testing, and should be removed" echo "before moving into a production environment." echo -echo -n "Remove test database and access to it? [Y/n] " +echo $echo_n "Remove test database and access to it? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -288,7 +299,7 @@ echo "Reloading the privilege tables will ensure that all changes made so far" echo "will take effect immediately." echo -echo -n "Reload privilege tables now? [Y/n] " +echo $echo_n "Reload privilege tables now? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." -- cgit v1.2.1 From c678f8e186e5851c07a4b2b83d606fa75280c87c Mon Sep 17 00:00:00 2001 From: "acurtis/antony@xiphis.org/ltamd64.xiphis.org" <> Date: Tue, 2 Jan 2007 09:42:13 -0800 Subject: Bug#24270 "mysql_install_db doesn't work properly on 5.1" force sql_mode to known value within initialization scripts --- scripts/fill_help_tables.sh | 1 + scripts/mysql_create_system_tables.sh | 1 + scripts/mysql_fix_privilege_tables.sql | 1 + 3 files changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 1dff7edd268..e600d24032b 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -521,6 +521,7 @@ print < Date: Fri, 5 Jan 2007 16:53:03 +0100 Subject: mysql.spec.sh, make_binary_distribution.sh: Add CFLAGS to gcc call with --print-libgcc-file, to make sure the correct "libgcc.a" path is returned for the 32/64 bit architecture --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 6359eb009ce..917ac0a19c1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -322,7 +322,7 @@ BASE=$BASE2 # if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ --print-libgcc-file` + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` if [ $? -ne 0 ] ; then echo "Warning: Couldn't find libgcc.a!" else -- cgit v1.2.1 From eeb82a8ed5a0415737c12ecc4ec97708461d5081 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Tue, 9 Jan 2007 09:32:56 +0100 Subject: BUG#24780 workaround for broken installations that depend on using /etc, but were configured differently --- scripts/mysqlaccess.sh | 4 ++++ scripts/mysqld_multi.sh | 3 +++ 2 files changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 22e9d121f9a..bcaf9f8af8e 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -465,6 +465,9 @@ MySQLaccess::Report::Print_Header(); elsif (-f "@sysconfdir@/$script_conf") { require "@sysconfdir@/$script_conf"; } + elsif (-f "/etc/$script_conf") { + require "/etc/$script_conf"; + } # **************************** # Read in all parameters @@ -930,6 +933,7 @@ sub MergeConfigFile { sub MergeConfigFiles { my ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid $<; MergeConfigFile("@sysconfdir@/my.cnf"); + MergeConfigFile("/etc/my.cnf"); MergeConfigFile("$dir/.my.cnf"); } diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index ce778c03206..8b435161e47 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -432,6 +432,9 @@ sub find_groups if (-f "@sysconfdir@/my.cnf" && -r "@sysconfdir@/my.cnf") { open(MY_CNF, "<@sysconfdir@/my.cnf") && (@tmp=) && close(MY_CNF); + } elsif (-f "/etc/my.cnf" && -r "/etc/my.cnf") + { + open(MY_CNF, ") && close(MY_CNF); } for ($i = 0; ($line = shift @tmp); $i++) { -- cgit v1.2.1 From bac65ee90a724278b76b27da12c0728b7427324c Mon Sep 17 00:00:00 2001 From: "tsmith@siva.hindu.god" <> Date: Tue, 9 Jan 2007 19:22:01 -0700 Subject: WL #3670: Compile-time option to remove GRANT-related startup options - configure --disable-grant-options defines DISABLE_GRANT_OPTIONS - configure.js/cmake also updated - if DISABLE_GRANT_OPTIONS is defined, mysqld no longer recognizes: --bootstrap --init-file --skip-grant-tables Scripts which rely on those three options are modified to check the environment for MYSQLD_BOOTSTRAP; it should be set to the full path of a mysqld which does handle those options. For example: $ export MYSQLD_BOOTSTRAP $ MYSQLD_BOOTSTRAP=/path/to/full/MySQL/bin/mysqld $ mysql_install_db $ make test --- scripts/mysql_install_db.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index e43b586054e..53324f59f53 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -224,7 +224,8 @@ if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" fi -mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ +mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" +mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ --skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ -- cgit v1.2.1 From 86890b89190181aff4b58c4110584f29ffaccf75 Mon Sep 17 00:00:00 2001 From: "mmj@tiger.mmj.dk" <> Date: Fri, 12 Jan 2007 01:04:39 +0100 Subject: mysql_explain_log.sh: Patch from Paul DuBois for better help messages --- scripts/mysql_explain_log.sh | 110 ++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 53 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index ad23a42451f..a549817db5a 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -21,9 +21,6 @@ use DBI; use Getopt::Long; $Getopt::Long::ignorecase=0; -print "explain_log provided by http://www.mobile.de\n"; -print "=========== ================================\n"; - my $Param={}; $Param->{host}=''; @@ -32,16 +29,28 @@ $Param->{password}=''; $Param->{PrintError}=0; $Param->{socket}=''; -if (!GetOptions ('date|d:i' => \$Param->{ViewDate}, +my $help; + +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}, + 'help|h' => \$help, )) { ShowOptions(); + exit(0); } -else { +if (defined ($help)) { + ShowOptions(); + exit(0); +} + + print "explain_log provided by http://www.mobile.de\n"; + print "=========== ================================\n"; + $Param->{UpdateCount} = 0; $Param->{SelectCount} = 0; $Param->{IdxUseCount} = 0; @@ -245,7 +254,6 @@ else { print "Finished: \t".localtime(time)."\n"; } -} ########################################################################### @@ -323,21 +331,26 @@ sub ShowOptions { print < Date: Tue, 23 Jan 2007 10:01:56 -0500 Subject: Bug#24496:Fresh install of mysql on windows has anonymous user with root access. - Add anonymous user with no rights. --- scripts/mysql_create_system_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 54f0ef230ad..36efab7d3ea 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -180,7 +180,7 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + INSERT INTO user (host,user) VALUES ('localhost','');" fi fi fi -- cgit v1.2.1 From 58ae89cb766520e8c048bca3710a2398b7fcbd4e Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Fri, 26 Jan 2007 12:00:38 -0800 Subject: User visible change - breaks some environments, per Paul DuBois. Reverting in 4.1 and 5.0. --- scripts/mysqld_multi.sh | 8 -------- 1 file changed, 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 48e64a6b541..54662d2c017 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -437,14 +437,6 @@ sub find_groups { $data[$i] = $line; } - if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf") - { - open(MY_CNF, ") && close(MY_CNF); - } - for (; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") { open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); -- cgit v1.2.1 From e580bd6c6f8e56dcc8566384b53990ffe3b48d2d Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 31 Jan 2007 00:06:42 +0100 Subject: gen_lex_hash.cc: If inserting a GPL header, include a complete one Makefile.am, mysql.dsw, mysql.sln: Removed C version of mysql-test-run mysql.spec.sh: Specify GPL license only in GPL sources .del-my_manage.h: Delete: mysql-test/my_manage.h mysql.spec.sh: Added GPL header .del-mysql_test_run_new.c: Delete: mysql-test/mysql_test_run_new.c .del-mysql_test_run_new.dsp: Delete: VC++Files/mysql-test/mysql_test_run_new.dsp .del-my_create_tables.c: Delete: mysql-test/my_create_tables.c .del-mysql_test_run_new_ia64.dsp: Delete: VC++Files/mysql-test/mysql_test_run_new_ia64.dsp msql2mysql.sh: Use up-to-date GPL header .del-mysql_test_run_new.vcproj: Delete: VC++Files/mysql-test/mysql_test_run_new.vcproj .del-my_manage.c: Delete: mysql-test/my_manage.c --- scripts/msql2mysql.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/msql2mysql.sh b/scripts/msql2mysql.sh index 89a1fcea959..3c802d63705 100644 --- a/scripts/msql2mysql.sh +++ b/scripts/msql2mysql.sh @@ -1,16 +1,18 @@ #!/bin/sh -# Copyright (C) 1979-1996 TcX AB & Monty Program KB & Detron HB +# Copyright (C) 1979-2007 MySQL AB # -# This software is distributed with NO WARRANTY OF ANY KIND. No author or -# distributor accepts any responsibility for the consequences of using it, or -# for whether it serves any particular purpose or works at all, unless he or -# she says so in writing. Refer to the Free Public License (the "License") -# for full details. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. # -# Every copy of this file must include a copy of the License, normally in a -# plain ASCII text file named PUBLIC. The License grants you the right to -# copy, modify and redistribute this file, but only under certain conditions -# described in the License. Among other things, the License requires that -# the copyright notice and this notice be preserved on all copies. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston +# MA 02110-1301 USA. @bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* -- cgit v1.2.1 From 3bb1114647459edec93a7aad2bab73cecc70db72 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Fri, 9 Feb 2007 00:10:40 +0100 Subject: make_binary_distribution.sh: Copy "ndb_size.tmpl" into binary distribution (Bug#24191) --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ba103357f5e..008520ef000 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -340,6 +340,7 @@ if [ x$NDBCLUSTER = x1 ]; then $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. + $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/. $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 rm -rf $BASE/ndb-stage -- cgit v1.2.1 From c550a455227c9390b7e0ad1f9f34807cda2671ab Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 26 Feb 2007 11:49:24 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Use mysql_system_tables.sql to create MySQL system tables in all places where we create them(mysql_install_db, mysql-test-run-pl and mysql_fix_privilege_tables.sql) --- scripts/Makefile.am | 22 +- scripts/mysql_create_system_tables.sh | 779 ------------------------------ scripts/mysql_fix_privilege_tables.sh | 6 +- scripts/mysql_fix_privilege_tables.sql | 573 ---------------------- scripts/mysql_fix_privilege_tables.sql.in | 394 +++++++++++++++ scripts/mysql_install_db.sh | 201 ++++---- scripts/mysql_system_tables.sql | 65 +++ scripts/mysql_test_data_timezone.sql | 5 + 8 files changed, 601 insertions(+), 1444 deletions(-) delete mode 100644 scripts/mysql_create_system_tables.sh delete mode 100644 scripts/mysql_fix_privilege_tables.sql create mode 100644 scripts/mysql_fix_privilege_tables.sql.in create mode 100644 scripts/mysql_system_tables.sql create mode 100644 scripts/mysql_test_data_timezone.sql (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1fad4befe6e..d1c3bd82050 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,8 +32,7 @@ bin_SCRIPTS = @server_scripts@ \ mysql_explain_log \ mysql_tableinfo \ mysql_upgrade_shell \ - mysqld_multi \ - mysql_create_system_tables + mysqld_multi noinst_SCRIPTS = make_binary_distribution \ make_sharedlib_distribution \ @@ -60,15 +59,18 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqld_multi.sh \ mysql_tableinfo.sh \ mysql_upgrade_shell.sh \ - mysqld_safe.sh \ - mysql_create_system_tables.sh + mysqld_safe.sh EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ - make_win_bin_dist + make_win_bin_dist \ + mysql_fix_privilege_tables.sql.in -dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql +dist_pkgdata_DATA = fill_help_tables.sql \ + mysql_fix_privilege_tables.sql \ + mysql_system_tables.sql \ + mysql_test_data_timezone.sql # mysqlbug should be distributed built so that people can report build # failures with it. @@ -99,6 +101,14 @@ DISTCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug mysqlbug: ${top_builddir}/config.status mysqlbug.sh +# Build mysql_fix_privilege_tables.sql from the files that contain +# the system tables for this version of MySQL plus any commands +# needed to upgrade the system tables from an older version +mysql_fix_privilege_tables.sql: mysql_fix_privilege_tables.sql.in \ + mysql_system_tables.sql + @echo "Building $@"; + @cat mysql_system_tables.sql $@.in > $@ + SUFFIXES = .sh .sh: diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh deleted file mode 100644 index 9292b329a3e..00000000000 --- a/scripts/mysql_create_system_tables.sh +++ /dev/null @@ -1,779 +0,0 @@ -#!/bin/sh -# Copyright (C) 1997-2003 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# This script writes on stdout SQL commands to generate all not -# existing MySQL system tables. It also replaces the help tables with -# new context from the manual (from fill_help_tables.sql). - -# $1 - "test" or "real" or "verbose" variant of database -# $2 - path to mysql-database directory -# $3 - hostname -# $4 - windows option - -if test "$1" = "" -then - echo " -This script writes on stdout SQL commands to generate all not -existing MySQL system tables. It also replaces the help tables with -new context from the manual (from fill_help_tables.sql). - -Usage: - mysql_create_system_tables [test|verbose|real] -" - exit -fi - -mdata=$2 -hostname=$3 -windows=$4 - -# Initialize variables -c_d="" i_d="" -c_h="" i_h="" -c_u="" i_u="" -c_f="" i_f="" -c_t="" c_c="" -c_ht="" -c_hc="" -c_hr="" -c_hk="" -i_ht="" -c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" -i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" -c_p="" c_pp="" - -# Check for old tables -if test ! -f $mdata/db.frm -then - if test "$1" = "verbose" ; then - echo "Preparing db table" 1>&2; - fi - - # mysqld --bootstrap wants one command/line - c_d="$c_d CREATE TABLE db (" - c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," - c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," - c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," - c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_d="$c_d PRIMARY KEY Host (Host,Db,User)," - c_d="$c_d KEY User (User)" - c_d="$c_d ) engine=MyISAM" - c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin" - c_d="$c_d comment='Database privileges';" - - i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); - INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');" -fi - -if test ! -f $mdata/host.frm -then - if test "$1" = "verbose" ; then - echo "Preparing host table" 1>&2; - fi - - c_h="$c_h CREATE TABLE host (" - c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," - c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," - c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_h="$c_h PRIMARY KEY Host (Host,Db)" - c_h="$c_h ) engine=MyISAM" - c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" - c_h="$c_h comment='Host privileges; Merged with database privileges';" -fi - -if test ! -f $mdata/user.frm -then - if test "$1" = "verbose" ; then - echo "Preparing user table" 1>&2; - fi - - c_u="$c_u CREATE TABLE user (" - c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," - c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL," - c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_u="$c_u ssl_cipher BLOB NOT NULL," - c_u="$c_u x509_issuer BLOB NOT NULL," - c_u="$c_u x509_subject BLOB NOT NULL," - c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u max_user_connections int(11) unsigned DEFAULT 0 NOT NULL," - c_u="$c_u PRIMARY KEY Host (Host,User)" - c_u="$c_u ) engine=MyISAM" - c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin" - c_u="$c_u comment='Users and global privileges';" - - if test "$1" = "test" - then - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" - else - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);" - if test "$windows" = "0" - then - i_u="$i_u - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - INSERT INTO user (host,user) values ('$hostname',''); - INSERT INTO user (host,user) values ('localhost','');" - else - i_u="$i_u - INSERT INTO user (host,user) VALUES ('localhost','');" - fi - fi -fi - -if test ! -f $mdata/func.frm -then - if test "$1" = "verbose" ; then - echo "Preparing func table" 1>&2; - fi - - c_f="$c_f CREATE TABLE func (" - c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," - c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," - c_f="$c_f dl char(128) DEFAULT '' NOT NULL," - c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL," - c_f="$c_f PRIMARY KEY (name)" - c_f="$c_f ) engine=MyISAM" - c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" - c_f="$c_f comment='User defined functions';" -fi - -if test ! -f $mdata/tables_priv.frm -then - if test "$1" = "verbose" ; then - echo "Preparing tables_priv table" 1>&2; - fi - - c_t="$c_t CREATE TABLE tables_priv (" - c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," - c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL," - c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," - c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," - c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," - c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," - c_t="$c_t KEY Grantor (Grantor)" - c_t="$c_t ) engine=MyISAM" - c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin" - c_t="$c_t comment='Table privileges';" -fi - -if test ! -f $mdata/columns_priv.frm -then - if test "$1" = "verbose" ; then - echo "Preparing columns_priv table" 1>&2; - fi - - c_c="$c_c CREATE TABLE columns_priv (" - c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," - c_c="$c_c Db char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," - c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," - c_c="$c_c Timestamp timestamp(14)," - c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" - c_c="$c_c ) engine=MyISAM" - c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" - c_c="$c_c comment='Column privileges';" -fi - -if test ! -f $mdata/procs_priv.frm -then - if test "$1" = "verbose" ; then - echo "Preparing procs_priv table" 1>&2; - fi - - c_pp="$c_pp CREATE TABLE procs_priv (" - c_pp="$c_pp Host char(60) binary DEFAULT '' NOT NULL," - c_pp="$c_pp Db char(64) binary DEFAULT '' NOT NULL," - c_pp="$c_pp User char(16) binary DEFAULT '' NOT NULL," - c_pp="$c_pp Routine_name char(64) binary DEFAULT '' NOT NULL," - c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL," - c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," - c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," - c_pp="$c_pp Timestamp timestamp(14)," - c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type)," - c_pp="$c_pp KEY Grantor (Grantor)" - c_pp="$c_pp ) engine=MyISAM" - c_pp="$c_pp CHARACTER SET utf8 COLLATE utf8_bin" - c_pp="$c_pp comment='Procedure privileges';" -fi - -if test ! -f $mdata/help_topic.frm -then - if test "$1" = "verbose" ; then - echo "Preparing help_topic table" 1>&2; - fi - - c_ht="$c_ht CREATE TABLE help_topic (" - c_ht="$c_ht help_topic_id int unsigned not null," - c_ht="$c_ht name char(64) not null," - c_ht="$c_ht help_category_id smallint unsigned not null," - c_ht="$c_ht description text not null," - c_ht="$c_ht example text not null," - c_ht="$c_ht url char(128) not null," - c_ht="$c_ht primary key (help_topic_id)," - c_ht="$c_ht unique index (name)" - c_ht="$c_ht ) engine=MyISAM" - c_ht="$c_ht CHARACTER SET utf8" - c_ht="$c_ht comment='help topics';" -fi - -old_categories="yes" - -if test ! -f $mdata/help_category.frm -then - if test "$1" = "verbose" ; then - echo "Preparing help_category table" 1>&2; - fi - - c_hc="$c_hc CREATE TABLE help_category (" - c_hc="$c_hc help_category_id smallint unsigned not null," - c_hc="$c_hc name char(64) not null," - c_hc="$c_hc parent_category_id smallint unsigned null," - c_hc="$c_hc url char(128) not null," - c_hc="$c_hc primary key (help_category_id)," - c_hc="$c_hc unique index (name)" - c_hc="$c_hc ) engine=MyISAM" - c_hc="$c_hc CHARACTER SET utf8" - c_hc="$c_hc comment='help categories';" -fi - -if test ! -f $mdata/help_keyword.frm -then - if test "$1" = "verbose" ; then - echo "Preparing help_keyword table" 1>&2; - fi - - c_hk="$c_hk CREATE TABLE help_keyword (" - c_hk="$c_hk help_keyword_id int unsigned not null," - c_hk="$c_hk name char(64) not null," - c_hk="$c_hk primary key (help_keyword_id)," - c_hk="$c_hk unique index (name)" - c_hk="$c_hk ) engine=MyISAM" - c_hk="$c_hk CHARACTER SET utf8" - c_hk="$c_hk comment='help keywords';" -fi - -if test ! -f $mdata/help_relation.frm -then - if test "$1" = "verbose" ; then - echo "Preparing help_relation table" 1>&2; - fi - - c_hr="$c_hr CREATE TABLE help_relation (" - c_hr="$c_hr help_topic_id int unsigned not null references help_topic," - c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword," - c_hr="$c_hr primary key (help_keyword_id, help_topic_id)" - c_hr="$c_hr ) engine=MyISAM" - c_hr="$c_hr CHARACTER SET utf8" - c_hr="$c_hr comment='keyword-topic relation';" -fi - -if test ! -f $mdata/time_zone_name.frm -then - if test "$1" = "verbose" ; then - echo "Preparing time_zone_name table" 1>&2; - fi - - c_tzn="$c_tzn CREATE TABLE time_zone_name (" - c_tzn="$c_tzn Name char(64) NOT NULL," - c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," - c_tzn="$c_tzn PRIMARY KEY Name (Name)" - c_tzn="$c_tzn ) engine=MyISAM CHARACTER SET utf8" - c_tzn="$c_tzn comment='Time zone names';" - - if test "$1" = "test" - then - i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" - i_tzn="$i_tzn ('MET', 1), ('UTC', 2), ('Universal', 2), " - i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4), " - i_tzn="$i_tzn ('Japan', 5);" - fi -fi - -if test ! -f $mdata/time_zone.frm -then - if test "$1" = "verbose" ; then - echo "Preparing time_zone table" 1>&2; - fi - - c_tz="$c_tz CREATE TABLE time_zone (" - c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," - c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," - c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" - c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8" - c_tz="$c_tz comment='Time zones';" - - if test "$1" = "test" - then - i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" - i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');" - fi -fi - -if test ! -f $mdata/time_zone_transition.frm -then - if test "$1" = "verbose" ; then - echo "Preparing time_zone_transition table" 1>&2; - fi - - c_tzt="$c_tzt CREATE TABLE time_zone_transition (" - c_tzt="$c_tzt Time_zone_id int unsigned NOT NULL," - c_tzt="$c_tzt Transition_time bigint signed NOT NULL," - c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," - c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" - c_tzt="$c_tzt ) engine=MyISAM CHARACTER SET utf8" - c_tzt="$c_tzt comment='Time zone transitions';" - - if test "$1" = "test" - then - i_tzt="$i_tzt INSERT INTO time_zone_transition" - i_tzt="$i_tzt (Time_zone_id, Transition_time, Transition_type_id)" - i_tzt="$i_tzt VALUES" - i_tzt="$i_tzt (1, -1693706400, 0) ,(1, -1680483600, 1)" - i_tzt="$i_tzt ,(1, -1663455600, 2) ,(1, -1650150000, 3)" - i_tzt="$i_tzt ,(1, -1632006000, 2) ,(1, -1618700400, 3)" - i_tzt="$i_tzt ,(1, -938905200, 2) ,(1, -857257200, 3)" - i_tzt="$i_tzt ,(1, -844556400, 2) ,(1, -828226800, 3)" - i_tzt="$i_tzt ,(1, -812502000, 2) ,(1, -796777200, 3)" - i_tzt="$i_tzt ,(1, 228877200, 2) ,(1, 243997200, 3)" - i_tzt="$i_tzt ,(1, 260326800, 2) ,(1, 276051600, 3)" - i_tzt="$i_tzt ,(1, 291776400, 2) ,(1, 307501200, 3)" - i_tzt="$i_tzt ,(1, 323830800, 2) ,(1, 338950800, 3)" - i_tzt="$i_tzt ,(1, 354675600, 2) ,(1, 370400400, 3)" - i_tzt="$i_tzt ,(1, 386125200, 2) ,(1, 401850000, 3)" - i_tzt="$i_tzt ,(1, 417574800, 2) ,(1, 433299600, 3)" - i_tzt="$i_tzt ,(1, 449024400, 2) ,(1, 465354000, 3)" - i_tzt="$i_tzt ,(1, 481078800, 2) ,(1, 496803600, 3)" - i_tzt="$i_tzt ,(1, 512528400, 2) ,(1, 528253200, 3)" - i_tzt="$i_tzt ,(1, 543978000, 2) ,(1, 559702800, 3)" - i_tzt="$i_tzt ,(1, 575427600, 2) ,(1, 591152400, 3)" - i_tzt="$i_tzt ,(1, 606877200, 2) ,(1, 622602000, 3)" - i_tzt="$i_tzt ,(1, 638326800, 2) ,(1, 654656400, 3)" - i_tzt="$i_tzt ,(1, 670381200, 2) ,(1, 686106000, 3)" - i_tzt="$i_tzt ,(1, 701830800, 2) ,(1, 717555600, 3)" - i_tzt="$i_tzt ,(1, 733280400, 2) ,(1, 749005200, 3)" - i_tzt="$i_tzt ,(1, 764730000, 2) ,(1, 780454800, 3)" - i_tzt="$i_tzt ,(1, 796179600, 2) ,(1, 811904400, 3)" - i_tzt="$i_tzt ,(1, 828234000, 2) ,(1, 846378000, 3)" - i_tzt="$i_tzt ,(1, 859683600, 2) ,(1, 877827600, 3)" - i_tzt="$i_tzt ,(1, 891133200, 2) ,(1, 909277200, 3)" - i_tzt="$i_tzt ,(1, 922582800, 2) ,(1, 941331600, 3)" - i_tzt="$i_tzt ,(1, 954032400, 2) ,(1, 972781200, 3)" - i_tzt="$i_tzt ,(1, 985482000, 2) ,(1, 1004230800, 3)" - i_tzt="$i_tzt ,(1, 1017536400, 2) ,(1, 1035680400, 3)" - i_tzt="$i_tzt ,(1, 1048986000, 2) ,(1, 1067130000, 3)" - i_tzt="$i_tzt ,(1, 1080435600, 2) ,(1, 1099184400, 3)" - i_tzt="$i_tzt ,(1, 1111885200, 2) ,(1, 1130634000, 3)" - i_tzt="$i_tzt ,(1, 1143334800, 2) ,(1, 1162083600, 3)" - i_tzt="$i_tzt ,(1, 1174784400, 2) ,(1, 1193533200, 3)" - i_tzt="$i_tzt ,(1, 1206838800, 2) ,(1, 1224982800, 3)" - i_tzt="$i_tzt ,(1, 1238288400, 2) ,(1, 1256432400, 3)" - i_tzt="$i_tzt ,(1, 1269738000, 2) ,(1, 1288486800, 3)" - i_tzt="$i_tzt ,(1, 1301187600, 2) ,(1, 1319936400, 3)" - i_tzt="$i_tzt ,(1, 1332637200, 2) ,(1, 1351386000, 3)" - i_tzt="$i_tzt ,(1, 1364691600, 2) ,(1, 1382835600, 3)" - i_tzt="$i_tzt ,(1, 1396141200, 2) ,(1, 1414285200, 3)" - i_tzt="$i_tzt ,(1, 1427590800, 2) ,(1, 1445734800, 3)" - i_tzt="$i_tzt ,(1, 1459040400, 2) ,(1, 1477789200, 3)" - i_tzt="$i_tzt ,(1, 1490490000, 2) ,(1, 1509238800, 3)" - i_tzt="$i_tzt ,(1, 1521939600, 2) ,(1, 1540688400, 3)" - i_tzt="$i_tzt ,(1, 1553994000, 2) ,(1, 1572138000, 3)" - i_tzt="$i_tzt ,(1, 1585443600, 2) ,(1, 1603587600, 3)" - i_tzt="$i_tzt ,(1, 1616893200, 2) ,(1, 1635642000, 3)" - i_tzt="$i_tzt ,(1, 1648342800, 2) ,(1, 1667091600, 3)" - i_tzt="$i_tzt ,(1, 1679792400, 2) ,(1, 1698541200, 3)" - i_tzt="$i_tzt ,(1, 1711846800, 2) ,(1, 1729990800, 3)" - i_tzt="$i_tzt ,(1, 1743296400, 2) ,(1, 1761440400, 3)" - i_tzt="$i_tzt ,(1, 1774746000, 2) ,(1, 1792890000, 3)" - i_tzt="$i_tzt ,(1, 1806195600, 2) ,(1, 1824944400, 3)" - i_tzt="$i_tzt ,(1, 1837645200, 2) ,(1, 1856394000, 3)" - i_tzt="$i_tzt ,(1, 1869094800, 2) ,(1, 1887843600, 3)" - i_tzt="$i_tzt ,(1, 1901149200, 2) ,(1, 1919293200, 3)" - i_tzt="$i_tzt ,(1, 1932598800, 2) ,(1, 1950742800, 3)" - i_tzt="$i_tzt ,(1, 1964048400, 2) ,(1, 1982797200, 3)" - i_tzt="$i_tzt ,(1, 1995498000, 2) ,(1, 2014246800, 3)" - i_tzt="$i_tzt ,(1, 2026947600, 2) ,(1, 2045696400, 3)" - i_tzt="$i_tzt ,(1, 2058397200, 2) ,(1, 2077146000, 3)" - i_tzt="$i_tzt ,(1, 2090451600, 2) ,(1, 2108595600, 3)" - i_tzt="$i_tzt ,(1, 2121901200, 2) ,(1, 2140045200, 3)" - i_tzt="$i_tzt ,(3, -1688265000, 2) ,(3, -1656819048, 1)" - i_tzt="$i_tzt ,(3, -1641353448, 2) ,(3, -1627965048, 3)" - i_tzt="$i_tzt ,(3, -1618716648, 1) ,(3, -1596429048, 3)" - i_tzt="$i_tzt ,(3, -1593829848, 5) ,(3, -1589860800, 4)" - i_tzt="$i_tzt ,(3, -1542427200, 5) ,(3, -1539493200, 6)" - i_tzt="$i_tzt ,(3, -1525323600, 5) ,(3, -1522728000, 4)" - i_tzt="$i_tzt ,(3, -1491188400, 7) ,(3, -1247536800, 4)" - i_tzt="$i_tzt ,(3, 354920400, 5) ,(3, 370728000, 4)" - i_tzt="$i_tzt ,(3, 386456400, 5) ,(3, 402264000, 4)" - i_tzt="$i_tzt ,(3, 417992400, 5) ,(3, 433800000, 4)" - i_tzt="$i_tzt ,(3, 449614800, 5) ,(3, 465346800, 8)" - i_tzt="$i_tzt ,(3, 481071600, 9) ,(3, 496796400, 8)" - i_tzt="$i_tzt ,(3, 512521200, 9) ,(3, 528246000, 8)" - i_tzt="$i_tzt ,(3, 543970800, 9) ,(3, 559695600, 8)" - i_tzt="$i_tzt ,(3, 575420400, 9) ,(3, 591145200, 8)" - i_tzt="$i_tzt ,(3, 606870000, 9) ,(3, 622594800, 8)" - i_tzt="$i_tzt ,(3, 638319600, 9) ,(3, 654649200, 8)" - i_tzt="$i_tzt ,(3, 670374000, 10) ,(3, 686102400, 11)" - i_tzt="$i_tzt ,(3, 695779200, 8) ,(3, 701812800, 5)" - i_tzt="$i_tzt ,(3, 717534000, 4) ,(3, 733273200, 9)" - i_tzt="$i_tzt ,(3, 748998000, 8) ,(3, 764722800, 9)" - i_tzt="$i_tzt ,(3, 780447600, 8) ,(3, 796172400, 9)" - i_tzt="$i_tzt ,(3, 811897200, 8) ,(3, 828226800, 9)" - i_tzt="$i_tzt ,(3, 846370800, 8) ,(3, 859676400, 9)" - i_tzt="$i_tzt ,(3, 877820400, 8) ,(3, 891126000, 9)" - i_tzt="$i_tzt ,(3, 909270000, 8) ,(3, 922575600, 9)" - i_tzt="$i_tzt ,(3, 941324400, 8) ,(3, 954025200, 9)" - i_tzt="$i_tzt ,(3, 972774000, 8) ,(3, 985474800, 9)" - i_tzt="$i_tzt ,(3, 1004223600, 8) ,(3, 1017529200, 9)" - i_tzt="$i_tzt ,(3, 1035673200, 8) ,(3, 1048978800, 9)" - i_tzt="$i_tzt ,(3, 1067122800, 8) ,(3, 1080428400, 9)" - i_tzt="$i_tzt ,(3, 1099177200, 8) ,(3, 1111878000, 9)" - i_tzt="$i_tzt ,(3, 1130626800, 8) ,(3, 1143327600, 9)" - i_tzt="$i_tzt ,(3, 1162076400, 8) ,(3, 1174777200, 9)" - i_tzt="$i_tzt ,(3, 1193526000, 8) ,(3, 1206831600, 9)" - i_tzt="$i_tzt ,(3, 1224975600, 8) ,(3, 1238281200, 9)" - i_tzt="$i_tzt ,(3, 1256425200, 8) ,(3, 1269730800, 9)" - i_tzt="$i_tzt ,(3, 1288479600, 8) ,(3, 1301180400, 9)" - i_tzt="$i_tzt ,(3, 1319929200, 8) ,(3, 1332630000, 9)" - i_tzt="$i_tzt ,(3, 1351378800, 8) ,(3, 1364684400, 9)" - i_tzt="$i_tzt ,(3, 1382828400, 8) ,(3, 1396134000, 9)" - i_tzt="$i_tzt ,(3, 1414278000, 8) ,(3, 1427583600, 9)" - i_tzt="$i_tzt ,(3, 1445727600, 8) ,(3, 1459033200, 9)" - i_tzt="$i_tzt ,(3, 1477782000, 8) ,(3, 1490482800, 9)" - i_tzt="$i_tzt ,(3, 1509231600, 8) ,(3, 1521932400, 9)" - i_tzt="$i_tzt ,(3, 1540681200, 8) ,(3, 1553986800, 9)" - i_tzt="$i_tzt ,(3, 1572130800, 8) ,(3, 1585436400, 9)" - i_tzt="$i_tzt ,(3, 1603580400, 8) ,(3, 1616886000, 9)" - i_tzt="$i_tzt ,(3, 1635634800, 8) ,(3, 1648335600, 9)" - i_tzt="$i_tzt ,(3, 1667084400, 8) ,(3, 1679785200, 9)" - i_tzt="$i_tzt ,(3, 1698534000, 8) ,(3, 1711839600, 9)" - i_tzt="$i_tzt ,(3, 1729983600, 8) ,(3, 1743289200, 9)" - i_tzt="$i_tzt ,(3, 1761433200, 8) ,(3, 1774738800, 9)" - i_tzt="$i_tzt ,(3, 1792882800, 8) ,(3, 1806188400, 9)" - i_tzt="$i_tzt ,(3, 1824937200, 8) ,(3, 1837638000, 9)" - i_tzt="$i_tzt ,(3, 1856386800, 8) ,(3, 1869087600, 9)" - i_tzt="$i_tzt ,(3, 1887836400, 8) ,(3, 1901142000, 9)" - i_tzt="$i_tzt ,(3, 1919286000, 8) ,(3, 1932591600, 9)" - i_tzt="$i_tzt ,(3, 1950735600, 8) ,(3, 1964041200, 9)" - i_tzt="$i_tzt ,(3, 1982790000, 8) ,(3, 1995490800, 9)" - i_tzt="$i_tzt ,(3, 2014239600, 8) ,(3, 2026940400, 9)" - i_tzt="$i_tzt ,(3, 2045689200, 8) ,(3, 2058390000, 9)" - i_tzt="$i_tzt ,(3, 2077138800, 8) ,(3, 2090444400, 9)" - i_tzt="$i_tzt ,(3, 2108588400, 8) ,(3, 2121894000, 9)" - i_tzt="$i_tzt ,(3, 2140038000, 8)" - i_tzt="$i_tzt ,(4, -1688265000, 2) ,(4, -1656819048, 1)" - i_tzt="$i_tzt ,(4, -1641353448, 2) ,(4, -1627965048, 3)" - i_tzt="$i_tzt ,(4, -1618716648, 1) ,(4, -1596429048, 3)" - i_tzt="$i_tzt ,(4, -1593829848, 5) ,(4, -1589860800, 4)" - i_tzt="$i_tzt ,(4, -1542427200, 5) ,(4, -1539493200, 6)" - i_tzt="$i_tzt ,(4, -1525323600, 5) ,(4, -1522728000, 4)" - i_tzt="$i_tzt ,(4, -1491188400, 7) ,(4, -1247536800, 4)" - i_tzt="$i_tzt ,(4, 354920409, 5) ,(4, 370728010, 4)" - i_tzt="$i_tzt ,(4, 386456410, 5) ,(4, 402264011, 4)" - i_tzt="$i_tzt ,(4, 417992411, 5) ,(4, 433800012, 4)" - i_tzt="$i_tzt ,(4, 449614812, 5) ,(4, 465346812, 8)" - i_tzt="$i_tzt ,(4, 481071612, 9) ,(4, 496796413, 8)" - i_tzt="$i_tzt ,(4, 512521213, 9) ,(4, 528246013, 8)" - i_tzt="$i_tzt ,(4, 543970813, 9) ,(4, 559695613, 8)" - i_tzt="$i_tzt ,(4, 575420414, 9) ,(4, 591145214, 8)" - i_tzt="$i_tzt ,(4, 606870014, 9) ,(4, 622594814, 8)" - i_tzt="$i_tzt ,(4, 638319615, 9) ,(4, 654649215, 8)" - i_tzt="$i_tzt ,(4, 670374016, 10) ,(4, 686102416, 11)" - i_tzt="$i_tzt ,(4, 695779216, 8) ,(4, 701812816, 5)" - i_tzt="$i_tzt ,(4, 717534017, 4) ,(4, 733273217, 9)" - i_tzt="$i_tzt ,(4, 748998018, 8) ,(4, 764722818, 9)" - i_tzt="$i_tzt ,(4, 780447619, 8) ,(4, 796172419, 9)" - i_tzt="$i_tzt ,(4, 811897219, 8) ,(4, 828226820, 9)" - i_tzt="$i_tzt ,(4, 846370820, 8) ,(4, 859676420, 9)" - i_tzt="$i_tzt ,(4, 877820421, 8) ,(4, 891126021, 9)" - i_tzt="$i_tzt ,(4, 909270021, 8) ,(4, 922575622, 9)" - i_tzt="$i_tzt ,(4, 941324422, 8) ,(4, 954025222, 9)" - i_tzt="$i_tzt ,(4, 972774022, 8) ,(4, 985474822, 9)" - i_tzt="$i_tzt ,(4, 1004223622, 8) ,(4, 1017529222, 9)" - i_tzt="$i_tzt ,(4, 1035673222, 8) ,(4, 1048978822, 9)" - i_tzt="$i_tzt ,(4, 1067122822, 8) ,(4, 1080428422, 9)" - i_tzt="$i_tzt ,(4, 1099177222, 8) ,(4, 1111878022, 9)" - i_tzt="$i_tzt ,(4, 1130626822, 8) ,(4, 1143327622, 9)" - i_tzt="$i_tzt ,(4, 1162076422, 8) ,(4, 1174777222, 9)" - i_tzt="$i_tzt ,(4, 1193526022, 8) ,(4, 1206831622, 9)" - i_tzt="$i_tzt ,(4, 1224975622, 8) ,(4, 1238281222, 9)" - i_tzt="$i_tzt ,(4, 1256425222, 8) ,(4, 1269730822, 9)" - i_tzt="$i_tzt ,(4, 1288479622, 8) ,(4, 1301180422, 9)" - i_tzt="$i_tzt ,(4, 1319929222, 8) ,(4, 1332630022, 9)" - i_tzt="$i_tzt ,(4, 1351378822, 8) ,(4, 1364684422, 9)" - i_tzt="$i_tzt ,(4, 1382828422, 8) ,(4, 1396134022, 9)" - i_tzt="$i_tzt ,(4, 1414278022, 8) ,(4, 1427583622, 9)" - i_tzt="$i_tzt ,(4, 1445727622, 8) ,(4, 1459033222, 9)" - i_tzt="$i_tzt ,(4, 1477782022, 8) ,(4, 1490482822, 9)" - i_tzt="$i_tzt ,(4, 1509231622, 8) ,(4, 1521932422, 9)" - i_tzt="$i_tzt ,(4, 1540681222, 8) ,(4, 1553986822, 9)" - i_tzt="$i_tzt ,(4, 1572130822, 8) ,(4, 1585436422, 9)" - i_tzt="$i_tzt ,(4, 1603580422, 8) ,(4, 1616886022, 9)" - i_tzt="$i_tzt ,(4, 1635634822, 8) ,(4, 1648335622, 9)" - i_tzt="$i_tzt ,(4, 1667084422, 8) ,(4, 1679785222, 9)" - i_tzt="$i_tzt ,(4, 1698534022, 8) ,(4, 1711839622, 9)" - i_tzt="$i_tzt ,(4, 1729983622, 8) ,(4, 1743289222, 9)" - i_tzt="$i_tzt ,(4, 1761433222, 8) ,(4, 1774738822, 9)" - i_tzt="$i_tzt ,(4, 1792882822, 8) ,(4, 1806188422, 9)" - i_tzt="$i_tzt ,(4, 1824937222, 8) ,(4, 1837638022, 9)" - i_tzt="$i_tzt ,(4, 1856386822, 8) ,(4, 1869087622, 9)" - i_tzt="$i_tzt ,(4, 1887836422, 8) ,(4, 1901142022, 9)" - i_tzt="$i_tzt ,(4, 1919286022, 8) ,(4, 1932591622, 9)" - i_tzt="$i_tzt ,(4, 1950735622, 8) ,(4, 1964041222, 9)" - i_tzt="$i_tzt ,(4, 1982790022, 8) ,(4, 1995490822, 9)" - i_tzt="$i_tzt ,(4, 2014239622, 8) ,(4, 2026940422, 9)" - i_tzt="$i_tzt ,(4, 2045689222, 8) ,(4, 2058390022, 9)" - i_tzt="$i_tzt ,(4, 2077138822, 8) ,(4, 2090444422, 9)" - i_tzt="$i_tzt ,(4, 2108588422, 8) ,(4, 2121894022, 9)" - i_tzt="$i_tzt ,(4, 2140038022, 8)" - i_tzt="$i_tzt ,(5, -1009875600, 1);" - fi -fi - -if test ! -f $mdata/time_zone_transition_type.frm -then - if test "$1" = "verbose" ; then - echo "Preparing time_zone_transition_type table" 1>&2; - fi - - c_tztt="$c_tztt CREATE TABLE time_zone_transition_type (" - c_tztt="$c_tztt Time_zone_id int unsigned NOT NULL," - c_tztt="$c_tztt Transition_type_id int unsigned NOT NULL," - c_tztt="$c_tztt Offset int signed DEFAULT 0 NOT NULL," - c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," - c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," - c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" - c_tztt="$c_tztt ) engine=MyISAM CHARACTER SET utf8" - c_tztt="$c_tztt comment='Time zone transition types';" - - if test "$1" = "test" - then - i_tztt="$i_tztt INSERT INTO time_zone_transition_type (Time_zone_id," - i_tztt="$i_tztt Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" - i_tztt="$i_tztt (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" - i_tztt="$i_tztt ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" - i_tztt="$i_tztt ,(2, 0, 0, 0, 'UTC')" - i_tztt="$i_tztt ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" - i_tztt="$i_tztt ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" - i_tztt="$i_tztt ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" - i_tztt="$i_tztt ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" - i_tztt="$i_tztt ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" - i_tztt="$i_tztt ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" - i_tztt="$i_tztt ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" - i_tztt="$i_tztt ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" - i_tztt="$i_tztt ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" - i_tztt="$i_tztt ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" - i_tztt="$i_tztt ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" - i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" - i_tztt="$i_tztt ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');" - fi -fi - -if test ! -f $mdata/time_zone_leap_second.frm -then - if test "$1" = "verbose" ; then - echo "Preparing time_zone_leap_second table" 1>&2; - fi - - c_tzls="$c_tzls CREATE TABLE time_zone_leap_second (" - c_tzls="$c_tzls Transition_time bigint signed NOT NULL," - c_tzls="$c_tzls Correction int signed NOT NULL," - c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" - c_tzls="$c_tzls ) engine=MyISAM CHARACTER SET utf8" - c_tzls="$c_tzls comment='Leap seconds information for time zones';" - - if test "$1" = "test" - then - i_tzls="$i_tzls INSERT INTO time_zone_leap_second " - i_tzls="$i_tzls (Transition_time, Correction) VALUES " - i_tzls="$i_tzls (78796800, 1) ,(94694401, 2) ,(126230402, 3)" - i_tzls="$i_tzls ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)" - i_tzls="$i_tzls ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)" - i_tzls="$i_tzls ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)" - i_tzls="$i_tzls ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)" - i_tzls="$i_tzls ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)" - i_tzls="$i_tzls ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)" - i_tzls="$i_tzls ,(915148821, 22);" - fi -fi - -if test ! -f $mdata/proc.frm -then - c_p="$c_p CREATE TABLE proc (" - c_p="$c_p db char(64) collate utf8_bin DEFAULT '' NOT NULL," - c_p="$c_p name char(64) DEFAULT '' NOT NULL," - c_p="$c_p type enum('FUNCTION','PROCEDURE') NOT NULL," - c_p="$c_p specific_name char(64) DEFAULT '' NOT NULL," - c_p="$c_p language enum('SQL') DEFAULT 'SQL' NOT NULL," - c_p="$c_p sql_data_access enum('CONTAINS_SQL'," - c_p="$c_p 'NO_SQL'," - c_p="$c_p 'READS_SQL_DATA'," - c_p="$c_p 'MODIFIES_SQL_DATA'" - c_p="$c_p ) DEFAULT 'CONTAINS_SQL' NOT NULL," - c_p="$c_p is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL," - c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," - c_p="$c_p param_list blob DEFAULT '' NOT NULL," - c_p="$c_p returns char(64) DEFAULT '' NOT NULL," - c_p="$c_p body longblob DEFAULT '' NOT NULL," - c_p="$c_p definer char(77) collate utf8_bin DEFAULT '' NOT NULL," - c_p="$c_p created timestamp," - c_p="$c_p modified timestamp," - c_p="$c_p sql_mode set(" - c_p="$c_p 'REAL_AS_FLOAT'," - c_p="$c_p 'PIPES_AS_CONCAT'," - c_p="$c_p 'ANSI_QUOTES'," - c_p="$c_p 'IGNORE_SPACE'," - c_p="$c_p 'NOT_USED'," - c_p="$c_p 'ONLY_FULL_GROUP_BY'," - c_p="$c_p 'NO_UNSIGNED_SUBTRACTION'," - c_p="$c_p 'NO_DIR_IN_CREATE'," - c_p="$c_p 'POSTGRESQL'," - c_p="$c_p 'ORACLE'," - c_p="$c_p 'MSSQL'," - c_p="$c_p 'DB2'," - c_p="$c_p 'MAXDB'," - c_p="$c_p 'NO_KEY_OPTIONS'," - c_p="$c_p 'NO_TABLE_OPTIONS'," - c_p="$c_p 'NO_FIELD_OPTIONS'," - c_p="$c_p 'MYSQL323'," - c_p="$c_p 'MYSQL40'," - c_p="$c_p 'ANSI'," - c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'," - c_p="$c_p 'NO_BACKSLASH_ESCAPES'," - c_p="$c_p 'STRICT_TRANS_TABLES'," - c_p="$c_p 'STRICT_ALL_TABLES'," - c_p="$c_p 'NO_ZERO_IN_DATE'," - c_p="$c_p 'NO_ZERO_DATE'," - c_p="$c_p 'INVALID_DATES'," - c_p="$c_p 'ERROR_FOR_DIVISION_BY_ZERO'," - c_p="$c_p 'TRADITIONAL'," - c_p="$c_p 'NO_AUTO_CREATE_USER'," - c_p="$c_p 'HIGH_NOT_PRECEDENCE'" - c_p="$c_p ) DEFAULT '' NOT NULL," - c_p="$c_p comment char(64) collate utf8_bin DEFAULT '' NOT NULL," - c_p="$c_p PRIMARY KEY (db,name,type)" - c_p="$c_p ) engine=MyISAM" - c_p="$c_p character set utf8" - c_p="$c_p comment='Stored Procedures';" -fi - -cat << END_OF_DATA -use mysql; -set table_type=myisam; -$c_d -$i_d - -$c_h -$i_h - -$c_u -$i_u - -$c_f -$i_f - -$c_t -$c_c - -$c_ht -$c_hc -$c_hr -$c_hk - -$c_tzn -$i_tzn -$c_tz -$i_tz -$c_tzt -$i_tzt -$c_tztt -$i_tztt -$c_tzls -$i_tzls - -$c_p -$c_pp - -END_OF_DATA - diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 5493f8fdb4f..a353273dc28 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -175,11 +175,7 @@ s_echo() } s_echo "This script updates all the mysql privilege tables to be usable by" -s_echo "MySQL 4.0 and above." -s_echo "" -s_echo "This is needed if you want to use the new GRANT functions," -s_echo "CREATE AGGREGATE FUNCTION, stored procedures, or" -s_echo "more secure passwords in 4.1" +s_echo "the current version of MySQL" s_echo "" if test $verbose = 1 diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql deleted file mode 100644 index 5709fb96793..00000000000 --- a/scripts/mysql_fix_privilege_tables.sql +++ /dev/null @@ -1,573 +0,0 @@ --- This script converts any old privilege tables to privilege tables suitable --- for MySQL 4.1 - --- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" --- because these just mean that your tables are already up to date. --- This script is safe to run even if your tables are already up to date! - --- On unix, you should use the mysql_fix_privilege_tables script to execute --- this sql script. --- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' - -set storage_engine=MyISAM; - -CREATE TABLE IF NOT EXISTS func ( - name char(64) binary DEFAULT '' NOT NULL, - ret tinyint(1) DEFAULT '0' NOT NULL, - dl char(128) DEFAULT '' NOT NULL, - type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, - PRIMARY KEY (name) -) CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; - --- Detect whether or not we had the Grant_priv column -SET @hadGrantPriv:=0; -SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; - -ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; - --- Fix privileges for old tables -UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; -UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; -UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; - --- --- The second alter changes ssl_type to new 4.0.2 format --- Adding columns needed by GRANT .. REQUIRE (openssl)" - -ALTER TABLE user -ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, -ADD ssl_cipher BLOB NOT NULL, -ADD x509_issuer BLOB NOT NULL, -ADD x509_subject BLOB NOT NULL; -ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; - --- --- tables_priv --- -CREATE TABLE IF NOT EXISTS tables_priv ( - Host char(60) binary DEFAULT '' NOT NULL, - Db char(64) binary DEFAULT '' NOT NULL, - User char(16) binary DEFAULT '' NOT NULL, - Table_name char(64) binary DEFAULT '' NOT NULL, - Grantor char(77) DEFAULT '' NOT NULL, - Timestamp timestamp(14), - Table_priv set('Select','Insert','Update','Delete','Create', - 'Drop','Grant','References','Index','Alter') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - PRIMARY KEY (Host,Db,User,Table_name) -) CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE tables_priv - ADD KEY Grantor (Grantor); - -ALTER TABLE tables_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Grantor char(77) NOT NULL default '', - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE tables_priv - MODIFY Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - MODIFY Table_priv set('Select','Insert','Update','Delete','Create', - 'Drop','Grant','References','Index','Alter', - 'Create View','Show view') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - COMMENT='Table privileges'; - --- --- columns_priv --- -CREATE TABLE IF NOT EXISTS columns_priv ( - Host char(60) DEFAULT '' NOT NULL, - Db char(64) DEFAULT '' NOT NULL, - User char(16) DEFAULT '' NOT NULL, - Table_name char(64) DEFAULT '' NOT NULL, - Column_name char(64) DEFAULT '' NOT NULL, - Timestamp timestamp(14), - Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, - PRIMARY KEY (Host,Db,User,Table_name,Column_name) -) CHARACTER SET utf8 COLLATE utf8_bin; - --- Name change of Type -> Column_priv from MySQL 3.22.12 -ALTER TABLE columns_priv - CHANGE Type Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE columns_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Column_name char(64) NOT NULL default '', - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin, - COMMENT='Column privileges'; - -ALTER TABLE columns_priv - MODIFY Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - --- --- Add the new 'type' column to the func table. --- - -ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; - --- --- Change the user,db and host tables to current format --- - -# Detect whether we had Show_db_priv -SET @hadShowDbPriv:=0; -SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; - -ALTER TABLE user -ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, -ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, -ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; - --- Convert privileges so that users have similar privileges as before - -UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; - - --- Add fields that can be used to limit number of questions and connections --- for some users. - -ALTER TABLE user -ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, -ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, -ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; - - --- --- Add Create_tmp_table_priv and Lock_tables_priv to db and host --- - -ALTER TABLE db -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -ALTER TABLE host -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; - - -alter table db comment='Database privileges'; -alter table host comment='Host privileges; Merged with database privileges'; -alter table user comment='Users and global privileges'; -alter table func comment='User defined functions'; - --- Convert all tables to UTF-8 with binary collation --- and reset all char columns to correct width -ALTER TABLE user - MODIFY Host char(60) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user - MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE db - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -ALTER TABLE host - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -ALTER TABLE func - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func - MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; - -# -# Detect whether we had Create_view_priv -# -SET @hadCreateViewPriv:=0; -SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; - -# -# Create VIEWs privileges (v5.0) -# -ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; - -ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; - -ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; -ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; - -# -# Show VIEWs privileges (v5.0) -# -ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -# -# Assign create/show view privileges to people who have create provileges -# -UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; - -# -# -# -SET @hadCreateRoutinePriv:=0; -SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; - -# -# Create PROCEDUREs privileges (v5.0) -# -ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -# -# Alter PROCEDUREs privileges (v5.0) -# -ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; - -ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; - -# -# Assign create/alter routine privileges to people who have create privileges -# -UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; -UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; -UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0; - -# -# Add max_user_connections resource limit -# -ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; - -# -# user.Create_user_priv -# - -SET @hadCreateUserPriv:=0; -SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; - -ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' - WHERE @hadCreateUserPriv = 0 AND - (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); - --- --- procs_priv --- -CREATE TABLE IF NOT EXISTS procs_priv ( - Host char(60) binary DEFAULT '' NOT NULL, - Db char(64) binary DEFAULT '' NOT NULL, - User char(16) binary DEFAULT '' NOT NULL, - Routine_name char(64) binary DEFAULT '' NOT NULL, - Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, - Grantor char(77) DEFAULT '' NOT NULL, - Proc_priv set('Execute','Alter Routine','Grant') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - Timestamp timestamp(14), - PRIMARY KEY (Host, Db, User, Routine_name, Routine_type), - KEY Grantor (Grantor) -) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; - -ALTER TABLE procs_priv - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE procs_priv - MODIFY Proc_priv set('Execute','Alter Routine','Grant') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE procs_priv - ADD Routine_type enum('FUNCTION','PROCEDURE') - COLLATE utf8_general_ci NOT NULL AFTER Routine_name; - -ALTER TABLE procs_priv - MODIFY Timestamp timestamp(14) AFTER Proc_priv; - --- --- help_topic --- -CREATE TABLE IF NOT EXISTS help_topic ( -help_topic_id int unsigned not null, -name varchar(64) not null, -help_category_id smallint unsigned not null, -description text not null, -example text not null, -url varchar(128) not null, -primary key (help_topic_id), unique index (name) -) CHARACTER SET utf8 comment='help topics'; - -CREATE TABLE IF NOT EXISTS help_category ( -help_category_id smallint unsigned not null, -name varchar(64) not null, -parent_category_id smallint unsigned null, -url varchar(128) not null, -primary key (help_category_id), -unique index (name) -) CHARACTER SET utf8 comment='help categories'; - -CREATE TABLE IF NOT EXISTS help_relation ( -help_topic_id int unsigned not null references help_topic, -help_keyword_id int unsigned not null references help_keyword, -primary key (help_keyword_id, help_topic_id) -) CHARACTER SET utf8 comment='keyword-topic relation'; - -CREATE TABLE IF NOT EXISTS help_keyword ( -help_keyword_id int unsigned not null, -name varchar(64) not null, -primary key (help_keyword_id), -unique index (name) -) CHARACTER SET utf8 comment='help keywords'; - -# -# Create missing time zone related tables -# - -CREATE TABLE IF NOT EXISTS time_zone_name ( -Name char(64) NOT NULL, -Time_zone_id int unsigned NOT NULL, -PRIMARY KEY Name (Name) -) CHARACTER SET utf8 comment='Time zone names'; - -CREATE TABLE IF NOT EXISTS time_zone ( -Time_zone_id int unsigned NOT NULL auto_increment, -Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -PRIMARY KEY TzId (Time_zone_id) -) CHARACTER SET utf8 comment='Time zones'; --- Make enum field case-insensitive -ALTER TABLE time_zone - MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -CREATE TABLE IF NOT EXISTS time_zone_transition ( -Time_zone_id int unsigned NOT NULL, -Transition_time bigint signed NOT NULL, -Transition_type_id int unsigned NOT NULL, -PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) -) CHARACTER SET utf8 comment='Time zone transitions'; - -CREATE TABLE IF NOT EXISTS time_zone_transition_type ( -Time_zone_id int unsigned NOT NULL, -Transition_type_id int unsigned NOT NULL, -Offset int signed DEFAULT 0 NOT NULL, -Is_DST tinyint unsigned DEFAULT 0 NOT NULL, -Abbreviation char(8) DEFAULT '' NOT NULL, -PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) -) CHARACTER SET utf8 comment='Time zone transition types'; - -CREATE TABLE IF NOT EXISTS time_zone_leap_second ( -Transition_time bigint signed NOT NULL, -Correction int signed NOT NULL, -PRIMARY KEY TranTime (Transition_time) -) CHARACTER SET utf8 comment='Leap seconds information for time zones'; - - -# -# Create proc table if it does not exists -# - -CREATE TABLE IF NOT EXISTS proc ( - db char(64) collate utf8_bin DEFAULT '' NOT NULL, - name char(64) DEFAULT '' NOT NULL, - type enum('FUNCTION','PROCEDURE') NOT NULL, - specific_name char(64) DEFAULT '' NOT NULL, - language enum('SQL') DEFAULT 'SQL' NOT NULL, - sql_data_access enum('CONTAINS_SQL', - 'NO_SQL', - 'READS_SQL_DATA', - 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL, - is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, - security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, - param_list blob DEFAULT '' NOT NULL, - returns char(64) DEFAULT '' NOT NULL, - body longblob DEFAULT '' NOT NULL, - definer char(77) collate utf8_bin DEFAULT '' NOT NULL, - created timestamp, - modified timestamp, - sql_mode set( - 'REAL_AS_FLOAT', - 'PIPES_AS_CONCAT', - 'ANSI_QUOTES', - 'IGNORE_SPACE', - 'NOT_USED', - 'ONLY_FULL_GROUP_BY', - 'NO_UNSIGNED_SUBTRACTION', - 'NO_DIR_IN_CREATE', - 'POSTGRESQL', - 'ORACLE', - 'MSSQL', - 'DB2', - 'MAXDB', - 'NO_KEY_OPTIONS', - 'NO_TABLE_OPTIONS', - 'NO_FIELD_OPTIONS', - 'MYSQL323', - 'MYSQL40', - 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO', - 'NO_BACKSLASH_ESCAPES', - 'STRICT_TRANS_TABLES', - 'STRICT_ALL_TABLES', - 'NO_ZERO_IN_DATE', - 'NO_ZERO_DATE', - 'INVALID_DATES', - 'ERROR_FOR_DIVISION_BY_ZERO', - 'TRADITIONAL', - 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL, - comment char(64) collate utf8_bin DEFAULT '' NOT NULL, - PRIMARY KEY (db,name,type) -) engine=MyISAM - character set utf8 - comment='Stored Procedures'; - -# Correct the name fields to not binary, and expand sql_data_access -ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, - MODIFY specific_name char(64) DEFAULT '' NOT NULL, - MODIFY sql_data_access - enum('CONTAINS_SQL', - 'NO_SQL', - 'READS_SQL_DATA', - 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL, - MODIFY body longblob DEFAULT '' NOT NULL, - MODIFY sql_mode - set('REAL_AS_FLOAT', - 'PIPES_AS_CONCAT', - 'ANSI_QUOTES', - 'IGNORE_SPACE', - 'NOT_USED', - 'ONLY_FULL_GROUP_BY', - 'NO_UNSIGNED_SUBTRACTION', - 'NO_DIR_IN_CREATE', - 'POSTGRESQL', - 'ORACLE', - 'MSSQL', - 'DB2', - 'MAXDB', - 'NO_KEY_OPTIONS', - 'NO_TABLE_OPTIONS', - 'NO_FIELD_OPTIONS', - 'MYSQL323', - 'MYSQL40', - 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO', - 'NO_BACKSLASH_ESCAPES', - 'STRICT_TRANS_TABLES', - 'STRICT_ALL_TABLES', - 'NO_ZERO_IN_DATE', - 'NO_ZERO_DATE', - 'INVALID_DATES', - 'ERROR_FOR_DIVISION_BY_ZERO', - 'TRADITIONAL', - 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL, - DEFAULT CHARACTER SET utf8; - -# Correct the character set and collation -ALTER TABLE proc CONVERT TO CHARACTER SET utf8; -# Reset some fields after the conversion -ALTER TABLE proc MODIFY db - char(64) collate utf8_bin DEFAULT '' NOT NULL, - MODIFY definer - char(77) collate utf8_bin DEFAULT '' NOT NULL, - MODIFY comment - char(64) collate utf8_bin DEFAULT '' NOT NULL; - -# Activate the new, possible modified privilege tables -# This should not be needed, but gives us some extra testing that the above -# changes was correct - -flush privileges; diff --git a/scripts/mysql_fix_privilege_tables.sql.in b/scripts/mysql_fix_privilege_tables.sql.in new file mode 100644 index 00000000000..00363b27fdd --- /dev/null +++ b/scripts/mysql_fix_privilege_tables.sql.in @@ -0,0 +1,394 @@ +# This part converts any old privilege tables to privilege tables suitable +# for current version of MySQL + +# You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +# because these just mean that your tables are already up to date. +# This script is safe to run even if your tables are already up to date! + +# On unix, you should use the mysql_fix_privilege_tables script to execute +# this sql script. +# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' + +set storage_engine=MyISAM; + +ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + +# Detect whether or not we had the Grant_priv column +SET @hadGrantPriv:=0; +SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; + +ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + +# Fix privileges for old tables +UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; + +# +# The second alter changes ssl_type to new 4.0.2 format +# Adding columns needed by GRANT .. REQUIRE (openssl)" + +ALTER TABLE user +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, +ADD ssl_cipher BLOB NOT NULL, +ADD x509_issuer BLOB NOT NULL, +ADD x509_subject BLOB NOT NULL; +ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; + +# +# tables_priv +# + +ALTER TABLE tables_priv + ADD KEY Grantor (Grantor); + +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; + +ALTER TABLE tables_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Table_priv set('Select','Insert','Update','Delete','Create', + 'Drop','Grant','References','Index','Alter', + 'Create View','Show view') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + COMMENT='Table privileges'; + +# +# columns_priv +# + +# Name change of Type -> Column_priv from MySQL 3.22.12 +ALTER TABLE columns_priv + CHANGE Type Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin, + COMMENT='Column privileges'; + +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +# +# Add the new 'type' column to the func table. +# + +ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; + +# +# Change the user,db and host tables to current format +# + +# Detect whether we had Show_db_priv +SET @hadShowDbPriv:=0; +SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; + +ALTER TABLE user +ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, +ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; + +# Convert privileges so that users have similar privileges as before + +UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; + + +# Add fields that can be used to limit number of questions and connections +# for some users. + +ALTER TABLE user +ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, +ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, +ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; + + +# +# Add Create_tmp_table_priv and Lock_tables_priv to db and host +# + +ALTER TABLE db +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; + + +alter table db comment='Database privileges'; +alter table host comment='Host privileges; Merged with database privileges'; +alter table user comment='Users and global privileges'; +alter table func comment='User defined functions'; + +# Convert all tables to UTF-8 with binary collation +# and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user + MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; + +# +# Detect whether we had Create_view_priv +# +SET @hadCreateViewPriv:=0; +SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; + +# +# Create VIEWs privileges (v5.0) +# +ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + +ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + +ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; +ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; + +# +# Show VIEWs privileges (v5.0) +# +ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +# +# Assign create/show view privileges to people who have create provileges +# +UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; + +# +# +# +SET @hadCreateRoutinePriv:=0; +SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; + +# +# Create PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +# +# Alter PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + +ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + +# +# Assign create/alter routine privileges to people who have create privileges +# +UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0; + +# +# Add max_user_connections resource limit +# +ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; + +# +# user.Create_user_priv +# + +SET @hadCreateUserPriv:=0; +SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; + +ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' + WHERE @hadCreateUserPriv = 0 AND + (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); + +# +# procs_priv +# + +ALTER TABLE procs_priv + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; + +ALTER TABLE procs_priv + MODIFY Proc_priv set('Execute','Alter Routine','Grant') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE procs_priv + ADD Routine_type enum('FUNCTION','PROCEDURE') + COLLATE utf8_general_ci NOT NULL AFTER Routine_name; + +ALTER TABLE procs_priv + MODIFY Timestamp timestamp(14) AFTER Proc_priv; + +# +# proc +# + +# Correct the name fields to not binary, and expand sql_data_access +ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, + MODIFY specific_name char(64) DEFAULT '' NOT NULL, + MODIFY sql_data_access + enum('CONTAINS_SQL', + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY body longblob DEFAULT '' NOT NULL, + MODIFY sql_mode + set('REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' + ) DEFAULT '' NOT NULL, + DEFAULT CHARACTER SET utf8; + +# Correct the character set and collation +ALTER TABLE proc CONVERT TO CHARACTER SET utf8; +# Reset some fields after the conversion +ALTER TABLE proc MODIFY db + char(64) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY definer + char(77) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY comment + char(64) collate utf8_bin DEFAULT '' NOT NULL; + +# Activate the new, possible modified privilege tables +# This should not be needed, but gives us some extra testing that the above +# changes was correct + +flush privileges; diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 0e89a32aa66..ed5c8c97d6b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -14,8 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This scripts creates the privilege tables db, host, user, tables_priv, -# columns_priv, procs_priv in the mysql database, as well as the func table. +# This scripts creates the MySQL Server system tables # # All unrecognized arguments to this script are passed to mysqld. @@ -30,6 +29,14 @@ case "$1" in ;; esac +s_echo() +{ + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + then + echo $1 + fi +} + parse_arguments() { # We only need to pass arguments through to the server if we don't # handle them here. So, we collect unrecognized options (passed on @@ -53,9 +60,20 @@ parse_arguments() { # where a chown of datadir won't help) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --skip-name-resolve) ip_only=1 ;; - --verbose) verbose=1 ;; + --verbose) verbose=1 ;; # Obsolete --rpm) in_rpm=1 ;; - --windows) windows=1 ;; + + --windows) + # This is actually a "cross bootstrap" argument used when + # building the MySQL system tables on a different host + # than the target. The platform independent + # files that are created in --datadir on the host can + # be copied to the target system, the most common use for + # this feature is in the windows installer which will take + # the files from datadir and include them as part of the install + # package. + windows=1 ;; + *) if test -n "$pick_args" then @@ -93,8 +111,6 @@ bindir= basedir= srcdir= force=0 -verbose=0 -fill_help_tables="" parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -119,29 +135,42 @@ else fi fi -# find fill_help_tables.sh +# Find SQL scripts needed for bootstrap +fill_help_tables="fill_help_tables.sql" +create_system_tables="mysql_system_tables.sql" if test -n "$srcdir" then - fill_help_tables=$srcdir/scripts/fill_help_tables.sql + fill_help_tables=$srcdir/scripts/$fill_help_tables + create_system_tables=$srcdir/scripts/$create_system_tables else for i in $basedir/support-files $basedir/share $basedir/share/mysql \ $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ do - if test -f $i/fill_help_tables.sql + if test -f $i/$fill_help_tables then pkgdatadir=$i fi done - fill_help_tables=$pkgdatadir/fill_help_tables.sql + fill_help_tables=$pkgdatadir/$fill_help_tables + create_system_tables=$pkgdatadir/$create_system_tables +fi + +if test ! -f $create_system_tables +then + echo "FATAL ERROR: Could not find SQL file '$create_system_tables' in" + echo "@pkgdatadir@ or inside $basedir" + exit 1; fi if test ! -f $fill_help_tables then - echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir". + echo "FATAL ERROR: Could not find help file '$fill_help_tables' in" + echo "@pkgdatadir@ or inside $basedir" exit 1; fi +# Find executables and paths mdata=$ldata/mysql mysqld=$execdir/mysqld mysqld_opt="" @@ -167,7 +196,7 @@ then echo "FATAL ERROR $mysqld not found!" exit 1 else - echo "Didn't find $mysqld" + echo "FATAL ERROR Didn't find $mysqld" echo "You should do a 'make install' before executing this script" exit 1 fi @@ -187,9 +216,10 @@ then then echo "Neither host '$hostname' nor 'localhost' could be looked up with" echo "$bindir/resolveip" - echo "Please configure the 'hostname' command to return a correct hostname." - echo "If you want to solve this at a later stage, restart this script with" - echo "the --force option" + echo "Please configure the 'hostname' command to return a correct" + echo "hostname." + echo "If you want to solve this at a later stage, restart this script" + echo "with the --force option" exit 1 fi echo "WARNING: The host '$hostname' could not be looked up with resolveip." @@ -208,104 +238,113 @@ then fi # Create database directories mysql & test - - if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi - if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi - if test ! -d $ldata/test; then mkdir $ldata/test; chmod 700 $ldata/test ; fi - if test -w / -a ! -z "$user"; then - chown $user $ldata $ldata/mysql $ldata/test; - fi - -if test ! -f $mdata/db.frm -then - c_d="yes" +if test ! -d $ldata; then + mkdir $ldata; + chmod 700 $ldata ; +fi +if test ! -d $ldata/mysql; then + mkdir $ldata/mysql; + chmod 700 $ldata/mysql ; +fi +if test ! -d $ldata/test; then + mkdir $ldata/test; + chmod 700 $ldata/test ; +fi +if test -w / -a ! -z "$user"; then + chown $user $ldata $ldata/mysql $ldata/test; fi -if test $verbose = 1 +# Check is "db" table already exist +if test ! -f $mdata/db.frm then - create_option="verbose" -else - create_option="real" + db_table_already_exist="yes" fi if test -n "$user"; then args="$args --user=$user" fi -if test "$in_rpm" -eq 0 -a "$windows" -eq 0 -then - echo "Installing all prepared tables" -fi +# Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ---skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" -if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ - | eval "$mysqld_install_cmd_line" +--basedir=$basedir --datadir=$ldata --skip-innodb \ +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M \ +--net_buffer_length=16K" + +# Pipe mysql_system_tables.sql to "mysqld --bootstrap" +s_echo "Installing MySQL system tables..." +if `(echo "use mysql;"; cat $create_system_tables) | $mysqld_install_cmd_line` then + s_echo "OK" + if test -n "$fill_help_tables" then - if test "$in_rpm" -eq 0 -a "$windows" -eq 0 - then - echo "Fill help tables" - fi - (echo "use mysql;"; cat $fill_help_tables) | eval "$mysqld_install_cmd_line" - res=$? - if test $res != 0 + s_echo "Filling help tables..." + # Pipe fill_help_tables.sql to "mysqld --bootstrap" + if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` then + # Fill suceeded + s_echo "OK" + else echo "" echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" echo "The \"HELP\" command might not work properly" echo "" fi fi - if test "$in_rpm" = 0 -a "$windows" = 0 - then - echo "" - echo "To start mysqld at boot time you have to copy support-files/mysql.server" - echo "to the right place for your system" - echo - fi + + s_echo "" + s_echo "To start mysqld at boot time you have to copy" + s_echo "support-files/mysql.server to the right place for your system" + s_echo + if test "$windows" -eq 0 then - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" - echo "To do so, start the server, then issue the following commands:" - echo "$bindir/mysqladmin -u root password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" - echo "See the manual for more instructions." - # - # Print message about upgrading unless we have created a new db table. - if test -z "$c_d" - then - echo - echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" - echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" - echo "able to use the new GRANT command!" - fi - echo - if test "$in_rpm" = "0" - then - echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/mysqld_safe &" + # A root password should of course also be set on Windows! + # The reason for not displaying these prompts here is that when + # executing this script with the --windows argument the script + # is used to generate system tables mainly used by the + # windows installer. And thus the password should not be set until + # those files has been copied to the target system + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" + echo "See the manual for more instructions." + + # Print message about upgrading unless we have created a new db table. + if test -z "$db_table_already_exist" + then + echo + echo "NOTE: If you are upgrading from a previous MySQL verision you " + echo "should run '$bindir/mysql_upgrade', to make sure all tables have " + echo "been upgraded for this version of MySQL" + fi echo - echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" - echo "cd sql-bench ; perl run-all-tests" + + if test "$in_rpm" = "0" + then + echo "You can start the MySQL daemon with:" + echo "cd @prefix@ ; $bindir/mysqld_safe &" + echo + echo "You can test the MySQL daemon with mysql-test-run.pl" + echo "cd mysql-test ; perl mysql-test-run.pl" + echo + fi + echo "Please report any problems with the @scriptdir@/mysqlbug script!" echo - fi - echo "Please report any problems with the @scriptdir@/mysqlbug script!" - echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com" - echo "Support MySQL by buying support/licenses at http://shop.mysql.com" + echo "The latest information about MySQL is available on the web at" + echo "http://www.mysql.com" + echo "Support MySQL by buying support/licenses at http://shop.mysql.com" fi exit 0 else echo "Installation of system tables failed!" echo echo "Examine the logs in $ldata for more information." - echo "You can also try to start the mysqld daemon with:" + echo "You can try to start the mysqld daemon with:" echo "$mysqld --skip-grant &" - echo "You can use the command line tool" + echo "and use the command line tool" echo "$bindir/mysql to connect to the mysql" echo "database and look at the grant tables:" echo diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql new file mode 100644 index 00000000000..7b4e0ee877d --- /dev/null +++ b/scripts/mysql_system_tables.sql @@ -0,0 +1,65 @@ +-- +-- The system tables of MySQL Server +-- + +set storage_engine=myisam; + +CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; + +-- default grants for anyone to access database 'test' and 'test_%' +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db VALUES ('%','test_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); + + +CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; + + +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; + + +CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; + + +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; + +CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; + + +CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; + + +CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; + + +CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; + + +CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; + + +CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; + + +CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; + + +CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; + + +CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; + + +CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; + + +CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob DEFAULT '' NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; + + +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; + +-- default users allowing root access from local machine +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + + diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql new file mode 100644 index 00000000000..e52df2149f2 --- /dev/null +++ b/scripts/mysql_test_data_timezone.sql @@ -0,0 +1,5 @@ +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1) ,(1, -1663455600, 2) ,(1, -1650150000, 3) ,(1, -1632006000, 2) ,(1, -1618700400, 3) ,(1, -938905200, 2) ,(1, -857257200, 3) ,(1, -844556400, 2) ,(1, -828226800, 3) ,(1, -812502000, 2) ,(1, -796777200, 3) ,(1, 228877200, 2) ,(1, 243997200, 3) ,(1, 260326800, 2) ,(1, 276051600, 3) ,(1, 291776400, 2) ,(1, 307501200, 3) ,(1, 323830800, 2) ,(1, 338950800, 3) ,(1, 354675600, 2) ,(1, 370400400, 3) ,(1, 386125200, 2) ,(1, 401850000, 3) ,(1, 417574800, 2) ,(1, 433299600, 3) ,(1, 449024400, 2) ,(1, 465354000, 3) ,(1, 481078800, 2) ,(1, 496803600, 3) ,(1, 512528400, 2) ,(1, 528253200, 3) ,(1, 543978000, 2) ,(1, 559702800, 3) ,(1, 575427600, 2) ,(1, 591152400, 3) ,(1, 606877200, 2) ,(1, 622602000, 3) ,(1, 638326800, 2) ,(1, 654656400, 3) ,(1, 670381200, 2) ,(1, 686106000, 3) ,(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8) ,(5, -1009875600, 1); +INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); +INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22); -- cgit v1.2.1 From 386e08af1e451b3b8c53900a064493ef2599a989 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 26 Feb 2007 14:48:41 +0100 Subject: Remove spurious " --- scripts/mysql_fix_privilege_tables.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql.in b/scripts/mysql_fix_privilege_tables.sql.in index 00363b27fdd..2098f93dcb7 100644 --- a/scripts/mysql_fix_privilege_tables.sql.in +++ b/scripts/mysql_fix_privilege_tables.sql.in @@ -1,7 +1,7 @@ # This part converts any old privilege tables to privilege tables suitable # for current version of MySQL -# You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +# You can safely ignore all 'Duplicate column' and 'Unknown column' errors # because these just mean that your tables are already up to date. # This script is safe to run even if your tables are already up to date! -- cgit v1.2.1 From fce4cd3ec0f16087f2d6284465beb5bc41943b23 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 26 Feb 2007 14:49:41 +0100 Subject: Remove another spurious " --- scripts/mysql_fix_privilege_tables.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sql.in b/scripts/mysql_fix_privilege_tables.sql.in index 2098f93dcb7..205bc93efea 100644 --- a/scripts/mysql_fix_privilege_tables.sql.in +++ b/scripts/mysql_fix_privilege_tables.sql.in @@ -28,7 +28,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr # # The second alter changes ssl_type to new 4.0.2 format -# Adding columns needed by GRANT .. REQUIRE (openssl)" +# Adding columns needed by GRANT .. REQUIRE (openssl) ALTER TABLE user ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, -- cgit v1.2.1 From 846e5ad8d30a170eaffe9766efefabbc045e5186 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Tue, 27 Feb 2007 11:39:29 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Updates for 5.1 --- scripts/mysql_system_tables.sql | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7b4e0ee877d..fa43a9a9a9e 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -4,23 +4,29 @@ set storage_engine=myisam; -CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; +CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; -- default grants for anyone to access database 'test' and 'test_%' -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO db VALUES ('%','test_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); +INSERT INTO db VALUES ('%','test_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); -CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; +CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl char(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='MySQL plugins'; + + +CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; + + +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; @@ -58,8 +64,24 @@ CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NU CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- default users allowing root access from local machine -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + + +CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END; +CALL create_general_log_table(); +DROP PROCEDURE create_general_log_table; + + +CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END; +CALL create_slow_log_table(); +DROP PROCEDURE create_slow_log_table; + + +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; + + +CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; -- cgit v1.2.1 From 394e9e86d6c6310144f7d32c25bb9184204dc922 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Tue, 27 Feb 2007 14:10:27 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Escape undercore character in mysql.db to only allow access test_% and not test% --- scripts/mysql_system_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7b4e0ee877d..56729f56020 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db c -- default grants for anyone to access database 'test' and 'test_%' INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO db VALUES ('%','test_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -- cgit v1.2.1 From c66f902862dc091c20a6c7e388348504c3f50f25 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Tue, 27 Feb 2007 15:28:19 +0100 Subject: Bug#23669 mysql.proc not created in default install - Remove DEFAULT values for blob's in mysql_system_tables.sql --- scripts/mysql_system_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 56729f56020..03a0b36b985 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -52,7 +52,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob DEFAULT '' NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- cgit v1.2.1 From ea2261d1a1b2540673c01def6ee85a168069e9d0 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 28 Feb 2007 11:23:00 +0100 Subject: A binary package should also contain the "mysqld-debug" server (backport from 5.1). --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 008520ef000..96cd1868862 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -143,7 +143,8 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ + sql/mysqld$BS sql/mysqld-debug$BS \ + sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ -- cgit v1.2.1 From e391b86fb0748591a7fa98b6924c2509ccd66c6a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 28 Feb 2007 14:26:58 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Split out initial data in mysql_system_tables.sql to it's own file - Use file from mysql_install_db and mysql-test-run --- scripts/Makefile.am | 16 +- scripts/mysql_fix_privilege_tables.sql.in | 394 ------------------------------ scripts/mysql_install_db.sh | 12 +- scripts/mysql_system_tables.sql | 10 - scripts/mysql_system_tables_data.sql | 13 + scripts/mysql_system_tables_fix.sql | 394 ++++++++++++++++++++++++++++++ 6 files changed, 427 insertions(+), 412 deletions(-) delete mode 100644 scripts/mysql_fix_privilege_tables.sql.in create mode 100644 scripts/mysql_system_tables_data.sql create mode 100644 scripts/mysql_system_tables_fix.sql (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d1c3bd82050..cca81cd8818 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -65,15 +65,14 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ make_win_bin_dist \ - mysql_fix_privilege_tables.sql.in + mysql_system_tables_fix.sql dist_pkgdata_DATA = fill_help_tables.sql \ mysql_fix_privilege_tables.sql \ mysql_system_tables.sql \ + mysql_system_tables_data.sql \ mysql_test_data_timezone.sql -# mysqlbug should be distributed built so that people can report build -# failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ make_sharedlib_distribution \ @@ -94,8 +93,11 @@ CLEANFILES = @server_scripts@ \ mysql_upgrade_shell \ mysqld_multi \ make_win_src_distribution \ - mysql_create_system_tables + mysql_create_system_tables \ + mysql_fix_privilege_tables.sql +# mysqlbug should be distributed built so that people can report build +# failures with it. DISTCLEANFILES = mysqlbug # We want the right version and configure comand line in mysqlbug @@ -104,10 +106,10 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh # Build mysql_fix_privilege_tables.sql from the files that contain # the system tables for this version of MySQL plus any commands # needed to upgrade the system tables from an older version -mysql_fix_privilege_tables.sql: mysql_fix_privilege_tables.sql.in \ - mysql_system_tables.sql +mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ + mysql_system_tables_fix.sql @echo "Building $@"; - @cat mysql_system_tables.sql $@.in > $@ + @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ SUFFIXES = .sh diff --git a/scripts/mysql_fix_privilege_tables.sql.in b/scripts/mysql_fix_privilege_tables.sql.in deleted file mode 100644 index 205bc93efea..00000000000 --- a/scripts/mysql_fix_privilege_tables.sql.in +++ /dev/null @@ -1,394 +0,0 @@ -# This part converts any old privilege tables to privilege tables suitable -# for current version of MySQL - -# You can safely ignore all 'Duplicate column' and 'Unknown column' errors -# because these just mean that your tables are already up to date. -# This script is safe to run even if your tables are already up to date! - -# On unix, you should use the mysql_fix_privilege_tables script to execute -# this sql script. -# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' - -set storage_engine=MyISAM; - -ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; - -# Detect whether or not we had the Grant_priv column -SET @hadGrantPriv:=0; -SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; - -ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; - -# Fix privileges for old tables -UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; -UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; -UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; - -# -# The second alter changes ssl_type to new 4.0.2 format -# Adding columns needed by GRANT .. REQUIRE (openssl) - -ALTER TABLE user -ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, -ADD ssl_cipher BLOB NOT NULL, -ADD x509_issuer BLOB NOT NULL, -ADD x509_subject BLOB NOT NULL; -ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; - -# -# tables_priv -# - -ALTER TABLE tables_priv - ADD KEY Grantor (Grantor); - -ALTER TABLE tables_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Grantor char(77) NOT NULL default '', - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE tables_priv - MODIFY Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - MODIFY Table_priv set('Select','Insert','Update','Delete','Create', - 'Drop','Grant','References','Index','Alter', - 'Create View','Show view') - COLLATE utf8_general_ci DEFAULT '' NOT NULL, - COMMENT='Table privileges'; - -# -# columns_priv -# - -# Name change of Type -> Column_priv from MySQL 3.22.12 -ALTER TABLE columns_priv - CHANGE Type Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE columns_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Column_name char(64) NOT NULL default '', - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin, - COMMENT='Column privileges'; - -ALTER TABLE columns_priv - MODIFY Column_priv set('Select','Insert','Update','References') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -# -# Add the new 'type' column to the func table. -# - -ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; - -# -# Change the user,db and host tables to current format -# - -# Detect whether we had Show_db_priv -SET @hadShowDbPriv:=0; -SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; - -ALTER TABLE user -ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, -ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, -ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; - -# Convert privileges so that users have similar privileges as before - -UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; - - -# Add fields that can be used to limit number of questions and connections -# for some users. - -ALTER TABLE user -ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, -ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, -ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; - - -# -# Add Create_tmp_table_priv and Lock_tables_priv to db and host -# - -ALTER TABLE db -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -ALTER TABLE host -ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; - - -alter table db comment='Database privileges'; -alter table host comment='Host privileges; Merged with database privileges'; -alter table user comment='Users and global privileges'; -alter table func comment='User defined functions'; - -# Convert all tables to UTF-8 with binary collation -# and reset all char columns to correct width -ALTER TABLE user - MODIFY Host char(60) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user - MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE db - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -ALTER TABLE host - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host - MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, - MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; - -ALTER TABLE func - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func - MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; - -# -# Detect whether we had Create_view_priv -# -SET @hadCreateViewPriv:=0; -SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; - -# -# Create VIEWs privileges (v5.0) -# -ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; - -ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; -ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; - -ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; -ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; - -# -# Show VIEWs privileges (v5.0) -# -ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; -ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; - -# -# Assign create/show view privileges to people who have create provileges -# -UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; - -# -# -# -SET @hadCreateRoutinePriv:=0; -SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; - -# -# Create PROCEDUREs privileges (v5.0) -# -ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; -ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; - -# -# Alter PROCEDUREs privileges (v5.0) -# -ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; -ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; - -ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; - -ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; - -# -# Assign create/alter routine privileges to people who have create privileges -# -UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; -UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; -UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0; - -# -# Add max_user_connections resource limit -# -ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; - -# -# user.Create_user_priv -# - -SET @hadCreateUserPriv:=0; -SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; - -ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; -UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' - WHERE @hadCreateUserPriv = 0 AND - (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); - -# -# procs_priv -# - -ALTER TABLE procs_priv - ENGINE=MyISAM, - CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE procs_priv - MODIFY Proc_priv set('Execute','Alter Routine','Grant') - COLLATE utf8_general_ci DEFAULT '' NOT NULL; - -ALTER TABLE procs_priv - ADD Routine_type enum('FUNCTION','PROCEDURE') - COLLATE utf8_general_ci NOT NULL AFTER Routine_name; - -ALTER TABLE procs_priv - MODIFY Timestamp timestamp(14) AFTER Proc_priv; - -# -# proc -# - -# Correct the name fields to not binary, and expand sql_data_access -ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, - MODIFY specific_name char(64) DEFAULT '' NOT NULL, - MODIFY sql_data_access - enum('CONTAINS_SQL', - 'NO_SQL', - 'READS_SQL_DATA', - 'MODIFIES_SQL_DATA' - ) DEFAULT 'CONTAINS_SQL' NOT NULL, - MODIFY body longblob DEFAULT '' NOT NULL, - MODIFY sql_mode - set('REAL_AS_FLOAT', - 'PIPES_AS_CONCAT', - 'ANSI_QUOTES', - 'IGNORE_SPACE', - 'NOT_USED', - 'ONLY_FULL_GROUP_BY', - 'NO_UNSIGNED_SUBTRACTION', - 'NO_DIR_IN_CREATE', - 'POSTGRESQL', - 'ORACLE', - 'MSSQL', - 'DB2', - 'MAXDB', - 'NO_KEY_OPTIONS', - 'NO_TABLE_OPTIONS', - 'NO_FIELD_OPTIONS', - 'MYSQL323', - 'MYSQL40', - 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO', - 'NO_BACKSLASH_ESCAPES', - 'STRICT_TRANS_TABLES', - 'STRICT_ALL_TABLES', - 'NO_ZERO_IN_DATE', - 'NO_ZERO_DATE', - 'INVALID_DATES', - 'ERROR_FOR_DIVISION_BY_ZERO', - 'TRADITIONAL', - 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL, - DEFAULT CHARACTER SET utf8; - -# Correct the character set and collation -ALTER TABLE proc CONVERT TO CHARACTER SET utf8; -# Reset some fields after the conversion -ALTER TABLE proc MODIFY db - char(64) collate utf8_bin DEFAULT '' NOT NULL, - MODIFY definer - char(77) collate utf8_bin DEFAULT '' NOT NULL, - MODIFY comment - char(64) collate utf8_bin DEFAULT '' NOT NULL; - -# Activate the new, possible modified privilege tables -# This should not be needed, but gives us some extra testing that the above -# changes was correct - -flush privileges; diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index ed5c8c97d6b..5dd5d86c666 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -138,10 +138,12 @@ fi # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" +fill_system_tables="mysql_system_tables_data.sql" if test -n "$srcdir" then fill_help_tables=$srcdir/scripts/$fill_help_tables create_system_tables=$srcdir/scripts/$create_system_tables + fill_system_tables=$srcdir/scripts/$fill_system_tables else for i in $basedir/support-files $basedir/share $basedir/share/mysql \ $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@ @@ -154,6 +156,7 @@ else fill_help_tables=$pkgdatadir/$fill_help_tables create_system_tables=$pkgdatadir/$create_system_tables + fill_system_tables=$pkgdatadir/$fill_system_tables fi if test ! -f $create_system_tables @@ -170,6 +173,13 @@ then exit 1; fi +if test ! -f $fill_system_tables +then + echo "FATAL ERROR: Could not find help file '$fill_system_tables' in" + echo "@pkgdatadir@ or inside $basedir" + exit 1; +fi + # Find executables and paths mdata=$ldata/mysql mysqld=$execdir/mysqld @@ -273,7 +283,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ # Pipe mysql_system_tables.sql to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." -if `(echo "use mysql;"; cat $create_system_tables) | $mysqld_install_cmd_line` +if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line` then s_echo "OK" diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 03a0b36b985..5f5aea20729 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -6,10 +6,6 @@ set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; --- default grants for anyone to access database 'test' and 'test_%' -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); - CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; @@ -57,9 +53,3 @@ CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NU CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; --- default users allowing root access from local machine -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); - - diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql new file mode 100644 index 00000000000..a9c816f2896 --- /dev/null +++ b/scripts/mysql_system_tables_data.sql @@ -0,0 +1,13 @@ +-- +-- The inital data for system tables of MySQL Server +-- + +-- default grants for anyone to access database 'test' and 'test_%' +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); + +-- default users allowing root access from local machine +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); + diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql new file mode 100644 index 00000000000..205bc93efea --- /dev/null +++ b/scripts/mysql_system_tables_fix.sql @@ -0,0 +1,394 @@ +# This part converts any old privilege tables to privilege tables suitable +# for current version of MySQL + +# You can safely ignore all 'Duplicate column' and 'Unknown column' errors +# because these just mean that your tables are already up to date. +# This script is safe to run even if your tables are already up to date! + +# On unix, you should use the mysql_fix_privilege_tables script to execute +# this sql script. +# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' + +set storage_engine=MyISAM; + +ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + +# Detect whether or not we had the Grant_priv column +SET @hadGrantPriv:=0; +SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; + +ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + +# Fix privileges for old tables +UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; +UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; + +# +# The second alter changes ssl_type to new 4.0.2 format +# Adding columns needed by GRANT .. REQUIRE (openssl) + +ALTER TABLE user +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, +ADD ssl_cipher BLOB NOT NULL, +ADD x509_issuer BLOB NOT NULL, +ADD x509_subject BLOB NOT NULL; +ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL; + +# +# tables_priv +# + +ALTER TABLE tables_priv + ADD KEY Grantor (Grantor); + +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; + +ALTER TABLE tables_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Table_priv set('Select','Insert','Update','Delete','Create', + 'Drop','Grant','References','Index','Alter', + 'Create View','Show view') + COLLATE utf8_general_ci DEFAULT '' NOT NULL, + COMMENT='Table privileges'; + +# +# columns_priv +# + +# Name change of Type -> Column_priv from MySQL 3.22.12 +ALTER TABLE columns_priv + CHANGE Type Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin, + COMMENT='Column privileges'; + +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +# +# Add the new 'type' column to the func table. +# + +ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; + +# +# Change the user,db and host tables to current format +# + +# Detect whether we had Show_db_priv +SET @hadShowDbPriv:=0; +SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; + +ALTER TABLE user +ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, +ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; + +# Convert privileges so that users have similar privileges as before + +UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0; + + +# Add fields that can be used to limit number of questions and connections +# for some users. + +ALTER TABLE user +ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject, +ADD max_updates int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions, +ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates; + + +# +# Add Create_tmp_table_priv and Lock_tables_priv to db and host +# + +ALTER TABLE db +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL; + + +alter table db comment='Database privileges'; +alter table host comment='Host privileges; Merged with database privileges'; +alter table user comment='Users and global privileges'; +alter table func comment='User defined functions'; + +# Convert all tables to UTF-8 with binary collation +# and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user + MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; + +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; + +# +# Detect whether we had Create_view_priv +# +SET @hadCreateViewPriv:=0; +SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%'; + +# +# Create VIEWs privileges (v5.0) +# +ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + +ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; +ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv; + +ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; +ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv; + +# +# Show VIEWs privileges (v5.0) +# +ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; +ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv; + +# +# Assign create/show view privileges to people who have create provileges +# +UPDATE user SET Create_view_priv=Create_priv, Show_view_priv=Create_priv where user<>"" AND @hadCreateViewPriv = 0; + +# +# +# +SET @hadCreateRoutinePriv:=0; +SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%'; + +# +# Create PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; +ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv; + +# +# Alter PROCEDUREs privileges (v5.0) +# +ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; +ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv; + +ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + +ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; + +# +# Assign create/alter routine privileges to people who have create privileges +# +UPDATE user SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE db SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where user<>"" AND @hadCreateRoutinePriv = 0; +UPDATE host SET Create_routine_priv=Create_priv, Alter_routine_priv=Alter_priv, Execute_priv=Select_priv where @hadCreateRoutinePriv = 0; + +# +# Add max_user_connections resource limit +# +ALTER TABLE user ADD max_user_connections int(11) unsigned DEFAULT '0' NOT NULL AFTER max_connections; + +# +# user.Create_user_priv +# + +SET @hadCreateUserPriv:=0; +SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%'; + +ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv; +UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y' + WHERE @hadCreateUserPriv = 0 AND + (user.Grant_priv = 'Y' OR db.Grant_priv = 'Y'); + +# +# procs_priv +# + +ALTER TABLE procs_priv + ENGINE=MyISAM, + CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; + +ALTER TABLE procs_priv + MODIFY Proc_priv set('Execute','Alter Routine','Grant') + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + +ALTER TABLE procs_priv + ADD Routine_type enum('FUNCTION','PROCEDURE') + COLLATE utf8_general_ci NOT NULL AFTER Routine_name; + +ALTER TABLE procs_priv + MODIFY Timestamp timestamp(14) AFTER Proc_priv; + +# +# proc +# + +# Correct the name fields to not binary, and expand sql_data_access +ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, + MODIFY specific_name char(64) DEFAULT '' NOT NULL, + MODIFY sql_data_access + enum('CONTAINS_SQL', + 'NO_SQL', + 'READS_SQL_DATA', + 'MODIFIES_SQL_DATA' + ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY body longblob DEFAULT '' NOT NULL, + MODIFY sql_mode + set('REAL_AS_FLOAT', + 'PIPES_AS_CONCAT', + 'ANSI_QUOTES', + 'IGNORE_SPACE', + 'NOT_USED', + 'ONLY_FULL_GROUP_BY', + 'NO_UNSIGNED_SUBTRACTION', + 'NO_DIR_IN_CREATE', + 'POSTGRESQL', + 'ORACLE', + 'MSSQL', + 'DB2', + 'MAXDB', + 'NO_KEY_OPTIONS', + 'NO_TABLE_OPTIONS', + 'NO_FIELD_OPTIONS', + 'MYSQL323', + 'MYSQL40', + 'ANSI', + 'NO_AUTO_VALUE_ON_ZERO', + 'NO_BACKSLASH_ESCAPES', + 'STRICT_TRANS_TABLES', + 'STRICT_ALL_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'INVALID_DATES', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'TRADITIONAL', + 'NO_AUTO_CREATE_USER', + 'HIGH_NOT_PRECEDENCE' + ) DEFAULT '' NOT NULL, + DEFAULT CHARACTER SET utf8; + +# Correct the character set and collation +ALTER TABLE proc CONVERT TO CHARACTER SET utf8; +# Reset some fields after the conversion +ALTER TABLE proc MODIFY db + char(64) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY definer + char(77) collate utf8_bin DEFAULT '' NOT NULL, + MODIFY comment + char(64) collate utf8_bin DEFAULT '' NOT NULL; + +# Activate the new, possible modified privilege tables +# This should not be needed, but gives us some extra testing that the above +# changes was correct + +flush privileges; -- cgit v1.2.1 From 3fc963f169eb469e883b14e11ae3b3b65cfed8f6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 28 Feb 2007 14:58:19 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation --- scripts/mysql_system_tables_data.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index a9c816f2896..0ac6f59b9ea 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -3,11 +3,11 @@ -- -- default grants for anyone to access database 'test' and 'test_%' -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y'); -- default users allowing root access from local machine -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -- cgit v1.2.1 From fb36bf9562b8877cffdafda600e796040e386dcd Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 28 Feb 2007 15:15:38 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Null merge 4.1 patch --- scripts/Makefile.am | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index cca81cd8818..d7053a86b3a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -93,7 +93,6 @@ CLEANFILES = @server_scripts@ \ mysql_upgrade_shell \ mysqld_multi \ make_win_src_distribution \ - mysql_create_system_tables \ mysql_fix_privilege_tables.sql # mysqlbug should be distributed built so that people can report build -- cgit v1.2.1 From 0b4598a4b3651c1bfbe785fb41e76564693b4b10 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 28 Feb 2007 20:44:49 +0100 Subject: Bug #20166 mysql-test-run.pl does not test system privilege tables creation - No .sql files in mysql-test/lib/ anymore, don't copy them --- scripts/make_binary_distribution.sh | 1 - scripts/make_win_bin_dist | 1 - 2 files changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 008520ef000..ce959c634ba 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -251,7 +251,6 @@ copyfileto $BASE/mysql-test \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib -$CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 211eea8a265..9e2df23fe51 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -292,7 +292,6 @@ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ -cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ # Need this trick, or we get "argument list too long". ABS_DST=`pwd`/$DESTDIR -- cgit v1.2.1 From a49d6c5f51d3a043aed1a2b8f166e3e9cc89bd26 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 1 Mar 2007 07:23:37 +0100 Subject: There is no .sql files in mysql-test/lib/ anymore, don't try to copy from there --- scripts/make_win_bin_dist | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b98e0667d56..146dcad95f1 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -291,7 +291,6 @@ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ -cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ # Need this trick, or we get "argument list too long". ABS_DST=`pwd`/$DESTDIR -- cgit v1.2.1 From 189f5925518869a6d02dd168a18893200490e2c5 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 8 Mar 2007 15:43:54 +0100 Subject: Bug#24248 Problem updating from 5.0.15 to 5.1.12 running under Win XP SP2 - Fix error message to say that "mysql_upgrade" should be run when a particular error message is found to be missing - Dont's set default value on blob's - it will not be used anyway. --- scripts/mysql_system_tables_fix.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a35cc00d132..27c0f3b5bd4 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -343,7 +343,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, - MODIFY body longblob DEFAULT '' NOT NULL, + MODIFY body longblob NOT NULL, MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', -- cgit v1.2.1 From baaf7ac5da4e78e0eee9dbef2ab2a90b3d634e3c Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Mon, 12 Mar 2007 13:15:43 +0100 Subject: add missing test cases to windows binary distribution --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 211eea8a265..ffd3712715a 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -291,6 +291,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From cf0e52ea17bb8ea8ae95cd046dc1b2acc052377c Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Fri, 16 Mar 2007 11:52:30 +0100 Subject: Bug#27022 Install fails with Duplicate entry '%-test-' for key 'PRIMARY' - Bail out with error if MySQL System tables already exist --- scripts/mysql_install_db.sh | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5dd5d86c666..c1a27eb0bc8 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -135,6 +135,17 @@ else fi fi +# Check that no previous MySQL installation exist +if test -f "$ldata/mysql/db.frm" +then + echo "FATAL ERROR: Found already existing MySQL system tables" + echo "in $ldata." + echo "If you are upgrading from a previous MySQL version you" + echo "should run '$bindir/mysql_upgrade', " + echo "to upgrade all tables for this version of MySQL" + exit 1; +fi + # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" @@ -181,7 +192,6 @@ then fi # Find executables and paths -mdata=$ldata/mysql mysqld=$execdir/mysqld mysqld_opt="" scriptdir=$bindir @@ -264,12 +274,6 @@ if test -w / -a ! -z "$user"; then chown $user $ldata $ldata/mysql $ldata/test; fi -# Check is "db" table already exist -if test ! -f $mdata/db.frm -then - db_table_already_exist="yes" -fi - if test -n "$user"; then args="$args --user=$user" fi @@ -322,16 +326,6 @@ then echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." - # Print message about upgrading unless we have created a new db table. - if test -z "$db_table_already_exist" - then - echo - echo "NOTE: If you are upgrading from a previous MySQL verision you " - echo "should run '$bindir/mysql_upgrade', to make sure all tables have " - echo "been upgraded for this version of MySQL" - fi - echo - if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" -- cgit v1.2.1 From 3e44599c11e90c2b6470e64dbe6d78bc6c5f9f10 Mon Sep 17 00:00:00 2001 From: "cbell/Chuck@mysql_cab_desk." <> Date: Fri, 16 Mar 2007 09:56:57 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This changeset adds replication of events and user-defined functions. There are several bug reports involved in this change: BUG#16421, BUG#17857, BUG#20384: This patch modifies the mysql.events table to permit the addition of another enum value for the status column. The column now has values of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of SLAVESIDE_DISABLED is set on the slave during replication of events. This enables users to determine which events werereplicated from the master and to later enable them if they promote the slave to a master. The CREATE, ALTER, and DROP statements are binlogged. A new test was added for replication of events (rpl_events). BUG#17671: This patch modifies the code to permit logging of user-defined functions. Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error message to be displayed should a replicated user-defined function not be found in the loadable library or if the library is missing from the slave.The CREATE andDROP statements are binlogged. A new test was added for replication of user-defined functions (rpl_udf). The patch also adds a new column to the mysql.event table named 'originator' that is used to store the server_id of the server that the event originated on. This enables users to promote a slave to a master and later return the promoted slave to a slave and disable the replicated events. --- scripts/mysql_create_system_tables.sh | 3 ++- scripts/mysql_fix_privilege_tables.sql | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..ddb90b55633 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -832,7 +832,7 @@ then c_ev="$c_ev last_executed DATETIME default NULL," c_ev="$c_ev starts DATETIME default NULL," c_ev="$c_ev ends DATETIME default NULL," - c_ev="$c_ev status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED'," + c_ev="$c_ev status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'," c_ev="$c_ev on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP'," c_ev="$c_ev sql_mode set(" c_ev="$c_ev 'REAL_AS_FLOAT'," @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev originator int(10) NOT NULL, c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..4d661dd8146 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -648,7 +648,7 @@ CREATE TABLE event ( last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', + status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set( 'REAL_AS_FLOAT', @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + originator int(10) NOT NULL, PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -737,6 +738,8 @@ ALTER TABLE event ADD sql_mode UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; +ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; # # TRIGGER privilege -- cgit v1.2.1 From 6d8f6b5bfd6351142164b1f85b613ea133d478d3 Mon Sep 17 00:00:00 2001 From: "kroki/tomash@moonlight.home" <> Date: Fri, 16 Mar 2007 17:31:07 +0300 Subject: BUG#16420: Events: timestamps become UTC BUG#26429: SHOW CREATE EVENT is incorrect for an event that STARTS NOW() BUG#26431: Impossible to re-create an event from backup if its STARTS clause is in the past WL#3698: Events: execution in local time zone The problem was that local times specified by the user in AT, STARTS and ENDS of CREATE EVENT/ALTER EVENT statement were converted to UTC, and the original time zone was forgotten. This way, event scheduler couldn't honor Daylight Saving Time shifts, and times shown to the user were also in UTC. Additionally, CREATE EVENT didn't allow times in the past, thus preventing straightforward event restoration from old backups. This patch reworks event scheduler time computations, performing them in the time zone associated with the event. Also it allows times to be in the past. The patch adds time_zone column to mysql.event table. NOTE: The patch is almost final, but the bug#9953 should be pushed first. --- scripts/mysql_create_system_tables.sh | 1 + scripts/mysql_fix_privilege_tables.sql | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index cc86def1a5c..808f4adc222 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -867,6 +867,7 @@ then c_ev="$c_ev 'HIGH_NOT_PRECEDENCE'" c_ev="$c_ev ) DEFAULT '' NOT NULL," c_ev="$c_ev comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default ''," + c_ev="$c_ev time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM'," c_ev="$c_ev PRIMARY KEY (db, name)" c_ev="$c_ev ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';" fi diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 9cdea507493..9a966c653f2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -683,6 +683,7 @@ CREATE TABLE event ( 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', + time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db,name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; @@ -734,10 +735,12 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; - UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; +ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 + NOT NULL DEFAULT 'SYSTEM' AFTER comment; + # # TRIGGER privilege # -- cgit v1.2.1 From 88b4c86e09abbb2687adef3c1e4f1e8700140737 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Fri, 16 Mar 2007 17:28:32 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files --- scripts/make_binary_distribution.sh | 6 ------ 1 file changed, 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi -- cgit v1.2.1 From 66960bd1e72b4c609b97e60fa3c94e177c71bd8a Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Fri, 16 Mar 2007 20:56:16 +0100 Subject: Bug#20166 mysql-test-run.pl does not test system privilege tables creation - Build sql files for netware from the mysql_system_tables*.sq files - Fix comments about mysql_create_system_tables.sh - Use mysql_install_db.sh to create system tables for mysql_test-run-shell - Fix mysql-test-run.pl to also look in share/mysql for the msyql_system*.sql files Changeset coded today by Magnus Svensson, just the application to 5.0.38 is by Joerg Bruehe. --- scripts/make_binary_distribution.sh | 6 ------ 1 file changed, 6 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4e95c51a829..7d7918975f2 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,12 +298,6 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql - echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ - >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ - > $BASE/bin/test_db.sql ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi -- cgit v1.2.1 From 1c6fc80fdc00d14584a0ae6be50367876d92341a Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Sun, 18 Mar 2007 10:47:15 +0100 Subject: make_win_bin_dist: - Support both "release" and "relwithdebinfo" targets - Copy ".pdb" and ".pdb" files for the server and instance manager - Removed the examples directory, unsupported - Handle both old and new builds in the same script, "-debug" and "-nt" extensions, directory "data" and "share" in different location --- scripts/make_win_bin_dist | 88 +++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 34 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9e2df23fe51..b1ef199375f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,11 +126,20 @@ if [ -e $DESTDIR ] ; then usage fi +trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR + # ---------------------------------------------------------------------- -# Copy executables, and client DLL (FIXME why?) +# Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR +if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + +# ---------------------------------------------------------------------- +# Copy executables, and client DLL +# ---------------------------------------------------------------------- mkdir $DESTDIR mkdir $DESTDIR/bin @@ -138,20 +147,36 @@ cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp myisam/$TARGET/*.exe $DESTDIR/bin/ cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ || true +cp server-tools/instance-manager/$TARGET/*.map $DESTDIR/bin/ || true cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe -cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +if [ -f "sql/$TARGET/mysqld-nt.exe" ] ; then + BASENAME="mysqld-nt" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi + +# Depending on Visual Studio target, the optimized server has symbols +cp sql/$TARGET/$BASENAME.exe $DESTDIR/bin/$BASENAME$EXE_SUFFIX.exe +cp sql/$TARGET/$BASENAME.pdb $DESTDIR/bin/$BASENAME$EXE_SUFFIX.pdb || true +cp sql/$TARGET/$BASENAME.map $DESTDIR/bin/$BASENAME$EXE_SUFFIX.map || true + +if [ -f "sql/debug/mysqld-debug.exe" ] ; then + BASENAME="mysqld-debug" # Old style non CMake build +else + BASENAME="mysqld" # New style CMake build +fi -if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ +if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/$BASENAME.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then - cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe - cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map + cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe + cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb + cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true fi # ---------------------------------------------------------------------- @@ -160,7 +185,9 @@ fi # FIXME is there ever a data directory to copy? if [ -d win/data ] ; then - cp -pR win/data $DESTDIR/data + cp -pR win/data $DESTDIR/ +elif [ -d data ] ; then + cp -pR data $DESTDIR/ fi # FIXME maybe a flag to define "release build", or do the @@ -210,27 +237,6 @@ if [ x"$PACK_EMBEDDED" = "" -a \ copy_embedded fi -# ---------------------------------------------------------------------- -# FIXME test stuff that is useless garbage? -# ---------------------------------------------------------------------- - -mkdir -p $DESTDIR/examples/libmysqltest/release -cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/$TARGET/myTest.exe \ - $DESTDIR/examples/libmysqltest/ -cp libmysql/$TARGET/myTest.exe $DESTDIR/examples/libmysqltest/release/ - -if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/myTest.exe" -o \ - x"$PACK_DEBUG" = "yes" ] ; then - mkdir -p $DESTDIR/examples/libmysqltest/debug - cp libmysql/debug/myTest.exe $DESTDIR/examples/libmysqltest/debug/ -fi - -mkdir -p $DESTDIR/examples/tests -cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/ - -mkdir -p $DESTDIR/examples/udf_example -cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/ - # ---------------------------------------------------------------------- # FIXME why not copy it all in "include"?! # ---------------------------------------------------------------------- @@ -271,14 +277,23 @@ if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \ cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ client/debug/mysqlclient.lib \ - mysys/debug/mysys.lib \ regex/debug/regex.lib \ strings/debug/strings.lib \ zlib/debug/zlib.lib $DESTDIR/lib/debug/ + + if [ -f "mysys/debug/mysys-nt.lib" ] ; then + cp mysys/debug/mysys-nt.lib $DESTDIR/lib/debug/ + else + cp mysys/debug/mysys.lib $DESTDIR/lib/debug/mysys-nt.lib + fi + fi -# FIXME sort this out... -cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib +if [ -f "mysys/$TARGET/mysys-nt.lib" ] ; then + cp mysys/$TARGET/mysys-nt.lib $DESTDIR/lib/opt/ +else + cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys-nt.lib +fi # ---------------------------------------------------------------------- # Copy the test directory @@ -292,6 +307,7 @@ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ +cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ # Need this trick, or we get "argument list too long". ABS_DST=`pwd`/$DESTDIR @@ -335,7 +351,11 @@ for i in `cd scripts && ls`; do \ fi; \ done -cp -pR sql/share $DESTDIR/ +if [ -d "share" ] ; then + cp -pR share $DESTDIR/ +else + cp -pR sql/share $DESTDIR/ +fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* -- cgit v1.2.1 From 19a6a0912604a203c995c8a3ef52609978f420a2 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 19 Mar 2007 16:18:10 +0100 Subject: Many files: Major cleanup of old Visual Studio project files, aligning engines etc --- scripts/make_win_bin_dist | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a674fe08362..b1ef199375f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -306,7 +306,6 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ -cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From e9d65ba363e979d24f9adc542900e58993cd9fb0 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 19 Mar 2007 16:45:37 +0100 Subject: make_win_bin_dist: Restore accidently removed line --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b1ef199375f..a674fe08362 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -306,6 +306,7 @@ cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ +cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -- cgit v1.2.1 From 731c3e5b2054b16ea0dd699cf4154a8051314658 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 19 Mar 2007 22:41:16 +0100 Subject: mysys.vcproj: Removed accidently added my_winsem.c make_win_bin_dist: Corrected test for relwithdebinfo target mysql.sln: Specify that comp_err depends on zlib --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a674fe08362..59018195ef2 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -132,7 +132,7 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR # Adjust target name if needed, release with debug info has another name # ---------------------------------------------------------------------- -if [ x"$TARGET" = x"release" -a "client/relwithdebinfo/mysql.exe" ] +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] then TARGET="relwithdebinfo" fi -- cgit v1.2.1 From cd1005ab0485fa506d000b21a825b184e943489f Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Tue, 20 Mar 2007 15:12:50 +0100 Subject: vio.vcproj, mysqld.vcproj, mysys.vcproj, libmysqld.vcproj, mysqldemb.vcproj: No need to set LICENSE or USE_SYMDIR from project files make_win_bin_dist: Changed location of SQL initialization files to be "share/" --- scripts/make_win_bin_dist | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 59018195ef2..5d4c7ab917d 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -360,6 +360,9 @@ fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- -- cgit v1.2.1 From 39eafdd8531ea9479caba2691e3910a5fa2180b9 Mon Sep 17 00:00:00 2001 From: "kostja@bodhi.local" <> Date: Wed, 21 Mar 2007 19:20:44 +0300 Subject: Fix a broken merge. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 70 +++---------------------------------- 2 files changed, 6 insertions(+), 66 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..f6e2a45339e 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 57f97256b39..d973c1dddae 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -424,83 +424,24 @@ END// delimiter ; CALL create_log_tables(); DROP PROCEDURE create_log_tables; -# -# EVENT table -# - - -CREATE TABLE event ( - db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - name char(64) CHARACTER SET utf8 NOT NULL default '', - body longblob NOT NULL, - definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - execute_at DATETIME default NULL, - interval_value int(11) default NULL, - interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK', - 'SECOND','MICROSECOND', 'YEAR_MONTH','DAY_HOUR', - 'DAY_MINUTE','DAY_SECOND', - 'HOUR_MINUTE','HOUR_SECOND', - 'MINUTE_SECOND','DAY_MICROSECOND', - 'HOUR_MICROSECOND','MINUTE_MICROSECOND', - 'SECOND_MICROSECOND') default NULL, - created TIMESTAMP NOT NULL, - modified TIMESTAMP NOT NULL, - last_executed DATETIME default NULL, - starts DATETIME default NULL, - ends DATETIME default NULL, - status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', - on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', - sql_mode set( - 'REAL_AS_FLOAT', - 'PIPES_AS_CONCAT', - 'ANSI_QUOTES', - 'IGNORE_SPACE', - 'NOT_USED', - 'ONLY_FULL_GROUP_BY', - 'NO_UNSIGNED_SUBTRACTION', - 'NO_DIR_IN_CREATE', - 'POSTGRESQL', - 'ORACLE', - 'MSSQL', - 'DB2', - 'MAXDB', - 'NO_KEY_OPTIONS', - 'NO_TABLE_OPTIONS', - 'NO_FIELD_OPTIONS', - 'MYSQL323', - 'MYSQL40', - 'ANSI', - 'NO_AUTO_VALUE_ON_ZERO', - 'NO_BACKSLASH_ESCAPES', - 'STRICT_TRANS_TABLES', - 'STRICT_ALL_TABLES', - 'NO_ZERO_IN_DATE', - 'NO_ZERO_DATE', - 'INVALID_DATES', - 'ERROR_FOR_DIVISION_BY_ZERO', - 'TRADITIONAL', - 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' - ) DEFAULT '' NOT NULL, - comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', - time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', - PRIMARY KEY (db,name) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; - # # EVENT privilege # - SET @hadEventPriv := 0; SELECT @hadEventPriv :=1 FROM user WHERE Event_priv LIKE '%'; ALTER TABLE user add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; ALTER TABLE user MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL AFTER Create_user_priv; +UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; + ALTER TABLE db add Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NOT NULL; +# +# EVENT table +# ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); ALTER TABLE event ADD sql_mode @@ -535,7 +476,6 @@ ALTER TABLE event ADD sql_mode 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; -UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 -- cgit v1.2.1 From a55735b96441f9593c0fd92abca52afe313515da Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 22 Mar 2007 19:43:15 +0100 Subject: .del-fill_func_tables.sh: Delete: scripts/fill_func_tables.sh .del-fill_help_tables.sh: Delete: scripts/fill_help_tables.sh .del-internals.texi: Delete: Docs/internals.texi --- scripts/fill_func_tables.sh | 239 ------------------ scripts/fill_help_tables.sh | 603 -------------------------------------------- 2 files changed, 842 deletions(-) delete mode 100644 scripts/fill_func_tables.sh delete mode 100644 scripts/fill_help_tables.sh (limited to 'scripts') diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh deleted file mode 100644 index b7bd3736392..00000000000 --- a/scripts/fill_func_tables.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# fill_func_tables - parse ../Docs/manual.texi -# -# Original version by Victor Vagin -# - -my $cat_name= ""; -my $func_name= ""; -my $text= ""; -my $example= ""; - -local $mode= ""; - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - - $a =~ s/\(\)//g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; #$a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3 $1/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs;#$a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1 $2/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - return $a; -} - -sub prepare_text -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/\@item/ /g; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - - return $a; -} - -sub flush_all -{ - my ($mode) = @_; - - if ($mode eq ""){return;} - - $func_name= prepare_name($func_name); - $text= prepare_text($text); - $example= prepare_example($example); - - if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO function (name,description,example) VALUES ("; - print "'$func_name',"; - print "'$text',"; - print "'$example'"; - print ");\n"; - print "INSERT INTO function_category (cat_id,func_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; - } - - $func_name= ""; - $text= ""; - $example= ""; - $mode= ""; -} - -sub new_category -{ - my ($category)= @_; - - $category= prepare_text($category); - - print "INSERT INTO function_category_name (name) VALUES (\'$category\');\n"; - print "SELECT \@cur_category:=LAST_INSERT_ID();\n"; -} - -print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; -print "CREATE DATABASE mysql_help;\n"; - -print "USE mysql_help;\n"; - -print "DROP TABLE IF EXISTS function;\n"; -print "CREATE TABLE function ("; -print " func_id int unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " description text not null,"; -print " example text not null,"; -print " min_args tinyint not null,"; -print " max_args tinyint,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (func_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category_name;\n"; -print "CREATE TABLE function_category_name ("; -print " cat_id smallint unsigned not null auto_increment,"; -print " name varchar(64) not null,"; -print " url varchar(128) not null,"; -print " date_created datetime not null,"; -print " last_modified timestamp not null,"; -print " primary key (cat_id)"; -print ") type=myisam;\n\n"; - -print "DROP TABLE IF EXISTS function_category;\n"; -print "CREATE TABLE function_category ("; -print " cat_id smallint unsigned not null references function_category_name,"; -print " func_id int unsigned not null references function,"; -print " primary key (cat_id, func_id)"; -print ") type=myisam;\n\n"; - -print "DELETE FROM function_category_name;\n"; -print "DELETE FROM function_category;\n"; -print "DELETE FROM function;\n"; -print "SELECT \@cur_category:=null;\n\n"; - -my $in_section_6_3= 0; - -for(<>) -{ - if ($_=~/\@section Functions for Use in \@code{SELECT} and \@code{WHERE} Clauses/ && - !$in_section_6_3){ - $in_section_6_3= 1; - next; - } - - if ($_=~/\@section/ && $in_section_6_3){ - $in_section_6_3= 0; - next; - } - - if (!$in_section_6_3) { next; } - - my $c_name= ""; - - ($c_name)=m|\@c for_mysql_help,(.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsubsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($c_name)=m|\@subsection (.+?)$|; - if (!($c_name eq "") && ! ($c_name =~ m/$cat_name/i)){ - ($cat_name)= $c_name; - new_category($cat_name); - next; - } - - ($f_name)=m|\@findex (.+?)$|; - if (!($f_name eq "")){ - flush_all($mode); - ($func_name)= ($f_name); - $mode= "text"; - next; - } - - if ($_=~/\@example/ && ($mode eq "text")){ - $mode= "example"; - next; - } - - if ($_=~/\@end example/ && ($mode eq "example")){ - flush_all($mode); - next; - } - - if ($mode eq "text") { $text .= $_; } - if ($mode eq "example") { $example .= $_; } -} - - -print "DELETE function_category_name "; -print "FROM function_category_name "; -print "LEFT JOIN function_category ON function_category.cat_id=function_category_name.cat_id "; -print "WHERE function_category.cat_id is null;" - diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh deleted file mode 100644 index fc0c684c2dc..00000000000 --- a/scripts/fill_help_tables.sh +++ /dev/null @@ -1,603 +0,0 @@ -#!@PERL@ -# -# Copyright (C) 2003 MySQL AB -# For a more info consult the file COPYRIGHT distributed with this file. -# -# This script generates the SQL statements required by mysql_install_db to -# fill up the tables for the server-side online function help, which can be -# invoked with "help " from the MySQL client. -# -# Usage: -# fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql -# -# --help display this helpscreen and exit -# --verbose print information about help completeness to STDERR -# --lexems=path path to file with lexems. it is used with verbose option. -# default value is ../sql/lex.h -# Examples: -# ./fill_help_tables --help -# ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql -# ./fill_help_tables < manual.texi > fill_help_tables.sql -# -# Please note, that you first need to update Docs/manual.texi with the -# manual file from the separate "mysqldoc" BitKeeper-Tree! The manual.texi -# included in the source tree is just an empty stub file - the full manual -# is now maintained in a separate tree. -# -# extra tags in manual.texi: -# -# @c help_category [@] -# -# @c description_for_help_topic -# .... -# @c end_description_for_help_topic -# -# @c example_for_help_topic -# @example -# .... -# @end example -# -# -# Original version by Victor Vagin -# - -use strict; -use Getopt::Long; - -my $insert_portion_size= 15; -my $error_prefix= "---- help parsing errors :"; - -my $path_to_lex_file= "../sql/lex.h"; -my $verbose_option= 0; -my $help_option= 0; - -my $cur_line= 0; -my $count_errors= 0; - -GetOptions( - "help",\$help_option, - "verbose",\$verbose_option, - "lexems=s",\$path_to_lex_file -); - -if ($help_option ne 0) -{ - print <<_HELP; - -This script generates the SQL statements required by mysql_install_db to -fill up the tables for the server-side online function help, which can be -invoked with "help " from the MySQL client. - -Usage: - fill_help_tables OPTIONS < manual.texi > fill_help_tables.sql - - --help display this helpscreen and exit - --verbose print information about help completeness to STDERR - --lexems=path path to file with lexems. it is used with verbose option. - default value is ../sql/lex.h - -Examples: - ./fill_help_tables --help - ./fill_help_tables --verbose < manual.texi > fill_help_tables.sql - ./fill_help_tables < manual.texi > fill_help_tables.sql - -_HELP - exit; -} - -my $current_category= ""; -my $current_parent_category= ""; -my $next_example_for_topic= ""; - -my %topics; -my %categories; -my %keywords; - -$categories{Contents}->{__parent_category__}= ""; - -sub print_error -{ - my ($text)= @_; - if ($count_errors==0) - { - print STDERR "$error_prefix\n"; - } - print STDERR "line $cur_line : $text"; - $count_errors++; -} - -sub add_topic_to_category -{ - my ($topic_name)= @_; - - $categories{$current_category}->{$topic_name}= $topics{$topic_name}; - my $category= $categories{$current_category}; - $category->{__name__}= $current_category; - - if (exists($category->{__parent_category__})) - { - my $old_parent= $category->{__parent_category__}; - if ($old_parent ne $current_parent_category) - { - print_error "wrong parent for $current_category\n"; - } - } - - if ($current_parent_category ne "") - { - $category->{__parent_category__}= $current_parent_category; - } - - if (exists($topics{$topic_name}->{category})) - { - my $old_category= $topics{$topic_name}->{category}; - if ($old_category ne $category) - { - print_error "wrong category for $topic_name (first one's \"$old_category->{__name__}\" second one's \"$current_category\")\n"; - } - } - - $topics{$topic_name}->{category}= $category; -} - -sub add_example -{ - my ($topic_name,$example)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{example})) - { - print_error "double example for $topic_name\n"; - } - - $topics{$topic_name}->{example}= $example; - add_topic_to_category($topic_name); -} - -sub add_description -{ - my ($topic_name,$description)= @_; - - $topic_name=~ tr/a-z/A-Z/; - - if (exists($topics{$topic_name}->{description})) - { - print_error "double description for $topic_name\n"; - } - $topics{$topic_name}->{description}= $description; - add_topic_to_category($topic_name); -} - -sub add_keyword -{ - my ($topic_name,$keyword)= @_; - - $topic_name=~ tr/a-z/A-Z/; - $keyword=~ tr/a-z/A-Z/; - - push(@{$topics{$topic_name}->{keywords}},$keyword); - if (exists($keywords{$keyword}->{$topic_name})) - { - print_error "double keyword $keyword for $topic_name\n"; - } - $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; -} - -sub prepare_name -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet)/ /g; - $a =~ s/(\@end itemize)/ /g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)/ /g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@item/ /g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\'/\'\'/g; - $a =~ s/\\/\\\\/g; - $a =~ s/\`/\`\`/g; - - $a =~ s/\@table \@code/ /g; - $a =~ s/\(\)//g; - $a =~ s/\"/\\\"/g; - - $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; - $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; - $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; - - $a =~ s/((\s)+)$//g; - - return $a; -} - -sub prepare_description -{ - my ($a)= @_; - - $a =~ s/(\@itemize \@bullet\n)//g; - $a =~ s/(\@c help_keyword (.*?)\n)//g; - $a =~ s/(\@end itemize\n)//g; - $a =~ s/(\@end example\n)//g; - $a =~ s/(\@example\n)//g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@end multitable)/ /g; - $a =~ s/(\@end table)/ /g; - $a =~ s/(\@cindex(.*?)\n)//g; - $a =~ s/(\@findex(.*?)\n)//g; - $a =~ s/(\@table(.*?)\n)//g; - $a =~ s/(\@multitable \@columnfractions(.*?)\n)/ /g; - $a =~ s/(\@node(.*?)\n)/ /g; - $a =~ s/(\@tab)/\t/g; - $a =~ s/\@itemx/ /g; - $a =~ s/(\@item\n(\s*?))(\S)/ --- $3/g; - $a =~ s/(\@item)/ /g; - $a =~ s/(\@tindex\s(.*?)\n)//g; - $a =~ s/(\@c\s(.*?)\n)//g; - $a =~ s/\@minus\{\}/-/g; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@command\{((.|\n)+?)\}/$1/go; - $a =~ s/\@code\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/'$1'/go; - $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; - $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; - $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; - $a =~ s/\@w\{((.|\n)+?)\}/$1/go; - $a =~ s/\@strong\{((.|\n)+?)\}/\n!!!!\n$1\n!!!!\n/go; - $a =~ s/\@file\{((.|\n)+?)\}/\*$1/go; - $a =~ s/\\/\\\\/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n\n$/\n/g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - $a =~ s/\@table \@code/ /g; - - return $a; -} - -sub prepare_example -{ - my ($a)= @_; - - $a =~ s/(^\@c for_help_topic(.*?)\n)//g; - - $a =~ s/\@var\{((.|\n)+?)\}/$1/go; - $a =~ s/\@dots\{\}/.../g; - $a =~ s/\\/\\\\/g; - $a =~ s/(\@{)/{/g; - $a =~ s/(\@})/}/g; - $a =~ s/(\@\@)/\@/g; - $a =~ s/(\n*?)$//g; - $a =~ s/\n/\\n/g; - $a =~ s/\"/\\\"/g; - - return $a; -} - -sub parse_example -{ - return if (!($_=~/\@example/)); - return if ($next_example_for_topic eq ""); - - my $topic_name= $next_example_for_topic; - $next_example_for_topic= ""; - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@end example/); - $text .= $_; - } - - $text= prepare_example($text); - $topic_name= prepare_name($topic_name); - add_example($topic_name,$text) if ($topic_name ne ""); -} - -sub parse_example_for_topic -{ - my ($for_topic)= m|\@c example_for_help_topic (.+?)$|; - return if ($for_topic eq ""); - - $next_example_for_topic= $for_topic; -} - -sub parse_description -{ - my ($topic_description)= m|\@c description_for_help_topic (.+?)$|; - return if ($topic_description eq ""); - - my ($topic_name,$topic_keywords)= split(/ /,$topic_description); - - if ($topic_name eq "" || $topic_keywords eq "") - { - $topic_name= $topic_description; - } - else - { - my $keyword; - foreach $keyword (split(/ /,$topic_keywords)) - { - add_keyword($topic_name,$keyword) if ($keyword ne ""); - } - } - - my $text= ""; - - while (<>) - { - $cur_line++; - last if ($_=~/\@c end_description_for_help_topic/); - $text .= $_; - } - - $text= prepare_description($text); - $topic_name= prepare_name($topic_name); - add_description($topic_name,$text); -} - -sub parse_category -{ - my ($c_name,$pc_name)= m|\@c help_category (.+?)\@(.+?)$|; - - if ($pc_name ne "") - { - $current_category= prepare_name($c_name); - $current_parent_category= prepare_name($pc_name); - } - else - { - my ($c_name)=m|\@c help_category (.+?)$|; - return if ($c_name eq ""); - - $current_category= prepare_name($c_name); - $current_parent_category= "Contents" - } -} - -# parse manual: - -while (<>) -{ - parse_example_for_topic (); - parse_example (); - parse_description (); - parse_category (); - $cur_line++; -} - -# test results of parsing: - -sub print_bad_names -{ - my($names,$prompt)= @_; - if (scalar(@{$names})) - { - print STDERR "\n-------------- $prompt : \n\n"; - my $name; - foreach $name (@{$names}) - { - print STDERR "$name\n"; - } - print STDERR "\n"; - } -} - -sub print_verbose_errors -{ - my($name_of_log_file)= @_; - - my @without_help; - my @description_with_at; - my @example_with_at; - my @without_description; - my @without_example; - - print STDERR "\n-------------- parameters of help completeness : \n\n"; - - my $count_lex= 0; - if (!open (TLEX,"<$path_to_lex_file")) - { - print STDERR "Error opening lex file \"$path_to_lex_file\" $!\n"; - } - else - { - for () - { - my ($a,$lex,$b)=m|(.+?)\"(.+?)\"(.+?)$|; - next if ($lex eq ""); - $count_lex++; - next if (exists($topics{$lex}) || exists($keywords{$lex})); - push(@without_help,$lex); - } - close(TLEX); - print STDERR "number of lexems in \"$path_to_lex_file\" - $count_lex\n"; - } - - my $name; - my @topic_names= keys(%topics); - foreach $name (@topic_names) - { - my $topic= $topics{$name}; - push(@description_with_at,$name) if ($topic->{description}=~/\@/); - push(@example_with_at,$name) if ($topic->{example}=~/\@/); - push(@without_description,$name) if (!exists($topic->{description})); - push(@without_example,$name) if (!exists($topic->{example})); - } - - my $count_categories= scalar(keys(%categories)); - print STDERR "number of help categories - ",$count_categories,"\n"; - my $count_topics= scalar(@topic_names); - print STDERR "number of help topics - ",$count_topics,"\n"; - my $count_keywords= scalar(keys(%keywords)); - print STDERR "number of help keywords - ",$count_keywords,"\n"; - - my $count_without_help= scalar(@without_help); - my $percent_without_help= $count_lex ? - int (($count_without_help/$count_lex)*100) : - "100"; - print_bad_names(\@without_help,"lexems without help (". - $count_without_help." ~ ". - $percent_without_help."%)"); - print_bad_names(\@description_with_at, - " topics below have symbol \'@\' in their descriptions.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@example_with_at, - " topics below have symbol \'@\' in their examples.\n". - "it's probably the litter from 'texi' tags (script needs fixing)"); - print_bad_names(\@without_description,"topics without description"); - - my $count_without_example= scalar(@without_example); - my $percent_without_example= $count_topics ? - int (($count_without_example/$count_topics)*100) : - "100"; - print_bad_names(\@without_example,"topics without example (". - $count_without_example." ~ ". - $percent_without_example."%)"); -} - -print_verbose_errors if ($verbose_option ne 0); - -# output result - -sub print_insert_header -{ - my($count,$header)= @_; - - if ($count % $insert_portion_size ne 0) { - print ","; - } else { - print ";\n" if ($count ne 0); - print "$header"; - } -} - -print <{__id__}= $count; - $count++; - } - - my $header= "insert into help_category ". - "(help_category_id,name,parent_category_id) values "; - $count= 0; - foreach $cat_name (@category_names) - { - print_insert_header($count,$header); - my $parent_cat_name= $categories{$cat_name}->{__parent_category__}; - my $parent_cat_id= $parent_cat_name eq "" - ? "-1" : $categories{$parent_cat_name}->{__id__}; - print "($count,\"$cat_name\",$parent_cat_id)"; - $count++; - } - printf ";\n\n"; -} - -my @topic_names= keys(%topics); -if (scalar(@topic_names)) -{ - my $header= "insert into help_topic ". - "(help_topic_id,help_category_id,name,description,example) values "; - my $topic_name; - my $count= 0; - foreach $topic_name (@topic_names) - { - print_insert_header($count,$header); - my $topic= $topics{$topic_name}; - print "($count,"; - print "$topic->{category}->{__id__},"; - print "\"$topic_name\","; - print "\"$topic->{description}\","; - print "\"$topic->{example}\")"; - $topics{$topic_name}->{__id__}= $count; - $count++; - } - printf ";\n\n"; -} - -my @keywords_names= keys(%keywords); -if (scalar(@keywords_names)) -{ - my $header= "insert into help_keyword (help_keyword_id,name) values "; - my $keyword_name; - my $count= 0; - foreach $keyword_name (@keywords_names) - { - print_insert_header($count,$header); - print "($count,\"$keyword_name\")"; - $count++; - } - printf ";\n\n"; - - $header= "insert into help_relation ". - "(help_topic_id,help_keyword_id) values "; - $count= 0; - my $count_keyword= 0; - foreach $keyword_name (@keywords_names) - { - my $topic_name; - foreach $topic_name (keys(%{$keywords{$keyword_name}})) - { - print_insert_header($count,$header); - print "($topics{$topic_name}->{__id__},$count_keyword)"; - $count++; - } - $count_keyword++; - } - printf ";\n\n"; -} - -if ($count_errors) -{ - print STDERR "$count_errors errors !!!\n"; - exit 1; -} -- cgit v1.2.1 From 89838e1008ac1b175fd29b294408ee0e5b3ba702 Mon Sep 17 00:00:00 2001 From: "cbell/Chuck@mysql_cab_desk." <> Date: Thu, 29 Mar 2007 08:17:19 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This patch corrects errors that occurred in a local manual merge as a result of updating the local repository and includes changes necessary to correct problems found during the recalculation of next execution of events in RBR. --- scripts/mysql_system_tables.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7be5c94ad80..0c386fdc9c2 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -70,7 +70,7 @@ CALL create_slow_log_table(); DROP PROCEDURE create_slow_log_table; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; -- cgit v1.2.1 From bde1d63d7e38f5b288e00e98917c9805f7eb9fa6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 29 Mar 2007 16:42:08 +0200 Subject: Bug#26922 Test 'varbinary' fails to do copy_file on Windows - Copy all *.MY* files from std_data/, we have some .MYD and .MYI files from 4.1 there 5.0 version of make_win_bin_dist copies everything in std_data/ --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..1cd4141f532 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -302,6 +302,7 @@ cp mysql-test/std_data/*.cnf $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.dat $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.frm $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/ +cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/ cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ -- cgit v1.2.1 From c7c1b341f7c9843f97e2df8b5f0d90fb4355743b Mon Sep 17 00:00:00 2001 From: "cbell/Chuck@mysql_cab_desk." <> Date: Thu, 29 Mar 2007 16:43:00 -0400 Subject: WL#3629 - Replication of Invocation and Invoked Features This patch changes test to remove Windows-specific limitations and potential rounding errors in the calculation of a UDF. Also corrects a minor merge conflict. --- scripts/mysql_system_tables_fix.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 38c22d8f854..e9816bd21e9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -481,7 +481,7 @@ ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 - NOT NULL DEFAULT 'SYSTEM' AFTER comment; + NOT NULL DEFAULT 'SYSTEM' AFTER originator; # # TRIGGER privilege -- cgit v1.2.1 From 062ccf6905bbac5011deb617be50de4ac48c3d3e Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Mon, 2 Apr 2007 15:20:46 +0200 Subject: BUG#27489 build fix --- scripts/make_binary_distribution.sh | 43 +++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index eab3af29ad1..9101f7f0948 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -54,6 +54,21 @@ for arg do esac done +# Avoid too long command lines for cp (bug#27489) +MCP() { + for i + do + last=$i + done + for i + do + if test "x$i" != "x$last" + then + cp -p $i $last + fi + done +} + # Remove vendor from $system system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` @@ -253,25 +268,25 @@ copyfileto $BASE/mysql-test \ mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf -$CP mysql-test/lib/*.pl $BASE/mysql-test/lib -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/include/*.test $BASE/mysql-test/include -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ +MCP mysql-test/lib/*.pl $BASE/mysql-test/lib +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/include/*.inc $BASE/mysql-test/include +MCP mysql-test/include/*.test $BASE/mysql-test/include +MCP mysql-test/t/*.def $BASE/mysql-test/t +MCP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data -$CP mysql-test/t/*.test $BASE/mysql-test/t -$CP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t -$CP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t -$CP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -$CP mysql-test/r/*.result $BASE/mysql-test/r -$CP mysql-test/r/*.require $BASE/mysql-test/r -$CP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests -$CP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests +MCP mysql-test/t/*.test $BASE/mysql-test/t +MCP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t +MCP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t +MCP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +MCP mysql-test/r/*.result $BASE/mysql-test/r +MCP mysql-test/r/*.require $BASE/mysql-test/r +MCP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests +MCP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* -- cgit v1.2.1 From 817670eeeeb4a9fdde13bd411a5d7545d3f478b1 Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Wed, 4 Apr 2007 14:19:47 +0200 Subject: build fixes for 5.1.17 --- scripts/make_win_bin_dist | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 146dcad95f1..9916d71e724 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,6 +126,15 @@ if [ -e $DESTDIR ] ; then usage fi +# ---------------------------------------------------------------------- +# Adjust target name if needed, release with debug info has another name +# ---------------------------------------------------------------------- + +if [ x"$TARGET" = x"release" -a -f "client/relwithdebinfo/mysql.exe" ] +then + TARGET="relwithdebinfo" +fi + # ---------------------------------------------------------------------- # Copy executables, and client DLL (FIXME why?) # ---------------------------------------------------------------------- @@ -134,18 +143,20 @@ trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR mkdir $DESTDIR mkdir $DESTDIR/bin -cp client/$TARGET/*.exe $DESTDIR/bin/ -cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ -cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ +cp client/$TARGET/*.exe $DESTDIR/bin/ +cp extra/$TARGET/*.exe $DESTDIR/bin/ +cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp tests/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe +cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then @@ -342,6 +353,9 @@ done cp -pR sql/share $DESTDIR/ +# The SQL initiation code is really expected to be in "share" +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- -- cgit v1.2.1 From 463b34e77b187a4d6f725076de6713b7d49a9e5e Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 5 Apr 2007 08:36:56 +0200 Subject: zlib.m4: Only require the more recent zlibCompileFlags() when building the server, client zlib don't need it. Makefile.am: Always build the bundled zlib static only configure.in: Look for dlopen() even if --with-mysqld-ldflags constains "-static", as this is not the same as the flag to "ld", it just informs "libtool" to link static with libraries created part of the build, even if there exists shared versions. make_binary_distribution.sh: Real "mysqlmanager" executable might be in ".libs" --- scripts/make_binary_distribution.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 7d7918975f2..e8bf39bd016 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -115,7 +115,12 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -# Copy files if they exists, warn for those that don't +# Copy files if they exists, warn for those that don't. +# Note that when listing files to copy, we might list the file name +# twice, once in the directory location where it is build, and a +# second time in the ".libs" location. In the case the firs one +# is a wrapper script, the second one will overwrite it with the +# binary file. copyfileto() { destdir=$1 @@ -165,6 +170,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then # For all other platforms: else BIN_FILES="$BIN_FILES \ + server-tools/instance-manager/.libs/mysqlmanager \ client/mysqltestmanagerc \ client/mysqltestmanager-pwgen tools/mysqltestmanager \ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ -- cgit v1.2.1 From 6d70fd8751b09e78018a0a79047c7e84e8cf6e40 Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Wed, 11 Apr 2007 14:27:03 +0200 Subject: don't copy pdb files from the release target output folder, since this target does not build them --- scripts/make_win_bin_dist | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 862c572a75a..2e10e530ca6 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -146,7 +146,11 @@ mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.{exe,map,pdb} $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ +if [ x"$TARGET" != x"release" ] +then + cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ +fi cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ @@ -155,8 +159,11 @@ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map +if [ x"$TARGET" != x"release" ] +then + cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb +fi if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = "yes" ] ; then -- cgit v1.2.1 From 74dfba96e73bb00feb518f070ac41c10891965f7 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 12 Apr 2007 17:48:28 +0200 Subject: Bug#27783 mysql_install_db should be able to install again, preserving existing files. - Allow mysql_install_db to be run a second time in the same datadir to create and fill any missing system tables --- scripts/mysql_install_db.sh | 11 ----------- scripts/mysql_system_tables.sql | 5 +++++ scripts/mysql_system_tables_data.sql | 22 +++++++++++++++------- 3 files changed, 20 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c1a27eb0bc8..63995eb1575 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -135,17 +135,6 @@ else fi fi -# Check that no previous MySQL installation exist -if test -f "$ldata/mysql/db.frm" -then - echo "FATAL ERROR: Found already existing MySQL system tables" - echo "in $ldata." - echo "If you are upgrading from a previous MySQL version you" - echo "should run '$bindir/mysql_upgrade', " - echo "to upgrade all tables for this version of MySQL" - exit 1; -fi - # Find SQL scripts needed for bootstrap fill_help_tables="fill_help_tables.sql" create_system_tables="mysql_system_tables.sql" diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 5f5aea20729..d9c870f1d73 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -6,12 +6,17 @@ set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; +-- Remember for later if db table already existed +set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +-- Remember for later if user table already existed +set @had_user_table= @@warning_count != 0; + CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index a9c816f2896..5f0289ab197 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -2,12 +2,20 @@ -- The inital data for system tables of MySQL Server -- --- default grants for anyone to access database 'test' and 'test_%' -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); -INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +-- Fill "db" table with default grants for anyone to +-- access database 'test' and 'test_%' if "db" table didn't exist +CREATE TEMPORARY TABLE tmp_db LIKE db; +INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); +INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0; +DROP TABLE tmp_db; --- default users allowing root access from local machine -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +-- Fill "users" table with default users allowing root access +-- from local machine if "users" table didn't exist before +CREATE TEMPORARY TABLE tmp_user LIKE user; +INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; +DROP TABLE tmp_user; -- cgit v1.2.1 From 20e622dcf3d287cb8934ab7ad1d9a0cc90f88a45 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 18 Apr 2007 13:21:39 +0200 Subject: Bug#25452 mysql_upgrade access denied - Improve mysql_upgrade and add comments describing it's logic - Don't look for mysql and mysqlcheck randomly, use dir where mysql_upgrade was started from - Don't look for mysql_fix_privilege_tables.sql randomly, compile in the mysql_fix_privilege_tables.sql file and use that to upgrade the system tables of MySQL - Check for any unexpected error returned from runnning the mysql_fix_privilege_tables SQL - Fix bug#26639, bug#24248 and bug#25405 --- scripts/CMakeLists.txt | 28 ++++++++++++ scripts/Makefile.am | 14 ++++++ scripts/comp_sql.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100755 scripts/CMakeLists.txt create mode 100644 scripts/comp_sql.c (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100755 index 00000000000..8580844097e --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +ADD_EXECUTABLE(comp_sql comp_sql.c) +TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) + +# Build comp_sql - used for embedding SQL in C or C++ programs +GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) + +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + COMMAND ${COMP_SQL_EXE} + ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql + ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) + diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d7053a86b3a..e4a75ab4591 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -165,5 +165,19 @@ SUFFIXES = .sh @CHMOD@ +x $@-t @MV@ $@-t $@ + +BUILT_SOURCES = mysql_fix_privilege_tables_sql.c +noinst_PROGRAMS = comp_sql + +# +# Build mysql_fix_privilege_tables_sql.c from +# mysql_fix_privileges_tables.sql using comp_sql +# +mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql + $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) + $(top_builddir)/scripts/comp_sql$(EXEEXT) \ + mysql_fix_privilege_tables.sql $@ + + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c new file mode 100644 index 00000000000..60236774701 --- /dev/null +++ b/scripts/comp_sql.c @@ -0,0 +1,119 @@ +/* Copyright (C) 2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + Written by Magnus Svensson +*/ + +/* + Converts a SQL file into a C file that can be compiled and linked + into other programs +*/ + +#include +#include +#include + +FILE *in, *out; + +static void die(const char *fmt, ...) +{ + va_list args; + + /* Print the error message */ + fprintf(stderr, "FATAL ERROR: "); + if (fmt) + { + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + } + else + fprintf(stderr, "unknown error"); + fprintf(stderr, "\n"); + fflush(stderr); + + /* Close any open files */ + if (in) + fclose(in); + if (out) + fclose(out); + + exit(1); +} + + +int main(int argc, char *argv[]) +{ + char buff[512]; + char* infile_name= argv[1]; + char* outfile_name= argv[2]; + char* end= infile_name; + + if (argc != 3) + die("Usage: comp_sql "); + + /* Open input and output file */ + if (!(in= fopen(infile_name, "r"))) + die("Failed to open SQL file '%s'", infile_name); + if (!(out= fopen(outfile_name, "w"))) + die("Failed to open output file '%s'", outfile_name); + + while(*end && *end != '.') + end++; + *end= 0; + fprintf(out, "const char* %s={\"\\\n", infile_name); + + while (fgets(buff, sizeof(buff), in)) + { + char *curr= buff; + while (*curr) + { + if (*curr == '\n') + { + /* + Reached end of line, add escaped newline, escaped + backslash and a newline to outfile + */ + fprintf(out, "\\n\\\n"); + curr++; + } + else if (*curr == '\r') + { + curr++; /* Skip */ + } + else + { + if (*curr == '"') + { + /* Needs escape */ + fputc('\\', out); + } + + fputc(*curr, out); + curr++; + } + } + } + + fprintf(out, "\\\n\"};\n"); + + fclose(in); + fclose(out); + + exit(0); + +} + -- cgit v1.2.1 From 76285bdf31d0add956441eb81db7a90b5950f05f Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 18 Apr 2007 16:23:19 +0200 Subject: Update mysql_upgrade tests for 5.1 Add "two liner" to mysqld --bootstrap that allows wo write scripts that can be run both by mysql and mysqld --bootstrap Remove duplicate create of MySQL system tables --- scripts/mysql_system_tables.sql | 18 ++++++++--------- scripts/mysql_system_tables_fix.sql | 39 ------------------------------------- 2 files changed, 9 insertions(+), 48 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 3250aa0fc9a..c779d174d12 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,15 +65,15 @@ CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NU CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END; -CALL create_general_log_table(); -DROP PROCEDURE create_general_log_table; - - -CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END; -CALL create_slow_log_table(); -DROP PROCEDURE create_slow_log_table; - +delimiter ;; +CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END;; +CALL create_general_log_table();; +DROP PROCEDURE create_general_log_table;; + +CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END;; +CALL create_slow_log_table();; +DROP PROCEDURE create_slow_log_table;; +delimiter ; CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index e9816bd21e9..7985dc1802e 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -388,43 +388,6 @@ ALTER TABLE proc MODIFY db MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; -# -# Create missing log tables (5.1) -# - -delimiter // -CREATE PROCEDURE create_log_tables() -BEGIN - DECLARE is_csv_enabled int DEFAULT 0; - SELECT @@have_csv = 'YES' INTO is_csv_enabled; - IF (is_csv_enabled) THEN - CREATE TABLE IF NOT EXISTS general_log ( - event_time TIMESTAMP NOT NULL, - user_host MEDIUMTEXT, - thread_id INTEGER, - server_id INTEGER, - command_type VARCHAR(64), - argument MEDIUMTEXT - ) engine=CSV CHARACTER SET utf8 comment='General log'; - CREATE TABLE IF NOT EXISTS slow_log ( - start_time TIMESTAMP NOT NULL, - user_host MEDIUMTEXT NOT NULL, - query_time TIME NOT NULL, - lock_time TIME NOT NULL, - rows_sent INTEGER NOT NULL, - rows_examined INTEGER NOT NULL, - db VARCHAR(512), - last_insert_id INTEGER, - insert_id INTEGER, - server_id INTEGER, - sql_text MEDIUMTEXT NOT NULL - ) engine=CSV CHARACTER SET utf8 comment='Slow log'; - END IF; -END// -delimiter ; -CALL create_log_tables(); -DROP PROCEDURE create_log_tables; - # # EVENT privilege # @@ -503,8 +466,6 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; -CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; - # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From 50669c43ac4e085d5e1e6d78d7c1ef4eefd416da Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Wed, 18 Apr 2007 19:34:33 +0200 Subject: Add CMakeLists.txt to EXTRA_DIST --- scripts/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e4a75ab4591..e9398fc1a72 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -65,7 +65,8 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ make_win_bin_dist \ - mysql_system_tables_fix.sql + mysql_system_tables_fix.sql \ + CMakeLists.txt dist_pkgdata_DATA = fill_help_tables.sql \ mysql_fix_privilege_tables.sql \ -- cgit v1.2.1 From 41c41448b95fd7c24611d7650c9ea040ead07e56 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 19 Apr 2007 17:00:29 +0200 Subject: mysql_upgrade win fixes --- scripts/CMakeLists.txt | 9 ++++++--- scripts/comp_sql.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8580844097e..cb5efd0ff9b 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -20,9 +20,12 @@ TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) # Build comp_sql - used for embedding SQL in C or C++ programs GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} - ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql - ${PROJECT_SOURCE_DIR}/client/mysql_fix_privilege_tables_sql.c + mysql_fix_privilege_tables.sql + mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) +ADD_CUSTOM_TARGET(GenFixPrivs + ALL + DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 60236774701..328dab0cf13 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) while(*end && *end != '.') end++; *end= 0; - fprintf(out, "const char* %s={\"\\\n", infile_name); + fprintf(out, "const char* %s={\n\"", infile_name); while (fgets(buff, sizeof(buff), in)) { @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) Reached end of line, add escaped newline, escaped backslash and a newline to outfile */ - fprintf(out, "\\n\\\n"); + fprintf(out, "\\n \"\n\""); curr++; } else if (*curr == '\r') -- cgit v1.2.1 From da93a36a0e6a137861d9bc6b1f04b86d89e8c1e3 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Thu, 19 Apr 2007 21:30:46 +0200 Subject: mysql_upgrade portability fixes --- scripts/comp_sql.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 328dab0cf13..53359d384c1 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -106,6 +106,15 @@ int main(int argc, char *argv[]) curr++; } } + if (*(curr-1) != '\n') + { + /* + Some compilers have a max string length, + insert a newline at every 512th char in long + strings + */ + fprintf(out, "\"\n\""); + } } fprintf(out, "\\\n\"};\n"); -- cgit v1.2.1 From b0d923d73bdb4ec8ceb35d96190fc03a1b1d177f Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Fri, 20 Apr 2007 20:46:55 +0200 Subject: Don't copy subidrs of scripts/ --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 2e10e530ca6..42fade7cbd2 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -352,7 +352,7 @@ mkdir -p $DESTDIR/scripts for i in `cd scripts && ls`; do \ if echo $i | grep -q '\.sh'; then \ cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \ - elif [ $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ + elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ : ; \ else \ cp scripts/$i $DESTDIR/scripts/$i; \ -- cgit v1.2.1 From 1561c39c5d91370178999584ddd30d7314ce1a8a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 23 Apr 2007 14:01:48 +0200 Subject: Add "name of struct" as first arg to comp_sql Fix "make distcheck" --- scripts/CMakeLists.txt | 1 + scripts/Makefile.am | 32 ++++++++++++++++++-------------- scripts/comp_sql.c | 15 ++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index cb5efd0ff9b..bca0581ecbc 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -22,6 +22,7 @@ GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} + mysql_fix_privilege_tables mysql_fix_privilege_tables.sql mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e9398fc1a72..79f4666f855 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -15,6 +15,11 @@ ## Process this file with automake to create Makefile.in +BUILT_SOURCES = mysql_fix_privilege_tables.sql \ + mysql_fix_privilege_tables_sql.c + +noinst_PROGRAMS = comp_sql + bin_SCRIPTS = @server_scripts@ \ msql2mysql \ mysql_config \ @@ -94,7 +99,8 @@ CLEANFILES = @server_scripts@ \ mysql_upgrade_shell \ mysqld_multi \ make_win_src_distribution \ - mysql_fix_privilege_tables.sql + mysql_fix_privilege_tables.sql \ + mysql_fix_privilege_tables_sql.c # mysqlbug should be distributed built so that people can report build # failures with it. @@ -111,6 +117,17 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ @echo "Building $@"; @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ +# +# Build mysql_fix_privilege_tables_sql.c from +# mysql_fix_privileges_tables.sql using comp_sql +# +mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql + $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) + $(top_builddir)/scripts/comp_sql$(EXEEXT) \ + mysql_fix_privilege_tables \ + $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ + + SUFFIXES = .sh .sh: @@ -167,18 +184,5 @@ SUFFIXES = .sh @MV@ $@-t $@ -BUILT_SOURCES = mysql_fix_privilege_tables_sql.c -noinst_PROGRAMS = comp_sql - -# -# Build mysql_fix_privilege_tables_sql.c from -# mysql_fix_privileges_tables.sql using comp_sql -# -mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - $(top_builddir)/scripts/comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables.sql $@ - - # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 53359d384c1..88e88e632b6 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -58,12 +58,12 @@ static void die(const char *fmt, ...) int main(int argc, char *argv[]) { char buff[512]; - char* infile_name= argv[1]; - char* outfile_name= argv[2]; - char* end= infile_name; + char* struct_name= argv[1]; + char* infile_name= argv[2]; + char* outfile_name= argv[3]; - if (argc != 3) - die("Usage: comp_sql "); + if (argc != 4) + die("Usage: comp_sql "); /* Open input and output file */ if (!(in= fopen(infile_name, "r"))) @@ -71,10 +71,7 @@ int main(int argc, char *argv[]) if (!(out= fopen(outfile_name, "w"))) die("Failed to open output file '%s'", outfile_name); - while(*end && *end != '.') - end++; - *end= 0; - fprintf(out, "const char* %s={\n\"", infile_name); + fprintf(out, "const char* %s={\n\"", struct_name); while (fgets(buff, sizeof(buff), in)) { -- cgit v1.2.1 From 4a1fd222cea3cb2297870761ca60538e1a271b07 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 23 Apr 2007 18:16:57 +0200 Subject: Don't copy any subdirs in scripts/ --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 5d4c7ab917d..87d35a0850b 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -345,7 +345,7 @@ mkdir -p $DESTDIR/scripts for i in `cd scripts && ls`; do \ if echo $i | grep -q '\.sh'; then \ cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \ - elif [ $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ + elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ : ; \ else \ cp scripts/$i $DESTDIR/scripts/$i; \ -- cgit v1.2.1 From 0f43ac0d2acd5bcbdbf2c54fe671aab4226b30f8 Mon Sep 17 00:00:00 2001 From: "iggy@alf." <> Date: Tue, 24 Apr 2007 12:41:08 -0400 Subject: Minor fixes. --- scripts/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bca0581ecbc..e9113b098da 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -13,20 +13,30 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# Build mysql_fix_privilege_tables.sql +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql + COMMAND copy /b + mysql_system_tables.sql + mysql_system_tables_fix.sql + mysql_fix_privilege_tables.sql + DEPENDS + ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql + ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql) +# Build comp_sql - used for embedding SQL in C or C++ programs ADD_EXECUTABLE(comp_sql comp_sql.c) TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) -# Build comp_sql - used for embedding SQL in C or C++ programs +# Use comp_sql to build mysql_fix_privilege_tables_sql.c GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} mysql_fix_privilege_tables mysql_fix_privilege_tables.sql - mysql_fix_privilege_tables_sql.c + mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) +# Add dummy target for the above to be built ADD_CUSTOM_TARGET(GenFixPrivs ALL DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) -- cgit v1.2.1 From 4d34614389c68d99439e3c16fa0d16e4c0955022 Mon Sep 17 00:00:00 2001 From: "tsmith@quadxeon.mysql.com" <> Date: Wed, 25 Apr 2007 09:16:38 +0200 Subject: mysql_install_db.sh: Disable broken quoting of extra arguments; proper fix requires using eval and lots more quoting throughout the script --- scripts/mysql_install_db.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 63995eb1575..f90e99ec468 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -79,7 +79,10 @@ parse_arguments() { then # This sed command makes sure that any special chars are quoted, # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + # XXX: This is broken; true fix requires using eval and proper + # quoting of every single arg ($basedir, $ldata, etc.) + #args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + args="$args $arg" fi ;; esac -- cgit v1.2.1 From 70a742f8171cb6f0a8a23d84edbbe390364b7872 Mon Sep 17 00:00:00 2001 From: "tsmith@quadxeon.mysql.com" <> Date: Fri, 27 Apr 2007 00:35:09 +0200 Subject: mysql_install_db.sh: Fix algorithm for finding pkgdata directory --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f90e99ec468..934d245db15 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -154,6 +154,7 @@ else if test -f $i/$fill_help_tables then pkgdatadir=$i + break fi done -- cgit v1.2.1 From b90b0c7eb28993ca1abe5e288702efb309ba27a2 Mon Sep 17 00:00:00 2001 From: "tsmith@quadxeon.mysql.com" <> Date: Sat, 28 Apr 2007 01:27:54 +0200 Subject: Bug #27390: mysqld_multi --config-file= not working as documented Recognize the --no-defaults, --defaults-file and --defaults-extra-file options. Treat old --config-file argument as if --defaults-extra-file had been specified instead. Plus a few other defaults-related cleanups. --- scripts/mysqld_multi.sh | 312 ++++++++++++++++++++---------------------------- 1 file changed, 127 insertions(+), 185 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index a664bcfd3ad..92cfbe3ef22 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,9 +4,10 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.15"; +$VER="2.16"; + +my @defaults_options; # Leading --no-defaults, --defaults-file, etc. -$opt_config_file = undef(); $opt_example = 0; $opt_help = 0; $opt_log = undef(); @@ -49,54 +50,52 @@ sub main print "MySQL distribution.\n"; $my_print_defaults_exists= 0; } - if ($my_print_defaults_exists) + + # Remove leading defaults options from @ARGV + while (@ARGV > 0) + { + last unless $ARGV[0] =~ + /^--(?:no-defaults$|(?:defaults-file|defaults-extra-file)=)/; + push @defaults_options, (shift @ARGV); + } + + # Handle deprecated --config-file option: convert to --defaults-extra-file + foreach my $arg (@ARGV) { - foreach my $arg (@ARGV) + if ($arg =~ m/^--config-file=(.*)/) { - if ($arg =~ m/^--config-file=(.*)/) - { - if (!length($1)) - { - die "Option config-file requires an argument\n"; - } - elsif (!( -e $1 && -r $1)) - { - die "Option file '$1' doesn't exists, or is not readable\n"; - } - else - { - $opt_config_file= $1; - if (!($opt_config_file =~ m/\//)) - { - # No path. Use current working directory - $opt_config_file= "./" . $opt_config_file; - } - } - } + # Put it at the beginning of the list, so it has lower precedence + # than a correct --defaults-extra-file option + + unshift @defaults_options, "--defaults-extra-file=$1"; } - my $com= "my_print_defaults "; - $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); - $com.= "mysqld_multi"; - my @defops = `$com`; - chop @defops; - splice @ARGV, 0, 0, @defops; } - if (!GetOptions("help","example","version","mysqld=s","mysqladmin=s", - "config-file=s","user=s","password=s","log=s","no-log", - "tcp-ip", "silent","verbose")) + + foreach (@defaults_options) { - $flag_exit= 1; + $_ = quote_shell_word($_); } - if (defined($opt_config_file) && !($opt_config_file =~ m/\//)) + + # Add [mysqld_multi] options to front of @ARGV, ready for GetOptions() + unshift @ARGV, defaults_for_group('mysqld_multi'); + + # The --config-file option can be ignored; if passed on the command + # line, it's already handled; if specified in the configuration file, + # it's redundant and not useful + @ARGV= grep { not /^--config-file=/ } @ARGV; + + # We've already handled --no-defaults, --defaults-file, etc. + if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s", + "user=s", "password=s", "log=s", "no-log", + "tcp-ip", "silent", "verbose")) { - # No path. Use current working directory - $opt_config_file= "./" . $opt_config_file; + $flag_exit= 1; } usage() if ($opt_help); if ($opt_verbose && $opt_silent) { - print "Both --verbose and --silent has been given. Some of the warnings "; + print "Both --verbose and --silent have been given. Some of the warnings "; print "will be disabled\nand some will be enabled.\n\n"; } @@ -168,51 +167,42 @@ sub main } } -#### -#### Quote option argument. Add double quotes around the argument -#### and escape the following: $, \, " -#### This function is needed, because my_print_defaults drops possible -#### quotes, single or double, from in front of an argument and from -#### the end. -#### +# +# Quote word for shell +# -sub quote_opt_arg +sub quote_shell_word { my ($option)= @_; - if ($option =~ m/(\-\-[a-zA-Z0-9\_\-]+)=(.*)/) - { - $option= $1; - $arg= $2; - $arg=~ s/\\/\\\\/g; # Escape escape character first to avoid doubling. - $arg=~ s/\$/\\\$/g; - $arg=~ s/\"/\\\"/g; - $arg= "\"" . $arg . "\""; - $option= $option . "=" . $arg; - } + $option =~ s!([^\w=./-])!\\$1!g; return $option; } +sub defaults_for_group +{ + my ($group) = @_; + + return () unless $my_print_defaults_exists; + + my $com= join ' ', 'my_print_defaults', @defaults_options, $group; + my @defaults = `$com`; + chomp @defaults; + return @defaults; +} + #### #### Init log file. Check for appropriate place for log file, in the following -#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp +#### order: my_print_defaults mysqld datadir, @datadir@ #### sub init_log { - if ($my_print_defaults_exists) + foreach my $opt (defaults_for_group('mysqld')) { - @mysqld_opts= `my_print_defaults mysqld`; - chomp @mysqld_opts; - foreach my $opt (@mysqld_opts) + if ($opt =~ m/^--datadir=(.*)/ && -d "$1" && -w "$1") { - if ($opt =~ m/^\-\-datadir[=](.*)/) - { - if (-d "$1" && -w "$1") - { - $logdir= $1; - } - } + $logdir= $1; } } if (!defined($logdir)) @@ -303,11 +293,7 @@ sub start_mysqlds() @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; + @options = defaults_for_group($groups[$i]); $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); @@ -326,7 +312,7 @@ sub start_mysqlds() } else { - $options[$j]= quote_opt_arg($options[$j]); + $options[$j]= quote_shell_word($options[$j]); $tmp.= " $options[$j]"; } } @@ -401,11 +387,7 @@ sub get_mysqladmin_options my ($i, @groups)= @_; my ($mysqladmin_found, $com, $tmp, $j); - $com = "my_print_defaults"; - $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; - $com.= " $groups[$i]"; - @options = `$com`; - chop @options; + @options = defaults_for_group($groups[$i]); $mysqladmin_found= 1; # The default $mysqladmin_found= 0 if (!length($mysqladmin)); @@ -445,129 +427,81 @@ sub get_mysqladmin_options return $com; } -#### -#### Find groups. Takes the valid group numbers as an argument, parses -#### them, puts them in the ascending order, removes duplicates and -#### returns the wanted groups accordingly. -#### +# Return a list of option files which can be opened. Similar, but not +# identical, to behavior of my_search_option_files() +sub list_defaults_files +{ + my %opt; + foreach (@defaults_options) + { + return () if /^--no-defaults$/; + $opt{$1} = $2 if /^--defaults-(extra-file|file)=(.*)$/; + } + + return ($opt{file}) if exists $opt{file}; + + my %seen; # Don't list the same file more than once + return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ } + ('/etc/my.cnf', + '/etc/mysql/my.cnf', + '@sysconfdir@/my.cnf', + ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef), + $opt{'extra-file'}, + ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef)); +} + +# Takes a specification of GNRs (see --help), and returns a list of matching +# groups which actually are mentioned in a relevant config file sub find_groups { my ($raw_gids) = @_; - my (@groups, @data, @tmp, $line, $i, $k, @pre_gids, @gids, @tmp2, - $prev_value); - # Read the lines from the config file to variable 'data' - if (defined($opt_config_file)) - { - open(MY_CNF, "<$opt_config_file") && (@data=) && close(MY_CNF); - } - else - { - if (-f "@sysconfdir@/my.cnf" && -r "@sysconfdir@/my.cnf") - { - open(MY_CNF, "<@sysconfdir@/my.cnf") && (@tmp=) && close(MY_CNF); - } elsif (-f "/etc/my.cnf" && -r "/etc/my.cnf") - { - open(MY_CNF, ") && close(MY_CNF); - } - for ($i = 0; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - if (-f "/etc/mysql/my.cnf" && -r "/etc/mysql/my.cnf") - { - open(MY_CNF, ") && close(MY_CNF); - } - for (; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - if (defined($ENV{MYSQL_HOME}) && -f "$ENV{MYSQL_HOME}/my.cnf" && - -r "$ENV{MYSQL_HOME}/my.cnf") - { - open(MY_CNF, "<$ENV{MYSQL_HOME}/my.cnf") && (@tmp=) && - close(MY_CNF); - } - for (; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - if (-f "$homedir/.my.cnf" && -r "$homedir/.my.cnf") - { - open(MY_CNF, "<$homedir/.my.cnf") && (@tmp=) && close(MY_CNF); - } - for (; ($line = shift @tmp); $i++) - { - $data[$i] = $line; - } - } - chomp @data; - # Make a list of the wanted group ids - if (defined($raw_gids)) - { - @pre_gids = split(',', $raw_gids); - } + my %gids; + my @groups; + if (defined($raw_gids)) { - for ($i = 0, $j = 0; defined($pre_gids[$i]); $i++) + # Make a hash of the wanted group ids + foreach my $raw_gid (split ',', $raw_gids) { - if ($pre_gids[$i] =~ m/^(\d+)$/) + # Match 123 or 123-456 + my ($start, $end) = ($raw_gid =~ /^\s*(\d+)(?:\s*-\s*(\d+))?\s*$/); + $end = $start if not defined $end; + if (not defined $start or $end < $start or $start < 0) { - $gids[$j] = $1; - $j++; + print "ABORT: Bad GNR: $raw_gid; see $my_progname --help\n"; + exit(1); } - elsif ($pre_gids[$i] =~ m/^(\d+)(\-)(\d+)$/) - { - for ($k = $1; $k <= $3; $k++) - { - $gids[$j] = $k; - $j++; - } - } - else + + foreach my $i ($start .. $end) { - print "ABORT: Bad GNR: $pre_gids[$i] See $my_progname --help\n"; - exit(1); + # Use $i + 0 to normalize numbers (002 + 0 -> 2) + $gids{$i + 0}= 1; } } } - # Sort the list of gids numerically in ascending order - @gids = sort {$a <=> $b} @gids; - # Remove non-positive integers and duplicates - for ($i = 0, $j = 0; defined($gids[$i]); $i++) - { - next if ($gids[$i] <= 0); - if (!$i || $prev_value != $gids[$i]) - { - $tmp2[$j] = $gids[$i]; - $j++; - } - $prev_value = $gids[$i]; - } - @gids = @tmp2; - # Find and return the wanted groups - for ($i = 0, $j = 0; defined($data[$i]); $i++) + + my @defaults_files = list_defaults_files(); + #warn "@{[sort keys %gids]} -> @defaults_files\n"; + foreach my $file (@defaults_files) { - if ($data[$i] =~ m/^(\s*\[\s*)(mysqld)(\d+)(\s*\]\s*)$/) + next unless open CONF, "< $file"; + + while () { - if (defined($raw_gids)) - { - for ($k = 0; defined($gids[$k]); $k++) - { - if ($gids[$k] == $3) - { - $groups[$j] = $2 . $3; - $j++; - } - } - } - else + if (/^\s*\[\s*(mysqld)(\d+)\s*\]\s*$/) { - $groups[$j] = $2 . $3; - $j++; + #warn "Found a group: $1$2\n"; + # Use $2 + 0 to normalize numbers (002 + 0 -> 2) + if (not defined($raw_gids) or $gids{$2 + 0}) + { + push @groups, "$1$2"; + } } } + + close CONF; } return @groups; } @@ -806,8 +740,16 @@ groups found will either be started, stopped, or reported. Note that syntax for specifying GNRs must appear without spaces. Options: ---config-file=... Alternative config file. - Using: $opt_config_file + +These options must be given before any others: +--no-defaults Do not read any defaults file +--defaults-file=... Read only this configuration file, do not read the + standard system-wide and user-specific files +--defaults-extra-file=... Read this configuration file in addition to the + standard system-wide and user-specific files +Using: @{[join ' ', @defaults_options]} + +--config-file=... Deprecated, please use --defaults-extra-file instead --example Give an example of a config file with extra information. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: -- cgit v1.2.1 From dbd683a7d902d5e1712b616adee45a20ea3c8887 Mon Sep 17 00:00:00 2001 From: "serg@sergbook.mysql.com" <> Date: Mon, 30 Apr 2007 07:45:56 -0700 Subject: mysql-test/mysql-test-run.pl: another mysqld --help fix scripts/mysql_install_db.sh: don't fail if --skip-XXX is not recognized --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 8ff7a9c11e1..506f1e58cbf 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -270,8 +270,8 @@ fi # Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ---basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-ndbcluster $args --max_allowed_packet=8M \ +--basedir=$basedir --datadir=$ldata --loose-skip-innodb \ +--loose-skip-ndbcluster $args --max_allowed_packet=8M \ --net_buffer_length=16K" # Pipe mysql_system_tables.sql to "mysqld --bootstrap" -- cgit v1.2.1 From 8b0f68331bf626566ac9a50146189ecab8a0b401 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Mon, 30 Apr 2007 17:01:00 +0200 Subject: Necessary change for cross-builds: Include "mysql_fix_privilege_tables_sql.c" in the source tarball. --- scripts/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 79f4666f855..52c1b6140d3 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -18,7 +18,7 @@ BUILT_SOURCES = mysql_fix_privilege_tables.sql \ mysql_fix_privilege_tables_sql.c -noinst_PROGRAMS = comp_sql +EXTRA_PROGRAMS = comp_sql bin_SCRIPTS = @server_scripts@ \ msql2mysql \ @@ -70,6 +70,8 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ make_win_bin_dist \ + mysql_fix_privilege_tables.sql \ + mysql_fix_privilege_tables_sql.c \ mysql_system_tables_fix.sql \ CMakeLists.txt -- cgit v1.2.1 From bb2996f48705b27d57cd2fcfba76af2902d71b73 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 2 May 2007 14:01:49 +0200 Subject: Format corrections for various "Makefile.am": Leading tab, no trailing blank. --- scripts/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 79f4666f855..97691318cc6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -124,7 +124,7 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) $(top_builddir)/scripts/comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ + mysql_fix_privilege_tables \ $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ -- cgit v1.2.1 From f4f9480785643fdfd548c4ef392e7deab0691cd4 Mon Sep 17 00:00:00 2001 From: "iggy@recycle.(none)" <> Date: Wed, 2 May 2007 12:41:36 -0400 Subject: Minor fix. --- scripts/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bca0581ecbc..e9113b098da 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -13,20 +13,30 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# Build mysql_fix_privilege_tables.sql +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql + COMMAND copy /b + mysql_system_tables.sql + mysql_system_tables_fix.sql + mysql_fix_privilege_tables.sql + DEPENDS + ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql + ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql) +# Build comp_sql - used for embedding SQL in C or C++ programs ADD_EXECUTABLE(comp_sql comp_sql.c) TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) -# Build comp_sql - used for embedding SQL in C or C++ programs +# Use comp_sql to build mysql_fix_privilege_tables_sql.c GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c COMMAND ${COMP_SQL_EXE} mysql_fix_privilege_tables mysql_fix_privilege_tables.sql - mysql_fix_privilege_tables_sql.c + mysql_fix_privilege_tables_sql.c DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) +# Add dummy target for the above to be built ADD_CUSTOM_TARGET(GenFixPrivs ALL DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) -- cgit v1.2.1 From 16dfab5e926a2bb3ee51703c6ce87eb32c9fbf91 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 2 May 2007 20:07:01 +0200 Subject: Resolve a possible timing issue with "scripts/mysql_fix_privilege_tables_sql.c" in the source tarball, this is essential for cross builds, like for NetWare. --- scripts/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index cb0658f8756..754ca2ea4c0 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -122,9 +122,11 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ # # Build mysql_fix_privilege_tables_sql.c from # mysql_fix_privileges_tables.sql using comp_sql +# The "sleep" ensures the generated file has a younger timestamp than its source. # mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) + sleep 5 $(top_builddir)/scripts/comp_sql$(EXEEXT) \ mysql_fix_privilege_tables \ $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ -- cgit v1.2.1 From 6511b280ca271dd042fb4cb7820769a45f3f3bf8 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 3 May 2007 15:51:02 +0200 Subject: Better distinction between "CLEANFILES" and "DISTCLEANFILES" for some generated files (here: "scripts/mysql_fix_privilege_tables{.sql,_sql.c}"). Important for cross-builds. --- scripts/Makefile.am | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 754ca2ea4c0..d4944962884 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -16,7 +16,7 @@ ## Process this file with automake to create Makefile.in BUILT_SOURCES = mysql_fix_privilege_tables.sql \ - mysql_fix_privilege_tables_sql.c + mysql_fix_privilege_tables_sql.c EXTRA_PROGRAMS = comp_sql @@ -70,7 +70,6 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug \ make_win_bin_dist \ - mysql_fix_privilege_tables.sql \ mysql_fix_privilege_tables_sql.c \ mysql_system_tables_fix.sql \ CMakeLists.txt @@ -100,13 +99,11 @@ CLEANFILES = @server_scripts@ \ mysql_tableinfo \ mysql_upgrade_shell \ mysqld_multi \ - make_win_src_distribution \ - mysql_fix_privilege_tables.sql \ - mysql_fix_privilege_tables_sql.c + make_win_src_distribution # mysqlbug should be distributed built so that people can report build # failures with it. -DISTCLEANFILES = mysqlbug +DISTCLEANFILES = $(BUILT_SOURCES) mysqlbug # We want the right version and configure comand line in mysqlbug mysqlbug: ${top_builddir}/config.status mysqlbug.sh @@ -122,11 +119,12 @@ mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ # # Build mysql_fix_privilege_tables_sql.c from # mysql_fix_privileges_tables.sql using comp_sql -# The "sleep" ensures the generated file has a younger timestamp than its source. +# The "sleep" ensures the generated file has a younger timestamp than its source +# (which may have been generated in this very same "make" run). # mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 5 + sleep 2 $(top_builddir)/scripts/comp_sql$(EXEEXT) \ mysql_fix_privilege_tables \ $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ -- cgit v1.2.1 From fd4774c35c6cb38bfaf118b840c4a6de2c3684ed Mon Sep 17 00:00:00 2001 From: "tsmith@siva.hindu.god" <> Date: Fri, 4 May 2007 19:06:36 -0600 Subject: Bug #4858: mysql_safe logs to syslog instead of stderr mysqld_safe.sh: Overhaul the logging design, to allow logging mysqld messages to syslog. Add --syslog and --skip-syslog arguments for mysqld_safe. --- scripts/mysqld_safe.sh | 255 +++++++++++++++++++++++++++++-------------------- 1 file changed, 153 insertions(+), 102 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index bfaa1d57ed2..357dd275d1f 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -2,16 +2,23 @@ # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB # This file is public domain and comes with NO WARRANTY of any kind # -# scripts to start the MySQL daemon and restart it if it dies unexpectedly +# Script to start the MySQL daemon and restart it if it dies unexpectedly # # This should be executed in the MySQL base directory if you are using a -# binary installation that has other paths than you are using. +# binary installation that is not installed in its compile-time default +# location # # mysql.server works by first doing a cd to the base directory and from there # executing mysqld_safe KILL_MYSQLD=1; MYSQLD= +niceness=0 +# Default on, unless --log-err is specified (and before options are parsed) +syslog=2 +user=@MYSQLD_USER@ +pid_file= +err_log= trap '' 1 2 3 15 # we shouldn't let anyone kill us @@ -38,6 +45,8 @@ Usage: $0 [OPTIONS] --mysqld-version=VERSION Use "mysqld-VERSION" as mysqld --nice=NICE Set the scheduling priority of mysqld --skip-kill-mysqld Don't try to kill stray mysqld processes + --syslog Log messages to syslog with 'logger' + --skip-syslog Log messages to error log All other options are passed to the mysqld program. @@ -45,6 +54,43 @@ EOF exit 1 } +log_generic () { + priority="$1" + shift + + msg="`date +'%y%m%d %H:%M:%S'` mysqld_safe $*" + echo "$msg" + if [ $syslog -eq 0 ] + then + echo "$msg" >> "$err_log" + else + logger -i -t mysqld_safe -p "$priority" "$*" + fi +} + +log_error () { + log_generic daemon.error "$@" >&2 +} + +log_notice () { + log_generic daemon.notice "$@" +} + +eval_log_error () { + cmd="$1" + if [ $syslog -eq 0 ] + then + cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" + else + # mysqld often (not always) prefixes messages on stdout with a + # timestamp in the form of '%y%m%d %H:%M:%S '; this is redundant + # when logging via syslog, so strip it + cmd="$cmd 2>&1 | sed -e 's/^[0-9]\{6\} [0-9:]\{8\} *//' | logger -i -t mysqld -p daemon.error" + fi + #echo "Running mysqld: [$cmd]" + eval "$cmd" +} + shell_quote_string() { # This sed command makes sure that any special chars are quoted, # so the arg gets passed exactly to the server. @@ -63,41 +109,41 @@ parse_arguments() { fi for arg do + val=`echo "$arg" | sed -e "s;--[^=]*=;;"` 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=;;"` ;; - --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; + --basedir=*) MY_BASEDIR_VERSION="$val" ;; + --datadir=*) DATADIR="$val" ;; + --pid-file=*) pid_file="$val" ;; + --user=*) user="$val"; SET_USER=1 ;; # these might have been set in a [mysqld_safe] section of my.cnf # they are added to mysqld command line to override settings from my.cnf - --log-error=*) err_log=`echo "$arg" | sed -e "s;--log-error=;;"` ;; - --socket=*) mysql_unix_port=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --port=*) mysql_tcp_port=`echo "$arg" | sed -e "s;--port=;;"` ;; + --log-error=*) err_log="$val" ;; + --port=*) mysql_tcp_port="$val" ;; + --socket=*) mysql_unix_port="$val" ;; # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! - --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; - --open-files-limit=*) open_files=`echo "$arg" | sed -e "s;--open-files-limit=;;"` ;; - --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core-file-size=;;"` ;; - --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; - --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; + --core-file-size=*) core_file_size="$val" ;; + --ledir=*) ledir="$val" ;; + --mysqld=*) MYSQLD="$val" ;; --mysqld-version=*) - tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"` - if test -n "$tmp" - then - MYSQLD="mysqld-$tmp" - else - MYSQLD="mysqld" - fi - ;; - --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; - --help) - usage + if test -n "$val" + then + MYSQLD="mysqld-$val" + else + MYSQLD="mysqld" + fi ;; + --nice=*) niceness="$val" ;; + --open-files-limit=*) open_files="$val" ;; + --skip-kill-mysqld*) KILL_MYSQLD=0 ;; + --syslog) syslog=1 ;; + --skip-syslog) syslog=0 ;; + --timezone=*) TZ="$val"; export TZ; ;; + + --help) usage ;; + *) if test -n "$pick_args" then @@ -120,8 +166,7 @@ then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is # Check for the directories we would expect from a source install -elif test -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld +elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is @@ -156,17 +201,17 @@ if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" then - echo "WARNING: Found two instances of my.cnf -" - echo "$MY_BASEDIR_VERSION/my.cnf and" - echo "$DATADIR/my.cnf" - echo "IGNORING $DATADIR/my.cnf" - echo + log_error "WARNING: Found two instances of my.cnf - +$MY_BASEDIR_VERSION/my.cnf and +$DATADIR/my.cnf +IGNORING $DATADIR/my.cnf" + MYSQL_HOME=$MY_BASEDIR_VERSION elif test -r "$DATADIR/my.cnf" then - echo "WARNING: Found $DATADIR/my.cnf" - echo "Datadir is deprecated place for my.cnf, please move it to $MY_BASEDIR_VERSION" - echo + log_error "WARNING: Found $DATADIR/my.cnf +The data directory is a deprecated location for my.cnf, please move it to +$MY_BASEDIR_VERSION/my.cnf" MYSQL_HOME=$DATADIR else MYSQL_HOME=$MY_BASEDIR_VERSION @@ -174,12 +219,6 @@ then fi export MYSQL_HOME -user=@MYSQLD_USER@ -niceness=0 - -# these rely on $DATADIR by default, so we'll set them later on -pid_file= -err_log= # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments @@ -201,16 +240,56 @@ append_arg_to_args () { } args= + SET_USER=2 parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` if test $SET_USER -eq 2 then SET_USER=0 fi + parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" -safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} +# Determine what logging facility to use +if [ -n "$err_log" -o $syslog -eq 0 ] +then + if [ -n "$err_log" ] + then + # mysqld adds ".err" if there is no extension on the --log-err + # argument; must match that here, or mysqld_safe will write to a + # different log file than mysqld + + # mysqld does not add ".err" to "--log-error=foo."; it considers a + # trailing "." as an extension + if expr "$err_log" : '.*\.[^/]*$' > /dev/null + then + : + else + err_log="$err_log".err + fi + + case "$err_log" in + /* ) ;; + * ) err_log="$DATADIR/$err_log" ;; + esac + else + err_log=$DATADIR/`@HOSTNAME@`.err + fi + + append_arg_to_args "--log-error=$err_log" + + if [ $syslog -eq 1 ] + then + # User explicitly asked for syslog, so warn that it isn't used + log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect. Logging to '$err_log'." + fi + + # Don't use syslog since syslog and error log don't mix well + syslog=0 +fi + +safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` if [ ! -d $mysql_unix_port_dir ] @@ -228,12 +307,11 @@ fi if test ! -x $ledir/$MYSQLD then - echo "The file $ledir/$MYSQLD doesn't exist or is not executable" - echo "Please do a cd to the mysql installation directory and restart" - echo "this script from there as follows:" - echo "./bin/mysqld_safe". - echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" - echo "information" + log_error "The file $ledir/$MYSQLD +does not exist or is not executable. Please cd to the mysql installation +directory and restart this script from there as follows: +./bin/mysqld_safe& +See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more information" exit 1 fi @@ -248,30 +326,6 @@ else fi append_arg_to_args "--pid-file=$pid_file" -if [ -n "$err_log" ] -then - # mysqld adds ".err" if there is no extension on the --log-err - # argument; must match that here, or mysqld_safe will write to a - # different log file than mysqld - - # mysqld does not add ".err" to "--log-error=foo."; it considers a - # trailing "." as an extension - if expr "$err_log" : '.*\.[^/]*$' > /dev/null - then - : - else - err_log="$err_log".err - fi - - case "$err_log" in - /* ) ;; - * ) err_log="$DATADIR/$err_log" ;; - esac -else - err_log=$DATADIR/`@HOSTNAME@`.err -fi -append_arg_to_args "--log-error=$err_log" - if test -n "$mysql_unix_port" then append_arg_to_args "--socket=$mysql_unix_port" @@ -296,7 +350,7 @@ fi if nohup nice > /dev/null 2>&1 then normal_niceness=`nice` - nohup_niceness=`nohup nice` + nohup_niceness=`nohup nice 2>/dev/null` numeric_nice_values=1 for val in $normal_niceness $nohup_niceness @@ -366,18 +420,17 @@ then then if @FIND_PROC@ then # The pid contains a mysqld process - echo "A mysqld process already exists" - echo "A mysqld process already exists at " `date` >> $err_log + log_error "A mysqld process already exists" exit 1 fi fi rm -f $pid_file if test -f $pid_file then - echo "Fatal error: Can't remove the pid file: $pid_file" - echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log - echo "Please remove it manually and start $0 again" - echo "mysqld daemon not started" + log_error "Fatal error: Can't remove the pid file: +$pid_file +Please remove it manually and start $0 again; +mysqld daemon not started" exit 1 fi fi @@ -394,33 +447,32 @@ fi # $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" - # Does this work on all systems? #if type ulimit | grep "shell builtin" > /dev/null #then # ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems #fi -echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log +cmd="$NOHUP_NICENESS" + +for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ + "--datadir=$DATADIR" "$USER_OPTION" +do + cmd="$cmd "`shell_quote_string "$i"` +done +cmd="$cmd $args" +# Avoid 'nohup: ignoring input' warning +test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" + +log_notice "Starting $MYSQLD daemon with databases from $DATADIR" while true do rm -f $safe_mysql_unix_port $pid_file # Some extra safety - cmd="$NOHUP_NICENESS" - - for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ - "--datadir=$DATADIR" "$USER_OPTION" - do - cmd="$cmd "`shell_quote_string "$i"` - done - cmd="$cmd $args >> "`shell_quote_string "$err_log"`" 2>&1" - #echo "Running mysqld: [$cmd]" - eval "$cmd" + eval_log_error "$cmd" if test ! -f $pid_file # This is removed if normal shutdown then - echo "STOPPING server from pid file $pid_file" break fi @@ -433,7 +485,7 @@ do # kill -9 is used or the process won't react on the kill. numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` - echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log + log_notice "Number of processes running now: $numofproces" I=1 while test "$I" -le "$numofproces" do @@ -446,16 +498,15 @@ do # echo "TEST $I - $T **" if kill -9 $T then - echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log - else + log_error "$MYSQLD process hanging, pid $T - killed" + else break fi I=`expr $I + 1` done fi - echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log + log_notice "mysqld restarted" done -echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log -echo "" | tee -a $err_log +log_notice "mysqld from pid file $pid_file ended" -- cgit v1.2.1 From ae801bb0ae6fe87d30a319fbbf692540f6d77bd3 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 15 May 2007 18:19:18 +0200 Subject: Fix bug#27833 "Bourne shell string comparison issue in scripts/make_win_bin_dist": Several string comparisons could never yield true because they had an 'x' guard added to the variable but not to the constant value. Fix that by guarding both sides. --- scripts/make_win_bin_dist | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 87d35a0850b..30127b0043f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -39,7 +39,7 @@ The "package-base-name" argument should be something like mysql-noinstall-5.0.25-win32 (or winx64) -and will be the name of the directory of the unpacked ZIP (stripping +and will become the name of the directory of the unpacked ZIP (stripping away the "noinstall" part of the ZIP file name if any) and the base for the resulting package name. @@ -51,6 +51,7 @@ Options are --no-embedded Don't pack the embedded server even if built --debug Pack the debug binaries and give error if not built. + The default is to pack them if they are built. --no-debug Don't pack the debug binaries even if built @@ -58,10 +59,10 @@ Options are want to replace the normal binaries with debug versions, i.e. no separate "debug" directories. - --exe-suffix=SUF Add a suffix to the "mysqld" binary. + --exe-suffix=SUF Add a suffix to the filename part of the "mysqld" binary. As you might want to include files of directories from other builds -(like a "mysqld-max.exe" server), you can instruct this script do copy +(like a "mysqld-max.exe" server), you can instruct this script to copy them in for you. This is the "copy-def" arguments, and they are of the form @@ -172,10 +173,10 @@ else BASENAME="mysqld" # New style CMake build fi -if [ x"$PACK_DEBUG" = "" -a -f "sql/debug/$BASENAME.exe" -o \ - x"$PACK_DEBUG" = "yes" ] ; then +if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/$BASENAME.exe" -o \ + x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe - cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb + cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb || true cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true fi @@ -221,8 +222,8 @@ copy_embedded() cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/ cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/ - if [ x"$PACK_DEBUG" = "" -a -f "libmysqld/debug/libmysqld.lib" -o \ - x"$PACK_DEBUG" = "yes" ] ; then + if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \ + x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/Embedded/DLL/debug cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/ @@ -230,10 +231,10 @@ copy_embedded() fi } -if [ x"$PACK_EMBEDDED" = "" -a \ +if [ x"$PACK_EMBEDDED" = x"" -a \ -f "libmysqld/$TARGET/mysqlserver.lib" -a \ -f "libmysqld/$TARGET/libmysqld.lib" -o \ - x"$PACK_EMBEDDED" = "yes" ] ; then + x"$PACK_EMBEDDED" = x"yes" ] ; then copy_embedded fi @@ -271,8 +272,8 @@ cp libmysql/$TARGET/libmysql.dll \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ -if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/libmysql.lib" -o \ - x"$PACK_DEBUG" = "yes" ] ; then +if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ + x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/lib/debug cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ @@ -329,12 +330,11 @@ fi # ---------------------------------------------------------------------- # Copy what could be usable in the "scripts" directory. Currently -# only SQL files, others are bourne shell scripts or Perl scripts +# only SQL files, others are Bourne shell scripts or Perl scripts # not really usable on Windows. # # But to be nice to the few Cygwin users we might have in 5.0 we -# continue to copy the stuff, but don't include it include it in -# the WiX install. +# continue to copy the stuff, but don't include it in the WiX install. # ---------------------------------------------------------------------- mkdir -p $DESTDIR/scripts @@ -360,7 +360,7 @@ fi cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* -# The SQL initiation code is really expected to be in "share" +# The SQL initialisation code is really expected to be in "share" mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true # ---------------------------------------------------------------------- @@ -381,7 +381,7 @@ for arg do done # ---------------------------------------------------------------------- -# Finally creat the ZIP archive +# Finally create the ZIP archive # ---------------------------------------------------------------------- rm -f $NOINST_NAME.zip -- cgit v1.2.1 From d84c8072048e5258a76e60e93568bb9bc4b41cff Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 16 May 2007 21:00:35 +0200 Subject: After-merge fix in "scripts/make_win_bin_dist": Ensure the balanced use of 'x' guards in string comparisons also in the new 5.1 lines. --- scripts/make_win_bin_dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 2e6236ac6a8..6593e2c6039 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -238,8 +238,8 @@ cp libmysql/mytest.c libmysql/myTest.vcproj libmysql/$TARGET/myTest.exe \ $DESTDIR/examples/libmysqltest/ cp libmysql/$TARGET/myTest.exe $DESTDIR/examples/libmysqltest/release/ -if [ x"$PACK_DEBUG" = "" -a -f "libmysql/debug/myTest.exe" -o \ - x"$PACK_DEBUG" = "yes" ] ; then +if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/myTest.exe" -o \ + x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/examples/libmysqltest/debug cp libmysql/debug/myTest.exe $DESTDIR/examples/libmysqltest/debug/ fi -- cgit v1.2.1 From bc69d072f3c3d5af79a0835d92ac242c3cef2ba0 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Sat, 19 May 2007 18:15:08 +0200 Subject: Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE - The SQL commands used by mysql_upgrade are written to be run with sql_mode set to '' - thus the scripts should change sql_mode for the session to make sure the SQL is legal. --- scripts/mysql_system_tables_fix.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 205bc93efea..c8334339b32 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -9,6 +9,7 @@ # this sql script. # On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' +set sql_mode=''; set storage_engine=MyISAM; ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; -- cgit v1.2.1 From 4215eb8a50d7a9ebb8a5fe1a3c9b62b1a1d93dd5 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Sat, 19 May 2007 18:55:38 +0200 Subject: Bug#28521 Upgrade from 5.1.17 to 5.1.18 breaks events - Add test for upgrading from 5.1.17 - it's a beta but anyway good to have a check oif upgrading new system tables for 5.1 - Always put the "originator" column after "comment" to get correct order of columns in "events" table --- scripts/mysql_system_tables_fix.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 6fbf20a2c9f..8ee28cbf1cb 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -440,7 +440,7 @@ ALTER TABLE event ADD sql_mode 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL AFTER on_completion; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; -ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL; +ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL AFTER comment; ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 -- cgit v1.2.1 From b0677f1ddc90119cecefd7d1b665b3eb769d56e9 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 22 May 2007 17:06:47 +0200 Subject: scripts/make_binary_distribution.sh : Include all the additional test suites in the binary packages ("tar.gz"). This is the tar.gz part of the fixes for bug#26609; for RPMs it is already done. --- scripts/make_binary_distribution.sh | 72 ++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e8bf39bd016..77f51c51c19 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -102,11 +102,41 @@ case $system in ;; esac +# This is needed to prefer GNU tar over platform tar because that 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 [ -x $file -a ! -d $file ] ; then + echo $file + exit 0 + fi + done + done + done + exit 1 +} + +tar=`which_1 gnutar gtar` +if [ "$?" = "1" -o x"$tar" = x"" ] ; then + tar=tar +fi + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ + $BASE/mysql-test/suite if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ @@ -117,8 +147,8 @@ fi # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name -# twice, once in the directory location where it is build, and a -# second time in the ".libs" location. In the case the firs one +# twice, once in the directory location where it is built, and a +# second time in the ".libs" location. In the case the first one # is a wrapper script, the second one will overwrite it with the # binary file. copyfileto() @@ -274,6 +304,13 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \ $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r +# Copy the additional suites "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) +# Clean up if we did this from a bk tree +if [ -d mysql-test/SCCS ] ; then + find $BASE/mysql-test -name SCCS -print | xargs rm -rf +fi + if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* copyfileto $BASE/bin scripts/* @@ -374,41 +411,12 @@ if [ x$DEBUG = x1 ] ; then 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 [ -x $file -a ! -d $file ] ; then - echo $file - exit 0 - fi - done - done - done - exit 1 -} - if [ $BASE_SYSTEM != "netware" ] ; then # # Create the result tar file # - tar=`which_1 gnutar gtar` - if [ "$?" = "1" -o x"$tar" = x"" ] ; then - tar=tar - fi - echo "Using $tar to create archive" OPT=cvf -- cgit v1.2.1 From affeddbd8fa5ec247706e17fd2c69e826bd63b82 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Tue, 12 Jun 2007 19:49:02 +0200 Subject: make_win_bin_dist: Aligned headers to include with Unix 'make install' --- scripts/make_win_bin_dist | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 30127b0043f..cecee4f57af 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -239,25 +239,45 @@ if [ x"$PACK_EMBEDDED" = x"" -a \ fi # ---------------------------------------------------------------------- -# FIXME why not copy it all in "include"?! +# Note: Make sure to sync with include/Makefile.am and WiX installer +# XML specifications # ---------------------------------------------------------------------- mkdir -p $DESTDIR/include -cp include/conf*.h \ - include/mysql*.h \ - include/errmsg.h \ - include/my_alloc.h \ - include/my_getopt.h \ - include/my_sys.h \ +cp include/mysql.h \ + include/mysql_com.h \ + include/mysql_time.h \ include/my_list.h \ - include/my_pthread.h \ + include/my_alloc.h \ + include/typelib.h \ include/my_dbug.h \ include/m_string.h \ - include/m_ctype.h \ - include/my_global.h \ + include/my_sys.h \ + include/my_xml.h \ + include/mysql_embed.h \ + include/my_pthread.h \ + include/my_no_pthread.h \ include/raid.h \ - include/typelib.h $DESTDIR/include/ -cp libmysql/libmysql.def $DESTDIR/include/ + include/decimal.h \ + include/errmsg.h \ + include/my_global.h \ + include/my_net.h \ + include/my_getopt.h \ + include/sslopt-longopts.h \ + include/my_dir.h \ + include/sslopt-vars.h \ + include/sslopt-case.h \ + include/sql_common.h \ + include/keycache.h \ + include/m_ctype.h \ + include/my_attribute.h \ + include/mysqld_error.h \ + include/sql_state.h \ + include/mysqld_ername.h + include/mysql_version.h \ + include/config-win.h \ + libmysql/libmysql.def \ + $DESTDIR/include/ # ---------------------------------------------------------------------- # Client libraries, and other libraries -- cgit v1.2.1 From 6db1887a5c53a423bc9f92544e0a5b3cfcb29fb9 Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Wed, 13 Jun 2007 19:19:11 +0200 Subject: fix make_win_bin_dist typo --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index cecee4f57af..beb274ca1a3 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -273,7 +273,7 @@ cp include/mysql.h \ include/my_attribute.h \ include/mysqld_error.h \ include/sql_state.h \ - include/mysqld_ername.h + include/mysqld_ername.h \ include/mysql_version.h \ include/config-win.h \ libmysql/libmysql.def \ -- cgit v1.2.1 From 9fae9ef66f1055c561f48ced4b4a2d3b40195f31 Mon Sep 17 00:00:00 2001 From: "anozdrin/alik@ibm." <> Date: Thu, 28 Jun 2007 21:34:54 +0400 Subject: Patch for the following bugs: - BUG#11986: Stored routines and triggers can fail if the code has a non-ascii symbol - BUG#16291: mysqldump corrupts string-constants with non-ascii-chars - BUG#19443: INFORMATION_SCHEMA does not support charsets properly - BUG#21249: Character set of SP-var can be ignored - BUG#25212: Character set of string constant is ignored (stored routines) - BUG#25221: Character set of string constant is ignored (triggers) There were a few general problems that caused these bugs: 1. Character set information of the original (definition) query for views, triggers, stored routines and events was lost. 2. mysqldump output query in client character set, which can be inappropriate to encode definition-query. 3. INFORMATION_SCHEMA used strings with mixed encodings to display object definition; 1. No query-definition-character set. In order to compile query into execution code, some extra data (such as environment variables or the database character set) is used. The problem here was that this context was not preserved. So, on the next load it can differ from the original one, thus the result will be different. The context contains the following data: - client character set; - connection collation (character set and collation); - collation of the owner database; The fix is to store this context and use it each time we parse (compile) and execute the object (stored routine, trigger, ...). 2. Wrong mysqldump-output. The original query can contain several encodings (by means of character set introducers). The problem here was that we tried to convert original query to the mysqldump-client character set. Moreover, we stored queries in different character sets for different objects (views, for one, used UTF8, triggers used original character set). The solution is - to store definition queries in the original character set; - to change SHOW CREATE statement to output definition query in the binary character set (i.e. without any conversion); - introduce SHOW CREATE TRIGGER statement; - to dump special statements to switch the context to the original one before dumping and restore it afterwards. Note, in order to preserve the database collation at the creation time, additional ALTER DATABASE might be used (to temporary switch the database collation back to the original value). In this case, ALTER DATABASE privilege will be required. This is a backward-incompatible change. 3. INFORMATION_SCHEMA showed non-UTF8 strings The fix is to generate UTF8-query during the parsing, store it in the object and show it in the INFORMATION_SCHEMA. Basically, the idea is to create a copy of the original query convert it to UTF8. Character set introducers are removed and all text literals are converted to UTF8. This UTF8 query is intended to provide user-readable output. It must not be used to recreate the object. Specialized SHOW CREATE statements should be used for this. The reason for this limitation is the following: the original query can contain symbols from several character sets (by means of character set introducers). Example: - original query: CREATE VIEW v1 AS SELECT _cp1251 'Hello' AS c1; - UTF8 query (for INFORMATION_SCHEMA): CREATE VIEW v1 AS SELECT 'Hello' AS c1; --- scripts/mysql_system_tables.sql | 5 ++-- scripts/mysql_system_tables_fix.sql | 46 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index c779d174d12..f46c7c7027a 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -59,8 +59,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; - +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; @@ -75,7 +74,7 @@ CALL create_slow_log_table();; DROP PROCEDURE create_slow_log_table;; delimiter ; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 8ee28cbf1cb..78e6a0ceb57 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -388,6 +388,29 @@ ALTER TABLE proc MODIFY db MODIFY comment char(64) collate utf8_bin DEFAULT '' NOT NULL; +ALTER TABLE proc ADD character_set_client + char(32) collate utf8_bin DEFAULT NULL + AFTER comment; +ALTER TABLE proc MODIFY character_set_client + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE proc ADD collation_connection + char(32) collate utf8_bin DEFAULT NULL + AFTER character_set_client; +ALTER TABLE proc MODIFY collation_connection + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE proc ADD db_collation + char(32) collate utf8_bin DEFAULT NULL + AFTER collation_connection; +ALTER TABLE proc MODIFY db_collation + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL + AFTER db_collation; +ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL; + + # # EVENT privilege # @@ -446,6 +469,29 @@ ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISA ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM' AFTER originator; +ALTER TABLE event ADD character_set_client + char(32) collate utf8_bin DEFAULT NULL + AFTER time_zone; +ALTER TABLE event MODIFY character_set_client + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE event ADD collation_connection + char(32) collate utf8_bin DEFAULT NULL + AFTER character_set_client; +ALTER TABLE event MODIFY collation_connection + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE event ADD db_collation + char(32) collate utf8_bin DEFAULT NULL + AFTER collation_connection; +ALTER TABLE event MODIFY db_collation + char(32) collate utf8_bin DEFAULT NULL; + +ALTER TABLE event ADD body_utf8 longblob DEFAULT NULL + AFTER db_collation; +ALTER TABLE event MODIFY body_utf8 longblob DEFAULT NULL; + + # # TRIGGER privilege # -- cgit v1.2.1 From ef80d45d0d11ad82dfc07d976878e9da624b02a2 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 29 Jun 2007 14:43:54 +0200 Subject: Update make_win_bin_dist to also copy mysql-test/suite directory --- scripts/make_win_bin_dist | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 6593e2c6039..480ea39b2cf 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -304,7 +304,7 @@ cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib mkdir -p $DESTDIR/mysql-test/include $DESTDIR/mysql-test/lib \ $DESTDIR/mysql-test/r $DESTDIR/mysql-test/std_data \ - $DESTDIR/mysql-test/t + $DESTDIR/mysql-test/t $DESTDIR/mysql-test/suite cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db @@ -324,7 +324,7 @@ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/ cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ +cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ || /bin/true cp mysql-test/t/*.sql $DESTDIR/mysql-test/t/ cp mysql-test/t/*.def $DESTDIR/mysql-test/t/ (cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/) @@ -335,6 +335,12 @@ if [ -d mysql-test/extra ] ; then cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/ fi +# Copy all directories in mysql-test/suite/ +for i in `cd mysql-test/suite && ls`; do \ + mkdir -p $DESTDIR/mysql-test/suite/$i; \ + cp -R mysql-test/suite/$i $DESTDIR/mysql-test/suite/; \ +done + # ---------------------------------------------------------------------- # Copy what could be usable in the "scripts" directory. Currently # only SQL files, others are Bourne shell scripts or Perl scripts -- cgit v1.2.1 From e345a242f4ea5ded5216e2e1b14f01836da2a217 Mon Sep 17 00:00:00 2001 From: "tsmith@sita.local" <> Date: Mon, 9 Jul 2007 15:30:19 -0600 Subject: mysqld_safe.sh: Fix a few typos in comments (from Paul DuBois) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 357dd275d1f..987c714d3ff 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -14,7 +14,7 @@ KILL_MYSQLD=1; MYSQLD= niceness=0 -# Default on, unless --log-err is specified (and before options are parsed) +# Default on, unless --log-error is specified (and before options are parsed) syslog=2 user=@MYSQLD_USER@ pid_file= @@ -256,7 +256,7 @@ if [ -n "$err_log" -o $syslog -eq 0 ] then if [ -n "$err_log" ] then - # mysqld adds ".err" if there is no extension on the --log-err + # mysqld adds ".err" if there is no extension on the --log-error # argument; must match that here, or mysqld_safe will write to a # different log file than mysqld -- cgit v1.2.1 From 63dd4251e4c6e631cc27a5a6a5128889f24e04b5 Mon Sep 17 00:00:00 2001 From: "tsmith@sita.local" <> Date: Mon, 9 Jul 2007 16:10:43 -0600 Subject: Bug #29634: mysqld_safe does not set err_log variable, error log file is not created Dont touch & chmod the err_log file if using syslog (mysqld_safe) --- scripts/mysqld_safe.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 987c714d3ff..597bf38a518 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -289,6 +289,25 @@ then syslog=0 fi +USER_OPTION="" +if test -w / -o "$USER" = "root" +then + if test "$user" != "root" -o $SET_USER = 1 + then + USER_OPTION="--user=$user" + fi + # Change the err log to the right user, if it is in use + if [ $syslog -eq 0 ]; then + touch $err_log + chown $user $err_log + fi + if test -n "$open_files" + then + ulimit -n $open_files + append_arg_to_args "--open-files-limit=$open_files" + fi +fi + safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` @@ -387,22 +406,6 @@ else fi fi -USER_OPTION="" -if test -w / -o "$USER" = "root" -then - if test "$user" != "root" -o $SET_USER = 1 - then - USER_OPTION="--user=$user" - fi - # If we are root, change the err log to the right user. - touch $err_log; chown $user $err_log - if test -n "$open_files" - then - ulimit -n $open_files - append_arg_to_args "--open-files-limit=$open_files" - fi -fi - # Try to set the core file size (even if we aren't root) because many systems # don't specify a hard limit on core file size. if test -n "$core_file_size" -- cgit v1.2.1 From 0e98bed90376f6378648daaafce0a447dbe038f7 Mon Sep 17 00:00:00 2001 From: "dfischer/mysqldev@mysql.com/production.mysql.com" <> Date: Tue, 17 Jul 2007 10:25:48 +0200 Subject: make_binary_distribution.sh: BUG#29382 --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 77f51c51c19..eee5ed99fa5 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -295,6 +295,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/Index.xml \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data -- cgit v1.2.1 From cb28594deb25fe7e7a350fa724d67262c0285bd4 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 17 Jul 2007 16:25:32 +0200 Subject: Ensure "mysql-stress-test.pl" is included in both "tar.gz" and RPM packages. Fixing bug#21023: "mysql-stress-test.pl" missing in builds --- scripts/make_binary_distribution.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 77f51c51c19..94b4019cd1e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -284,7 +284,8 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD copyfileto $BASE/mysql-test \ mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ - mysql-test/valgrind.supp \ + mysql-test/mysql-stress-test.pl \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib -- cgit v1.2.1 From 8f87bd6008b3580d20eba39442f475f23b15f6c0 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Thu, 26 Jul 2007 12:57:46 +0200 Subject: Clean up the mysql_install_db script to ensure that a sane environment is available and reduce the chance of failure. This should fix bug#28585 which is caused by the script being quite random in how it finds files it requires and not giving very good feedback to the user about what went wrong. Also update make_binary_distribution so that it provides the correct path to the required SQL scripts when generating mysql_install_db. The script only previously worked because of the permissive behaviour which looked around the current working directory before the "correct" location. This could lead to severe problems if the user happened to run the script from a location which contained older or even broken copies of the SQL scripts. We now require either a complete binary release (and the mysql_install_db script ran from inside the extracted archive), or an installed compiled tree, as this is the only way we can be sure everything that we need is available and ready to run. While working on this fix, also clean up the mysql_install_db script a lot to make it simpler, easier to read, and hopefully less prone to bugs in the future. --- scripts/make_binary_distribution.sh | 2 +- scripts/mysql_install_db.sh | 274 ++++++++++++++++++------------------ 2 files changed, 136 insertions(+), 140 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 9584721682f..dab1bbec956 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -318,7 +318,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then copyfileto $BASE/bin scripts/* $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./support-files \ + @HOSTNAME@ \@pkgdatadir\@ ./share \ < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ \@sbindir\@ ./bin \@libexecdir\@ ./bin \ diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 934d245db15..c5d532ee4ed 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -18,26 +18,65 @@ # # All unrecognized arguments to this script are passed to mysqld. +force=0 in_rpm=0 +ip_only=0 windows=0 -defaults="" -user="" case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$1"; shift + ;; esac +usage() +{ + cat <&1` if [ $? -ne 0 ] @@ -244,39 +247,35 @@ then fi fi -if test "$ip_only" = "1" +if test "$ip_only" -eq 1 then - ip=`echo "$resolved" | awk '/ /{print $6}'` - hostname=$ip + hostname=`echo "$resolved" | awk '/ /{print $6}'` fi # Create database directories mysql & test -if test ! -d $ldata; then - mkdir $ldata; - chmod 700 $ldata ; -fi -if test ! -d $ldata/mysql; then - mkdir $ldata/mysql; - chmod 700 $ldata/mysql ; -fi -if test ! -d $ldata/test; then - mkdir $ldata/test; - chmod 700 $ldata/test ; -fi -if test -w / -a ! -z "$user"; then - chown $user $ldata $ldata/mysql $ldata/test; -fi +for dir in $ldata $ldata/mysql $ldata/test +do + if test ! -d $dir + then + mkdir -p $dir + chmod 700 $dir + fi + if test -w / -a ! -z "$user" + then + chown $user $dir + fi +done -if test -n "$user"; then +if test -n "$user" +then args="$args --user=$user" fi # Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ---basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M \ ---net_buffer_length=16K" + --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb \ + --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" # Pipe mysql_system_tables.sql to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." @@ -284,23 +283,20 @@ if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld then s_echo "OK" - if test -n "$fill_help_tables" + s_echo "Filling help tables..." + # Pipe fill_help_tables.sql to "mysqld --bootstrap" + if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` then - s_echo "Filling help tables..." - # Pipe fill_help_tables.sql to "mysqld --bootstrap" - if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` - then - # Fill suceeded - s_echo "OK" - else - echo "" - echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" - echo "The \"HELP\" command might not work properly" - echo "" - fi + # Fill suceeded + s_echo "OK" + else + echo + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly" + echo fi - s_echo "" + s_echo s_echo "To start mysqld at boot time you have to copy" s_echo "support-files/mysql.server to the right place for your system" s_echo @@ -319,7 +315,7 @@ then echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." - if test "$in_rpm" = "0" + if test "$in_rpm" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" -- cgit v1.2.1 From 2c95b977874d232cc0fc935d5ac0e0c85a5db682 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Thu, 26 Jul 2007 14:27:36 +0200 Subject: Apply a few more cleanups to improve the robustness of mysql_install_db --- scripts/mysql_install_db.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index c5d532ee4ed..760ece5aaed 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -18,6 +18,15 @@ # # All unrecognized arguments to this script are passed to mysqld. +basedir="" +ldata="" +srcdir="" + +args="" +defaults="" +mysqld_opt="" +user="" + force=0 in_rpm=0 ip_only=0 @@ -87,7 +96,8 @@ parse_arguments() shift fi - for arg do + for arg + do case "$arg" in --force) force=1 ;; --basedir=*) basedir=`parse_arg "$arg"` ;; @@ -203,11 +213,10 @@ then mysqld="./sql/mysqld" if test -n "$srcdir" -a -f "$srcdir/sql/share/english/errmsg.sys" then - langdir="$srcdir/sql/share/english" + mysqld_opt="--language=$srcdir/sql/share/english" else - langdir="./sql/share/english" + mysqld_opt="./sql/share/english" fi - mysqld_opt="--language=$langdir" fi # Make sure mysqld is available in default location (--basedir option is -- cgit v1.2.1 From d2936fad10513227fa6cfc5a7b92461e30d1cc88 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Thu, 26 Jul 2007 14:31:11 +0200 Subject: mysql_install_db.sh: Fix error in previous change, correct --language argument. --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 760ece5aaed..7e1f6217b7b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -215,7 +215,7 @@ then then mysqld_opt="--language=$srcdir/sql/share/english" else - mysqld_opt="./sql/share/english" + mysqld_opt="--language=./sql/share/english" fi fi -- cgit v1.2.1 From aee749d0d93352fcdcc3159c28e9ce6cbc31d5eb Mon Sep 17 00:00:00 2001 From: "anozdrin/alik@ibm." <> Date: Thu, 26 Jul 2007 20:05:01 +0400 Subject: Fix for BUG#30029: mysql_upgrade fails for 5.0 -> 5.1.21, 5.1.20 -> 5.1.21 upgrades. We generate mysql_fix_privilege.sql file, which contains SQL statements required to upgrade the system database. This script is generated by concatenation of mysql_system_tables.sql and mysql_system_tables_fix.sql. The problem was that - in order to create general_log and slow_log tables we use stored programs in mysql_system_tables.sql; - we upgrade mysql.proc table in mysql_system_tables_fix.sql; So, if mysql.proc table needs to be upgraded, stored procedures can not be used in mysql_system_tables.sql. In other words, in mysql_system_tables.sql stored programs must not be used because they may be unavailable at this point. The fix is to use dynamic SQL instead of stored programs. There is no test case for this bug because our test suite is not suitable for such test cases. system_mysql_db_fix* test cases play with the database "test". Here we need to modify the system database and we can not do that in the test suite. --- scripts/mysql_system_tables.sql | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f46c7c7027a..cd0882e3af4 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -63,16 +63,21 @@ CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NUL CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +-- Create general_log if CSV is enabled. -delimiter ;; -CREATE PROCEDURE create_general_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment='General log'; END IF; END;; -CALL create_general_log_table();; -DROP PROCEDURE create_general_log_table;; +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); -CREATE PROCEDURE create_slow_log_table() BEGIN DECLARE is_csv_enabled int DEFAULT 0; SELECT @@have_csv = 'YES' INTO is_csv_enabled; IF (is_csv_enabled) THEN CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment='Slow log'; END IF; END;; -CALL create_slow_log_table();; -DROP PROCEDURE create_slow_log_table;; -delimiter ; +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- Create slow_log if CSV is enabled. + +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); + +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; -- cgit v1.2.1 From d5293e45840f532c9100cd37c87bdef9ed879601 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Fri, 27 Jul 2007 15:14:21 +0200 Subject: More fixes and cleanups for bug#28585: - make the 'dist-hook' from top-level Makefile work again. - we can find my_print_defaults from --basedir by parsing command line arguments prior to running my_print_defaults. - take advantage of additional command line parsing and allow the --no-defaults etc arguments to work anywhere rather than having to be the first argument. - find SQL files either from binary archive or source install. - consolidate and tidy code and error messages. --- scripts/mysql_install_db.sh | 107 ++++++++++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 29 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7e1f6217b7b..a66129af1d3 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -32,12 +32,6 @@ in_rpm=0 ip_only=0 windows=0 -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac - usage() { cat < Date: Fri, 27 Jul 2007 17:20:43 -0600 Subject: Bug #29992: syslog error logging does not flush Don't use syslog by default; user will have to request it explicitly with the --syslog option. Use "sed -u" to get unbuffered output from sed, if it's supported. Otherwise, don't use sed at all - don't strip the timestamp from mysqld messages. Also, add new --syslog-tag=FOO option, which adds "-FOO" to the tag used when logging messages to syslog (i.e., mysqld-FOO or mysqld_safe-FOO) Also, explicitly mention where log messages are going, so user can more easily find them. Also, check if 'logger' is in the PATH, and log to the error log file if it can't be found. --- scripts/mysqld_safe.sh | 116 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 25 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 597bf38a518..2a592a6fbf5 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -14,12 +14,17 @@ KILL_MYSQLD=1; MYSQLD= niceness=0 -# Default on, unless --log-error is specified (and before options are parsed) -syslog=2 +# Initial logging status: error log is not open, and not using syslog +logging=init +want_syslog=0 +syslog_tag= user=@MYSQLD_USER@ pid_file= err_log= +syslog_tag_mysqld=mysqld +syslog_tag_mysqld_safe=mysqld_safe + trap '' 1 2 3 15 # we shouldn't let anyone kill us umask 007 @@ -46,7 +51,8 @@ Usage: $0 [OPTIONS] --nice=NICE Set the scheduling priority of mysqld --skip-kill-mysqld Don't try to kill stray mysqld processes --syslog Log messages to syslog with 'logger' - --skip-syslog Log messages to error log + --skip-syslog Log messages to error log (default) + --syslog-tag=TAG Pass -t "mysqld-TAG" to 'logger' All other options are passed to the mysqld program. @@ -54,18 +60,46 @@ EOF exit 1 } +my_which () +{ + save_ifs="${IFS-UNSET}" + IFS=: + for file + do + for dir in $PATH + do + if [ -f "$dir/$file" ] + then + echo "$dir/$file" + continue 2 + fi + done + return 1 # Failure, didn't find file in path + done + if [ "$save_ifs" = UNSET ] + then + unset IFS + else + IFS="$save_ifs" + fi + return 0 # Success +} + log_generic () { priority="$1" shift msg="`date +'%y%m%d %H:%M:%S'` mysqld_safe $*" echo "$msg" - if [ $syslog -eq 0 ] - then - echo "$msg" >> "$err_log" - else - logger -i -t mysqld_safe -p "$priority" "$*" - fi + case $logging in + init) ;; # Just echo the message, don't save it anywhere + file) echo "$msg" >> "$err_log" ;; + syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;; + *) + echo "Internal program error (non-fatal):" \ + " unknown logging method '$logging'" >&2 + ;; + esac } log_error () { @@ -78,15 +112,23 @@ log_notice () { eval_log_error () { cmd="$1" - if [ $syslog -eq 0 ] - then - cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" - else - # mysqld often (not always) prefixes messages on stdout with a - # timestamp in the form of '%y%m%d %H:%M:%S '; this is redundant - # when logging via syslog, so strip it - cmd="$cmd 2>&1 | sed -e 's/^[0-9]\{6\} [0-9:]\{8\} *//' | logger -i -t mysqld -p daemon.error" - fi + case $logging in + file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;; + syslog) + # mysqld often prefixes its messages with a timestamp, which is + # redundant when logging to syslog (which adds its own timestamp) + # However, we don't strip the timestamp with sed here, because + # sed buffers output (only GNU sed supports a -u (unbuffered) option) + # which means that messages may not get sent to syslog until the + # mysqld process quits. + cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error" + ;; + *) + echo "Internal program error (non-fatal):" \ + " unknown logging method '$logging'" >&2 + ;; + esac + #echo "Running mysqld: [$cmd]" eval "$cmd" } @@ -138,8 +180,9 @@ parse_arguments() { --nice=*) niceness="$val" ;; --open-files-limit=*) open_files="$val" ;; --skip-kill-mysqld*) KILL_MYSQLD=0 ;; - --syslog) syslog=1 ;; - --skip-syslog) syslog=0 ;; + --syslog) want_syslog=1 ;; + --skip-syslog) want_syslog=0 ;; + --syslog-tag=*) syslog_tag="$val" ;; --timezone=*) TZ="$val"; export TZ; ;; --help) usage ;; @@ -252,7 +295,19 @@ parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysq parse_arguments PICK-ARGS-FROM-ARGV "$@" # Determine what logging facility to use -if [ -n "$err_log" -o $syslog -eq 0 ] + +# Ensure that 'logger' exists, if it's requested +if [ $want_syslog -eq 1 ] +then + my_which logger > /dev/null 2>&1 + if [ $? -ne 0 ] + then + log_error "--syslog requested, but no 'logger' program found." + want_syslog=0 + fi +fi + +if [ -n "$err_log" -o $want_syslog -eq 0 ] then if [ -n "$err_log" ] then @@ -279,14 +334,25 @@ then append_arg_to_args "--log-error=$err_log" - if [ $syslog -eq 1 ] + if [ $want_syslog -eq 1 ] then # User explicitly asked for syslog, so warn that it isn't used - log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect. Logging to '$err_log'." + log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect." fi - # Don't use syslog since syslog and error log don't mix well - syslog=0 + # Log to err_log file + log_notice "Logging to '$err_log'." + logging=file +else + if [ -n "$syslog_tag" ] + then + # Sanitize the syslog tag + syslog_tag=`echo "$syslog_tag" | sed -e 's/[^a-zA-Z0-9_-]/_/g'` + syslog_tag_mysqld_safe="${syslog_tag_mysqld_safe}-$syslog_tag" + syslog_tag_mysqld="${syslog_tag_mysqld}-$syslog_tag" + fi + log_notice "Logging to syslog." + logging=syslog fi USER_OPTION="" -- cgit v1.2.1 From a9d2569cba4ff0e9c419d26d4e2005337e047984 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 30 Jul 2007 21:09:45 +0200 Subject: Generate "config.h" directly into the "include" directory, later copied to "my_config.h". Not to pollute the top directory, and to get more control over what is included. Made the include path for "libedit" pick up its own "config.h" first. --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index dab1bbec956..a87bb03526d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -257,7 +257,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/lib/*.la fi -copyfileto $BASE/include config.h include/* +copyfileto $BASE/include include/* rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h if [ $BASE_SYSTEM != "netware" ] ; then -- cgit v1.2.1 From 950a482a4b87ac7e1d879f21c65d3385588bfdb8 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 30 Jul 2007 13:35:36 -0600 Subject: mysqld_safe.sh: Post-review fix, if 'logger' can't be found, and --syslog is requested, exit with error message instead of fall back to logging to error file. --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 2a592a6fbf5..e6f7ff7b3cb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -302,8 +302,8 @@ then my_which logger > /dev/null 2>&1 if [ $? -ne 0 ] then - log_error "--syslog requested, but no 'logger' program found." - want_syslog=0 + log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." + exit 1 fi fi -- cgit v1.2.1 From f5c8c9a81d79587241f41e05112812c4abc8655f Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Wed, 1 Aug 2007 11:58:25 +0200 Subject: Option 6 tries to grant global privileges at the database level which does not work. Removing these attempted privileges makes this identical to option 5 so remove it completely. The spirit of the program appears to be aimed at database privileges, so do not add another option for granting global privileges as it may be unexpected. Fixes bug#14618 (same as previous patch, this time applied to -maint tree). --- scripts/mysql_setpermission.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 9699cd28047..1f5509f9955 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -19,13 +19,14 @@ ## 1.3 Applied patch provided by Martin Mokrejs ## (General code cleanup, use the GRANT statement instead of updating ## the privilege tables directly, added option to revoke privileges) +## 1.4 Remove option 6 which attempted to erroneously grant global privileges #### TODO # # empty ... suggestions ... mail them to me ... -$version="1.3"; +$version="1.4"; use DBI; use Getopt::Long; @@ -103,13 +104,9 @@ sub q1 { # first question ... print " existing database and host combination (user can do\n"; print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,\n"; print " LOCK TABLES,CREATE TEMPORARY TABLES)\n"; - print " 6. Create/append database administrative privileges for an\n"; - print " existing database and host combination (user can do\n"; - print " SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,\n"; - print " CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS)\n"; - print " 7. Create/append full privileges for an existing database\n"; + print " 6. Create/append full privileges for an existing database\n"; print " and host combination (user has FULL privilege)\n"; - print " 8. Remove all privileges for for an existing database and\n"; + print " 7. Remove all privileges for for an existing database and\n"; print " host combination.\n"; print " (user will have all permission fields set to N)\n"; print " 0. exit this program\n"; @@ -117,10 +114,10 @@ sub q1 { # first question ... while () { $answer = $_; chomp($answer); - if ($answer =~ /^[12345678]$/) { + if ($answer =~ /^[1234567]$/) { if ($answer == 1) { setpwd(); - } elsif ($answer =~ /^[2345678]$/) { + } elsif ($answer =~ /^[234567]$/) { addall($answer); } else { print "Sorry, something went wrong. With such option number you should not get here.\n\n"; @@ -233,7 +230,7 @@ sub addall { } } - if ( ( !$todo ) or not ( $todo =~ m/^[2-8]$/ ) ) { + if ( ( !$todo ) or not ( $todo =~ m/^[2-7]$/ ) ) { print STDERR "Sorry, select option $todo isn't known inside the program .. See ya\n"; quit(); } @@ -256,12 +253,9 @@ sub addall { # user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 6) { - # admin privileges: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; - } elsif ($todo == 7) { # all privileges $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; - } elsif ($todo == 8) { + } elsif ($todo == 7) { # all privileges set to N $sth = $dbh->do("REVOKE ALL ON *.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; } -- cgit v1.2.1 From 74267ad9b83266a860a6e370cf22c64a56e1333d Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 2 Aug 2007 12:49:27 +0200 Subject: CMakeLists.txt (several), make_win_bin_dist: Aligned client library build and use with the Unix version when it comes to what source to include directly in the builds, and what libraries to link with (bug#30118). Also reviewed, corrected and made more clear when static or dynamic Thread Local Storage is to be used. Some code duplication was removed, and some redundant library usage were removed, reducing the risk of incorrect TLS usage. --- scripts/make_win_bin_dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index beb274ca1a3..c14423a06c1 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -287,7 +287,7 @@ cp include/mysql.h \ mkdir -p $DESTDIR/lib/opt cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ - client/$TARGET/mysqlclient.lib \ + libmysql/$TARGET/mysqlclient.lib \ regex/$TARGET/regex.lib \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ @@ -297,7 +297,7 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ mkdir -p $DESTDIR/lib/debug cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ - client/debug/mysqlclient.lib \ + libmysql/debug/mysqlclient.lib \ regex/debug/regex.lib \ strings/debug/strings.lib \ zlib/debug/zlib.lib $DESTDIR/lib/debug/ -- cgit v1.2.1 From 838a98c1e6ad9064bd7cb6c051aca33b36cf0f86 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 2 Aug 2007 20:51:04 +0200 Subject: make_win_bin_dist: Simplified copying of 'mysql-test' directory --- scripts/make_win_bin_dist | 81 ++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 53 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index c14423a06c1..14ea77e3e0e 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -144,14 +144,16 @@ fi mkdir $DESTDIR mkdir $DESTDIR/bin -cp client/$TARGET/*.exe $DESTDIR/bin/ -cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ || true -cp server-tools/instance-manager/$TARGET/*.map $DESTDIR/bin/ || true -cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ +cp client/$TARGET/*.exe $DESTDIR/bin/ +cp extra/$TARGET/*.exe $DESTDIR/bin/ +cp myisam/$TARGET/*.exe $DESTDIR/bin/ +cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ +if [ x"$TARGET" != x"release" ] ; then + cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ +fi +cp tests/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/*.exe $DESTDIR/bin/ +cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe @@ -164,8 +166,10 @@ fi # Depending on Visual Studio target, the optimized server has symbols cp sql/$TARGET/$BASENAME.exe $DESTDIR/bin/$BASENAME$EXE_SUFFIX.exe -cp sql/$TARGET/$BASENAME.pdb $DESTDIR/bin/$BASENAME$EXE_SUFFIX.pdb || true -cp sql/$TARGET/$BASENAME.map $DESTDIR/bin/$BASENAME$EXE_SUFFIX.map || true +cp sql/$TARGET/$BASENAME.map $DESTDIR/bin/$BASENAME$EXE_SUFFIX.map +if [ x"$TARGET" != x"release" ] ; then + cp sql/$TARGET/$BASENAME.pdb $DESTDIR/bin/$BASENAME$EXE_SUFFIX.pdb +fi if [ -f "sql/debug/mysqld-debug.exe" ] ; then BASENAME="mysqld-debug" # Old style non CMake build @@ -176,19 +180,16 @@ fi if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/$BASENAME.exe" -o \ x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/$BASENAME.exe $DESTDIR/bin/mysqld-debug.exe - cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb || true - cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map || true + cp sql/debug/$BASENAME.pdb $DESTDIR/bin/mysqld-debug.pdb + cp sql/debug/$BASENAME.map $DESTDIR/bin/mysqld-debug.map fi # ---------------------------------------------------------------------- # Copy data directory, readme files etc # ---------------------------------------------------------------------- -# FIXME is there ever a data directory to copy? if [ -d win/data ] ; then cp -pR win/data $DESTDIR/ -elif [ -d data ] ; then - cp -pR data $DESTDIR/ fi # FIXME maybe a flag to define "release build", or do the @@ -288,6 +289,7 @@ mkdir -p $DESTDIR/lib/opt cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ libmysql/$TARGET/mysqlclient.lib \ + mysys/$TARGET/mysys.lib \ regex/$TARGET/regex.lib \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ @@ -298,53 +300,24 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ libmysql/debug/mysqlclient.lib \ + mysys/debug/mysys.lib \ regex/debug/regex.lib \ strings/debug/strings.lib \ zlib/debug/zlib.lib $DESTDIR/lib/debug/ - - if [ -f "mysys/debug/mysys-nt.lib" ] ; then - cp mysys/debug/mysys-nt.lib $DESTDIR/lib/debug/ - else - cp mysys/debug/mysys.lib $DESTDIR/lib/debug/mysys-nt.lib - fi - -fi - -if [ -f "mysys/$TARGET/mysys-nt.lib" ] ; then - cp mysys/$TARGET/mysys-nt.lib $DESTDIR/lib/opt/ -else - cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys-nt.lib fi # ---------------------------------------------------------------------- # Copy the test directory # ---------------------------------------------------------------------- -mkdir -p $DESTDIR/mysql-test/include $DESTDIR/mysql-test/lib \ - $DESTDIR/mysql-test/r $DESTDIR/mysql-test/std_data \ - $DESTDIR/mysql-test/t +mkdir $DESTDIR/mysql-test cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ -cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db -cp mysql-test/include/*.inc $DESTDIR/mysql-test/include/ -cp mysql-test/include/*.test $DESTDIR/mysql-test/include/ -cp mysql-test/lib/*.pl $DESTDIR/mysql-test/lib/ -cp mysql-test/lib/*.sql $DESTDIR/mysql-test/lib/ || true -cp mysql-test/r/*.require $DESTDIR/mysql-test/r/ -# Need this trick, or we get "argument list too long". -ABS_DST=`pwd`/$DESTDIR -(cd mysql-test/r/ && cp *.result $ABS_DST/mysql-test/r/) -cp mysql-test/std_data/* $DESTDIR/mysql-test/std_data/ -cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.sql $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.def $DESTDIR/mysql-test/t/ -(cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/) +cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/ # Note that this will not copy "extra" if a soft link if [ -d mysql-test/extra ] ; then - mkdir -p $DESTDIR/mysql-test/extra + mkdir $DESTDIR/mysql-test/extra cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/ fi @@ -372,17 +345,19 @@ for i in `cd scripts && ls`; do \ fi; \ done -if [ -d "share" ] ; then - cp -pR share $DESTDIR/ -else - cp -pR sql/share $DESTDIR/ -fi +cp -pR sql/share $DESTDIR/ cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* # The SQL initialisation code is really expected to be in "share" mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true +# ---------------------------------------------------------------------- +# Clean up from possibly copied SCCS directories +# ---------------------------------------------------------------------- + +rm -rf `find $DISTDIR -type d -name SCCS -print` + # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- -- cgit v1.2.1 From a6d082f36de35794006fd7bcb5495eeaf2dd7e82 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Fri, 3 Aug 2007 21:51:37 +0200 Subject: CMakeLists.txt, README, configure.js Several adjustments to make client libraries pass the link test on both win32 and winx64, Visual Studio 2003 and 2005 (bug#30118) --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e9113b098da..6fbfcab72d4 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -24,7 +24,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl # Build comp_sql - used for embedding SQL in C or C++ programs ADD_EXECUTABLE(comp_sql comp_sql.c) -TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) +TARGET_LINK_LIBRARIES(comp_sql debug dbug mysys strings) # Use comp_sql to build mysql_fix_privilege_tables_sql.c GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) -- cgit v1.2.1 From f9fdd5ae8c438718ec466c351b8a9f0aa61e4ae3 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 6 Aug 2007 08:28:16 +0200 Subject: make_win_bin_dist: Copy embedded .pdb and static debug lib --- scripts/make_win_bin_dist | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 14ea77e3e0e..6b6342b268f 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -219,16 +219,22 @@ copy_embedded() $DESTDIR/include cp libmysqld/libmysqld.def $DESTDIR/include/ cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/ + cp libmysqld/$TARGET/mysqlserver.pdb $DESTDIR/Embedded/static/release/ cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/ cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/ cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/ + cp libmysqld/$TARGET/libmysqld.pdb $DESTDIR/Embedded/DLL/release/ if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \ x"$PACK_DEBUG" = x"yes" ] ; then - mkdir -p $DESTDIR/Embedded/DLL/debug + mkdir -p $DESTDIR/Embedded/DLL/debug \ + $DESTDIR/Embedded/static/debug + cp libmysqld/debug/mysqlserver.lib $DESTDIR/Embedded/DLL/debug/ + cp libmysqld/debug/mysqlserver.pdb $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.lib $DESTDIR/Embedded/DLL/debug/ + cp libmysqld/debug/libmysqld.pdb $DESTDIR/Embedded/DLL/debug/ fi } -- cgit v1.2.1 From d75c7a58c14d1c842e90e93cad9c666df487dd5c Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 6 Aug 2007 08:31:09 +0200 Subject: make_win_bin_dist: Corrected install path --- scripts/make_win_bin_dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 6b6342b268f..849226c94ea 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -229,8 +229,8 @@ copy_embedded() x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/Embedded/DLL/debug \ $DESTDIR/Embedded/static/debug - cp libmysqld/debug/mysqlserver.lib $DESTDIR/Embedded/DLL/debug/ - cp libmysqld/debug/mysqlserver.pdb $DESTDIR/Embedded/DLL/debug/ + cp libmysqld/debug/mysqlserver.lib $DESTDIR/Embedded/static/debug/ + cp libmysqld/debug/mysqlserver.pdb $DESTDIR/Embedded/static/debug/ cp libmysqld/debug/libmysqld.dll $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.exp $DESTDIR/Embedded/DLL/debug/ cp libmysqld/debug/libmysqld.lib $DESTDIR/Embedded/DLL/debug/ -- cgit v1.2.1 From e53a73e26cf858ac48ead40927d84d54e33c1695 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com/nosik.monty.fi" <> Date: Mon, 13 Aug 2007 16:11:25 +0300 Subject: Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map() --- scripts/mysql_install_db.sh | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index bd90e6916b1..7e5412aa8c3 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -22,6 +22,7 @@ in_rpm=0 windows=0 defaults="" user="" +source_install=0 case "$1" in --no-defaults|--defaults-file=*|--defaults-extra-file=*) @@ -74,6 +75,13 @@ parse_arguments() { # package. windows=1 ;; + --source-install) + # This is used when you want to run mysqld directly from the + # source tree (for example when you are developing MySQL and + # only want to create the default tables but don't want to + # install mysqld yet. + source_install=1 ;; + *) if test -n "$pick_args" then @@ -119,22 +127,37 @@ parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" test -z "$ldata" && ldata=@localstatedir@ -if test -z "$basedir" +if test -z "$basedir" -a "$source_install" = 0 then basedir=@prefix@ bindir=@bindir@ + extra_bindir="$bindir" execdir=@libexecdir@ pkgdatadir=@pkgdatadir@ else - bindir="$basedir/bin" + if test -z "$basedir" + then + bindir="$basedir/bin" + extra_bindir="$bindir" + fi if test -x "$basedir/libexec/mysqld" then execdir="$basedir/libexec" elif test -x "$basedir/sbin/mysqld" then execdir="$basedir/sbin" - else + elif test -x "$basedir/bin/mysqld" + then execdir="$basedir/bin" + elif test -x "./sql/mysqld" + then + execdir="./sql" + bindir="./client" + extra_bindir="./extra" + else + echo "Can't find mysqld executable through --basedir=$basedir." + echo "Please verify that you have MySQL installed in this location" + exit 1; fi fi @@ -221,14 +244,14 @@ hostname=`@HOSTNAME@` # Check if hostname is valid if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0 then - resolved=`$bindir/resolveip $hostname 2>&1` + resolved=`$extra_bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] then - resolved=`$bindir/resolveip localhost 2>&1` + resolved=`$extra_bindir/resolveip localhost 2>&1` if [ $? -ne 0 ] then echo "Neither host '$hostname' nor 'localhost' could be looked up with" - echo "$bindir/resolveip" + echo "$extra_bindir/resolveip" echo "Please configure the 'hostname' command to return a correct" echo "hostname." echo "If you want to solve this at a later stage, restart this script" @@ -274,7 +297,7 @@ fi # Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ ---basedir=$basedir --datadir=$ldata --loose-skip-innodb \ +--basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ --net_buffer_length=16K" @@ -322,7 +345,7 @@ then if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/mysqld_safe &" + echo "cd @prefix@ ; $scriptdir/mysqld_safe &" echo echo "You can test the MySQL daemon with mysql-test-run.pl" echo "cd mysql-test ; perl mysql-test-run.pl" -- cgit v1.2.1 From 7287ecd814b8ad2a6e844610ffd7d0387bb44c69 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Tue, 14 Aug 2007 00:03:05 +0200 Subject: make_win_src_distribution_old.sh: Rename: scripts/make_win_src_distribution.sh -> scripts/make_win_src_distribution_old.sh Makefile.am, make_win_src_distribution_old.sh: Rename and put in note not to be used --- scripts/Makefile.am | 6 +- scripts/make_win_src_distribution.sh | 552 ------------------------------ scripts/make_win_src_distribution_old.sh | 560 +++++++++++++++++++++++++++++++ 3 files changed, 563 insertions(+), 555 deletions(-) delete mode 100644 scripts/make_win_src_distribution.sh create mode 100644 scripts/make_win_src_distribution_old.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d4944962884..161c8a54df2 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -41,11 +41,11 @@ bin_SCRIPTS = @server_scripts@ \ noinst_SCRIPTS = make_binary_distribution \ make_sharedlib_distribution \ - make_win_src_distribution + make_win_src_distribution_old EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ - make_win_src_distribution.sh \ + make_win_src_distribution_old.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ @@ -99,7 +99,7 @@ CLEANFILES = @server_scripts@ \ mysql_tableinfo \ mysql_upgrade_shell \ mysqld_multi \ - make_win_src_distribution + make_win_src_distribution_old # mysqlbug should be distributed built so that people can report build # failures with it. diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh deleted file mode 100644 index d6109772060..00000000000 --- a/scripts/make_win_src_distribution.sh +++ /dev/null @@ -1,552 +0,0 @@ -#!/bin/sh -# Copyright (C) 2003-2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Terminate loudly on error, we don't want partial package -set -e -trap "echo '*** script failed ***'" 0 - -# -# Script to create a Windows src package -# - -version=@VERSION@ -CP="cp -p" - -DEBUG=0 -SILENT=0 -SUFFIX="" -DIRNAME="" -OUTTAR="0" -OUTZIP="0" - -# -# An "abort" function taking a variable number of strings (one per line) -# - -abort() -{ - for line - do - echo "$line" - done - exit 1 -} - - -# -# This script must run from MySQL top directory -# - -if [ ! -f scripts/make_win_src_distribution ]; then - abort "ERROR : You must run this script from the MySQL top-level directory" -fi -SOURCE=`pwd` - -# -# Check for source compilation/configuration -# - -if [ ! -f sql/sql_yacc.cc ]; then - abort "ERROR : Sorry, you must run this script after the complete build," \ - " hope you know what you are trying to do !!" -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 Show no progress information" - echo " --tar Create tar.gz package" - echo " --zip Create zip package" - echo " --help Show this help message" - - exit 0 -} - -# -# Parse the input arguments -# - -parse_arguments() { - for arg do - case "$arg" in - --add-tar) ADDTAR=1 ;; - --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 ;; - --zip) OUTZIP=1 ;; - --help) show_usage ;; - *) abort "Unknown argument '$arg'" - ;; - 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 - - -# -# Convert argument file from unix to DOS text -# - -unix_to_dos() -{ - for arg do - print_debug "Replacing LF -> CRLF from '$arg'" - - awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done -} - - -# -# Create a tmp dest directory to copy files -# - -BASE=$TMP/my_win_dist$SUFFIX.$$ -trap "rm -r -f $BASE; echo '*** interrupted ***'; exit 1" 1 2 3 13 15 - -if [ -d $BASE ] ; then - echo "WARNING: Destination directory '$BASE' already exists, deleting it" - rm -r -f $BASE -fi - -$CP -r $SOURCE/VC++Files $BASE -# This includes an implicit 'mkdir $BASE' ! - -# -# Process version tags in InstallShield files -# - -vreplace() -{ - for arg do - unix_to_dos $arg - cat $arg | sed -e 's!@''VERSION''@!@VERSION@!' > $arg.tmp - rm -f $arg - mv $arg.tmp $arg - done -} - -if test -d $BASE/InstallShield -then - for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic - do - cd $BASE/InstallShield/$d/String\ Tables/0009-English - vreplace value.shl - cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent - vreplace infolist.txt - done -fi - -# -# 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" - -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 *.hpp *.yy *dsp *.dsw \ - README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ - *.inc *.test *.result *.pem Moscow_leap des_key_file \ - *.vcproj *.sln *.dat *.000001 *.require *.opt *.cnf - 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 - - cd $SOURCE - ( - find $arg -type d \ - -and -not -path \*SCCS\* \ - -and -not -path \*.deps\* \ - -and -not -path \*.libs\* \ - -and -not -path \*autom4te.cache -print - )|( - while read v - do - copy_dir_files $v - done - ) - - done -} - -# -# Input directories to be copied -# - -for i in client dbug extra heap include \ - libmysql libmysqld myisam \ - myisammrg mysys regex sql strings sql-common sql/examples \ - tools vio zlib -do - copy_dir_files $i -done - -# -# Create project files for ndb -# -make -C $SOURCE/ndb windoze || true - -# -# Input directories to be copied recursively -# - -for i in bdb innobase ndb extra/yassl server-tools -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 EXCEPTIONS-CLIENT\ - INSTALL-SOURCE INSTALL-WIN \ - INSTALL-WIN-SOURCE \ - Docs/INSTALL-BINARY Docs/manual.chm -do - print_debug "Copying file '$i'" - if [ -f $i ] - then - $CP $i $BASE/$i - fi -done - -# -# support files -# -mkdir $BASE/support-files - -# Rename the cnf files to .ini -for i in support-files/*.cnf -do - i=`echo $i | sed 's/.cnf$//g'` - cp $i.cnf $BASE/$i.ini -done - -# -# Raw dirs from source tree -# - -for i in scripts sql-bench mysql-test SSL tests -do - print_debug "Copying directory '$i'" - if [ -d $i ] - then - if [ -d $BASE/$i ] - then - $CP -R $i $BASE - else - $CP -R $i $BASE/$i - fi - fi - # But remove object files from destination - find $BASE/$i -type f -name \*.o | xargs rm -f -done - -# -# Fix some windows files to avoid compiler warnings -# - -if [ -x extra/replace ] ; then - ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | \ - sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' \ - > $BASE/sql/sql_yacc.cpp-new - mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp -else - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "extra/replace" not built, can not filter "sql_yacc.ccp"' - echo 'WARNING: to reduce the number of warnings when building' - fi -fi - -# -# Search the tree for plain text files and adapt the line end marker -# -find $BASE \( -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ - -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ - -o -name "*.dsp" -o -name "*.dsw" \ - -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ -| while read v - do - unix_to_dos $v - done - -mv $BASE/README $BASE/README.txt - -# -# Clean up if we did this from a bk tree -# - -find $BASE -type d \( -name SCCS -o -name .deps -o -name .libs \) -print0 | \ -xargs -0 rm -r -f -rm -r -f "$BASE/mysql-test/var" - -# -# Initialize the initial data directory -# - -if [ ! -f scripts/mysql_install_db ] ; then - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "scripts/mysql_install_db" is not built, can not initiate databases' - fi -elif [ ! -f extra/my_print_defaults ]; then - if [ "$SILENT" = "0" ] ; then - echo 'WARNING: "extra/my_print_defaults" is not built, can not initiate databases' - fi -else - print_debug "Initializing the 'data' directory" - scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data - if test "$?" = 1 - then - exit 1; - fi -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 -# - -if [ "$OUTTAR" = "0" ]; then - if [ "$OUTZIP" = "0" ]; then - OUTZIP=1 - fi -fi - -set_tarzip_options() -{ - for arg - do - if [ "$arg" = "tar" ]; then - ZIPFILE1=gnutar - ZIPFILE2=gtar - OPT=cf - EXT=".tar" - NEED_COMPRESS=1 - else - ZIPFILE1=zip - ZIPFILE2="" - OPT="-r -q" - EXT=".zip" - NEED_COMPRESS=0 - fi - done -} - - -# -# Create the archive -# -create_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 - - if [ "$SILENT" = "0" ] ; then - echo "$NEW_NAME$EXT created successfully !!" - fi -} - -if [ "$OUTTAR" = "1" ]; then - set_tarzip_options 'tar' - - 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_archive -fi - -if [ "$OUTZIP" = "1" ]; then - set_tarzip_options 'zip' - - tar=`which_1 $ZIPFILE1 $ZIPFILE2` - if test "$?" = "1" -o "$tar" = "" - then - echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" - fi - - create_archive -fi - -print_debug "Removing temporary directory" -rm -r -f $BASE - -# No need to report anything if we got here -trap "" 0 - -# End of script diff --git a/scripts/make_win_src_distribution_old.sh b/scripts/make_win_src_distribution_old.sh new file mode 100644 index 00000000000..dfb43585a21 --- /dev/null +++ b/scripts/make_win_src_distribution_old.sh @@ -0,0 +1,560 @@ +#!/bin/sh +# Copyright (C) 2003-2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# NOTE: This script creates a source TAR and ZIP to be used when +# building using Visual Studio 2003 .Net. To gain more flexibility, a +# new CMake build was added. The new build obsoletes this script, Unix +# and Windows share the same source TAR/ZIP. +# Also note that the old build from source created by this script is +# no longer tested by MySQL AB and may not work. Please use the new +# CMake based build. + +# Terminate loudly on error, we don't want partial package +set -e +trap "echo '*** script failed ***'" 0 + +# +# Script to create a Windows src package +# + +version=@VERSION@ +CP="cp -p" + +DEBUG=0 +SILENT=0 +SUFFIX="" +DIRNAME="" +OUTTAR="0" +OUTZIP="0" + +# +# An "abort" function taking a variable number of strings (one per line) +# + +abort() +{ + for line + do + echo "$line" + done + exit 1 +} + + +# +# This script must run from MySQL top directory +# + +if [ ! -f scripts/make_win_src_distribution ]; then + abort "ERROR : You must run this script from the MySQL top-level directory" +fi +SOURCE=`pwd` + +# +# Check for source compilation/configuration +# + +if [ ! -f sql/sql_yacc.cc ]; then + abort "ERROR : Sorry, you must run this script after the complete build," \ + " hope you know what you are trying to do !!" +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 Show no progress information" + echo " --tar Create tar.gz package" + echo " --zip Create zip package" + echo " --help Show this help message" + + exit 0 +} + +# +# Parse the input arguments +# + +parse_arguments() { + for arg do + case "$arg" in + --add-tar) ADDTAR=1 ;; + --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 ;; + --zip) OUTZIP=1 ;; + --help) show_usage ;; + *) abort "Unknown argument '$arg'" + ;; + 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 + + +# +# Convert argument file from unix to DOS text +# + +unix_to_dos() +{ + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} + + +# +# Create a tmp dest directory to copy files +# + +BASE=$TMP/my_win_dist$SUFFIX.$$ +trap "rm -r -f $BASE; echo '*** interrupted ***'; exit 1" 1 2 3 13 15 + +if [ -d $BASE ] ; then + echo "WARNING: Destination directory '$BASE' already exists, deleting it" + rm -r -f $BASE +fi + +$CP -r $SOURCE/VC++Files $BASE +# This includes an implicit 'mkdir $BASE' ! + +# +# Process version tags in InstallShield files +# + +vreplace() +{ + for arg do + unix_to_dos $arg + cat $arg | sed -e 's!@''VERSION''@!@VERSION@!' > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done +} + +if test -d $BASE/InstallShield +then + for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic + do + cd $BASE/InstallShield/$d/String\ Tables/0009-English + vreplace value.shl + cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent + vreplace infolist.txt + done +fi + +# +# 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" + +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 *.hpp *.yy *dsp *.dsw \ + README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ + *.inc *.test *.result *.pem Moscow_leap des_key_file \ + *.vcproj *.sln *.dat *.000001 *.require *.opt *.cnf + 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 + + cd $SOURCE + ( + find $arg -type d \ + -and -not -path \*SCCS\* \ + -and -not -path \*.deps\* \ + -and -not -path \*.libs\* \ + -and -not -path \*autom4te.cache -print + )|( + while read v + do + copy_dir_files $v + done + ) + + done +} + +# +# Input directories to be copied +# + +for i in client dbug extra heap include \ + libmysql libmysqld myisam \ + myisammrg mysys regex sql strings sql-common sql/examples \ + tools vio zlib +do + copy_dir_files $i +done + +# +# Create project files for ndb +# +make -C $SOURCE/ndb windoze || true + +# +# Input directories to be copied recursively +# + +for i in bdb innobase ndb extra/yassl server-tools +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 EXCEPTIONS-CLIENT\ + INSTALL-SOURCE INSTALL-WIN \ + INSTALL-WIN-SOURCE \ + Docs/INSTALL-BINARY Docs/manual.chm +do + print_debug "Copying file '$i'" + if [ -f $i ] + then + $CP $i $BASE/$i + fi +done + +# +# support files +# +mkdir $BASE/support-files + +# Rename the cnf files to .ini +for i in support-files/*.cnf +do + i=`echo $i | sed 's/.cnf$//g'` + cp $i.cnf $BASE/$i.ini +done + +# +# Raw dirs from source tree +# + +for i in scripts sql-bench mysql-test SSL tests +do + print_debug "Copying directory '$i'" + if [ -d $i ] + then + if [ -d $BASE/$i ] + then + $CP -R $i $BASE + else + $CP -R $i $BASE/$i + fi + fi + # But remove object files from destination + find $BASE/$i -type f -name \*.o | xargs rm -f +done + +# +# Fix some windows files to avoid compiler warnings +# + +if [ -x extra/replace ] ; then + ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | \ + sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' \ + > $BASE/sql/sql_yacc.cpp-new + mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp +else + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "extra/replace" not built, can not filter "sql_yacc.ccp"' + echo 'WARNING: to reduce the number of warnings when building' + fi +fi + +# +# Search the tree for plain text files and adapt the line end marker +# +find $BASE \( -name "*.cnf" -o -name "*.ini" \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.dsp" -o -name "*.dsw" \ + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ +| while read v + do + unix_to_dos $v + done + +mv $BASE/README $BASE/README.txt + +# +# Clean up if we did this from a bk tree +# + +find $BASE -type d \( -name SCCS -o -name .deps -o -name .libs \) -print0 | \ +xargs -0 rm -r -f +rm -r -f "$BASE/mysql-test/var" + +# +# Initialize the initial data directory +# + +if [ ! -f scripts/mysql_install_db ] ; then + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "scripts/mysql_install_db" is not built, can not initiate databases' + fi +elif [ ! -f extra/my_print_defaults ]; then + if [ "$SILENT" = "0" ] ; then + echo 'WARNING: "extra/my_print_defaults" is not built, can not initiate databases' + fi +else + print_debug "Initializing the 'data' directory" + scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data + if test "$?" = 1 + then + exit 1; + fi +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 +# + +if [ "$OUTTAR" = "0" ]; then + if [ "$OUTZIP" = "0" ]; then + OUTZIP=1 + fi +fi + +set_tarzip_options() +{ + for arg + do + if [ "$arg" = "tar" ]; then + ZIPFILE1=gnutar + ZIPFILE2=gtar + OPT=cf + EXT=".tar" + NEED_COMPRESS=1 + else + ZIPFILE1=zip + ZIPFILE2="" + OPT="-r -q" + EXT=".zip" + NEED_COMPRESS=0 + fi + done +} + + +# +# Create the archive +# +create_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 + + if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" + fi +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' + + 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_archive +fi + +if [ "$OUTZIP" = "1" ]; then + set_tarzip_options 'zip' + + tar=`which_1 $ZIPFILE1 $ZIPFILE2` + if test "$?" = "1" -o "$tar" = "" + then + echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" + fi + + create_archive +fi + +print_debug "Removing temporary directory" +rm -r -f $BASE + +# No need to report anything if we got here +trap "" 0 + +# End of script -- cgit v1.2.1 From dcd94251d41cfab156c48f94ee5ee3325c3d166c Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 20 Aug 2007 11:00:51 -0600 Subject: Bug #27694: mysqlhotcopy & p5-DBD-mysql51-4.003 Use "SHOW TABLES FROM `db`" instead of $dbh->tables() in the get_list_of_tables() routine. The symptom is that, when used with recent versions of DBD::mysql, mysqlhotcopy uses a double-qualified table name, for example: Invalid db.table name 'test.test`.`x' at /usr/bin/mysqlhotcopy line 855. This is caused by a change in DBD::mysql. See this diff: http://svn.perl.org/viewcvs/modules/DBD-mysql/trunk/lib/DBD/mysql.pm?r1=9183&r2=9188 Basically, older DBD::mysql implemented a limited ->table_info method; now the full method is implemented, and as a result DBI's ->tables() method has access to the schema value, so it uses it. --- scripts/mysqlhotcopy.sh | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 61cd59457d1..6ad5c77b954 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -821,30 +821,14 @@ sub get_raid_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() }; - - ## Remove quotes around table names - my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR - if ($quote) { - foreach (@dbh_tables) { - s/^$quote(.*)$quote$/$1/; - s/$quote$quote/$quote/g; - } - } - - $dbh->disconnect(); - return @dbh_tables; + my $tables = + eval { + $dbh->selectall_arrayref('SHOW TABLES FROM ' . + $dbh->quote_identifier($db)) + } || []; + warn "Unable to retrieve list of tables in $db: $@" if $@; + + return (map { $_->[0] } @$tables); } sub quote_names { -- cgit v1.2.1 From 501a930dc6f8efe2b146ca7456aa39a5b02c7477 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Fri, 24 Aug 2007 16:40:26 +0200 Subject: Finish up last syslog -> want_syslog change missed in r1.91, fixing bug#30624 --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e6f7ff7b3cb..d9c1a16e21a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -363,7 +363,7 @@ then USER_OPTION="--user=$user" fi # Change the err log to the right user, if it is in use - if [ $syslog -eq 0 ]; then + if [ $want_syslog -eq 0 ]; then touch $err_log chown $user $err_log fi -- cgit v1.2.1 From f5489f67e9dcd7010959a49ebe0ef1c72a099ab1 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 11:23:10 +0200 Subject: Bug#30029 mysql_upgrade fails for 5.0 -> 5.1.21, 5.1.20 -> 5.1.21 upgrades - Change to use '' to quote a string inside another string --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index cd0882e3af4..81eb3340d32 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment=''General log''', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -73,7 +73,7 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=''Slow log''', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; -- cgit v1.2.1 From 9d1570302b7dcd8fbcd223ff1af346f9b6692cf6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 13:16:39 +0200 Subject: Cset exclude: msvensson@pilot.(none)|ChangeSet|20070827092310|49459 --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 81eb3340d32..cd0882e3af4 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment=''General log''', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -73,7 +73,7 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=''Slow log''', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; -- cgit v1.2.1 From e42afa010d70c46d74e63315f7e489564d51102d Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Mon, 27 Aug 2007 13:30:22 +0200 Subject: More cleanup / fixing for NetWare: 1) "test_db.sql" is a plaintext file, no binary; 2) do not try to strip the binaries, it will not work. --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b6404a33cc4..8e670f0e6ba 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -212,7 +212,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ if [ $BASE_SYSTEM = "netware" ] ; then BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql$BS \ + netware/init_db.sql netware/test_db.sql \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; # For all other platforms: -- cgit v1.2.1 From ffc67d70ce6f7b8a197db5fcd51ca551cf1b52db Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 13:39:34 +0200 Subject: Bug#28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE - Set sql_mode to default when creating system tables --- scripts/mysql_system_tables.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index cd0882e3af4..f7b23e4e7ae 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -2,6 +2,7 @@ -- The system tables of MySQL Server -- +set sql_mode=''; set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; -- cgit v1.2.1 From cf285315ebb64789e914ee99539deba99ad826f5 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 29 Aug 2007 22:24:11 +0200 Subject: mysql_config.sh: Flag changed name in icc 10 --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 1fcad16affb..addc3a10474 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -122,7 +122,7 @@ done cflags=`echo "$cflags"|sed -e 's/ *\$//'` # Same for --libs(_r) -for remove in lmtmalloc static-libcxa i-static +for remove in lmtmalloc static-libcxa i-static static-intel do # We know the strings starts with a space libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` -- cgit v1.2.1 From 3c6ca8d6edf55764df93a831f61dc3855e82d91c Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/sin.intern.azundris.com" <> Date: Thu, 13 Sep 2007 16:19:46 +0200 Subject: Bug #15327: configure: --with-tcp-port option being partially ignored make sure that if builder configured with a non-standard (!= 3306) default TCP port that value actually gets used throughout. if they didn't configure a value, assume "use a sensible default", which will be read from /etc/services or, failing that, from the factory default. That makes the order of preference - command-line option - my.cnf, where applicable - $MYSQL_TCP_PORT environment variable - /etc/services (unless configured --with-tcp-port) - default port (--with-tcp-port=... or factory default) --- scripts/Makefile.am | 1 + scripts/mysql_config.sh | 7 ++++++- scripts/mysql_fix_privilege_tables.sh | 1 + scripts/mysqld_safe-watch.sh | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index d4944962884..2b6870717ba 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -174,6 +174,7 @@ SUFFIXES = .sh -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ + -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \ -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index f094cb060b7..ab58c512aac 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,9 +92,14 @@ fix_path pkgincludedir include/mysql include version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' -port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' +if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then + port=0 +else + port=@MYSQL_TCP_PORT@ +fi + # Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index a353273dc28..3b179957932 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -25,6 +25,7 @@ sql_only=0 basedir="@prefix@" verbose=0 args="" +# no elaborate fallback here; with no argument, it will happen in "mysql" port="" socket="" database="mysql" diff --git a/scripts/mysqld_safe-watch.sh b/scripts/mysqld_safe-watch.sh index c837ba9a118..f853741c87b 100644 --- a/scripts/mysqld_safe-watch.sh +++ b/scripts/mysqld_safe-watch.sh @@ -66,7 +66,7 @@ fi echo "Starting mysqld demon with databases from $DATADIR" #Default communication ports -#MYSQL_TCP_PORT=3306 +#MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ if test -z "$MYSQL_UNIX_PORT" then MYSQL_UNIX_PORT="/tmp/mysql.sock" -- cgit v1.2.1 From c66df1c1696a201c648e2b672b1579b6394f8c01 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Fri, 14 Sep 2007 00:59:22 +0200 Subject: scripts/mysqld_safe.sh Copy a fix by jperkin for bug#30624 into the 5.1.22 build tree. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e6f7ff7b3cb..d9c1a16e21a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -363,7 +363,7 @@ then USER_OPTION="--user=$user" fi # Change the err log to the right user, if it is in use - if [ $syslog -eq 0 ]; then + if [ $want_syslog -eq 0 ]; then touch $err_log chown $user $err_log fi -- cgit v1.2.1 From e068e99cd0f7cc64c999c81f546daa9337402a8e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 26 Sep 2007 17:04:41 +0200 Subject: Bug#31167 Introduction of @@hostname breaks replication in a ring - Use a local uservariable to avoid @@hostname in binlog --- scripts/mysql_system_tables_data.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 5f0289ab197..8399ae796ef 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -15,7 +15,8 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +set @hostname= @@hostname; +REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; -- cgit v1.2.1 From 18acdc7581148c362d0d66d6c78ded9bd0e3e471 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Wed, 26 Sep 2007 20:19:33 +0200 Subject: make_binary_distribution.sh: Use 'make install' to create the package Makefile.am: Added 'pkgsuppdir' to control location separately Pass on mandir and infodir Don't install headers --- scripts/Makefile.am | 2 + scripts/make_binary_distribution.sh | 443 ++++++++++++++++-------------------- 2 files changed, 204 insertions(+), 241 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 0507385500e..471a23f0a73 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -135,6 +135,8 @@ SUFFIXES = .sh -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ + -e 's!@''mandir''@!$(mandir)!g' \ + -e 's!@''infodir''@!$(infodir)!g' \ -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b6404a33cc4..73d47b1b320 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -14,36 +14,59 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This is a script to create a TAR or ZIP binary distribution out of a -# built source tree. The output file will be put at the top level of -# the source tree, as "mysql-....{tar.gz,zip}" +############################################################################## # -# The temporary directory path given to "--tmp=" has to be -# absolute and with no spaces. +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-....{tar.gz,zip}" +# +# Note that the structure created by this script is slightly different from +# what a normal "make install" would produce. No extra "mysql" sub directory +# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or +# "$prefix/share/mysql". +# +# In GNU make/automake terms +# +# "pkglibdir" is set to the same as "libdir" +# "pkgincludedir" is set to the same as "includedir" +# "pkgdatadir" is set to the same as "datadir" +# "pkgsuppdir" is set to "@prefix@/support-files", +# normally the same as "datadir" (not to set?) +# +# The temporary directory path given to "--tmp=" has to be +# absolute and with no spaces. +# +# Note that for best result, the original "make" should be done with +# the same arguments as used for "make install" below, especially the +# 'pkglibdir', as the RPATH should to be set correctly. +# +############################################################################## + +############################################################################## +# +# Read the command line arguments that control this script +# +############################################################################## machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ -version=@VERSION@ SOURCE=`pwd` CP="cp -p" MV="mv" -STRIP=1 -DEBUG=0 +STRIP=1 # Option ignored SILENT=0 -MACHINE="" PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER="" +NDBCLUSTER="" # Option ignored 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=;;"` ;; --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; @@ -54,68 +77,52 @@ for arg do esac done -# Avoid too long command lines for cp (bug#27489) -MCP() { - for i - do - last=$i - done - for i - do - if test "x$i" != "x$last" - then - cp -p $i $last - fi - done -} - -# Remove vendor from $system -system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` - -# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) -system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` -system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` -system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` -system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` -system=`echo $system | sed -e 's/osf5.1b/tru64/g'` -system=`echo $system | sed -e 's/linux-gnu/linux/g'` -system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` -system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` - -if [ x"$MACHINE" != x"" ] ; then - machine=$MACHINE +# ---------------------------------------------------------------------- +# Adjust "system" output from "uname" to be more human readable +# ---------------------------------------------------------------------- + +if [ x"$PLATFORM" = x"" ] ; then + # FIXME move this to the build tools + # Remove vendor from $system + system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` + + # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) + system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` + system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` + system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` + system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` + system=`echo $system | sed -e 's/osf5.1b/tru64/g'` + system=`echo $system | sed -e 's/linux-gnu/linux/g'` + system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` + system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` + + PLATFORM="$system-$machine" fi -if [ x"$PLATFORM" != x"" ] ; then - platform="$PLATFORM" -else - platform="$system-$machine" -fi +# Print the platform name for build logs +echo "PLATFORM NAME: $PLATFORM" -# FIXME This should really be integrated with automake and not duplicate the -# installation list. +case $PLATFORM in + *netware*) BASE_SYSTEM="netware" ;; +esac -BASE=$TMP/my_dist$SUFFIX +# Change the distribution to a long descriptive name +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX +# ---------------------------------------------------------------------- +# Define BASE, and remove the old BASE directory if any +# ---------------------------------------------------------------------- +BASE=$TMP/my_dist$SUFFIX if [ -d $BASE ] ; then rm -rf $BASE fi -BS="" -BIN_FILES="" -BASE_SYSTEM="any" -MYSQL_SHARE=$BASE/share/mysql - -case $system in - *netware*) - BASE_SYSTEM="netware" - BS=".nlm" - MYSQL_SHARE=$BASE/share - ;; -esac +# ---------------------------------------------------------------------- +# Find the TAR to use +# ---------------------------------------------------------------------- # This is needed to prefer GNU tar over platform tar because that can't # always handle long filenames @@ -142,26 +149,115 @@ which_1 () } tar=`which_1 gnutar gtar` -if [ "$?" = "1" -o x"$tar" = x"" ] ; then +if [ $? -ne 0 -o x"$tar" = x"" ] ; then tar=tar fi +############################################################################## +# +# Handle the Unix/Linux packaging using "make install" +# +############################################################################## + +if [ x"$BASE_SYSTEM" != x"netware" ] ; then + + # ---------------------------------------------------------------------- + # Terminate on any base level error + # ---------------------------------------------------------------------- + set -e + + # ---------------------------------------------------------------------- + # Do a install that we later are to pack. Use the same paths as in + # the build for the relevant directories. + # ---------------------------------------------------------------------- + @MAKE@ DESTDIR=$BASE install \ + pkglibdir=@pkglibdir@ \ + pkgincludedir=@pkgincludedir@ \ + pkgdatadir=@pkgdatadir@ \ + mandir=@mandir@ \ + infodir=@infodir@ + + # ---------------------------------------------------------------------- + # Rename top directory, and set DEST to the new directory + # ---------------------------------------------------------------------- + mv $BASE@prefix@ $BASE/$NEW_NAME + DEST=$BASE/$NEW_NAME + + # ---------------------------------------------------------------------- + # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a + # ---------------------------------------------------------------------- + if [ x"@GXX@" = x"yes" ] ; then + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` + if [ $? -ne 0 ] ; then + echo "Warning: Couldn't find libgcc.a!" + else + $CP $gcclib $DEST/lib/libmygcc.a + fi + fi + + # FIXME let this script be in "bin/", where it is in the RPMs? + # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html + mkdir $DEST/scripts + mv $DEST/bin/mysql_install_db $DEST/scripts/ + + # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 + + # Copy readme and license files + cp README Docs/INSTALL-BINARY $DEST/ + if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then + cp COPYING EXCEPTIONS-CLIENT $DEST/ + elif [ -f LICENSE.mysql ] ; then + cp LICENSE.mysql $DEST/ + else + echo "ERROR: no license files found" + exit 1 + fi + + # FIXME should be handled by make file, and to other dir + cp scripts/mysqlaccess.conf $DEST/bin/ + cp support-files/magic $DEST/support-files/ + + # Create empty data directories, set permission (FIXME why?) + mkdir $DEST/data $DEST/data/mysql $DEST/data/test + chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test + + # ---------------------------------------------------------------------- + # Create the result tar file + # ---------------------------------------------------------------------- + + echo "Using $tar to create archive" + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + echo "Creating and compressing archive" + rm -f $NEW_NAME.tar.gz + (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz + echo "$NEW_NAME.tar.gz created" + + echo "Removing temporary directory" + rm -rf $BASE + exit 0 +fi + + +############################################################################## +# +# Handle the Netware case, until integrated above +# +############################################################################## + +BS=".nlm" +MYSQL_SHARE=$BASE/share + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ - $BASE/mysql-test/extra \ - $BASE/mysql-test/extra/binlog_tests $BASE/mysql-test/extra/rpl_tests \ $BASE/mysql-test/suite -if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test - - chmod o-rwx $BASE/data $BASE/data/* -fi - # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name # twice, once in the directory location where it is built, and a @@ -209,41 +305,16 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ "; # Platform-specific bin dir files: -if [ $BASE_SYSTEM = "netware" ] ; then - BIN_FILES="$BIN_FILES \ +BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql$BS \ + netware/init_db.sql netware/test_db.sql \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; -# For all other platforms: -else - BIN_FILES="$BIN_FILES \ - server-tools/instance-manager/.libs/mysqlmanager \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqlslap \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog \ - tests/.libs/mysql_client_test \ - libmysqld/examples/.libs/mysql_client_test_embedded \ - libmysqld/examples/.libs/mysqltest_embedded \ - "; -fi copyfileto $BASE/bin $BIN_FILES -if [ x$STRIP = x1 ] ; then - strip $BASE/bin/* -fi - -# Obsolete, starting from 5.1.6-beta -# # Copy not binary files -# copyfileto $BASE/bin sql/mysqld.sym.gz - -if [ $BASE_SYSTEM = "netware" ] ; then - $CP netware/*.pl $BASE/scripts - $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl -fi +$CP netware/*.pl $BASE/scripts +$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a \ @@ -265,31 +336,17 @@ copyfileto $BASE/lib \ zlib/.libs/libz.a # convert the .a to .lib for NetWare -if [ $BASE_SYSTEM = "netware" ] ; then - for i in $BASE/lib/*.a - do - libname=`basename $i .a` - $MV $i $BASE/lib/$libname.lib - done - rm -f $BASE/lib/*.la -fi +for i in $BASE/lib/*.a +do + libname=`basename $i .a` + $MV $i $BASE/lib/$libname.lib +done +rm -f $BASE/lib/*.la -copyfileto $BASE/include include/* -rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h -if [ $BASE_SYSTEM != "netware" ] ; then - rm -f $BASE/include/config-netware.h -fi +copyfileto $BASE/include config.h include/* -if [ $BASE_SYSTEM != "netware" ] ; then - if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests - fi - if [ -d man ] ; then - $CP man/*.1 $BASE/man/man1 - $CP man/*.8 $BASE/man/man8 - fi -fi +rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h copyfileto $BASE/support-files support-files/* @@ -305,26 +362,23 @@ copyfileto $BASE/mysql-test \ mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf -MCP mysql-test/lib/*.pl $BASE/mysql-test/lib -MCP mysql-test/t/*.def $BASE/mysql-test/t -MCP mysql-test/include/*.inc $BASE/mysql-test/include -MCP mysql-test/include/*.test $BASE/mysql-test/include -MCP mysql-test/t/*.def $BASE/mysql-test/t -MCP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ +$CP mysql-test/lib/*.pl $BASE/mysql-test/lib +$CP mysql-test/t/*.def $BASE/mysql-test/t +$CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.test $BASE/mysql-test/include +$CP mysql-test/t/*.def $BASE/mysql-test/t +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ mysql-test/std_data/Index.xml \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data -MCP mysql-test/t/*.test $BASE/mysql-test/t -MCP mysql-test/t/*.imtest mysql-test/t/*.disabled $BASE/mysql-test/t -MCP mysql-test/t/*.opt mysql-test/t/*.slave-mi $BASE/mysql-test/t -MCP mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -MCP mysql-test/r/*.result $BASE/mysql-test/r -MCP mysql-test/r/*.require $BASE/mysql-test/r -MCP mysql-test/extra/binlog_tests/*.test $BASE/mysql-test/extra/binlog_tests -MCP mysql-test/extra/rpl_tests/*.test $BASE/mysql-test/extra/rpl_tests +$CP mysql-test/t/*.test mysql-test/t/*.imtest \ + mysql-test/t/*.disabled mysql-test/t/*.opt \ + mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +$CP mysql-test/r/*.result mysql-test/r/*.require \ + $BASE/mysql-test/r # Copy the additional suites "as is", they are in flux $tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) @@ -333,27 +387,6 @@ if [ -d mysql-test/SCCS ] ; then find $BASE/mysql-test -name SCCS -print | xargs rm -rf fi -if [ $BASE_SYSTEM != "netware" ] ; then - chmod a+x $BASE/bin/* - copyfileto $BASE/bin scripts/* - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ - ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./share \ - < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ - \@sbindir\@ ./bin \@libexecdir\@ ./bin \ - \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ - \@HOSTNAME\@ @HOSTNAME@ \ - < support-files/mysql.server.sh > $BASE/support-files/mysql.server - $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe - mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ - $BASE/support-files/mysql.server $BASE/configure - $CP -r sql-bench/* $BASE/sql-bench - rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la - rm -f $BASE/bin/*.sql -fi - rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ @@ -362,109 +395,37 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # # Copy system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql -fi +./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql # # Remove system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/support-files/magic \ +rm -f $BASE/support-files/magic \ $BASE/support-files/mysql.server \ $BASE/support-files/mysql*.spec \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ $BASE/support-files/MySQL-shared-compat.spec \ - $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY -fi - -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi # Clean up if we did this from a bk tree -if [ -d $BASE/share/SCCS ] ; then +if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/share -name SCCS -print | xargs rm -rf find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi -# NDB Cluster -if [ x$NDBCLUSTER = x1 ]; then - ( cd storage/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. - $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. - $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/. - test -d $BASE/include/storage || mkdir $BASE/include/storage - $CP -r $BASE/ndb-stage@pkgincludedir@/storage/ndb $BASE/include/storage/ - $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 - $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup50 $BASE/mysql-test/std_data/. || exit 1 - $CP -r $BASE/ndb-stage@prefix@/mysql-test/std_data/ndb_backup51 $BASE/mysql-test/std_data/. || exit 1 - rm -rf $BASE/ndb-stage -fi - -# Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX - -# Print the platform name for build logs -echo "PLATFORM NAME: $platform" - BASE2=$TMP/$NEW_NAME rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 + # -# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a +# Create a zip file for NetWare users # - -if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` - if [ $? -ne 0 ] ; then - echo "Warning: Couldn't find libgcc.a!" - else - $CP $gcclib $BASE/lib/libmygcc.a - fi -fi - -#if we are debugging, do not do tar/gz -if [ x$DEBUG = x1 ] ; then - exit -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - - # - # Create the result tar file - # - - echo "Using $tar to create archive" - - OPT=cvf - if [ x$SILENT = x1 ] ; then - OPT=cf - fi - - echo "Creating and compressing archive" - rm -f $NEW_NAME.tar.gz - (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz - echo "$NEW_NAME.tar.gz created" - -else - - # - # Create a zip file for NetWare users - # - - rm -f $NEW_NAME.zip - (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) - echo "$NEW_NAME.zip created" - -fi +rm -f $NEW_NAME.zip +(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) +echo "$NEW_NAME.zip created" echo "Removing temporary directory" rm -rf $BASE -- cgit v1.2.1 From e5ad2cdd58a93904f4cc06d4e458282c9b062df7 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 27 Sep 2007 12:21:56 +0200 Subject: Makefile.am, make_binary_distribution.sh: Use custom 'pkgduppdir' mysql.server.sh: The server is installed in 'libexecdir' --- scripts/Makefile.am | 4 ++++ scripts/make_binary_distribution.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 471a23f0a73..fed96490397 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -90,6 +90,9 @@ CLEANFILES = @server_scripts@ \ mysql_tableinfo \ mysqld_multi +# Default same as 'pkgdatadir', but we can override it +pkgsuppdir = $(datadir)/@PACKAGE@ + # mysqlbug should be distributed built so that people can report build # failures with it. DISTCLEANFILES = $(BUILT_SOURCES) mysqlbug @@ -134,6 +137,7 @@ SUFFIXES = .sh -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ + -e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \ -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ -e 's!@''mandir''@!$(mandir)!g' \ -e 's!@''infodir''@!$(infodir)!g' \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 73d47b1b320..4d027659227 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -31,7 +31,7 @@ # "pkgincludedir" is set to the same as "includedir" # "pkgdatadir" is set to the same as "datadir" # "pkgsuppdir" is set to "@prefix@/support-files", -# normally the same as "datadir" (not to set?) +# normally the same as "datadir" # # The temporary directory path given to "--tmp=" has to be # absolute and with no spaces. @@ -175,6 +175,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then pkglibdir=@pkglibdir@ \ pkgincludedir=@pkgincludedir@ \ pkgdatadir=@pkgdatadir@ \ + pkgsuppdir=@pkgsuppdir@ \ mandir=@mandir@ \ infodir=@infodir@ @@ -215,6 +216,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then fi # FIXME should be handled by make file, and to other dir + mkdir -p $DEST/bin $DEST/support-files cp scripts/mysqlaccess.conf $DEST/bin/ cp support-files/magic $DEST/support-files/ -- cgit v1.2.1 From 2b86686dab8fc97d9175dc5a85332f618f2bfa40 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Fri, 28 Sep 2007 17:33:14 +0200 Subject: Preliminary fix for Bug #30759 mysql_install_db fails to set $extra_bindir properly in all cases. --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index d2fe636c4e7..2af1979adda 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -231,6 +231,7 @@ then pkgdatadir="@pkgdatadir@" else bindir="$basedir/bin" + extra_bindir="$bindir" # We set up bootstrap-specific paths later, so skip this for --windows if test "$windows" -eq 0 then -- cgit v1.2.1 From 4d2c8e2445eec21bc85fa0ab1f3a7b38b5d9c8f5 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 1 Oct 2007 18:41:38 +0200 Subject: make_binary_distribution.sh: Added special handling of "mysql_install_db" and "mysql.server" scripts, find executables relative to the current directory. --- scripts/make_binary_distribution.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 4d027659227..8d3e2133a45 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -167,6 +167,35 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then # ---------------------------------------------------------------------- set -e + # ---------------------------------------------------------------------- + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", + # i.e. makes access relative the current directory. This matches + # the documentation, so better not change this. And for another script, + # "mysql.server", we make some relative, others not. + # ---------------------------------------------------------------------- + + cd scripts + rm -f mysql_install_db + @MAKE@ mysql_install_db \ + prefix=. \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=./share \ + localstatedir=./data + cd .. + + cd support-files + rm -f mysql.server + @MAKE@ mysql.server \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=@pkgdatadir@ + cd .. + # ---------------------------------------------------------------------- # Do a install that we later are to pack. Use the same paths as in # the build for the relevant directories. -- cgit v1.2.1 From 5c0c59214591d7f54930193833a4bb3231a1f1e2 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Thu, 4 Oct 2007 11:30:30 +0200 Subject: Restore creation of test databases and the anonymous user which were accidentally removed during a previous rototill of this code. Fixes bug#27692. While it can be argued we should strive to provide a 'secure by default' installation, this happens to be the setup currently documented in the manual as the default, so defer changes that improve security out of the box to a co-ordinated effort later on. For now, make a note about the test databases and anonymous user in mysql_install_db and recommend that mysql_secure_installation be ran for users wishing to remove these defaults. [..re-commit of previously lost change..] --- scripts/mysql_install_db.sh | 9 +++++++++ scripts/mysql_system_tables_data.sql | 2 ++ 2 files changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index a66129af1d3..5716d4f51c0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -371,7 +371,16 @@ then echo "To do so, start the server, then issue the following commands:" echo "$bindir/mysqladmin -u root password 'new-password'" echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" + echo + echo "Alternatively you can run:" + echo "$bindir/mysql_secure_installation" + echo + echo "which will also give you the option of removing the test" + echo "databases and anonymous user created by default. This is" + echo "strongly recommended for production servers." + echo echo "See the manual for more instructions." + echo if test "$in_rpm" -eq 0 then diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 5f0289ab197..c0e3af1c9c8 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -17,5 +17,7 @@ CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO tmp_user (host,user) VALUES ('localhost',''); +INSERT INTO tmp_user (host,user) VALUES (@@hostname,''); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; -- cgit v1.2.1 From eedde95a3308f5ab95f886bb3145be8d338264f3 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Fri, 5 Oct 2007 13:16:54 -0400 Subject: Change URLs. Our web server has been restructured several times, and references to it in our source code has stayed the same. This patch from Paul DuBois updates all URLs to modern semantics. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 52fe282f916..e6b015e7d16 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -231,7 +231,7 @@ then echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/mysqld_safe". - echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more" echo "information" exit 1 fi -- cgit v1.2.1 From 49a0f09bbfa7c29a2919f8f2b56677e8a5436f3c Mon Sep 17 00:00:00 2001 From: "anozdrin/alik@station." <> Date: Wed, 17 Oct 2007 12:13:56 +0400 Subject: Fix for BUG#24923: Functions with ENUM issues. The problem was that the RETURNS column in the mysql.proc was of CHAR(64). That was not enough for storing long-named datatypes. The fix is to change CHAR(64) to LONGBLOB, and to throw warnings at the time a stored routine is created if some data is truncated during writing into mysql.proc. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f7b23e4e7ae..927cbe81ff9 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 78e6a0ceb57..a43964bf09a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -344,6 +344,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, MODIFY body longblob NOT NULL, + MODIFY returns longblob NOT NULL, MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', -- cgit v1.2.1 From a238d6e280c9a1f43fddeb326b460f8f55421b35 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 18 Oct 2007 12:03:30 +0200 Subject: Modify "mysqlbug" ("scripts/mysqlbug.sh") so that it differs between the original and the modified values of the compile-related variables used in "configure". Make the necessary adjustments in "configure.in" and "scripts/Makefile.am". This fixes bug#31644 Values of *FLAGS that were used for building packages is missed in mysqlbug --- scripts/Makefile.am | 14 ++++++++++---- scripts/mysqlbug.sh | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 161c8a54df2..46717784b3d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -149,13 +149,19 @@ SUFFIXES = .sh -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ + -e 's!@''SAVE_CC''@!@SAVE_CC@!'\ + -e 's!@''SAVE_CXX''@!@SAVE_CXX@!'\ -e 's!@''CC_VERSION''@!@CC_VERSION@!'\ -e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\ -e 's!@''PERL''@!@PERL@!' \ - -e 's!@''ASFLAGS''@!@SAVE_ASFLAGS@!'\ - -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\ - -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ - -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ + -e 's!@''SAVE_ASFLAGS''@!@SAVE_ASFLAGS@!'\ + -e 's!@''SAVE_CFLAGS''@!@SAVE_CFLAGS@!'\ + -e 's!@''SAVE_CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ + -e 's!@''SAVE_LDFLAGS''@!@SAVE_LDFLAGS@!'\ + -e 's!@''ASFLAGS''@!@ASFLAGS@!'\ + -e 's!@''CFLAGS''@!@CFLAGS@!'\ + -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\ + -e 's!@''LDFLAGS''@!@LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 69ea82e8794..64804b5de19 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -23,7 +23,8 @@ VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" COMPILATION_COMMENT="@COMPILATION_COMMENT@" BUGmysql="mysql@lists.mysql.com" # This is set by configure -COMP_ENV_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" +COMP_CALL_INFO="CC='@SAVE_CC@' CFLAGS='@SAVE_CFLAGS@' CXX='@SAVE_CXX@' CXXFLAGS='@SAVE_CXXFLAGS@' LDFLAGS='@SAVE_LDFLAGS@' ASFLAGS='@SAVE_ASFLAGS@'" +COMP_RUN_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" CONFIGURE_LINE="@CONF_COMMAND@" LIBC_INFO="" @@ -261,7 +262,8 @@ ${ORGANIZATION- $ORGANIZATION_C} `test -n "$MACHINE" && echo "Machine: $MACHINE"` `test -n "$FILE_PATHS" && echo "Some paths: $FILE_PATHS"` `test -n "$GCC_INFO" && echo "GCC: $GCC_INFO"` -`test -n "$COMP_ENV_INFO" && echo "Compilation info: $COMP_ENV_INFO"` +`test -n "$COMP_CALL_INFO" && echo "Compilation info (call): $COMP_CALL_INFO"` +`test -n "$COMP_RUN_INFO" && echo "Compilation info (used): $COMP_RUN_INFO"` `test -n "$LIBC_INFO" && echo "LIBC: $LIBC_INFO"` `test -n "$CONFIGURE_LINE" && echo "Configure command: $CONFIGURE_LINE"` `test -n "$PERL_INFO" && echo "Perl: $PERL_INFO"` -- cgit v1.2.1 From f4a153c3c408b47527a85843570bed832f93e736 Mon Sep 17 00:00:00 2001 From: "antony@pcg5ppc.xiphis.org" <> Date: Thu, 18 Oct 2007 14:48:04 -0700 Subject: Bug#31473 "CSV does not work with NULL value in datetime fields" Attempting to insert a row with a NULL value for a DATETIME field results in a CSV file which the storage engine cannot read. Don't blindly assume that "0" is acceptable for all field types, Since CSV does not support NULL, we find out from the field the default non-null value. Do not permit the creation of a table with a nullable columns. --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f7b23e4e7ae..4f38ab83f04 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -74,7 +74,7 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; -- cgit v1.2.1 From 8cde2055ad02e23fe75c3471146e7540a6057433 Mon Sep 17 00:00:00 2001 From: "jperkin@production.mysql.com" <> Date: Thu, 8 Nov 2007 13:43:40 +0100 Subject: Remove the --source-install option and instead make use of --srcdir to install system tables directly from the source tree (useful for testing purposes). This helps clean the script up a lot and clarify the three possible ways the script can be called (using compiled-in paths, passing --basedir pointing to alternative install location, or --srcdir). Include further tidying as well. This fixes bug#30759. --- scripts/mysql_install_db.sh | 323 ++++++++++++++++++-------------------------- 1 file changed, 134 insertions(+), 189 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 6f147c45f3b..260c372c802 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -19,7 +19,7 @@ # All unrecognized arguments to this script are passed to mysqld. basedir="" -ldata="" +ldata="@localstatedir@" srcdir="" args="" @@ -31,7 +31,6 @@ force=0 in_rpm=0 ip_only=0 windows=0 -source_install=0 usage() { @@ -48,10 +47,10 @@ Usage: $0 [OPTIONS] --skip-name-resolve Use IP addresses rather than hostnames when creating grant table entries. This option can be useful if your DNS does not work. - --srcdir=path For internal use. The directory under which - mysql_install_db looks for support files such as the - error message file and the file for popoulating the - help tables. + --srcdir=path The path to the MySQL source directory. This option + uses the compiled binaries and support files within the + source tree, useful for if you don't want to install + MySQL yet and just want to create the system tables. --user=user_name The login username to use for running mysqld. Files and directories created by mysqld will be owned by this user. You must be root to use this option. By default @@ -121,13 +120,6 @@ parse_arguments() # package. windows=1 ;; - --source-install) - # This is used when you want to run mysqld directly from the - # source tree (for example when you are developing MySQL and - # only want to create the default tables but don't want to - # install mysqld yet. - source_install=1 ;; - *) if test -n "$pick_args" then @@ -155,41 +147,33 @@ find_in_basedir() file=$1; shift - base="$basedir" - if test -z "$base" - then - # Assume source installation if basedir is not given - base="." - fi - for dir in "$@" do - if test -f "$base/$dir/$file" + if test -f "$basedir/$dir/$file" then if test -n "$return_dir" then - echo "$base/$dir" + echo "$basedir/$dir" else - echo "$base/$dir/$file" + echo "$basedir/$dir/$file" fi break fi done } -missing_in_basedir() +cannot_find_file() { - if test -z "$basedir" - then - echo "FATAL ERROR: Could not find $* inside --basedir" - echo - echo "When using --basedir you must point either into a MySQL binary" - echo "distribution directory or a compiled tree previously populated" - echo "by 'make install'" - else - echo "FATAL ERROR: Can't find $*. Please specify your installation" - echo "directory with the '--basedir=' option." - fi + echo + echo "FATAL ERROR: Could not find $*" + echo + echo "If you compiled from source, you need to run 'make install' to" + echo "copy the software into the correct location ready for operation." + echo + echo "If you are using a binary release, you must either be at the top" + echo "level of the extracted archive, or pass the --basedir option" + echo "pointing to that location." + echo } # Ok, let's go. We first need to parse arguments which are required by @@ -197,23 +181,28 @@ missing_in_basedir() # the command line to add any extra bits that we need. parse_arguments PICK-ARGS-FROM-ARGV "$@" -# We can now find my_print_defaults, either in the supplied --basedir -# location or in the installed area. - -print_defaults=`find_in_basedir my_print_defaults bin extra` -if test -z "$print_defaults" +# +# We can now find my_print_defaults. This script supports: +# +# --srcdir=path pointing to compiled source tree +# --basedir=path pointing to installed binary location +# +# or default to compiled-in locations. +# +if test -n "$srcdir" +then + print_defaults="$srcdir/extra/my_print_defaults" +elif test -n "$basedir" then + print_defaults=`find_in_basedir my_print_defaults bin extra` +else print_defaults="@bindir@/my_print_defaults" - if ! test -x "$print_defaults" - then - echo "FATAL ERROR: Could not find $print_defaults" - echo - echo "If you are using a binary release, you must run this script from" - echo "within the directory the archive extracted into. If you compiled" - echo "MySQL yourself you must run 'make install' first or use" - echo "use --source-install --install-dir=xxx from the top source directory" - exit 1 - fi +fi + +if test ! -x "$print_defaults" +then + cannot_find_file "$print_defaults" + exit 1 fi # Now we can get arguments from the groups [mysqld] and [mysql_install_db] @@ -221,63 +210,33 @@ fi parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# Path to MySQL installation directory -if test -z "$basedir" -a "$source_install" = 0 +# Configure paths to support files +if test -n "$srcdir" +then + basedir="$srcdir" + bindir="$srcdir/client" + extra_bindir="$srcdir/extra" + mysqld="$srcdir/sql/mysqld" + mysqld_opt="--language=$srcdir/sql/share/english" + pkgdatadir="$srcdir/scripts" + scriptdir="$srcdir/scripts" +elif test -n "$basedir" then + bindir="$basedir/bin" + extra_bindir="$bindir" + mysqld=`find_in_basedir mysqld libexec sbin bin` + pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` + scriptdir="$basedir/scripts" +else basedir="@prefix@" bindir="@bindir@" extra_bindir="$bindir" mysqld="@libexecdir@/mysqld" pkgdatadir="@pkgdatadir@" -else - bindir="$basedir/bin" - extra_bindir="$bindir" - # We set up bootstrap-specific paths later, so skip this for --windows - if test "$windows" -eq 0 - then - mysqld=`find_in_basedir mysqld libexec sbin bin` - if test -z "$basedir" - then - # We come here when source-install is given - bindir="$basedir/bin" - extra_bindir="$bindir" - fi - if test -x "$mysqld" - then - pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql scripts` - if test -z "$pkgdatadir" - then - missing_in_basedir fill_help_tables.sql - exit 1 - fi - else - if test -x "./sql/mysqld" - then - # Source installation - mysqld="./sql/mysqld" - bindir="./client" - extra_bindir="./extra" - pkgdatadir="./scripts" - mysqld_opt="--language=./sql/share/english" - else - missing_in_basedir mysqld - fi - fi - fi -fi - -# Path to data directory -if test -z "$ldata" -then - ldata="@localstatedir@" -fi - -# Set up paths to SQL scripts required for bootstrap and ensure they exist. -if test -n "$srcdir" -then - pkgdatadir="$srcdir/scripts" + scriptdir="@scriptdir@" fi +# Set up paths to SQL scripts required for bootstrap fill_help_tables="$pkgdatadir/fill_help_tables.sql" create_system_tables="$pkgdatadir/mysql_system_tables.sql" fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql" @@ -286,28 +245,14 @@ for f in $fill_help_tables $create_system_tables $fill_system_tables do if test ! -f "$f" then - echo "FATAL ERROR: Could not find SQL file '$f'" + cannot_find_file "$f" exit 1 fi done -# Set up Windows-specific paths -if test "$windows" -eq 1 -then - mysqld="./sql/mysqld" - if test -n "$srcdir" -a -f "$srcdir/sql/share/english/errmsg.sys" - then - mysqld_opt="--language=$srcdir/sql/share/english" - else - mysqld_opt="--language=./sql/share/english" - fi -fi - -# Make sure mysqld is available in default location (--basedir option is -# already tested above). if test ! -x "$mysqld" then - echo "FATAL ERROR: 'mysqld' executable not found!" + cannot_find_file "$mysqld" exit 1 fi @@ -318,10 +263,10 @@ hostname=`@HOSTNAME@` if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 then resolved=`$extra_bindir/resolveip $hostname 2>&1` - if [ $? -ne 0 ] + if test $? -ne 0 then resolved=`$extra_bindir/resolveip localhost 2>&1` - if [ $? -ne 0 ] + if test $? -ne 0 then echo "Neither host '$hostname' nor 'localhost' could be looked up with" echo "$extra_bindir/resolveip" @@ -345,7 +290,7 @@ then hostname=`echo "$resolved" | awk '/ /{print $6}'` fi -# Create database directories mysql & test +# Create database directories for dir in $ldata $ldata/mysql $ldata/test do if test ! -d $dir @@ -364,98 +309,98 @@ then args="$args --user=$user" fi -# Peform the install of system tables +# Configure mysqld command line mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ --net_buffer_length=16K" -# Pipe mysql_system_tables.sql to "mysqld --bootstrap" +# Create the system and help tables by passing them to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line` then s_echo "OK" +else + echo + echo "Installation of system tables failed! Examine the logs in" + echo "$ldata for more information." + echo + echo "You can try to start the mysqld daemon with:" + echo + echo " shell> $mysqld --skip-grant &" + echo + echo "and use the command line tool $bindir/mysql" + echo "to connect to the mysql database and look at the grant tables:" + echo + echo " shell> $bindir/mysql -u root mysql" + echo " mysql> show tables" + echo + echo "Try 'mysqld --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" + echo "http://www.mysql.com/. Please consult the MySQL manual section" + echo "'Problems running mysql_install_db', and the manual section that" + echo "describes problems on your OS. Another information source are the" + echo "MySQL email archives available at http://lists.mysql.com/." + echo + echo "Please check all of the above before mailing us! And remember, if" + echo "you do mail us, you MUST use the $scriptdir/mysqlbug script!" + echo + exit 1 +fi - s_echo "Filling help tables..." - # Pipe fill_help_tables.sql to "mysqld --bootstrap" - if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` - then - # Fill suceeded - s_echo "OK" - else - echo - echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" - echo "The \"HELP\" command might not work properly" - echo - fi +s_echo "Filling help tables..." +if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` +then + s_echo "OK" +else + echo + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly." +fi +# Don't output verbose information if running inside bootstrap or using +# --srcdir for testing. +if test "$windows" -eq 0 && test -z "$srcdir" +then s_echo s_echo "To start mysqld at boot time you have to copy" s_echo "support-files/mysql.server to the right place for your system" - s_echo - if test "$windows" -eq 0 + echo + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" + echo + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" + echo + echo "Alternatively you can run:" + echo "$bindir/mysql_secure_installation" + echo + echo "which will also give you the option of removing the test" + echo "databases and anonymous user created by default. This is" + echo "strongly recommended for production servers." + echo + echo "See the manual for more instructions." + + if test "$in_rpm" -eq 0 then - # A root password should of course also be set on Windows! - # The reason for not displaying these prompts here is that when - # executing this script with the --windows argument the script - # is used to generate system tables mainly used by the - # windows installer. And thus the password should not be set until - # those files has been copied to the target system - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" - echo "To do so, start the server, then issue the following commands:" - echo "$bindir/mysqladmin -u root password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" - echo - echo "Alternatively you can run:" - echo "$bindir/mysql_secure_installation" echo - echo "which will also give you the option of removing the test" - echo "databases and anonymous user created by default. This is" - echo "strongly recommended for production servers." + echo "You can start the MySQL daemon with:" + echo "cd $basedir ; $bindir/mysqld_safe &" echo - echo "See the manual for more instructions." - echo - - if test "$in_rpm" -eq 0 -a "$source_install" -eq 0 - then - echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/mysqld_safe &" - echo - echo "You can test the MySQL daemon with mysql-test-run.pl" - echo "cd mysql-test ; perl mysql-test-run.pl" - echo - fi - echo "Please report any problems with the @scriptdir@/mysqlbug script!" - echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com" - echo "Support MySQL by buying support/licenses at http://shop.mysql.com" + echo "You can test the MySQL daemon with mysql-test-run.pl" + echo "cd $basedir/mysql-test ; perl mysql-test-run.pl" fi - exit 0 -else - echo "Installation of system tables failed!" - echo - echo "Examine the logs in $ldata for more information." - echo "You can try to start the mysqld daemon with:" - echo "$mysqld --skip-grant &" - echo "and use the command line tool" - echo "$bindir/mysql to connect to the mysql" - echo "database and look at the grant tables:" + echo - echo "shell> $bindir/mysql -u root mysql" - echo "mysql> show tables" + echo "Please report any problems with the $scriptdir/mysqlbug script!" echo - echo "Try 'mysqld --help' if you have problems with paths. Using --log" - echo "gives you a log in $ldata that may be helpful." + echo "The latest information about MySQL is available at http://www.mysql.com/" + echo "Support MySQL by buying support/licenses from http://shop.mysql.com/" echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com" - echo "Please consult the MySQL manual section: 'Problems running mysql_install_db'," - echo "and the manual section that describes problems on your OS." - echo "Another information source is the MySQL email archive." - echo "Please check all of the above before mailing us!" - echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" - exit 1 fi + +exit 0 -- cgit v1.2.1 From 127f8e968ea6c11ab8daee9c8b64109914576a57 Mon Sep 17 00:00:00 2001 From: "kaa@polly.(none)" <> Date: Thu, 22 Nov 2007 17:13:12 +0300 Subject: Fixed build failures on Windows introduced by the patch for bug #32221. We do not have any executables in libmysql/release/ anymore. --- scripts/make_win_bin_dist | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 849226c94ea..d065e171bb0 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -152,7 +152,6 @@ if [ x"$TARGET" != x"release" ] ; then cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ fi cp tests/$TARGET/*.exe $DESTDIR/bin/ -cp libmysql/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ # FIXME really needed?! -- cgit v1.2.1 From 909fa65a1f8be32c65210d9389cb10d58478dbe2 Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Fri, 23 Nov 2007 13:38:59 +0100 Subject: Fix make distcheck. --- scripts/mysql_install_db.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 260c372c802..798dbf60acd 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -189,12 +189,12 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@" # # or default to compiled-in locations. # -if test -n "$srcdir" -then - print_defaults="$srcdir/extra/my_print_defaults" -elif test -n "$basedir" +if test -n "$basedir" then print_defaults=`find_in_basedir my_print_defaults bin extra` +elif test -n "$srcdir" +then + print_defaults="$srcdir/extra/my_print_defaults" else print_defaults="@bindir@/my_print_defaults" fi @@ -211,22 +211,19 @@ parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" # Configure paths to support files -if test -n "$srcdir" -then - basedir="$srcdir" - bindir="$srcdir/client" - extra_bindir="$srcdir/extra" - mysqld="$srcdir/sql/mysqld" - mysqld_opt="--language=$srcdir/sql/share/english" - pkgdatadir="$srcdir/scripts" - scriptdir="$srcdir/scripts" -elif test -n "$basedir" +if test -n "$basedir" then bindir="$basedir/bin" extra_bindir="$bindir" - mysqld=`find_in_basedir mysqld libexec sbin bin` + mysqld=`find_in_basedir mysqld libexec sbin bin sql` pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` scriptdir="$basedir/scripts" +elif test -n "$srcdir" +then + basedir="$srcdir" + bindir="$srcdir/client" + extra_bindir="$srcdir/extra" + mysqld="$srcdir/sql/mysqld" else basedir="@prefix@" bindir="@bindir@" @@ -236,6 +233,13 @@ else scriptdir="@scriptdir@" fi +if test -n "$srcdir" +then + mysqld_opt="--language=$srcdir/sql/share/english" + pkgdatadir="$srcdir/scripts" + scriptdir="$srcdir/scripts" +fi + # Set up paths to SQL scripts required for bootstrap fill_help_tables="$pkgdatadir/fill_help_tables.sql" create_system_tables="$pkgdatadir/mysql_system_tables.sql" -- cgit v1.2.1 From d60eb190863b533628f86bf8c85a2c74a86f82b1 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 23 Nov 2007 18:12:14 +0100 Subject: Add mysql-test/lib/*.sql to dists* --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8d3e2133a45..a5deb52d526 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -396,6 +396,7 @@ copyfileto $BASE/mysql-test \ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.sql $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ -- cgit v1.2.1 From 5ed3fdeabc20d3d183d6ed0abe7e9475c43f1089 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Mon, 26 Nov 2007 18:46:05 +0100 Subject: Use myisam as default storage engine when running mysqld in --bootstrap mode --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 260c372c802..0a816cef493 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -314,6 +314,7 @@ mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ + --default-storage-engine=myisam \ --net_buffer_length=16K" # Create the system and help tables by passing them to "mysqld --bootstrap" -- cgit v1.2.1 From 69ae57ae73b70ccb8e47b69b20b658b53e8601dd Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Wed, 28 Nov 2007 17:32:28 +0100 Subject: fix make distcheck in a different way --- scripts/mysql_install_db.sh | 49 +++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5fbbebed195..b1d5ad7a0d0 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -19,6 +19,7 @@ # All unrecognized arguments to this script are passed to mysqld. basedir="" +builddir="" ldata="@localstatedir@" srcdir="" @@ -37,6 +38,9 @@ usage() cat < Date: Thu, 29 Nov 2007 16:40:46 +0000 Subject: Shell portability fix. --- scripts/mysql_install_db.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5716d4f51c0..257deed3d28 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -181,14 +181,14 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@" if test -n "$basedir" then print_defaults=`find_in_basedir my_print_defaults bin extra` - if ! test -x "$print_defaults" + if test ! -x "$print_defaults" then missing_in_basedir my_print_defaults exit 1 fi else print_defaults="@bindir@/my_print_defaults" - if ! test -x "$print_defaults" + if test ! -x "$print_defaults" then echo "FATAL ERROR: Could not find $print_defaults" echo @@ -223,7 +223,7 @@ else exit 1 fi mysqld=`find_in_basedir mysqld libexec sbin bin` - if ! test -x "$mysqld" + if test ! -x "$mysqld" then missing_in_basedir mysqld exit 1 -- cgit v1.2.1 From da357f723a696056cc4104ff521588f1033f971a Mon Sep 17 00:00:00 2001 From: "tsmith/mysqldev@mysql.com/production.mysql.com" <> Date: Fri, 30 Nov 2007 06:14:43 +0100 Subject: Bug #32219: too many hosts in default grant tables 6.0.3 Fix is to remove any references to the current hostname when running mysql_install_db --cross-bootstrap. (The dist-hook make target makes this call, and the resulting data directory is included in the source distribution as win/data/*.) Also, a few other clean-ups to mysql_install_db while there. --- scripts/mysql_install_db.sh | 66 ++++++++++++++++++++---------------- scripts/mysql_system_tables_data.sql | 11 ++++-- 2 files changed, 45 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5716d4f51c0..5d925a0b8ad 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -30,13 +30,15 @@ user="" force=0 in_rpm=0 ip_only=0 -windows=0 +cross_bootstrap=0 usage() { cat <&1` if [ $? -ne 0 ] @@ -329,6 +330,16 @@ then args="$args --user=$user" fi +# When doing a "cross bootstrap" install, no reference to the current +# host should be added to the system tables. So we filter out any +# lines which contain the current host name. +if test $cross_bootstrap -eq 1 +then + filter_cmd_line="sed -e '/@current_hostname/d'" +else + filter_cmd_line="cat" +fi + # Peform the install of system tables mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ @@ -337,15 +348,14 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ # Pipe mysql_system_tables.sql to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." -if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line` +if { echo "use mysql;"; cat $create_system_tables $fill_system_tables; } | eval "$filter_cmd_line" | $mysqld_install_cmd_line > /dev/null then s_echo "OK" s_echo "Filling help tables..." # Pipe fill_help_tables.sql to "mysqld --bootstrap" - if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` + if { echo "use mysql;"; cat $fill_help_tables; } | $mysqld_install_cmd_line > /dev/null then - # Fill suceeded s_echo "OK" else echo @@ -359,14 +369,12 @@ then s_echo "support-files/mysql.server to the right place for your system" s_echo - if test "$windows" -eq 0 + if test "$cross_bootstrap" -eq 0 then - # A root password should of course also be set on Windows! - # The reason for not displaying these prompts here is that when - # executing this script with the --windows argument the script - # is used to generate system tables mainly used by the - # windows installer. And thus the password should not be set until - # those files has been copied to the target system + # This is not a true installation on a running system. The end user must + # set a password after installing the data files on the real host system. + # At this point, there is no end user, so it does not make sense to print + # this reminder. echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "To do so, start the server, then issue the following commands:" echo "$bindir/mysqladmin -u root password 'new-password'" diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 47d4ea5d950..ce23953a1a5 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -2,6 +2,12 @@ -- The inital data for system tables of MySQL Server -- +-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix +-- host which will later be included in a Windows zip file), any lines +-- containing "@current_hostname" are filtered out by mysql_install_db. +set @current_hostname= @@hostname; + + -- Fill "db" table with default grants for anyone to -- access database 'test' and 'test_%' if "db" table didn't exist CREATE TEMPORARY TABLE tmp_db LIKE db; @@ -15,10 +21,9 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -set @hostname= @@hostname; -REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES (@current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES (@@hostname,''); +INSERT INTO tmp_user (host,user) VALUES (@current_hostname,''); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; -- cgit v1.2.1 From 95b791c7af4c5659e1c022de100af15dd8fd39cd Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 3 Dec 2007 18:19:35 -0700 Subject: Bug #32679: mysqld_safe looks for errmsg.sys in wrong path The fix for bug 28544 moved our package data from ./share/mysql to ./share. mysqld_safe had the old directory hard-coded. The fix is to use the @pkgdatadir@ and @prefix@ values, to adapt to different ways of building the package. --- scripts/make_binary_distribution.sh | 3 ++- scripts/mysqld_safe.sh | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8d3e2133a45..f7b7f8e5a7e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -23,7 +23,8 @@ # Note that the structure created by this script is slightly different from # what a normal "make install" would produce. No extra "mysql" sub directory # will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or -# "$prefix/share/mysql". +# "$prefix/share/mysql". This is because the build system explicitly calls +# make with pkgdatadir=, etc. # # In GNU make/automake terms # diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 99dcafbbf71..5e7a177a546 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -200,16 +200,24 @@ parse_arguments() { # # First, try to find BASEDIR and ledir (where mysqld is) -# +# + +if echo '@pkgdatadir@' | grep '^@prefix@' > /dev/null +then + relpkgdata=`echo '@pkgdatadir@' | sed -e 's,^@prefix@,,' -e 's,^/,,' -e 's,^,./,'` +else + # pkgdatadir is not relative to prefix + relpkgdata='@pkgdatadir@' +fi MY_PWD=`pwd` # Check for the directories we would expect from a binary release install -if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld +if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is # Check for the directories we would expect from a source install -elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld +elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is @@ -219,6 +227,7 @@ else ledir=@libexecdir@ fi + # # Second, try to find the data directory # -- cgit v1.2.1 From ffa270d616509cf12727ee26f2986462c2319173 Mon Sep 17 00:00:00 2001 From: "df@pippilotta.erinye.com" <> Date: Mon, 10 Dec 2007 12:21:02 +0100 Subject: after-merge fix --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index cc9c64e8f07..3c1d3ae0fab 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -378,7 +378,7 @@ fi # Don't output verbose information if running inside bootstrap or using # --srcdir for testing. -if test "$windows" -eq 0 && test -z "$srcdir" +if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" then s_echo s_echo "To start mysqld at boot time you have to copy" -- cgit v1.2.1 From 07c962393d280ed441c0b61e5633532ce82b0950 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Wed, 12 Dec 2007 19:14:28 -0700 Subject: Bug #33192: mysql_install_db bad merge, corrupt code == appears to succeed but does nothing Repair a bad merge that made mysql_install_db silently fail, doing nothing. --- scripts/mysql_install_db.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 3c1d3ae0fab..4e5ca7305f8 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -124,7 +124,7 @@ parse_arguments() # the install package. See top-level 'dist-hook' make target. # # --windows is a deprecated alias - cross_bootstrap=1 ;; + cross_bootstrap=1 ;; *) if test -n "$pick_args" @@ -324,6 +324,16 @@ then args="$args --user=$user" fi +# When doing a "cross bootstrap" install, no reference to the current +# host should be added to the system tables. So we filter out any +# lines which contain the current host name. +if test $cross_bootstrap -eq 1 +then + filter_cmd_line="sed -e '/@current_hostname/d'" +else + filter_cmd_line="cat" +fi + # Configure mysqld command line mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ @@ -367,7 +377,7 @@ else fi s_echo "Filling help tables..." -if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` +if { echo "use mysql;"; cat $fill_help_tables; } | $mysqld_install_cmd_line > /dev/null then s_echo "OK" else @@ -377,12 +387,14 @@ else fi # Don't output verbose information if running inside bootstrap or using -# --srcdir for testing. +# --srcdir for testing. In such cases, there's no end user looking at +# the screen. if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" then s_echo s_echo "To start mysqld at boot time you have to copy" s_echo "support-files/mysql.server to the right place for your system" + echo echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "To do so, start the server, then issue the following commands:" @@ -401,8 +413,10 @@ then if test "$in_rpm" -eq 0 then + echo echo "You can start the MySQL daemon with:" echo "cd $basedir ; $bindir/mysqld_safe &" + echo echo "You can test the MySQL daemon with mysql-test-run.pl" echo "cd $basedir/mysql-test ; perl mysql-test-run.pl" fi -- cgit v1.2.1 From f988a7e600b2eb997d0211ee0c9e7cb436fd260a Mon Sep 17 00:00:00 2001 From: "jperkin/jonathan@chorlton.adsl.perkin.org.uk" <> Date: Wed, 19 Dec 2007 13:24:43 +0000 Subject: Add new pkgplugindir handling to seperate plugins from libraries, and allow override for binary distributions. Extend mysql_config to print compiled-in plugin location for third-party plugins to use. Resolves bug#31736. --- scripts/Makefile.am | 3 +++ scripts/make_binary_distribution.sh | 3 +++ scripts/mysql_config.sh | 4 ++++ 3 files changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index fc4359fd872..8669e075959 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -90,6 +90,8 @@ CLEANFILES = @server_scripts@ \ mysql_tableinfo \ mysqld_multi +pkgplugindir = $(libdir)/@PACKAGE@/plugin + # Default same as 'pkgdatadir', but we can override it pkgsuppdir = $(datadir)/@PACKAGE@ @@ -137,6 +139,7 @@ SUFFIXES = .sh -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ + -e 's!@''pkgplugindir''@!$(pkgplugindir)!g' \ -e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \ -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ -e 's!@''mandir''@!$(mandir)!g' \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8d3e2133a45..88397052815 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -30,6 +30,8 @@ # "pkglibdir" is set to the same as "libdir" # "pkgincludedir" is set to the same as "includedir" # "pkgdatadir" is set to the same as "datadir" +# "pkgplugindir" is set to "@prefix@/lib/plugin", +# normally "$libdir/plugin" # "pkgsuppdir" is set to "@prefix@/support-files", # normally the same as "datadir" # @@ -204,6 +206,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then pkglibdir=@pkglibdir@ \ pkgincludedir=@pkgincludedir@ \ pkgdatadir=@pkgdatadir@ \ + pkgplugindir=@pkgplugindir@ \ pkgsuppdir=@pkgsuppdir@ \ mandir=@mandir@ \ infodir=@infodir@ diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ae58655ed0f..110c425ea5b 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -87,6 +87,8 @@ pkglibdir='@pkglibdir@' pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` fix_path pkglibdir $pkglibdir_rel lib/mysql lib +plugindir='@pkgplugindir@' + pkgincludedir='@pkgincludedir@' fix_path pkgincludedir include/mysql include @@ -147,6 +149,7 @@ Options: --include [$include] --libs [$libs] --libs_r [$libs_r] + --plugindir [$plugindir] --socket [$socket] --port [$port] --version [$version] @@ -163,6 +166,7 @@ while test $# -gt 0; do --include) echo "$include" ;; --libs) echo "$libs" ;; --libs_r) echo "$libs_r" ;; + --plugindir) echo "$plugindir" ;; --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; -- cgit v1.2.1 From dc1fb0750a3bc7be662e7e88eeba6125b5dfcc93 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 27 Dec 2007 19:51:06 +0100 Subject: scripts/make_binary_distribution.sh: Fix the code to get the "libgcc" file name so that the failure of Intel's ICC to provide this information does not cause any problems. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler --- scripts/make_binary_distribution.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 917ac0a19c1..24a99df2248 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -322,11 +322,13 @@ BASE=$BASE2 # if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` - if [ $? -ne 0 ] ; then - echo "Warning: Couldn't find libgcc.a!" - else + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true + if [ -z "$gcclib" ] ; then + echo "Warning: Compiler doesn't tell libgcc.a!" + elif [ -f "$gcclib" ] ; then $CP $gcclib $BASE/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" fi fi -- cgit v1.2.1 From 18418ff8c5c6d3700bc199417d0dd57af7d9b918 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Fri, 28 Dec 2007 01:02:28 +0100 Subject: make_win_bin_dist CMakeLists.txt resolveip.c Makefile.am: Better Windows support in the scripts directory mysql_config.pl.in, mysql_install_db.pl.in: New Perl version of Unix shell script, mainly for Windows Many files in scripts directory: Use default Perl location "#!/usr/bin/perl" instead of the build host path --- scripts/CMakeLists.txt | 41 +++ scripts/Makefile.am | 2 + scripts/make_win_bin_dist | 35 +- scripts/mysql_config.pl.in | 285 ++++++++++++++++ scripts/mysql_convert_table_format.sh | 2 +- scripts/mysql_explain_log.sh | 2 +- scripts/mysql_install_db.pl.in | 612 ++++++++++++++++++++++++++++++++++ scripts/mysql_tableinfo.sh | 2 +- scripts/mysqld_multi.sh | 2 +- scripts/mysqldumpslow.sh | 2 +- scripts/mysqlhotcopy.sh | 2 +- 11 files changed, 963 insertions(+), 24 deletions(-) create mode 100644 scripts/mysql_config.pl.in create mode 100644 scripts/mysql_install_db.pl.in (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6fbfcab72d4..8d369a6ab22 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -40,3 +40,44 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl ADD_CUSTOM_TARGET(GenFixPrivs ALL DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) + +# ---------------------------------------------------------------------- +# Replace some variables @foo@ in the .in/.sh file, and write the new script +# ---------------------------------------------------------------------- + +SET(CFLAGS "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}") +SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}") +SET(sysconfdir ${prefix}) +SET(bindir ${prefix}/bin) +SET(libexecdir ${prefix}/bin) +SET(scriptdir ${prefix}/bin) +SET(datadir ${prefix}/share) +SET(pkgdatadir ${prefix}/share) +SET(localstatedir ${prefix}/data) + +CONFIGURE_FILE(mysql_config.pl.in + scripts/mysql_config.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysql_convert_table_format.sh + scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysql_explain_log.sh + scripts/mysql_explain_log.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysql_install_db.pl.in + scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysql_secure_installation.sh + scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysql_tableinfo.sh + scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysqld_multi.sh + scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysqldumpslow.sh + scripts/mysqldumpslow.pl ESCAPE_QUOTES @ONLY) + +CONFIGURE_FILE(mysqlhotcopy.sh + scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5db5fdd550f..769c0f5fdba 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -48,9 +48,11 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ make_win_src_distribution_old.sh \ msql2mysql.sh \ mysql_config.sh \ + mysql_config.pl.in \ mysql_fix_privilege_tables.sh \ mysql_fix_extensions.sh \ mysql_install_db.sh \ + mysql_install_db.pl.in \ mysql_setpermission.sh \ mysql_secure_installation.sh \ mysql_zap.sh \ diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index d065e171bb0..b9a0842473b 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -327,27 +327,26 @@ if [ -d mysql-test/extra ] ; then fi # ---------------------------------------------------------------------- -# Copy what could be usable in the "scripts" directory. Currently -# only SQL files, others are Bourne shell scripts or Perl scripts -# not really usable on Windows. -# -# But to be nice to the few Cygwin users we might have in 5.0 we -# continue to copy the stuff, but don't include it in the WiX install. +# Copy what could be usable in the "scripts" directory # ---------------------------------------------------------------------- +mysql_scripts="\ +mysql_config.pl \ +mysql_convert_table_format.pl \ +mysql_explain_log.pl \ +mysql_install_db.pl \ +mysql_secure_installation.pl \ +mysql_tableinfo.pl \ +mysqld_multi.pl \ +mysqldumpslow.pl \ +mysqlhotcopy.pl \ +" + mkdir -p $DESTDIR/scripts -# Uncomment and remove the for loop in 5.1 -#cp scripts/*.sql $DESTDIR/scripts/ - -for i in `cd scripts && ls`; do \ - if echo $i | grep -q '\.sh'; then \ - cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \ - elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \ - : ; \ - else \ - cp scripts/$i $DESTDIR/scripts/$i; \ - fi; \ +for i in $mysql_scripts +do + cp scripts/$i $DESTDIR/scripts/$i done cp -pR sql/share $DESTDIR/ @@ -355,7 +354,7 @@ cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* # The SQL initialisation code is really expected to be in "share" -mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true +mv $DESTDIR/scripts/*.sql $DESTDIR/share/ # ---------------------------------------------------------------------- # Clean up from possibly copied SCCS directories diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in new file mode 100644 index 00000000000..3ae8baf7db0 --- /dev/null +++ b/scripts/mysql_config.pl.in @@ -0,0 +1,285 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2007 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +############################################################################## +# +# This script reports various configuration settings that may be needed +# when using the MySQL client library. +# +# This script try to match the shell script version as close as possible, +# but in addition being compatible with ActiveState Perl on Windows. +# +# All unrecognized arguments to this script are passed to mysqld. +# +# NOTE: This script will only be used on Windows until solved how to +# handle @LIBS@ and other strings inserted that might contain +# several arguments, possibly with spaces in them. +# +# NOTE: This script was deliberately written to be as close to the shell +# script as possible, to make the maintenance of both in parallel +# easier. +# +############################################################################## + +use File::Basename; +use Getopt::Long; +use Cwd; +use strict; + +my @exclude_cflags = + qw/DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX + DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS + DEXTRA_DEBUG DHAVE_purify O O[0-9] xO[0-9] W[-A-Za-z]* + Xa xstrconst xc99=none + unroll2 ip mp restrict/; + +my @exclude_libs = qw/lmtmalloc static-libcxa i-static static-intel/; + +my $cwd = cwd(); +my $basedir; + +my $socket = '@MYSQL_UNIX_ADDR@'; +my $version = '@VERSION@'; + +sub which +{ + my $file = shift; + + my $IFS = $^O eq "MSWin32" ? ";" : ":"; + + foreach my $dir ( split($IFS, $ENV{PATH}) ) + { + if ( -f "$dir/$file" or -f "$dir/$file.exe" ) + { + return "$dir/$file"; + } + } + print STDERR "which: no $file in ($ENV{PATH})\n"; + exit 1; +} + +# ---------------------------------------------------------------------- +# If we can find the given directory relatively to where mysql_config is +# we should use this instead of the incompiled one. +# This is to ensure that this script also works with the binary MySQL +# version +# ---------------------------------------------------------------------- + +sub fix_path +{ + my $default = shift; + my @dirs = @_; + + foreach my $dirname ( @dirs ) + { + my $path = "$basedir/$dirname"; + if ( -d $path ) + { + return $path; + } + } + return $default; +} + +sub get_full_path +{ + my $file = shift; + + # if the file is a symlink, try to resolve it + if ( $^O ne "MSWin32" and -l $file ) + { + $file = readlink($file); + } + + if ( $file =~ m,^/, ) + { + # Do nothing, absolute path + } + elsif ( $file =~ m,/, ) + { + # Make absolute, and remove "/./" in path + $file = "$cwd/$file"; + $file =~ s,/\./,/,g; + } + else + { + # Find in PATH + $file = which($file); + } + + return $file; +} + +############################################################################## +# +# Form a command line that can handle spaces in paths and arguments +# +############################################################################## + +sub quote_options { + my @cmd; + foreach my $opt ( @_ ) + { + next unless $opt; # If undefined or empty, just skip + push(@cmd, "\"$opt\""); # Quote argument + } + return join(" ", @cmd); +} + +############################################################################## +# +# Main program +# +############################################################################## + +my $me = get_full_path($0); +$basedir = dirname(dirname($me)); # Remove "/bin/mysql_config" part + +my $ldata = '@localstatedir@'; +my $execdir = '@libexecdir@'; +my $bindir = '@bindir@'; + +# ---------------------------------------------------------------------- +# If installed, search for the compiled in directory first (might be "lib64") +# ---------------------------------------------------------------------- + +my $pkglibdir = fix_path('@pkglibdir@',"libmysql/relwithdebinfo", + "libmysql/release","libmysql/debug","lib/mysql","lib"); + +my $pkgincludedir = fix_path('@pkgincludedir@', "include/mysql", "include"); + +# Assume no argument with space in it +my @ldflags = split(" ",'@LDFLAGS@'); + +my $port; +if ( '@MYSQL_TCP_PORT_DEFAULT@' == 0 ) { + $port = 0; +} else { + $port = '@MYSQL_TCP_PORT@'; +} + +# ---------------------------------------------------------------------- +# Create options +# We intentionally add a space to the beginning and end of lib strings, simplifies replace later +# ---------------------------------------------------------------------- + +my (@lib_opts,@lib_r_opts,@lib_e_opts); +if ( $^O eq "MSWin32" ) +{ + my $linkpath = "$pkglibdir"; + # user32 is only needed for debug or embedded + my @winlibs = ("wsock32.lib","advapi32.lib","user32.lib"); + @lib_opts = ("$linkpath/mysqlclient.lib",@winlibs); + @lib_r_opts = @lib_opts; + @lib_e_opts = ("$linkpath/mysqlserver.lib",@winlibs); +} +else +{ + my $linkpath = "-L$pkglibdir"; + @lib_opts = ($linkpath,"-lmysqlclient"); + @lib_r_opts = ($linkpath,"-lmysqlclient_r"); + @lib_e_opts = ($linkpath,"-lmysqld"); +} + +my $flags; +$flags->{libs} = + [@ldflags,@lib_opts,'@ZLIB_DEPS@','@NON_THREADED_LIBS@','@openssl_libs@','@STATIC_NSS_FLAGS@']; +$flags->{libs_r} = + [@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@']; +$flags->{embedded_libs} = + [@ldflags,@lib_e_opts,'@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@']; + +$flags->{include} = ["-I$pkgincludedir"]; +$flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')]; + +# ---------------------------------------------------------------------- +# Remove some options that a client doesn't have to care about +# FIXME until we have a --cxxflags, we need to remove -Xa +# and -xstrconst to make --cflags usable for Sun Forte C++ +# ---------------------------------------------------------------------- + +my $filter = join("|", @exclude_cflags); +my @tmp = @{$flags->{cflags}}; # Copy the flag list +$flags->{cflags} = []; # Clear it +foreach my $cflag ( @tmp ) +{ + push(@{$flags->{cflags}}, $cflag) unless $cflag =~ m/^($filter)$/o; +} + +# Same for --libs(_r) +$filter = join("|", @exclude_libs); +foreach my $lib_type ( "libs","libs_r","embedded_libs" ) +{ + my @tmp = @{$flags->{$lib_type}}; # Copy the flag list + $flags->{$lib_type} = []; # Clear it + foreach my $lib ( @tmp ) + { + push(@{$flags->{$lib_type}}, $lib) unless $lib =~ m/^($filter)$/o; + } +} + +my $include = quote_options(@{$flags->{include}}); +my $cflags = quote_options(@{$flags->{cflags}}); +my $libs = quote_options(@{$flags->{libs}}); +my $libs_r = quote_options(@{$flags->{libs_r}}); +my $embedded_libs = quote_options(@{$flags->{embedded_libs}}); + +############################################################################## +# +# Usage information, output if no option is given +# +############################################################################## + +sub usage +{ + print < sub { print "$cflags\n" }, + "include" => sub { print "$include\n" }, + "libs" => sub { print "$libs\n" }, + "libs_r" => sub { print "$libs_r\n" }, + "socket" => sub { print "$socket\n" }, + "port" => sub { print "$port\n" }, + "version" => sub { print "$version\n" }, + "embedded-libs|embedded|libmysqld-libs" => + sub { print "$embedded_libs\n" }, + ) or usage(); + +exit 0 diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index 0c9ce3a67e0..833b5bf5f11 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2000-2002 MySQL AB # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index a549817db5a..f3c7a4b04fa 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2001-2003, 2006 MySQL AB # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in new file mode 100644 index 00000000000..18bd713c041 --- /dev/null +++ b/scripts/mysql_install_db.pl.in @@ -0,0 +1,612 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2007 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +############################################################################## +# +# This scripts creates the MySQL Server system tables. +# +# This script try to match the shell script version as close as possible, +# but in addition being compatible with ActiveState Perl on Windows. +# +# All unrecognized arguments to this script are passed to mysqld. +# +# NOTE: This script in 5.0 doesn't really match the shell script +# version 100%, it is more close to the 5.1 version. +# +# NOTE: This script was deliberately written to be as close to the shell +# script as possible, to make the maintenance of both in parallel +# easier. +# +############################################################################## + +use File::Basename; +use Getopt::Long; +use Sys::Hostname; +use Data::Dumper; +use strict; + +Getopt::Long::Configure("pass_through"); + +my @args; # Argument list filled in + +############################################################################## +# +# Usage information +# +############################################################################## + +sub usage +{ + print <{help}; + + @args = @ARGV if $pick_args; + + @ARGV = @saved_ARGV; # Set back ARGV +} + +############################################################################## +# +# Try to find a specific file within --basedir which can either be a binary +# release or installed source directory and return the path. +# +############################################################################## + +sub find_in_basedir +{ + my $opt = shift; + my $mode = shift; # "dir" or "file" + my $files = shift; + + foreach my $file ( @{ref($files) ? $files : [$files]} ) + { + foreach my $dir ( @_ ) + { + foreach my $part ( "$file","$file.exe","release/$file.exe", + "debug/$file.exe","relwithdebinfo/$file.exe" ) + { + my $path = "$opt->{basedir}/$dir/$part"; + if ( -f $path ) + { + return $mode eq "dir" ? dirname($path) : $path; + } + } + } + } +} + +############################################################################## +# +# Just a function to write out an error report +# +############################################################################## + +sub cannot_find_file +{ + my $file = shift; + + print "FATAL ERROR: Could not find $file\n"; + print "\n"; + print "If you compiled from source, you need to run 'make install' to\n"; + print "copy the software into the correct location ready for operation.\n"; + print "\n"; + print "If you are using a binary release, you must either be at the top\n"; + print "level of the extracted archive, or pass the --basedir option\n"; + print "pointing to that location.\n"; + print "\n"; + + exit 1; +} + +############################################################################## +# +# Form a command line that can handle spaces in paths and arguments +# +############################################################################## + +# FIXME this backslash escaping needed if using '"..."' ? +# This regexp makes sure that any special chars are quoted, +# so the arg gets passed exactly to the server. +# XXX: This is broken; true fix requires using eval and proper +# quoting of every single arg ($opt->{basedir}, $opt->{ldata}, etc.) +# join(" ", map {s/([^\w\_\.\-])/\\$1/g} + +sub quote_options { + my @cmd; + foreach my $opt ( @_ ) + { + next unless $opt; # If undefined or empty, just skip + push(@cmd, "\"$opt\""); # Quote argument + } + return join(" ", @cmd); +} + +############################################################################## +# +# Ok, let's go. We first need to parse arguments which are required by +# my_print_defaults so that we can execute it first, then later re-parse +# the command line to add any extra bits that we need. +# +############################################################################## + +my $opt = {}; +parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV); + +# ---------------------------------------------------------------------- +# We can now find my_print_defaults. This script supports: +# +# --srcdir=path pointing to compiled source tree +# --basedir=path pointing to installed binary location +# +# or default to compiled-in locations. +# ---------------------------------------------------------------------- + +my $print_defaults; + +if ( $opt->{srcdir} and $opt->{basedir} ) +{ + error("Specify either --basedir or --srcdir, not both"); +} +if ( $opt->{srcdir} ) +{ + $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir}; + $print_defaults = "$opt->{builddir}/extra/my_print_defaults"; +} +elsif ( $opt->{basedir} ) +{ + $print_defaults = find_in_basedir($opt,"file","my_print_defaults","bin","extra"); +} +else +{ + $print_defaults='@bindir@/my_print_defaults'; +} + +-x $print_defaults or -f "$print_defaults.exe" + or cannot_find_file($print_defaults); + +# ---------------------------------------------------------------------- +# Now we can get arguments from the groups [mysqld] and [mysql_install_db] +# in the my.cfg file, then re-run to merge with command line arguments. +# ---------------------------------------------------------------------- + +my @default_options; +my $cmd = quote_options($print_defaults,$opt->{'defaults-file'}, + "mysqld","mysql_install_db"); +open(PIPE, "$cmd |") or error($opt,"can't run $cmd: $!"); +while ( ) +{ + chomp; + next unless /\S/; + push(@default_options, $_); +} +close PIPE; +$opt = {}; # Reset the arguments FIXME ? +parse_arguments($opt, @default_options); +parse_arguments($opt, 'PICK-ARGS-FROM-ARGV', @ARGV); + +# ---------------------------------------------------------------------- +# Configure paths to support files +# ---------------------------------------------------------------------- + +# FIXME $extra_bindir is not used +my ($bindir,$extra_bindir,$mysqld,$pkgdatadir,$mysqld_opt,$scriptdir); + +if ( $opt->{srcdir} ) +{ + $opt->{basedir} = $opt->{builddir}; + $bindir = "$opt->{basedir}/client"; + $extra_bindir = "$opt->{basedir}/extra"; + $mysqld = "$opt->{basedir}/sql/mysqld"; + $mysqld_opt = "--language=$opt->{srcdir}/sql/share/english"; + $pkgdatadir = "$opt->{srcdir}/scripts"; + $scriptdir = "$opt->{srcdir}/scripts"; +} +elsif ( $opt->{basedir} ) +{ + $bindir = "$opt->{basedir}/bin"; + $extra_bindir = $bindir; + $mysqld = find_in_basedir($opt,"file",["mysqld-nt","mysqld"], + "libexec","sbin","bin") || # ,"sql" + find_in_basedir($opt,"file","mysqld-nt", + "bin"); # ,"sql" + $pkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql", + "share","share/mysql"); # ,"scripts" + $scriptdir = "$opt->{basedir}/scripts"; +} +else +{ + $opt->{basedir} = '@prefix@'; + $bindir = '@bindir@'; + $extra_bindir = $bindir; + $mysqld = '@libexecdir@/mysqld'; + $pkgdatadir = '@pkgdatadir@'; + $scriptdir = '@scriptdir@'; +} + +unless ( $opt->{ldata} ) +{ + $opt->{ldata} = '@localstatedir@'; +} + +if ( $opt->{srcdir} ) +{ + $pkgdatadir = "$opt->{srcdir}/scripts"; +} + +# ---------------------------------------------------------------------- +# Set up paths to SQL scripts required for bootstrap +# ---------------------------------------------------------------------- + +my $fill_help_tables = "$pkgdatadir/fill_help_tables.sql"; +my $create_system_tables = "$pkgdatadir/mysql_system_tables.sql"; +my $fill_system_tables = "$pkgdatadir/mysql_system_tables_data.sql"; + +foreach my $f ( $fill_help_tables,$create_system_tables,$fill_system_tables ) +{ + -f $f or cannot_find_file($f); +} + +-x $mysqld or -f "$mysqld.exe" or cannot_find_file($mysqld); +# Try to determine the hostname +my $hostname = hostname(); + +# ---------------------------------------------------------------------- +# Check if hostname is valid +# ---------------------------------------------------------------------- + +my $resolved; +if ( !$opt->{'cross-bootstrap'} and !$opt->{rpm} and !$opt->{force} ) +{ + my $resolveip; + + $resolved = `$resolveip $hostname 2>&1`; + if ( $? != 0 ) + { + $resolved=`$resolveip localhost 2>&1`; + if ( $? != 0 ) + { + error($opt, + "Neither host '$hostname' nor 'localhost' could be looked up with", + "$bindir/resolveip", + "Please configure the 'hostname' command to return a correct", + "hostname.", + "If you want to solve this at a later stage, restart this script", + "with the --force option"); + } + warning($opt, + "The host '$hostname' could not be looked up with resolveip.", + "This probably means that your libc libraries are not 100 % compatible", + "with this binary MySQL version. The MySQL daemon, mysqld, should work", + "normally with the exception that host name resolving will not work.", + "This means that you should use IP addresses instead of hostnames", + "when specifying MySQL privileges !"); + } +} + +# FIXME what does this really mean.... +if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ ) +{ + $hostname = (split(' ', $resolved))[5]; +} + +# ---------------------------------------------------------------------- +# Create database directories mysql & test +# ---------------------------------------------------------------------- + +foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" ) +{ + # FIXME not really the same as original "mkdir -p", but ok? + mkdir($dir, 0700) unless -d $dir; + chown($opt->{user}, $dir) if -w "/" and !$opt->{user}; +} + +push(@args, "--user=$opt->{user}") if $opt->{user}; + +# ---------------------------------------------------------------------- +# Configure mysqld command line +# ---------------------------------------------------------------------- + +# FIXME use --init-file instead of --bootstrap ?! + +my $mysqld_bootstrap = $ENV{MYSQLD_BOOTSTRAP} || $mysqld; +my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap, + $opt->{'defaults-file'}, + $mysqld_opt, + "--bootstrap", + "--basedir=$opt->{basedir}", + "--datadir=$opt->{ldata}", + "--skip-innodb", + "--skip-bdb", + "--skip-ndbcluster", + "--max_allowed_packet=8M", + "--net_buffer_length=16K", + @args, + ); + +# ---------------------------------------------------------------------- +# Create the system and help tables by passing them to "mysqld --bootstrap" +# ---------------------------------------------------------------------- + +report_verbose_wait($opt,"Installing MySQL system tables..."); + +open(SQL, $create_system_tables) + or error($opt,"can't open $create_system_tables for reading: $!"); +# FIXME > /dev/null ? +if ( open(PIPE, "| $mysqld_install_cmd_line") ) +{ + print PIPE "use mysql;\n"; + while ( ) + { + # When doing a "cross bootstrap" install, no reference to the current + # host should be added to the system tables. So we filter out any + # lines which contain the current host name. + next if $opt->{'cross-bootstrap'} and /\@current_hostname/; + + print PIPE $_; + } + close PIPE; + close SQL; + + report_verbose($opt,"OK"); + + # ---------------------------------------------------------------------- + # Pipe fill_help_tables.sql to "mysqld --bootstrap" + # ---------------------------------------------------------------------- + + report_verbose_wait($opt,"Filling help tables..."); + open(SQL, $fill_help_tables) + or error($opt,"can't open $fill_help_tables for reading: $!"); + # FIXME > /dev/null ? + if ( open(PIPE, "| $mysqld_install_cmd_line") ) + { + print PIPE "use mysql;\n"; + while ( ) + { + print PIPE $_; + } + close PIPE; + close SQL; + + report_verbose($opt,"OK"); + } + else + { + warning($opt,"HELP FILES ARE NOT COMPLETELY INSTALLED!", + "The \"HELP\" command might not work properly"); + } + + report_verbose($opt,"To start mysqld at boot time you have to copy", + "support-files/mysql.server to the right place " . + "for your system"); + + if ( !$opt->{'cross-bootstrap'} ) + { + # This is not a true installation on a running system. The end user must + # set a password after installing the data files on the real host system. + # At this point, there is no end user, so it does not make sense to print + # this reminder. + report($opt, + "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !", + "To do so, start the server, then issue the following commands:", + "", + " $bindir/mysqladmin -u root password 'new-password'", + " $bindir/mysqladmin -u root -h $hostname password 'new-password'", + "", + "Alternatively you can run:", + "", + " $bindir/mysql_secure_installation", + "", + "which will also give you the option of removing the test", + "databases and anonymous user created by default. This is", + "strongly recommended for production servers.", + "", + "See the manual for more instructions."); + + if ( !$opt->{rpm} ) + { + report($opt, + "You can start the MySQL daemon with:", + "", + " cd " . '@prefix@' . " ; $bindir/mysqld_safe &", + "", + "You can test the MySQL daemon with mysql-test-run.pl", + "", + " cd mysql-test ; perl mysql-test-run.pl"); + } + report($opt, + "Please report any problems with the " . '@scriptdir@' . "/mysqlbug script!", + "", + "The latest information about MySQL is available on the web at", + "", + " http://www.mysql.com", + "", + "Support MySQL by buying support/licenses at http://shop.mysql.com"); + } + exit 0 +} +else +{ + error($opt, + "Installation of system tables failed!", + "", + "Examine the logs in $opt->{ldata} for more information.", + "You can try to start the mysqld daemon with:", + "$mysqld --skip-grant &", + "and use the command line tool", + "$bindir/mysql to connect to the mysql", + "database and look at the grant tables:", + "", + "shell> $bindir/mysql -u root mysql", + "mysql> show tables", + "", + "Try 'mysqld --help' if you have problems with paths. Using --log", + "gives you a log in $opt->{ldata} that may be helpful.", + "", + "The latest information about MySQL is available on the web at", + "http://www.mysql.com", + "Please consult the MySQL manual section: 'Problems running mysql_install_db',", + "and the manual section that describes problems on your OS.", + "Another information source is the MySQL email archive.", + "Please check all of the above before mailing us!", + "And if you do mail us, you MUST use the " . '@scriptdir@' . "/mysqlbug script!") +} + +############################################################################## +# +# Misc +# +############################################################################## + +sub report_verbose +{ + my $opt = shift; + my $text = shift; + + report_verbose_wait($opt, $text, @_); + print "\n\n"; +} + +sub report_verbose_wait +{ + my $opt = shift; + my $text = shift; + + if ( $opt->{verbose} or (!$opt->{rpm} and !$opt->{'cross-bootstrap'}) ) + { + print "$text"; + map {print "\n$_"} @_; + } +} + +sub report +{ + my $opt = shift; + my $text = shift; + + print "$text\n"; + map {print "$_\n"} @_; + print "\n"; +} + +sub error +{ + my $opt = shift; + my $text = shift; + + print "FATAL ERROR: $text\n"; + map {print "$_\n"} @_; + exit 1; +} + +sub warning +{ + my $opt = shift; + my $text = shift; + + print "WARNING: $text\n"; + map {print "$_\n"} @_; + print "\n"; +} diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh index 2ed7e381fa3..c90c410ca78 100644 --- a/scripts/mysql_tableinfo.sh +++ b/scripts/mysql_tableinfo.sh @@ -1,4 +1,4 @@ -#!@PERL@ -w +#!/usr/bin/perl use strict; use Getopt::Long; diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 92cfbe3ef22..3cb4665eb1c 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl use Getopt::Long; use POSIX qw(strftime); diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index ff82a35ec3f..f05761bb837 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # mysqldumpslow - parse and summarize the MySQL slow query log # Original version by Tim Bunce, sometime in 2000. diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 6ad5c77b954..bad0761cd80 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -1,4 +1,4 @@ -#!@PERL@ -w +#!/usr/bin/perl use strict; use Getopt::Long; -- cgit v1.2.1 From 06a7d7be419fb75356972a96f931efeaa24ea99e Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Fri, 28 Dec 2007 16:10:17 +0100 Subject: scripts/make_binary_distribution.sh After-merge fix for bug#33536: The target to copy to is now called "$DEST". --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1e9ec362d76..029679ceec9 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -222,7 +222,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then if [ -z "$gcclib" ] ; then echo "Warning: Compiler doesn't tell libgcc.a!" elif [ -f "$gcclib" ] ; then - $CP $gcclib $BASE/lib/libmygcc.a + $CP $gcclib $DEST/lib/libmygcc.a else echo "Warning: Compiler result '$gcclib' not found / no file!" fi -- cgit v1.2.1 From e45e7d9e2eec4342e4243bde0d9c284989db1ba2 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Fri, 28 Dec 2007 22:58:54 +0100 Subject: Makefile.am, CMakeLists.txt, mysql_secure_installation.pl.in: Added Perl version of script "mysql_secure_installation" make_win_bin_dist: Corrected copy of SQL files to "share" directory --- scripts/CMakeLists.txt | 2 +- scripts/Makefile.am | 1 + scripts/make_win_bin_dist | 4 +- scripts/mysql_secure_installation.pl.in | 352 ++++++++++++++++++++++++++++++++ 4 files changed, 356 insertions(+), 3 deletions(-) create mode 100755 scripts/mysql_secure_installation.pl.in (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8d369a6ab22..d7bcb8fd4e7 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -67,7 +67,7 @@ CONFIGURE_FILE(mysql_explain_log.sh CONFIGURE_FILE(mysql_install_db.pl.in scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY) -CONFIGURE_FILE(mysql_secure_installation.sh +CONFIGURE_FILE(mysql_secure_installation.pl.in scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY) CONFIGURE_FILE(mysql_tableinfo.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 769c0f5fdba..87170b46675 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -55,6 +55,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_install_db.pl.in \ mysql_setpermission.sh \ mysql_secure_installation.sh \ + mysql_secure_installation.pl.in \ mysql_zap.sh \ mysqlaccess.sh \ mysqlbug.sh \ diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index b9a0842473b..56510dc857b 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -353,8 +353,8 @@ cp -pR sql/share $DESTDIR/ cp -pR sql-bench $DESTDIR/ rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile* -# The SQL initialisation code is really expected to be in "share" -mv $DESTDIR/scripts/*.sql $DESTDIR/share/ +# The SQL initialisation code is to be in "share" +cp scripts/*.sql $DESTDIR/share/ # ---------------------------------------------------------------------- # Clean up from possibly copied SCCS directories diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in new file mode 100755 index 00000000000..4eeb50e6d2f --- /dev/null +++ b/scripts/mysql_secure_installation.pl.in @@ -0,0 +1,352 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2002 MySQL AB and Jeremy Cole +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +use Fcntl; +use strict; + +my $config = ".my.cnf.$$"; +my $command = ".mysql.$$"; +my $hadpass = 0; + +# FIXME +# trap "interrupt" 2 + +my $rootpass = ""; + +sub echo_on { + if ($^O eq 'MSWin32') { + ReadMode('normal'); + } else { + system("stty echo"); + } +} + +sub echo_off { + if ($^O eq 'MSWin32') { + ReadMode('noecho'); + } else { + system("stty -echo"); + } +} + +sub write_file { + my $file = shift; + -f $file or die "ERROR: file is missing \"$file\": $!"; + open(FILE, ">$file") or die "ERROR: can't write to file \"$file\": $!"; + foreach my $line ( @_ ) { + print FILE $line, "\n"; # Add EOL char + } + close FILE; +} + +sub prepare { + foreach my $file ( $config, $command ) { + next if -f $file; # Already exists + local *FILE; + sysopen(FILE, $file, O_CREAT, 0600) + or die "ERROR: can't create $file: $!"; + close FILE; + } +} + +sub do_query { + my $query = shift; + write_file($command, $query); + system("mysql --defaults-file=$config < $command"); + return $?; +} + +sub make_config { + my $password = shift; + + write_file($config, + "# mysql_secure_installation config file", + "[mysql]", + "user=root", + "password=$rootpass"); +} + +sub get_root_password { + my $status = 1; + while ( $status == 1 ) { + echo_off(); + print "Enter current password for root (enter for none): "; + my $password = ; + echo_on(); + if ( $password ) { + $hadpass = 1; + } else { + $hadpass = 0; + } + $rootpass = $password; + make_config($rootpass); + do_query(""); + $status = $?; + } + print "OK, successfully used password, moving on...\n\n"; +} + +sub set_root_password { + echo_off(); + print "New password: "; + my $password1 = ; + print "\nRe-enter new password: "; + my $password2 = ; + print "\n"; + echo_on(); + + if ( $password1 eq $password2 ) { + print "Sorry, passwords do not match.\n\n"; + return 1; + } + + if ( !$password1 ) { + print "Sorry, you can't use an empty password here.\n\n"; + return 1; + } + + do_query("UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';"); + if ( $? == 0 ) { + print "Password updated successfully!\n"; + print "Reloading privilege tables..\n"; + if ( !reload_privilege_tables() ) { + exit 1; + } + print "\n"; + $rootpass = $password1; + make_config($rootpass); + } else { + print "Password update failed!\n"; + exit 1; + } + + return 0; +} + +sub remove_anonymous_users { + do_query("DELETE FROM mysql.user WHERE User='';"); + if ( $? == 0 ) { + print " ... Success!\n"; + } else { + print " ... Failed!\n"; + exit 1; + } + + return 0; +} + +sub remove_remote_root { + do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';"); + if ( $? == 0 ) { + print " ... Success!\n"; + } else { + print " ... Failed!\n"; + } +} + +sub remove_test_database { + print " - Dropping test database...\n"; + do_query("DROP DATABASE test;"); + if ( $? == 0 ) { + print " ... Success!\n"; + } else { + print " ... Failed! Not critical, keep moving...\n"; + } + + print " - Removing privileges on test database...\n"; + do_query("DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"); + if ( $? == 0 ) { + print " ... Success!\n"; + } else { + print " ... Failed! Not critical, keep moving...\n"; + } + + return 0; +} + +sub reload_privilege_tables { + do_query("FLUSH PRIVILEGES;"); + if ( $? == 0 ) { + print " ... Success!\n"; + return 0; + } else { + print " ... Failed!\n"; + return 1; + } +} + +sub interrupt { + print "\nAborting!\n\n"; + cleanup(); + echo_on(); + exit 1; +} + +sub cleanup { + print "Cleaning up...\n"; + unlink($config,$command); +} + + +# The actual script starts here + +prepare(); + +print <; +if ( $reply =~ /n/i ) { + print " ... skipping.\n"; +} else { + my $status = 1; + while ( $status == 1 ) { + set_root_password(); + $status = $?; + } +} +print "\n"; + + +# +# Remove anonymous users +# + +print <; +if ( $reply =~ /n/i ) { + print " ... skipping.\n"; +} else { + remove_anonymous_users(); +} +print "\n"; + + +# +# Disallow remote root login +# + +print <; +if ( $reply =~ /n/i ) { + print " ... skipping.\n"; +} else { + remove_remote_root(); +} +print "\n"; + + +# +# Remove test database +# + +print <; +if ( $reply =~ /n/i ) { + print " ... skipping.\n"; +} else { + remove_test_database(); +} +print "\n"; + + +# +# Reload privilege tables +# + +print <; +if ( $reply =~ /n/i ) { + print " ... skipping.\n"; +} else { + reload_privilege_tables(); +} +print "\n"; + +cleanup(); + +print < Date: Wed, 2 Jan 2008 13:00:46 +0000 Subject: Use pkglibdir to simplify pkgplugindir, and fix the path in a couple of Makefiles. Continuation of the fix for bug#31736. --- scripts/Makefile.am | 2 +- scripts/make_binary_distribution.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 8669e075959..73c22031990 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -90,7 +90,7 @@ CLEANFILES = @server_scripts@ \ mysql_tableinfo \ mysqld_multi -pkgplugindir = $(libdir)/@PACKAGE@/plugin +pkgplugindir = $(pkglibdir)/plugin # Default same as 'pkgdatadir', but we can override it pkgsuppdir = $(datadir)/@PACKAGE@ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 88397052815..864e78657b0 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -30,8 +30,7 @@ # "pkglibdir" is set to the same as "libdir" # "pkgincludedir" is set to the same as "includedir" # "pkgdatadir" is set to the same as "datadir" -# "pkgplugindir" is set to "@prefix@/lib/plugin", -# normally "$libdir/plugin" +# "pkgplugindir" is set to "$pkglibdir/plugin" # "pkgsuppdir" is set to "@prefix@/support-files", # normally the same as "datadir" # -- cgit v1.2.1 From ae9a5a2fea9b0762c22e04370eb360b6f67e67d5 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Thu, 31 Jan 2008 20:55:58 +0100 Subject: Makefile.am, CMakeLists.txt, make_win_bin_dist: Removed references to deleted "mysql_explain_log" and "mysql_tableinfo" --- scripts/CMakeLists.txt | 6 ------ scripts/Makefile.am | 1 - scripts/make_win_bin_dist | 2 -- 3 files changed, 9 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index d7bcb8fd4e7..f0db25be79a 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -61,18 +61,12 @@ CONFIGURE_FILE(mysql_config.pl.in CONFIGURE_FILE(mysql_convert_table_format.sh scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY) -CONFIGURE_FILE(mysql_explain_log.sh - scripts/mysql_explain_log.pl ESCAPE_QUOTES @ONLY) - CONFIGURE_FILE(mysql_install_db.pl.in scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY) CONFIGURE_FILE(mysql_secure_installation.pl.in scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY) -CONFIGURE_FILE(mysql_tableinfo.sh - scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY) - CONFIGURE_FILE(mysqld_multi.sh scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index b61b614598d..cf061cc08e5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -90,7 +90,6 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysql_tableinfo \ mysqld_multi # Default same as 'pkgdatadir', but we can override it diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 87df554319a..f0dc3eff72b 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -322,10 +322,8 @@ fi mysql_scripts="\ mysql_config.pl \ mysql_convert_table_format.pl \ -mysql_explain_log.pl \ mysql_install_db.pl \ mysql_secure_installation.pl \ -mysql_tableinfo.pl \ mysqld_multi.pl \ mysqldumpslow.pl \ mysqlhotcopy.pl \ -- cgit v1.2.1 From 9a2090fcddcf97292720c7556d015eabc4a16fe9 Mon Sep 17 00:00:00 2001 From: "mtaylor@solace.(none)" <> Date: Wed, 6 Feb 2008 04:33:27 +0100 Subject: Strip comments from queries before explaining them. Fixes BUG#34339 --- scripts/mysql_explain_log.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index f3c7a4b04fa..30bee722873 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -196,9 +196,10 @@ if (defined ($help)) { elsif (m/^\s+(.+)$/ ) { # command could be some lines ... #print "multi-lined ($1)\n"; my ($A)=$1; - chomp $A; - $Param->{Query} .= " $1"; - #print "multi-lined ($1)<<$Param->{Query}>>\n"; + $A =~ s/\-\-.*//; + + $Param->{Query} .= " $A"; + #print "multi-lined ($A)<<$Param->{Query}>>\n"; } -- cgit v1.2.1 From 1c6768c487aa28b8ee33a623a406d89a1b2c3707 Mon Sep 17 00:00:00 2001 From: "davi@mysql.com/endora.local" <> Date: Thu, 7 Feb 2008 08:47:39 -0200 Subject: Bug#32633 Can not create any routine if SQL_MODE=no_engine_substitution The problem is that one can not create a stored routine if sql_mode contains NO_ENGINE_SUBSTITUTION or PAD_CHAR_TO_FULL_LENGTH. Also when a event is created, the mode is silently lost if sql_mode contains one of the aforementioned. This was happening because the table definitions which stored sql_mode values weren't being updated to accept new values of sql_mode. The solution is to update, in a backwards compatible manner, the various table definitions (columns) that store the sql_mode value to take into account the new possible values. One incompatible change is that if a event that is being created can't be stored to the mysql.event table, an error will be raised. The tests case also ensure that new SQL modes will be added to the mysql.proc and mysql.event tables, otherwise the tests will fail. --- scripts/mysql_system_tables.sql | 4 ++-- scripts/mysql_system_tables_fix.sql | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 7ca35ae0752..fdab9601129 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; @@ -80,7 +80,7 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a43964bf09a..e2bdd668c0f 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -375,7 +375,9 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' + 'HIGH_NOT_PRECEDENCE', + 'NO_ENGINE_SUBSTITUTION', + 'PAD_CHAR_TO_FULL_LENGTH' ) DEFAULT '' NOT NULL, DEFAULT CHARACTER SET utf8; @@ -461,7 +463,9 @@ ALTER TABLE event ADD sql_mode 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', - 'HIGH_NOT_PRECEDENCE' + 'HIGH_NOT_PRECEDENCE', + 'NO_ENGINE_SUBSTITUTION', + 'PAD_CHAR_TO_FULL_LENGTH' ) DEFAULT '' NOT NULL AFTER on_completion; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL AFTER comment; -- cgit v1.2.1 From cd6e2ad99f478e1e5f457e396863a1ca2a545198 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Thu, 14 Feb 2008 01:05:25 -0700 Subject: Bug #21158 mysql_config doesn't include -lmygcc Add -lmygcc to mysql_config output for libs, libs_r, and embedded_libs. Required when linking against our static libs, if yassl is used, and gcc used to build library is significantly different from that which is using the library. --- scripts/mysql_config.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ae58655ed0f..8abad75bc2a 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -107,6 +107,16 @@ libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " +if [ -r "$pkglibdir/libmygcc.a" ]; then + # When linking against the static library with a different version of GCC + # from what was used to compile the library, some symbols may not be defined + # automatically. We package the libmygcc.a from the build host, to provide + # definitions for those. Bugs 4921, 19561, 19817, 21158, etc. + libs="$libs -lmygcc " + libs_r="$libs_r -lmygcc " + embedded_libs="$embedded_libs -lmygcc " +fi + cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" @@ -116,6 +126,7 @@ include="-I$pkgincludedir" for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ + 'mtune=[-A-Za-z0-9]*' 'mcpu=[-A-Za-z0-9]*' 'march=[-A-Za-z0-9]*' \ Xa xstrconst "xc99=none" \ unroll2 ip mp restrict do -- cgit v1.2.1 From 845b94451f1a112d192944a91c25107a4f6e561d Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 18 Feb 2008 11:48:33 -0700 Subject: Bug #28460 mysqlhotcopy silently skips a database with two alphanumerics name Remove code from mysqlhotcopy which deals with the so-called "RAID" feature of older MyISAM. --- scripts/mysqlhotcopy.sh | 99 ++++++++++++------------------------------------- 1 file changed, 24 insertions(+), 75 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 6ad5c77b954..64e31e45a16 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -39,7 +39,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. # Documentation continued at end of file -my $VERSION = "1.22"; +my $VERSION = "1.23"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; @@ -132,7 +132,6 @@ GetOptions( \%opt, # 'target' - destination directory of the copy # 'tables' - array-ref to list of tables in the db # 'files' - array-ref to list of files to be copied -# (RAID files look like 'nn/name.MYD') # 'index' - array-ref to list of indexes to be copied # @@ -263,7 +262,6 @@ my $hc_locks = ""; my $hc_tables = ""; my $num_tables = 0; my $num_files = 0; -my $raid_dir_regex = '[A-Za-z0-9]{2}'; foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; @@ -292,20 +290,12 @@ foreach my $rdb ( @db_desc ) { or die "Cannot open dir '$db_dir': $!"; my %db_files; - my @raid_dir = (); while ( defined( my $name = readdir DBDIR ) ) { - if ( $name =~ /^$raid_dir_regex$/ && -d "$db_dir/$name" ) { - push @raid_dir, $name; - } - else { - $db_files{$name} = $1 if ( $name =~ /(.+)\.\w+$/ ); - } + $db_files{$name} = $1 if ( $name =~ /(.+)\.\w+$/ ); } closedir( DBDIR ); - scan_raid_dir( \%db_files, $db_dir, @raid_dir ); - unless( keys %db_files ) { warn "'$db' is an empty database\n"; } @@ -336,8 +326,6 @@ foreach my $rdb ( @db_desc ) { my @hc_tables = map { quote_names("$db.$_") } @dbh_tables; $rdb->{tables} = [ @hc_tables ]; - $rdb->{raid_dirs} = [ get_raid_dirs( $rdb->{files} ) ]; - $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; $hc_tables .= ", " if ( length $hc_tables && @hc_tables ); @@ -411,27 +399,24 @@ if ($opt{method} =~ /^cp\b/) retire_directory( @existing ) if @existing && !$opt{addtodest}; foreach my $rdb ( @db_desc ) { - foreach my $td ( '', @{$rdb->{raid_dirs}} ) { - - my $tgt_dirpath = "$rdb->{target}/$td"; - # Remove trailing slashes (needed for Mac OS X) - substr($tgt_dirpath, 1) =~ s|/+$||; - if ( $opt{dryrun} ) { - print "mkdir $tgt_dirpath, 0750\n"; - } - elsif ($opt{method} =~ /^scp\b/) { - ## assume it's there? - ## ... - } - else { - mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" - unless -d $tgt_dirpath; - if ($^O !~ m/^(NetWare)$/) - { - my @f_info= stat "$datadir/$rdb->{src}"; - chown $f_info[4], $f_info[5], $tgt_dirpath; - } - } + my $tgt_dirpath = "$rdb->{target}"; + # Remove trailing slashes (needed for Mac OS X) + substr($tgt_dirpath, 1) =~ s|/+$||; + if ( $opt{dryrun} ) { + print "mkdir $tgt_dirpath, 0750\n"; + } + elsif ($opt{method} =~ /^scp\b/) { + ## assume it's there? + ## ... + } + else { + mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" + unless -d $tgt_dirpath; + if ($^O !~ m/^(NetWare)$/) + { + my @f_info= stat "$datadir/$rdb->{src}"; + chown $f_info[4], $f_info[5], $tgt_dirpath; + } } } @@ -489,7 +474,7 @@ foreach my $rdb ( @db_desc ) my @files = map { "$datadir/$rdb->{src}/$_" } @{$rdb->{files}}; next unless @files; - eval { copy_files($opt{method}, \@files, $rdb->{target}, $rdb->{raid_dirs} ); }; + eval { copy_files($opt{method}, \@files, $rdb->{target}); }; push @failed, "$rdb->{src} -> $rdb->{target} failed: $@" if ( $@ ); @@ -582,7 +567,7 @@ exit 0; # --- sub copy_files { - my ($method, $files, $target, $raid_dirs) = @_; + my ($method, $files, $target) = @_; my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; @@ -603,15 +588,8 @@ sub copy_files { # add recursive option for scp $cp.= " -r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/; - my @non_raid = map { "'$_'" } grep { ! m:/$raid_dir_regex/[^/]+$: } @$files; - - # add files to copy and the destination directory - 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 ); - } + # perform the actual copy + safe_system( $cp, (map { "'$_'" } @$files), "'$target'" ); } else { @@ -789,35 +767,6 @@ sub get_row_hash { return $sth->fetchrow_hashref(); } -sub scan_raid_dir { - my ( $r_db_files, $data_dir, @raid_dir ) = @_; - - local(*RAID_DIR); - - foreach my $rd ( @raid_dir ) { - - opendir(RAID_DIR, "$data_dir/$rd" ) - or die "Cannot open dir '$data_dir/$rd': $!"; - - while ( defined( my $name = readdir RAID_DIR ) ) { - $r_db_files->{"$rd/$name"} = $1 if ( $name =~ /(.+)\.\w+$/ ); - } - closedir( RAID_DIR ); - } -} - -sub get_raid_dirs { - my ( $r_files ) = @_; - - my %dirs = (); - foreach my $f ( @$r_files ) { - if ( $f =~ m:^($raid_dir_regex)/: ) { - $dirs{$1} = 1; - } - } - return sort keys %dirs; -} - sub get_list_of_tables { my ( $db ) = @_; -- cgit v1.2.1 From 874e919872047d000207d7651c64380ae4df7221 Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/white.intern.koehntopp.de" <> Date: Mon, 25 Feb 2008 07:50:55 +0100 Subject: Bug#29645: Link failure when using the embedded server mysql_config --cflags gave a flag that forced the HP/UX C++ compiler into C-mode; as a result, C++ sources could not be compiled correctly. We now filter out the offending flag (like we do for Sun) so that --cflags will work for both C and C++. --- scripts/mysql_config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ae58655ed0f..a0c3b43d690 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -113,10 +113,12 @@ include="-I$pkgincludedir" # Remove some options that a client doesn't have to care about # FIXME until we have a --cxxflags, we need to remove -Xa # and -xstrconst to make --cflags usable for Sun Forte C++ +# FIXME until we have a --cxxflags, we need to remove -AC99 +# to make --cflags usable for HP C++ (aCC) for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ - Xa xstrconst "xc99=none" \ + Xa xstrconst "xc99=none" AC99 \ unroll2 ip mp restrict do # The first option we might strip will always have a space before it because -- cgit v1.2.1 From 773855c8006b21dd9c5b1161130fbda57da6f697 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 4 Mar 2008 22:00:53 +0100 Subject: scripts/CMakeLists.txt : Treat "mysql_upgrade_shell" the same way as all the other scripts. --- scripts/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index d7bcb8fd4e7..8aca7792e7c 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -73,6 +73,9 @@ CONFIGURE_FILE(mysql_secure_installation.pl.in CONFIGURE_FILE(mysql_tableinfo.sh scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY) +CONFIGURE_FILE(mysql_upgrade_shell.sh + scripts/mysql_upgrade_shell.pl ESCAPE_QUOTES @ONLY) + CONFIGURE_FILE(mysqld_multi.sh scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY) -- cgit v1.2.1 From 00160fe9e9ae3c0c1836dbc428fd33c90699df72 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 5 Mar 2008 14:03:05 +0100 Subject: Include "mysql_upgrade_shell.pl" in a binary distribution on Windows. --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 56510dc857b..2b2477c52cd 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -337,6 +337,7 @@ mysql_explain_log.pl \ mysql_install_db.pl \ mysql_secure_installation.pl \ mysql_tableinfo.pl \ +mysql_upgrade_shell.pl \ mysqld_multi.pl \ mysqldumpslow.pl \ mysqlhotcopy.pl \ -- cgit v1.2.1 From c6f63bc5bbf4c60084715320591dfc745db75645 Mon Sep 17 00:00:00 2001 From: "iggy@amd64.(none)" <> Date: Fri, 7 Mar 2008 15:45:40 -0500 Subject: Bug #27101 mysqlhotcopy --record_log_pos retrieves wrong slave parameters - Make sure mysqlhotcopy doesn't create unrestorable slaves. --- scripts/mysqlhotcopy.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 8814e36b2fa..4819f512a65 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -733,7 +733,7 @@ sub record_log_pos { = @{$row_hash}{ qw / Master_Host Log_File Pos / }; } else { ($master_host, $log_file, $log_pos ) - = @{$row_hash}{ qw / Master_Host Master_Log_File Read_Master_Log_Pos / }; + = @{$row_hash}{ qw / Master_Host Relay_Master_Log_File Exec_Master_Log_Pos / }; } my $hostname = hostname(); @@ -836,9 +836,10 @@ log-pos-table from the values returned from "show master status" and log_file and log_pos columns, and establish the position in the binary logs that any slaves of this host should adopt if initialised from this dump. The slave status values are stored in master_host, -master_log_file, and master_log_pos, and these are useful if the host -performing the dump is a slave and other sibling slaves are to be -initialised from this dump. +master_log_file, and master_log_pos, corresponding to the coordinates +of the next to the last event the slave has executed. The slave or its +siblings can connect to the master next time and request replication +starting from the recorded values. The name of the log-pos table should be supplied in database.table format. A sample log-pos table definition: -- cgit v1.2.1 From 1cda9d124bcba3acce49c3ddc4d1bd9a0150d094 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 10 Mar 2008 03:25:54 -0600 Subject: Bug #25486: mysqld_multi.server.sh missing from builds Make mysqld_multi.server executable, and allow it to be installed via chkconfig on LSB-compliant systems. --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8598a022669..68af030f17a 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -327,8 +327,8 @@ if [ $BASE_SYSTEM != "netware" ] ; then < support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ - $BASE/support-files/mysql.server $BASE/configure + chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-log-rotate \ + $BASE/support-files/*.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/bin/*.sql -- cgit v1.2.1 From 878b333680560343eb6d3e56c0553c12c0fb0b54 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Tue, 11 Mar 2008 15:21:58 +0100 Subject: make_win_bin_dist: Include .pdb files for tools and libraries (bug#35104) --- scripts/make_win_bin_dist | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 56510dc857b..8a57b545ac7 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -26,8 +26,7 @@ set -e # NOTE: Pattern matching with "{..,..}" can't be used, not portable. # ---------------------------------------------------------------------- -# FIXME FIXME "debug", own build or handled here? -# FIXME FIXME add way to copy from other builds executables +# FIXME why "libmysql.dll" installed both in "bin" and "lib/opt"? usage() { @@ -150,13 +149,16 @@ cp myisam/$TARGET/*.exe $DESTDIR/bin/ cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ if [ x"$TARGET" != x"release" ] ; then cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ + cp client/$TARGET/mysql.pdb $DESTDIR/bin/ + cp client/$TARGET/mysqladmin.pdb $DESTDIR/bin/ + cp client/$TARGET/mysqlbinlog.pdb $DESTDIR/bin/ + cp client/$TARGET/mysqldump.pdb $DESTDIR/bin/ + cp client/$TARGET/mysqlimport.pdb $DESTDIR/bin/ + cp client/$TARGET/mysqlshow.pdb $DESTDIR/bin/ fi cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ -# FIXME really needed?! -mv $DESTDIR/bin/comp_err.exe $DESTDIR/bin/comp-err.exe - if [ -f "sql/$TARGET/mysqld-nt.exe" ] ; then BASENAME="mysqld-nt" # Old style non CMake build else @@ -191,10 +193,6 @@ if [ -d win/data ] ; then cp -pR win/data $DESTDIR/ fi -# FIXME maybe a flag to define "release build", or do the -# check from the calling script that all these are there, -# and with the correct content. - mkdir $DESTDIR/Docs cp Docs/INSTALL-BINARY $DESTDIR/Docs/ cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true @@ -218,11 +216,13 @@ copy_embedded() $DESTDIR/include cp libmysqld/libmysqld.def $DESTDIR/include/ cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/ - cp libmysqld/$TARGET/mysqlserver.pdb $DESTDIR/Embedded/static/release/ cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/ cp libmysqld/$TARGET/libmysqld.exp $DESTDIR/Embedded/DLL/release/ cp libmysqld/$TARGET/libmysqld.lib $DESTDIR/Embedded/DLL/release/ - cp libmysqld/$TARGET/libmysqld.pdb $DESTDIR/Embedded/DLL/release/ + if [ x"$TARGET" != x"release" ] ; then + cp libmysqld/$TARGET/mysqlserver.pdb $DESTDIR/Embedded/static/release/ + cp libmysqld/$TARGET/libmysqld.pdb $DESTDIR/Embedded/DLL/release/ + fi if [ x"$PACK_DEBUG" = x"" -a -f "libmysqld/debug/libmysqld.lib" -o \ x"$PACK_DEBUG" = x"yes" ] ; then @@ -287,7 +287,6 @@ cp include/mysql.h \ # ---------------------------------------------------------------------- # Client libraries, and other libraries -# FIXME why "libmysql.dll" installed both in "bin" and "lib/opt"? # ---------------------------------------------------------------------- mkdir -p $DESTDIR/lib/opt @@ -299,16 +298,31 @@ cp libmysql/$TARGET/libmysql.dll \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ +if [ x"$TARGET" != x"release" ] ; then + cp libmysql/$TARGET/libmysql.pdb \ + libmysql/$TARGET/mysqlclient.pdb \ + mysys/$TARGET/mysys.pdb \ + regex/$TARGET/regex.pdb \ + strings/$TARGET/strings.pdb \ + zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/ +fi + if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/lib/debug cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ + libmysql/debug/libmysql.pdb \ libmysql/debug/mysqlclient.lib \ + libmysql/debug/mysqlclient.pdb \ mysys/debug/mysys.lib \ + mysys/debug/mysys.pdb \ regex/debug/regex.lib \ + regex/debug/regex.pdb \ strings/debug/strings.lib \ - zlib/debug/zlib.lib $DESTDIR/lib/debug/ + strings/debug/strings.pdb \ + zlib/debug/zlib.lib \ + zlib/debug/zlib.pdb $DESTDIR/lib/debug/ fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From 5d725bfdf8b90dd0fe65d68e8c2991850d283ce7 Mon Sep 17 00:00:00 2001 From: "davi@mysql.com/endora.local" <> Date: Fri, 4 Apr 2008 13:46:05 -0300 Subject: Bug#35824: mysql_upgrade does not fix scheduler tables when upgrading from 5.1.23 to 5.1.24 The problem is that when upgrading the event table, the sql_mode column was always being added instead of being updated to list new sql_mode values, causing upgrades of the event which already have a sql_mode column to not be updated to the new sql_mode values. The solution is to always add first a stub sql_mode column and subsequently update the column to the new sql_mode values. --- scripts/mysql_system_tables_fix.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index e2bdd668c0f..a33c4fcb9fa 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -433,7 +433,10 @@ ALTER TABLE db MODIFY Event_priv enum('N','Y') character set utf8 DEFAULT 'N' NO # ALTER TABLE event DROP PRIMARY KEY; ALTER TABLE event ADD PRIMARY KEY(db, name); -ALTER TABLE event ADD sql_mode +# Add sql_mode column just in case. +ALTER TABLE event ADD sql_mode set ('NOT_USED') AFTER on_completion; +# Update list of sql_mode values. +ALTER TABLE event MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', -- cgit v1.2.1 From eaa4d4e5a7d6121edbdc28d8f734221442422e15 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/kent-amd64.(none)" <> Date: Mon, 28 Apr 2008 21:53:52 +0200 Subject: make_binary_distribution.sh: Copy all of the "std_data" directory --- scripts/make_binary_distribution.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 68af030f17a..50cff8578c9 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -293,21 +293,15 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ - mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ - mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ - mysql-test/std_data/Index.xml \ - mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ - mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ - $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -# Copy the additional suites "as is", they are in flux -$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) +# Copy the additional suites and data "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) +$tar cf - mysql-test/std_data | ( cd $BASE ; $tar xf - ) # Clean up if we did this from a bk tree if [ -d mysql-test/SCCS ] ; then find $BASE/mysql-test -name SCCS -print | xargs rm -rf -- cgit v1.2.1 From aa45d0c01fc8d9230dcc1defe35048045928cf4b Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 17 Jun 2008 19:04:10 -0600 Subject: Bug #37024: Wrong location of messagefiles make_binary_distribution.sh got clobbered by the 5.0 version during a merge. This caused a few packaging problems, including message files put in the wrong place and some missing files. Fix is just to revert back to the 5.1 version from before the merge. Problem introduced in ChangeSet 1.2606.2.1 2008/05/13 15:56:07 kent@kent-amd64.(none) This change was made in the 5.1.25 release clone in BK, but never made it to the main mysql-5.1 BK tree. I am adding it to mysql-5.1 bzr. --- scripts/make_binary_distribution.sh | 453 +++++++++++++++++++----------------- 1 file changed, 239 insertions(+), 214 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 50cff8578c9..0a58f8b8ef1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -14,36 +14,61 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This is a script to create a TAR or ZIP binary distribution out of a -# built source tree. The output file will be put at the top level of -# the source tree, as "mysql-....{tar.gz,zip}" +############################################################################## # -# The temporary directory path given to "--tmp=" has to be -# absolute and with no spaces. +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-....{tar.gz,zip}" +# +# Note that the structure created by this script is slightly different from +# what a normal "make install" would produce. No extra "mysql" sub directory +# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or +# "$prefix/share/mysql". This is because the build system explicitly calls +# make with pkgdatadir=, etc. +# +# In GNU make/automake terms +# +# "pkglibdir" is set to the same as "libdir" +# "pkgincludedir" is set to the same as "includedir" +# "pkgdatadir" is set to the same as "datadir" +# "pkgplugindir" is set to "$pkglibdir/plugin" +# "pkgsuppdir" is set to "@prefix@/support-files", +# normally the same as "datadir" +# +# The temporary directory path given to "--tmp=" has to be +# absolute and with no spaces. +# +# Note that for best result, the original "make" should be done with +# the same arguments as used for "make install" below, especially the +# 'pkglibdir', as the RPATH should to be set correctly. +# +############################################################################## + +############################################################################## +# +# Read the command line arguments that control this script +# +############################################################################## machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ -version=@VERSION@ SOURCE=`pwd` CP="cp -p" MV="mv" -STRIP=1 -DEBUG=0 +STRIP=1 # Option ignored SILENT=0 -MACHINE="" PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER="" +NDBCLUSTER="" # Option ignored 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=;;"` ;; --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; @@ -54,53 +79,52 @@ for arg do esac done -# Remove vendor from $system -system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` - -# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) -system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` -system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` -system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` -system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` -system=`echo $system | sed -e 's/osf5.1b/tru64/g'` -system=`echo $system | sed -e 's/linux-gnu/linux/g'` -system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` -system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` - -if [ x"$MACHINE" != x"" ] ; then - machine=$MACHINE +# ---------------------------------------------------------------------- +# Adjust "system" output from "uname" to be more human readable +# ---------------------------------------------------------------------- + +if [ x"$PLATFORM" = x"" ] ; then + # FIXME move this to the build tools + # Remove vendor from $system + system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` + + # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) + system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` + system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` + system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` + system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` + system=`echo $system | sed -e 's/osf5.1b/tru64/g'` + system=`echo $system | sed -e 's/linux-gnu/linux/g'` + system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` + system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` + + PLATFORM="$system-$machine" fi -if [ x"$PLATFORM" != x"" ] ; then - platform="$PLATFORM" -else - platform="$system-$machine" -fi +# Print the platform name for build logs +echo "PLATFORM NAME: $PLATFORM" -# FIXME This should really be integrated with automake and not duplicate the -# installation list. +case $PLATFORM in + *netware*) BASE_SYSTEM="netware" ;; +esac -BASE=$TMP/my_dist$SUFFIX +# Change the distribution to a long descriptive name +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX +# ---------------------------------------------------------------------- +# Define BASE, and remove the old BASE directory if any +# ---------------------------------------------------------------------- +BASE=$TMP/my_dist$SUFFIX if [ -d $BASE ] ; then rm -rf $BASE fi -BS="" -BIN_FILES="" -BASE_SYSTEM="any" -MYSQL_SHARE=$BASE/share/mysql - -case $system in - *netware*) - BASE_SYSTEM="netware" - BS=".nlm" - MYSQL_SHARE=$BASE/share - ;; -esac +# ---------------------------------------------------------------------- +# Find the TAR to use +# ---------------------------------------------------------------------- # This is needed to prefer GNU tar over platform tar because that can't # always handle long filenames @@ -127,24 +151,149 @@ which_1 () } tar=`which_1 gnutar gtar` -if [ "$?" = "1" -o x"$tar" = x"" ] ; then +if [ $? -ne 0 -o x"$tar" = x"" ] ; then tar=tar fi +############################################################################## +# +# Handle the Unix/Linux packaging using "make install" +# +############################################################################## + +if [ x"$BASE_SYSTEM" != x"netware" ] ; then + + # ---------------------------------------------------------------------- + # Terminate on any base level error + # ---------------------------------------------------------------------- + set -e + + # ---------------------------------------------------------------------- + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", + # i.e. makes access relative the current directory. This matches + # the documentation, so better not change this. And for another script, + # "mysql.server", we make some relative, others not. + # ---------------------------------------------------------------------- + + cd scripts + rm -f mysql_install_db + @MAKE@ mysql_install_db \ + prefix=. \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=./share \ + localstatedir=./data + cd .. + + cd support-files + rm -f mysql.server + @MAKE@ mysql.server \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=@pkgdatadir@ + cd .. + + # ---------------------------------------------------------------------- + # Do a install that we later are to pack. Use the same paths as in + # the build for the relevant directories. + # ---------------------------------------------------------------------- + @MAKE@ DESTDIR=$BASE install \ + pkglibdir=@pkglibdir@ \ + pkgincludedir=@pkgincludedir@ \ + pkgdatadir=@pkgdatadir@ \ + pkgplugindir=@pkgplugindir@ \ + pkgsuppdir=@pkgsuppdir@ \ + mandir=@mandir@ \ + infodir=@infodir@ + + # ---------------------------------------------------------------------- + # Rename top directory, and set DEST to the new directory + # ---------------------------------------------------------------------- + mv $BASE@prefix@ $BASE/$NEW_NAME + DEST=$BASE/$NEW_NAME + + # ---------------------------------------------------------------------- + # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a + # ---------------------------------------------------------------------- + if [ x"@GXX@" = x"yes" ] ; then + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true + if [ -z "$gcclib" ] ; then + echo "Warning: Compiler doesn't tell libgcc.a!" + elif [ -f "$gcclib" ] ; then + $CP $gcclib $DEST/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" + fi + fi + + # FIXME let this script be in "bin/", where it is in the RPMs? + # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html + mkdir $DEST/scripts + mv $DEST/bin/mysql_install_db $DEST/scripts/ + + # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 + + # Copy readme and license files + cp README Docs/INSTALL-BINARY $DEST/ + if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then + cp COPYING EXCEPTIONS-CLIENT $DEST/ + elif [ -f LICENSE.mysql ] ; then + cp LICENSE.mysql $DEST/ + else + echo "ERROR: no license files found" + exit 1 + fi + + # FIXME should be handled by make file, and to other dir + mkdir -p $DEST/bin $DEST/support-files + cp scripts/mysqlaccess.conf $DEST/bin/ + cp support-files/magic $DEST/support-files/ + + # Create empty data directories, set permission (FIXME why?) + mkdir $DEST/data $DEST/data/mysql $DEST/data/test + chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test + + # ---------------------------------------------------------------------- + # Create the result tar file + # ---------------------------------------------------------------------- + + echo "Using $tar to create archive" + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + echo "Creating and compressing archive" + rm -f $NEW_NAME.tar.gz + (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz + echo "$NEW_NAME.tar.gz created" + + echo "Removing temporary directory" + rm -rf $BASE + exit 0 +fi + + +############################################################################## +# +# Handle the Netware case, until integrated above +# +############################################################################## + +BS=".nlm" +MYSQL_SHARE=$BASE/share + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ $BASE/mysql-test/suite -if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test - - chmod o-rwx $BASE/data $BASE/data/* -fi - # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name # twice, once in the directory location where it is built, and a @@ -176,12 +325,13 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqlslap$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ client/mysqlbinlog$BS client/mysql_upgrade$BS \ @@ -191,42 +341,16 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ "; # Platform-specific bin dir files: -if [ $BASE_SYSTEM = "netware" ] ; then - BIN_FILES="$BIN_FILES \ +BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/init_db.sql netware/test_db.sql \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; -# For all other platforms: -else - BIN_FILES="$BIN_FILES \ - server-tools/instance-manager/.libs/mysqlmanager \ - client/mysqltestmanagerc \ - client/mysqltestmanager-pwgen tools/mysqltestmanager \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ - client/.libs/mysqltestmanager-pwgen tools/.libs/mysqltestmanager \ - tests/.libs/mysql_client_test \ - libmysqld/examples/.libs/mysql_client_test_embedded \ - libmysqld/examples/.libs/mysqltest_embedded \ - "; -fi copyfileto $BASE/bin $BIN_FILES -if [ x$STRIP = x1 ] ; then - strip $BASE/bin/* -fi - -# Copy not binary files -copyfileto $BASE/bin sql/mysqld.sym.gz - -if [ $BASE_SYSTEM = "netware" ] ; then - $CP netware/*.pl $BASE/scripts - $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl -fi +$CP netware/*.pl $BASE/scripts +$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a \ @@ -248,31 +372,17 @@ copyfileto $BASE/lib \ zlib/.libs/libz.a # convert the .a to .lib for NetWare -if [ $BASE_SYSTEM = "netware" ] ; then - for i in $BASE/lib/*.a - do - libname=`basename $i .a` - $MV $i $BASE/lib/$libname.lib - done - rm -f $BASE/lib/*.la -fi +for i in $BASE/lib/*.a +do + libname=`basename $i .a` + $MV $i $BASE/lib/$libname.lib +done +rm -f $BASE/lib/*.la -copyfileto $BASE/include include/* -rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h -if [ $BASE_SYSTEM != "netware" ] ; then - rm -f $BASE/include/config-netware.h -fi +copyfileto $BASE/include config.h include/* -if [ $BASE_SYSTEM != "netware" ] ; then - if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests - fi - if [ -d man ] ; then - $CP man/*.1 $BASE/man/man1 - $CP man/*.8 $BASE/man/man8 - fi -fi +rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h copyfileto $BASE/support-files support-files/* @@ -291,43 +401,29 @@ copyfileto $BASE/mysql-test \ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.sql $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ + mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/Index.xml \ + mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ + $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -# Copy the additional suites and data "as is", they are in flux -$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) -$tar cf - mysql-test/std_data | ( cd $BASE ; $tar xf - ) +# Copy the additional suites "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) # Clean up if we did this from a bk tree if [ -d mysql-test/SCCS ] ; then find $BASE/mysql-test -name SCCS -print | xargs rm -rf fi -if [ $BASE_SYSTEM != "netware" ] ; then - chmod a+x $BASE/bin/* - copyfileto $BASE/bin scripts/* - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ - ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./share \ - < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ - \@sbindir\@ ./bin \@libexecdir\@ ./bin \ - \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ - \@HOSTNAME\@ @HOSTNAME@ \ - < support-files/mysql.server.sh > $BASE/support-files/mysql.server - $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe - mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-log-rotate \ - $BASE/support-files/*.server $BASE/configure - $CP -r sql-bench/* $BASE/sql-bench - rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la - rm -f $BASE/bin/*.sql -fi - rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ @@ -336,29 +432,19 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # # Copy system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql -fi +./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql # # Remove system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/support-files/magic \ +rm -f $BASE/support-files/magic \ $BASE/support-files/mysql.server \ $BASE/support-files/mysql*.spec \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ $BASE/support-files/MySQL-shared-compat.spec \ - $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY -fi - -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then @@ -366,78 +452,17 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi -# NDB Cluster -if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. - $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. - $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include - $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 - rm -rf $BASE/ndb-stage -fi - -# Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX - -# Print the platform name for build logs -echo "PLATFORM NAME: $platform" - BASE2=$TMP/$NEW_NAME rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 + # -# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a +# Create a zip file for NetWare users # - -if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true - if [ -z "$gcclib" ] ; then - echo "Warning: Compiler doesn't tell libgcc.a!" - elif [ -f "$gcclib" ] ; then - $CP $gcclib $BASE/lib/libmygcc.a - else - echo "Warning: Compiler result '$gcclib' not found / no file!" - fi -fi - -#if we are debugging, do not do tar/gz -if [ x$DEBUG = x1 ] ; then - exit -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - - # - # Create the result tar file - # - - echo "Using $tar to create archive" - - OPT=cvf - if [ x$SILENT = x1 ] ; then - OPT=cf - fi - - echo "Creating and compressing archive" - rm -f $NEW_NAME.tar.gz - (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz - echo "$NEW_NAME.tar.gz created" - -else - - # - # Create a zip file for NetWare users - # - - rm -f $NEW_NAME.zip - (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) - echo "$NEW_NAME.zip created" - -fi +rm -f $NEW_NAME.zip +(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) +echo "$NEW_NAME.zip created" echo "Removing temporary directory" rm -rf $BASE -- cgit v1.2.1 From 07268a15a1eccbc84c4a8d2fb96c29b24f805bfd Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 27 Jun 2008 19:12:42 +0200 Subject: OS X 10.5 is now a supported platform, so Apple's internal name ("darwin9") must be translated to ours ("osx10.5"). --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 50cff8578c9..af3db86af81 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -61,6 +61,7 @@ system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` +system=`echo $system | sed -e 's/darwin9.*/osx10.5/g'` system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` -- cgit v1.2.1 From 7423d499ededdf760fff7291a773ba86bc393e6d Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Mon, 7 Jul 2008 18:56:53 -0400 Subject: Bug#34129: mysqldumpslow does not aggregate times Query times were changed to contain subsecond information after a decimal. Change the capturing regex to account for decimal also. --- scripts/mysqldumpslow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index f05761bb837..2d59b470331 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -83,7 +83,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//; my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('',''); - s/^# Query_time: (\d+) Lock_time: (\d+) Rows_sent: (\d+).*\n//; + s/^# Query_time: ([0-9.]+) Lock_time: ([0-9.]+) Rows_sent: ([0-9.]+).*\n//; my ($t, $l, $r) = ($1, $2, $3); $t -= $l unless $opt{l}; -- cgit v1.2.1 From a0768d32c24b2548a47dbd99aa00d53c5019220d Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 31 Jul 2008 12:28:04 +0300 Subject: Bug#34159: mysql_install_db fails with sql_mode=TRADITIONAL Reset session sql_mode before creating system tables as it is done in the mysql_fix_privilege_tables.sql script. --- scripts/mysql_system_tables.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index d9c870f1d73..31eb205eed0 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -2,6 +2,7 @@ -- The system tables of MySQL Server -- +set sql_mode=''; set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; -- cgit v1.2.1 From ff3d230a03a69330d30ccbb43ce8550cdd6536d4 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 25 Aug 2008 21:07:41 +0200 Subject: Bug#37098 Get rid of "Installed (but unpackaged)" files in the RPM build Mostly, this affected files (programs, scripts, and manual pages) which got built during a RPM build but were not listed in the appropriate "%files" section of the "spec" file. This is fixed now, they are added. To make this consistent, this patch also makes the build of "innochecksum" (and its inclusion in a tar.gz or other package) depend on whether InnoDB is configured in the build. Also, some tools to create Windows packages are irrelevant in any binary Unix package (not the sources !), and so they are deleted before packaging. --- scripts/make_binary_distribution.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index af3db86af81..e5e08038bff 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -272,6 +272,8 @@ if [ $BASE_SYSTEM != "netware" ] ; then if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 $CP man/*.8 $BASE/man/man8 + # In a Unix binary package, these tools and their manuals are not useful + rm -f $BASE/man/man1/make_win_* fi fi @@ -331,6 +333,7 @@ fi rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ + $BASE/bin/make_win_* \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ $BASE/support-files/*.sh -- cgit v1.2.1 From 447fa91d8367e5044741edd7002838968b4bec72 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Tue, 2 Sep 2008 10:53:30 +0200 Subject: Bug#31315 mysql_install_db fails if a default table type of NDB is set in my.cnf - Use myisam as default storage engine when running mysqld in --bootstrap mode --- scripts/mysql_install_db.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 4e5ca7305f8..5a2409eeb6f 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -339,6 +339,7 @@ mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ + --default-storage-engine=myisam \ --net_buffer_length=16K" # Create the system and help tables by passing them to "mysqld --bootstrap" -- cgit v1.2.1 From bf996620cd79de204db22526d874df1425a3d7c0 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Wed, 24 Sep 2008 08:59:56 -0400 Subject: Bug#35754: mysql_install_db does not work if no hostname is set Machines with hostname set to "localhost" cause uniqueness errors in the SQL bootstrap data. Now, insert zero lines for cases where the (lowercased) hostname is the same as an already-inserted 'localhost' name. Also, fix a few tests that expect certain local accounts to have a certain host name. --- scripts/mysql_system_tables_data.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index ce23953a1a5..b70a8a13f6e 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -21,9 +21,9 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES (@current_hostname,''); +INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; -- cgit v1.2.1 From 628a7dd2bcc73b6c06510b1efb46c0662996f696 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Tue, 14 Oct 2008 15:52:52 -0400 Subject: In mysqldumpslow, consume arbitrary whitespace in the Query_time line. --- scripts/mysqldumpslow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 2d59b470331..60d972e1c8b 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -83,7 +83,7 @@ while ( defined($_ = shift @pending) or defined($_ = <>) ) { s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//; my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('',''); - s/^# Query_time: ([0-9.]+) Lock_time: ([0-9.]+) Rows_sent: ([0-9.]+).*\n//; + s/^# Query_time: ([0-9.]+)\s+Lock_time: ([0-9.]+)\s+Rows_sent: ([0-9.]+).*\n//; my ($t, $l, $r) = ($1, $2, $3); $t -= $l unless $opt{l}; -- cgit v1.2.1 From 8a774dcc68cc3db9f651a21e75ac87732aafc23b Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Mon, 10 Nov 2008 22:12:15 +0100 Subject: Bug#34025: mysql_config is not returning -ldl lib flag needed when using embedded server mysql_config did not output -ldl (or equivalent) when needed for --libmysqld-libs, so its output could be insufficient to build an application using the embedded server. LIBDL was already set in configure; it's now propagated all the way into the relevant mysql_config scripts. --- scripts/Makefile.am | 1 + scripts/mysql_config.pl.in | 2 +- scripts/mysql_config.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index ac43bb7b0a4..0292617c7a5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -162,6 +162,7 @@ SUFFIXES = .sh -e 's!@''CFLAGS''@!@CFLAGS@!'\ -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@LDFLAGS@!'\ + -e 's!@''LIBDL''@!@LIBDL@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in index 3ae8baf7db0..21896711fa8 100644 --- a/scripts/mysql_config.pl.in +++ b/scripts/mysql_config.pl.in @@ -202,7 +202,7 @@ $flags->{libs} = $flags->{libs_r} = [@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@']; $flags->{embedded_libs} = - [@ldflags,@lib_e_opts,'@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@']; + [@ldflags,@lib_e_opts,'@LIBDL@','@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@']; $flags->{include} = ["-I$pkgincludedir"]; $flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')]; diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index c16d9bb62e5..efc82544bc0 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -107,7 +107,7 @@ fi libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " +embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " if [ -r "$pkglibdir/libmygcc.a" ]; then # When linking against the static library with a different version of GCC -- cgit v1.2.1 From 0e44a4e94c0ddf2572384ed5daf3e5dc2c37a4e7 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Wed, 26 Nov 2008 10:51:59 -0500 Subject: Bug#32136: mysqld_multi --defaults-file not respected while using \ --mysqld=mysqld_safe The server run didn't know the correct section to read in a configuration file, and would read from "[mysqld]" even though mysqld_multi had already read the defaults and made them into explicit parameters. Worse, the "defaults-file" parameter says that it means "Read only this configuration file, do not read the standard system-wide and user-specific files", which should apply not only to mysql-multi, but to the server also. So, now if "defaults-file" is given, put "no-defaults" before all the explicit parameters we read from the defaults-file and feed to the mysqld or mysqld_safe. --- scripts/mysqld_multi.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 3cb4665eb1c..631e1e38cc7 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -293,7 +293,12 @@ sub start_mysqlds() @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { + # Defaults are made explicit parameters to server execution... @options = defaults_for_group($groups[$i]); + # ...so server MUST NOT try to read again from some config file, especially + # as the "right" file may be unknown to the server if we are using + # --defaults-file=... params in here. + unshift(@options,"--no-defaults"); $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); -- cgit v1.2.1 From 16a024c486f75b9eadc046511f48a23e566e9c4b Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Sat, 20 Dec 2008 11:01:41 +0100 Subject: Backport of DTrace patches from 6.0 --- scripts/Makefile.am | 10 +- scripts/dheadgen.pl | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 344 insertions(+), 4 deletions(-) create mode 100644 scripts/dheadgen.pl (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index ac43bb7b0a4..6c552d96bc9 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -37,7 +37,8 @@ bin_SCRIPTS = @server_scripts@ \ mysqld_multi noinst_SCRIPTS = make_binary_distribution \ - make_sharedlib_distribution + make_sharedlib_distribution \ + dheadgen.pl EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ @@ -59,7 +60,8 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ mysqld_multi.sh \ - mysqld_safe.sh + mysqld_safe.sh \ + dheadgen.pl EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ @@ -110,7 +112,7 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ mysql_system_tables_fix.sql @echo "Building $@"; - @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ + @cat $(srcdir)/mysql_system_tables.sql $(srcdir)/mysql_system_tables_fix.sql > $@ # # Build mysql_fix_privilege_tables_sql.c from @@ -123,7 +125,7 @@ mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql sleep 2 $(top_builddir)/scripts/comp_sql$(EXEEXT) \ mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ + $(top_builddir)/scripts/mysql_fix_privilege_tables.sql $@ SUFFIXES = .sh diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl new file mode 100644 index 00000000000..5ead0f90a31 --- /dev/null +++ b/scripts/dheadgen.pl @@ -0,0 +1,338 @@ +#!/usr/bin/perl -w + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of the above-listed copyright holders nor the names +# of its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ident "@(#)dheadgen.pl 1.4 07/06/24 SMI" + +# +# DTrace Header Generator +# ----------------------- +# +# This script is meant to mimic the output of dtrace(1M) with the -h +# (headergen) flag on system that lack native support for DTrace. This script +# is intended to be integrated into projects that use DTrace's static tracing +# facilities (USDT), and invoked as part of the build process to have a +# common build process on all target systems. To facilitate this, this script +# is licensed under a BSD license. On system with native DTrace support, the +# dtrace(1M) command will be invoked to create the full header file; on other +# systems, this script will generated a stub header file. +# +# Normally, generated macros take the form PROVIDER_PROBENAME(). It may be +# desirable to customize the output of this script and of dtrace(1M) to +# tailor the precise macro name. To do this, edit the emit_dtrace() subroutine +# to pattern match for the lines you want to customize. +# + +use strict; + +my @lines; +my @tokens = (); +my $lineno = 0; +my $newline = 1; +my $eof = 0; +my $infile; +my $outfile; +my $force = 0; + +sub emit_dtrace { + my ($line) = @_; + + # + # Insert customization here. For example, if you want to change the + # name of the macros you may do something like this: + # + # $line =~ s/(\s)[A-Z]+_/\1TRACE_MOZILLA_/; + # + + print $line; +} + +# +# The remaining code deals with parsing D provider definitions and emitting +# the stub header file. There should be no need to edit this absent a bug. +# + +# +# Emit the two relevant macros for each probe in the given provider: +# PROVIDER_PROBENAME() +# PROVIDER_PROBENAME_ENABLED() (0) +# +sub emit_provider { + my ($provname, @probes) = @_; + + $provname = uc($provname); + + foreach my $probe (@probes) { + my $probename = uc($$probe{'name'}); + my $argc = $$probe{'argc'}; + my $line; + + $probename =~ s/__/_/g; + + $line = "#define\t${provname}_${probename}("; + for (my $i = 0; $i < $argc; $i++) { + $line .= ($i == 0 ? '' : ', '); + $line .= "arg$i"; + } + $line .= ")\n"; + emit_dtrace($line); + + $line = "#define\t${provname}_${probename}_ENABLED() (0)\n"; + emit_dtrace($line); + } + + emit_dtrace("\n"); +} + +sub emit_prologue { + my ($filename) = @_; + + $filename =~ s/.*\///g; + $filename = uc($filename); + $filename =~ s/\./_/g; + + emit_dtrace <<"EOF"; +/* + * Generated by dheadgen(1). + */ + +#ifndef\t_${filename} +#define\t_${filename} + +#ifdef\t__cplusplus +extern "C" { +#endif + +EOF +} + +sub emit_epilogue { + my ($filename) = @_; + + $filename =~ s/.*\///g; + $filename = uc($filename); + $filename =~ s/\./_/g; + + emit_dtrace <<"EOF"; +#ifdef __cplusplus +} +#endif + +#endif /* _$filename */ +EOF +} + +# +# Get the next token from the file keeping track of the line number. +# +sub get_token { + my ($eof_ok) = @_; + my $tok; + + while (1) { + while (scalar(@tokens) == 0) { + if (scalar(@lines) == 0) { + $eof = 1; + return if ($eof_ok); + die "expected more data at line $lineno"; + } + + $lineno++; + push(@tokens, split(/(\s+|\n|[(){},#;]|\/\*|\*\/)/, + shift(@lines))); + } + + $tok = shift(@tokens); + next if ($tok eq ''); + next if ($tok =~ /^[ \t]+$/); + + return ($tok); + } +} + +# +# Ignore newlines, comments and typedefs +# +sub next_token { + my ($eof_ok) = @_; + my $tok; + + while (1) { + $tok = get_token($eof_ok); + return if ($eof_ok && $eof); + if ($tok eq "typedef" or $tok =~ /^#/) { + while (1) { + $tok = get_token(0); + last if ($tok eq "\n"); + } + next; + } elsif ($tok eq '/*') { + while (get_token(0) ne '*/') { + next; + } + next; + } elsif ($tok eq "\n") { + next; + } + + last; + } + + return ($tok); +} + +sub expect_token { + my ($t) = @_; + my $tok; + + while (($tok = next_token(0)) eq "\n") { + next; + } + + die "expected '$t' at line $lineno rather than '$tok'" if ($t ne $tok); +} + +sub get_args { + expect_token('('); + + my $tok = next_token(0); + my @args = (); + + return (@args) if ($tok eq ')'); + + if ($tok eq 'void') { + expect_token(')'); + return (@args); + } + + my $arg = $tok; + + while (1) { + $tok = next_token(0); + if ($tok eq ',' || $tok eq ')') { + push(@args, $arg); + $arg = ''; + last if ($tok eq ')'); + } else { + $arg = "$arg $tok"; + } + } + + return (@args); +} + +sub usage { + die "usage: $0 [-f] \n"; +} + +usage() if (scalar(@ARGV) < 1); +if ($ARGV[0] eq '-f') { + usage() if (scalar(@ARGV < 2)); + $force = 1; + shift; +} +$infile = $ARGV[0]; +usage() if ($infile !~ /(.+)\.d$/); + +# +# If the system has native support for DTrace, we'll use that binary instead. +# +if (-x '/usr/sbin/dtrace' && !$force) { + open(my $dt, '-|', "/usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") + or die "can't invoke dtrace(1M)"; + + while (<$dt>) { + emit_dtrace($_); + } + + close($dt); + + exit(0); +} + +emit_prologue($infile); + +open(my $d, '<', $infile) or die "couldn't open $infile"; +@lines = <$d>; +close($d); + +while (1) { + my $nl = 0; + my $tok = next_token(1); + last if $eof; + + if ($newline && $tok eq '#') { + while (1) { + $tok = get_token(0); + + last if ($tok eq "\n"); + } + $nl = 1; + } elsif ($tok eq "\n") { + $nl = 1; + } elsif ($tok eq 'provider') { + my $provname = next_token(0); + my @probes = (); + expect_token('{'); + + while (1) { + $tok = next_token(0); + if ($tok eq 'probe') { + my $probename = next_token(0); + my @args = get_args(); + + next while (next_token(0) ne ';'); + + push(@probes, { + 'name' => $probename, + 'argc' => scalar(@args) + }); + + } elsif ($tok eq '}') { + expect_token(';'); + + emit_provider($provname, @probes); + + last; + } + } + + } else { + die "syntax error at line $lineno near '$tok'\n"; + } + + $newline = $nl; +} + +emit_epilogue($infile); + +exit(0); -- cgit v1.2.1 From ba359419b7188894b5cee22d205d536ce023b9c8 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Sat, 20 Dec 2008 17:34:32 +0100 Subject: Remove instance manager also from Windows distribution builds --- scripts/make_binary_distribution.sh | 1 - scripts/make_win_bin_dist | 2 -- 2 files changed, 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 339b2a4c219..8b191cf2cf4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -330,7 +330,6 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ - server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqlslap$BS \ client/mysqldump$BS client/mysqlimport$BS \ diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 5eb5a5643f1..7419083f262 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -146,9 +146,7 @@ mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ -cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ if [ x"$TARGET" != x"release" ] ; then - cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ cp client/$TARGET/mysql.pdb $DESTDIR/bin/ cp client/$TARGET/mysqladmin.pdb $DESTDIR/bin/ cp client/$TARGET/mysqlbinlog.pdb $DESTDIR/bin/ -- cgit v1.2.1 From 8f40756168b38fe39c0fc06611144eaa3dfc44fd Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 23 Dec 2008 12:05:30 +0300 Subject: Fixed DTrace-related build failures. --- scripts/dheadgen.pl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/dheadgen.pl (limited to 'scripts') diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl old mode 100644 new mode 100755 -- cgit v1.2.1 From 240baba269f4abf6e472cd0170ca09acb8d0ff08 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 6 Jan 2009 15:08:15 +0000 Subject: bug#41828: mysql_install_db misses mysqld options when using --basedir * pass --languages to mysqld when using --basedir * improve error messages when unable to find files in basedir --- scripts/mysql_install_db.sh | 51 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 5a2409eeb6f..20b7973cb4e 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -21,6 +21,7 @@ basedir="" builddir="" ldata="@localstatedir@" +langdir="" srcdir="" args="" @@ -106,7 +107,7 @@ parse_arguments() # Note that the user will be passed to mysqld so that it runs # as 'user' (crucial e.g. if log-bin=/some_other_path/ # where a chown of datadir won't help) - user=`parse_arg "$arg"` ;; + user=`parse_arg "$arg"` ;; --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ;; # Obsolete --rpm) in_rpm=1 ;; @@ -171,7 +172,20 @@ find_in_basedir() cannot_find_file() { echo - echo "FATAL ERROR: Could not find $*" + echo "FATAL ERROR: Could not find $1" + + shift + if test $# -ne 0 + then + echo + echo "The following directories were searched:" + echo + for dir in "$@" + do + echo " $dir" + done + fi + echo echo "If you compiled from source, you need to run 'make install' to" echo "copy the software into the correct location ready for operation." @@ -210,6 +224,11 @@ then elif test -n "$basedir" then print_defaults=`find_in_basedir my_print_defaults bin extra` + if test -z "$print_defaults" + then + cannot_find_file my_print_defaults $basedir/bin $basedir/extra + exit 1 + fi else print_defaults="@bindir@/my_print_defaults" fi @@ -232,7 +251,7 @@ then bindir="$basedir/client" extra_bindir="$basedir/extra" mysqld="$basedir/sql/mysqld" - mysqld_opt="--language=$srcdir/sql/share/english" + langdir="$srcdir/sql/share/english" pkgdatadir="$srcdir/scripts" scriptdir="$srcdir/scripts" elif test -n "$basedir" @@ -240,7 +259,23 @@ then bindir="$basedir/bin" extra_bindir="$bindir" mysqld=`find_in_basedir mysqld libexec sbin bin` + if test -z "$mysqld" + then + cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin + exit 1 + fi + langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english` + if test -z "$langdir" + then + cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english + exit 1 + fi pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` + if test -z "$pkgdatadir" + then + cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql + exit 1 + fi scriptdir="$basedir/scripts" else basedir="@prefix@" @@ -271,6 +306,16 @@ then exit 1 fi +if test -n "$langdir" +then + if test ! -f "$langdir/errmsg.sys" + then + cannot_find_file "$langdir/errmsg.sys" + exit 1 + fi + mysqld_opt="--language=$langdir" +fi + # Try to determine the hostname hostname=`@HOSTNAME@` -- cgit v1.2.1 From 951d045231bbc435cb4fea544e71535612f5b83f Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 15 Jan 2009 20:09:58 +0100 Subject: Added option "--short-product-tag=" to "make_binary_distribution.sh", to enable product name and server suffix to differ. --- scripts/make_binary_distribution.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 339b2a4c219..0c4a6e2a717 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -60,13 +60,16 @@ STRIP=1 # Option ignored SILENT=0 PLATFORM="" TMP=/tmp +NEW_NAME="" # Final top directory and TAR package name SUFFIX="" +SHORT_PRODUCT_TAG="" # If don't want server suffix in package name NDBCLUSTER="" # Option ignored for arg do case "$arg" in --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; + --short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;; --no-strip) STRIP=0 ;; --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; @@ -113,7 +116,11 @@ case $PLATFORM in esac # Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX +if [ x"$SHORT_PRODUCT_TAG = x"" ] ; then + NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX +else + NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX +fi # ---------------------------------------------------------------------- # Define BASE, and remove the old BASE directory if any -- cgit v1.2.1 From 4915050033dfb2c88907d904ab4f049b7f982e6e Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Sat, 17 Jan 2009 09:29:40 +0100 Subject: Fixed typo --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 0c4a6e2a717..c5f1813aaf7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -116,7 +116,7 @@ case $PLATFORM in esac # Change the distribution to a long descriptive name -if [ x"$SHORT_PRODUCT_TAG = x"" ] ; then +if [ x"$SHORT_PRODUCT_TAG" = x"" ] ; then NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX else NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX -- cgit v1.2.1 From 47844077fd488d45089ed3736f66cfd324c8af87 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Mon, 19 Jan 2009 17:48:05 +0100 Subject: Incorrect test if "--short-product-tag=" was given or not --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c5f1813aaf7..ee7c36b097d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -116,7 +116,7 @@ case $PLATFORM in esac # Change the distribution to a long descriptive name -if [ x"$SHORT_PRODUCT_TAG" = x"" ] ; then +if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX else NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX -- cgit v1.2.1 From 63c4888cf939c63b6234bba01835fbc661208af7 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Fri, 23 Jan 2009 02:59:03 +0100 Subject: From 5.0.48 the NDB client libraries has been missing in the cluster packages, this is now corrected (Bug#42278) --- scripts/make_binary_distribution.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e5e08038bff..f156ea3b986 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -372,8 +372,8 @@ fi # NDB Cluster if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) + ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install pkglibdir=@pkglibdir@ ) + ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install pkglibdir=@pkglibdir@ ) $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. -- cgit v1.2.1 From a3ad5089cb62c6c4d4f1866a87a0ae333d8c638e Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Mon, 16 Feb 2009 15:38:18 +0100 Subject: Bug#42027: Incorrect parsing of debug and verbose options for mysqldumpslow Options got normalised to long rather than short options since we gave primary name and alias in wrong order. Consequently querying for the option using the short options (the correct primary name) didn't work, rendering the options in question inaccessible. We restore the right order of the universe, or at least the alii for --debug and --verbose. --- scripts/mysqldumpslow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index f05761bb837..009745fd896 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -17,9 +17,9 @@ my %opt = ( ); GetOptions(\%opt, - 'verbose|v+',# verbose + 'v|verbose+',# verbose 'help+', # write usage info - 'debug|d+', # debug + 'd|debug+', # debug 's=s', # what to sort by (t, at, l, al, r, ar etc) 'r!', # reverse the sort order (largest last instead of first) 't=i', # just show the top n queries -- cgit v1.2.1 From c5bb49d020066c2805efc52507e904d8342ed0a7 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 11 Mar 2009 17:30:56 -0300 Subject: Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large server_id The problem is that creating a event could fail if the value of the variable server_id didn't fit in the originator column of the event system table. The cause is two-fold: it was possible to set server_id to a value outside the documented range (from 0 to 2^32-1) and the originator column of the event table didn't have enough room for values in this range. The log tables (general_log and slow_log) also don't have a proper column type to store the server_id and having a large server_id value could prevent queries from being logged. The solution is to ensure that all system tables that store the server_id value have a proper column type (int unsigned) and that the variable can't be set to a value that is not within the range. --- scripts/mysql_system_tables.sql | 6 +++--- scripts/mysql_system_tables_fix.sql | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index fdab9601129..67e18517915 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -74,13 +74,13 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator int(10) NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a33c4fcb9fa..a6497f57f0a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -215,6 +215,20 @@ ALTER TABLE func ALTER TABLE func MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; +# +# Modify log tables. +# + +SET @old_log_state = @@global.general_log; +SET GLOBAL general_log = 'OFF'; +ALTER TABLE general_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; +SET GLOBAL general_log = @old_log_state; + +SET @old_log_state = @@global.slow_query_log; +SET GLOBAL slow_query_log = 'OFF'; +ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; +SET GLOBAL slow_query_log = @old_log_state; + # # Detect whether we had Create_view_priv # @@ -471,7 +485,10 @@ ALTER TABLE event MODIFY sql_mode 'PAD_CHAR_TO_FULL_LENGTH' ) DEFAULT '' NOT NULL AFTER on_completion; ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default ''; -ALTER TABLE event ADD COLUMN originator INT(10) NOT NULL AFTER comment; + +ALTER TABLE event MODIFY COLUMN originator INT UNSIGNED NOT NULL; +ALTER TABLE event ADD COLUMN originator INT UNSIGNED NOT NULL AFTER comment; + ALTER TABLE event MODIFY COLUMN status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED'; ALTER TABLE event ADD COLUMN time_zone char(64) CHARACTER SET latin1 -- cgit v1.2.1 From e53a81335266c30604db7e30d638db57d17457b3 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Mon, 16 Mar 2009 14:54:28 -0400 Subject: Bug#39326: mysqld_safe doesn't use --basedir value in search of \ my_print_defaults Now use basedir to set an unset ledir and to find the location of my_print_defaults . --- scripts/mysqld_safe.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5e7a177a546..502c981c72a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -212,15 +212,26 @@ fi MY_PWD=`pwd` # Check for the directories we would expect from a binary release install -if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/mysqld +if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION" then - MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are - ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + # BASEDIR is already overridden on command line. Do not re-set. + + # Use BASEDIR to discover le. + if test -x "$MY_BASEDIR_VERSION/libexec/mysqld" + then + ledir="$MY_BASEDIR_VERSION/libexec" + else + ledir="$MY_BASEDIR_VERSION/bin" + fi +elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/bin/mysqld" +then + MY_BASEDIR_VERSION="$MY_PWD" # Where bin, share and data are + ledir="$MY_PWD/bin" # Where mysqld is # Check for the directories we would expect from a source install -elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/mysqld +elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld" then - MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is + MY_BASEDIR_VERSION="$MY_PWD" # Where libexec, share and var are + ledir="$MY_PWD/libexec" # Where mysqld is # Since we didn't find anything, used the compiled-in defaults else MY_BASEDIR_VERSION=@prefix@ @@ -274,7 +285,10 @@ export MYSQL_HOME # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments -if test -x ./bin/my_print_defaults +if test -x "$MY_BASEDIR_VERSION/bin/my_print_defaults" +then + print_defaults="$MY_BASEDIR_VERSION/bin/my_print_defaults" +elif test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" elif test -x @bindir@/my_print_defaults -- cgit v1.2.1 From e7ed43065afc0c40a0c6dfcf98710e05c6645128 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Mon, 16 Mar 2009 15:28:06 -0400 Subject: Fix several quoting problems, and clean up IFS on failure in my_which(). --- scripts/mysqld_safe.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 502c981c72a..960c3e39bab 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -18,7 +18,7 @@ niceness=0 logging=init want_syslog=0 syslog_tag= -user=@MYSQLD_USER@ +user='@MYSQLD_USER@' pid_file= err_log= @@ -64,9 +64,10 @@ my_which () { save_ifs="${IFS-UNSET}" IFS=: + ret=0 for file do - for dir in $PATH + for dir in "$PATH" do if [ -f "$dir/$file" ] then @@ -74,15 +75,18 @@ my_which () continue 2 fi done - return 1 # Failure, didn't find file in path + + ret=1 #signal an error + break done + if [ "$save_ifs" = UNSET ] then unset IFS else IFS="$save_ifs" fi - return 0 # Success + return $ret # Success } log_generic () { @@ -234,8 +238,8 @@ then ledir="$MY_PWD/libexec" # Where mysqld is # Since we didn't find anything, used the compiled-in defaults else - MY_BASEDIR_VERSION=@prefix@ - ledir=@libexecdir@ + MY_BASEDIR_VERSION='@prefix@' + ledir='@libexecdir@' fi @@ -413,7 +417,7 @@ then MYSQLD=mysqld fi -if test ! -x $ledir/$MYSQLD +if test ! -x "$ledir/$MYSQLD" then log_error "The file $ledir/$MYSQLD does not exist or is not executable. Please cd to the mysql installation @@ -425,7 +429,7 @@ fi if test -z "$pid_file" then - pid_file=$DATADIR/`@HOSTNAME@`.pid + pid_file="$DATADIR/`@HOSTNAME@`.pid" else case "$pid_file" in /* ) ;; -- cgit v1.2.1 From cf208ac55a30ed176bbff9b0199db88f9519ae69 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Tue, 31 Mar 2009 12:59:22 +0200 Subject: Bug #39852 bug in mysql_setpermission mysql_setpermission is modified to honor the $db variable as suggested when doing a REVOKE ALL for menu option 7. --- scripts/mysql_setpermission.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 1f5509f9955..b1ea26a9b7d 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -257,7 +257,7 @@ sub addall { $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 7) { # all privileges set to N - $sth = $dbh->do("REVOKE ALL ON *.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; + $sth = $dbh->do("REVOKE ALL ON $db.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; } } $dbh->do("FLUSH PRIVILEGES") || print STDERR "Can't flush privileges\n"; -- cgit v1.2.1 From 9c9be50fe45e31a26e052abf918ac4294263e55d Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 31 Mar 2009 17:31:17 +0200 Subject: Handle the two part version number of cluster builds (general server part + NDB part) automatically when creating a binary package, include only the NDBpart in the package (file) name. --- scripts/make_binary_distribution.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ee7c36b097d..152225f86b1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -116,10 +116,15 @@ case $PLATFORM in esac # Change the distribution to a long descriptive name +# For the cluster product, concentrate on the second part +VERSION_NAME=@VERSION@ +case $VERSION_NAME in + *-ndb-* ) VERSION_NAME=`echo $VERSION_NAME | sed -e 's/[.0-9]*-ndb-//'` ;; +esac if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then - NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX + NEW_NAME=mysql-$SHORT_PRODUCT_TAG-$VERSION_NAME-$PLATFORM$SUFFIX else - NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX + NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$VERSION_NAME-$PLATFORM$SUFFIX fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From 668d988c71a7980b3f131feb51c24427cfd78082 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Thu, 2 Apr 2009 11:29:28 -0400 Subject: Bug#43876: mysqld_multi introduces --no-defaults which screws up my system Bug#32136: mysqld_multi --defaults-file not respected while using \ --mysqld=mysqld_safe Revert change that adds "--no-defaults" to mysqld_multi. This closes Bug#43508 and re-opens Bug#32136. --- scripts/mysqld_multi.sh | 5 ----- 1 file changed, 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 631e1e38cc7..3cb4665eb1c 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -293,12 +293,7 @@ sub start_mysqlds() @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - # Defaults are made explicit parameters to server execution... @options = defaults_for_group($groups[$i]); - # ...so server MUST NOT try to read again from some config file, especially - # as the "right" file may be unknown to the server if we are using - # --defaults-file=... params in here. - unshift(@options,"--no-defaults"); $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); -- cgit v1.2.1 From 452eeec08404e1ce6daf001d89f27a6a8fc0e248 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 14 Apr 2009 21:46:56 +0200 Subject: Just fix a silly typo in an error message ... --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 56ef427cd02..24e869fe6a4 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,7 +126,7 @@ if [ -e $DESTDIR ] ; then usage fi -trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR +trap 'echo "Cleaning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR # ---------------------------------------------------------------------- # Adjust target name if needed, release with debug info has another name -- cgit v1.2.1 From 7f119d203fca994cc8d4813d4f4f7332774e749a Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Tue, 28 Apr 2009 18:16:17 +0200 Subject: Bug#35769 typo in mysqlhotcopy documentation Fixed a number of typos, and made punctuation and capitalization more consistent in documentation and help. --- scripts/mysqlhotcopy.sh | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 4819f512a65..21fca0c0848 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -49,11 +49,11 @@ $0 Ver $VERSION Usage: $0 db_name[./table_regex/] [new_db_name | directory] - -?, --help display this helpscreen and exit + -?, --help display this help-screen and exit -u, --user=# user for database login if not current user -p, --password=# password to use when connecting to server (if not set in my.cnf, which is recommended) - -h, --host=# Hostname for local server when connecting over TCP/IP + -h, --host=# hostname for local server when connecting over TCP/IP -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server @@ -86,7 +86,7 @@ sub usage { # 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). +# at all, the defaults will be used (login name, no password). my %opt = ( noindices => 0, @@ -95,7 +95,7 @@ my %opt = ( method => "cp", flushlog => 0, ); -Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P +Getopt::Long::Configure(qw(no_ignore_case)); # disambiguate -p and -P GetOptions( \%opt, "help", "host|h=s", @@ -453,7 +453,7 @@ else { printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; $hc_started = time; # count from time lock is granted - # flush tables to make on-disk copy uptodate + # flush tables to make on-disk copy up to date $start = time; $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; @@ -895,7 +895,7 @@ tables and you don't want to have all the tables locked for the whole duration. In this situation, I you are happy for groups of tables to be -backed up separately (and thus possibly not be logically consistant +backed up separately (and thus possibly not be logically consistent with one another) then you can run mysqlhotcopy several times on the same database each with different db_name./table_regex/. All but the first should use the --addtodest option so the tables @@ -920,7 +920,7 @@ server in a mutual replication setup. =item --regexp pattern -Copy all databases with names matching the pattern +Copy all databases with names matching the pattern. =item --regexp /pattern1/./pattern2/ @@ -933,7 +933,7 @@ names begin with 'bar' from all databases which names end with 'foo': =item db_name./pattern/ Copy only tables matching pattern. Shell metacharacters ( (, ), |, !, -etc.) have to be escaped (e.g. \). For example, to select all tables +etc.) have to be escaped (e.g., \). For example, to select all tables in database db1 whose names begin with 'foo' or 'bar': mysqlhotcopy --indices --method=cp db1./^\(foo\|bar\)/ @@ -947,19 +947,19 @@ that do not begin with foo nor bar: =item -?, --help -Display helpscreen and exit +Display help-screen and exit. =item -u, --user=# -user for database login if not current user +User for database login if not current user. =item -p, --password=# -password to use when connecting to the server. Note that you are strongly +Password to use when connecting to the server. Note that you are strongly encouraged *not* to use this option as every user would be able to see the password in the process list. Instead use the '[mysqlhotcopy]' section in one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf. -(See the chapter 'my.cnf Option Files' in the manual) +(See the chapter 'my.cnf Option Files' in the manual.) =item -h, -h, --host=# @@ -968,12 +968,12 @@ different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection. =item -P, --port=# -port to use when connecting to MySQL server with TCP/IP. This is only used +Port to use when connecting to MySQL server with TCP/IP. This is only used when using the --host option. =item -S, --socket=# -UNIX domain socket to use when connecting to local server +UNIX domain socket to use when connecting to local server. =item --noindices @@ -983,7 +983,7 @@ on the backup. =item --method=# -method for copy (only "cp" currently supported). Alpha support for +Method for copy (only "cp" currently supported). Alpha support for "scp" was added in November 2000. Your experience with the scp method will vary with your ability to understand how scp works. 'man scp' and 'man ssh' are your friends. @@ -1000,15 +1000,15 @@ scp or rsync the files at your leisure. =item -q, --quiet -be silent except for errors +Be silent except for errors. =item --debug -Debug messages are displayed +Debug messages are displayed. =item -n, --dryrun -Display commands without actually doing them +Display commands without actually doing them. =back @@ -1030,18 +1030,18 @@ to be specified on the command line: mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : + where ":" delimits the subsets, the /^foo_/ indicates all tables -with names begining with "foo_" and the "+" indicates all tables +with names beginning with "foo_" and the "+" indicates all tables not copied by the previous subsets. -newdb is either another not existing database or a full path to a directory -where we can create a directory 'db' +'newdb' is either the name of the new database, or the full path name +of the new database file. The database should not already exist. Add option to lock each table in turn for people who don\'t need cross-table integrity. Add option to FLUSH STATUS just before UNLOCK TABLES. -Add support for other copy methods (eg tar to single file?). +Add support for other copy methods (e.g., tar to single file?). Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. @@ -1049,26 +1049,26 @@ Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. Tim Bunce -Martin Waite - added checkpoint, flushlog, regexp and dryrun options +Martin Waite - Added checkpoint, flushlog, regexp and dryrun options. Fixed cleanup of targets when hotcopy fails. - Added --record_log_pos. + Added --record_log_pos. RAID tables are now copied (don't know if this works over scp). -Ralph Corderoy - added synonyms for commands +Ralph Corderoy - Added synonyms for commands. -Scott Wiersdorf - added table regex and scp support +Scott Wiersdorf - Added table regex and scp support. -Monty - working --noindex (copy only first 2048 bytes of index file) - Fixes for --method=scp +Monty - Working --noindex (copy only first 2048 bytes of index file). + Fixes for --method=scp. Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. Emil S. Hansen - Added resetslave and resetmaster. -Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which +Jeremy D. Zawodny - Removed deprecated 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. -Paul DuBois - Remove end '/' from directory names +Paul DuBois - Remove end '/' from directory names. -- cgit v1.2.1 From f6bb5d0af62643ec9f94e4aa2794dd7eb92890af Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Tue, 28 Apr 2009 11:12:50 -0700 Subject: Check for MEMORY, HEAP, and BLACKHOLE in mysql_convert_table_format when preventing a change that would result in table data loss. (Bug #27149) Also updated mysql_convert_table_format to use --engine as the documentation claimed, and use the engine terminology throughout instead of the obsolete 'table type'. --- scripts/mysql_convert_table_format.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index d15c7b28410..e49c702d1df 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -23,18 +23,18 @@ $opt_help=$opt_version=$opt_verbose=$opt_force=0; $opt_user=$opt_database=$opt_password=undef; $opt_host="localhost"; $opt_socket=""; -$opt_type="MYISAM"; +$opt_engine="MYISAM"; $opt_port=0; $exit_status=0; -GetOptions("force","help","host=s","password=s","user=s","type=s","verbose","version","socket=s", "port=i") || +GetOptions("force","help","host=s","password=s","user=s","engine|type=s","verbose","version","socket=s", "port=i") || usage(0); usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version); $opt_database=shift(@ARGV); -if (uc($opt_type) eq "HEAP") +if (grep { /^$opt_engine$/i } qw(HEAP MEMORY BLACKHOLE)) { - print "Converting to type HEAP would delete your tables; aborting\n"; + print "Converting to '$opt_engine' would delete your data; aborting\n"; exit(1); } @@ -76,14 +76,15 @@ foreach $table (@ARGV) $sth=$dbh->prepare("show table status like '$table'"); if ($sth->execute && ($row = $sth->fetchrow_arrayref)) { - if (uc($row->[1]) eq uc($opt_type)) + if (uc($row->[1]) eq uc($opt_engine)) { - print "$table is already of type $opt_type; Ignored\n"; + print "$table already uses the '$opt_engine' engine; Ignored\n"; next; } } print "converting $table\n" if ($opt_verbose); - if (!$dbh->do("ALTER TABLE $table ENGINE=$opt_type")) + $table=~ s/`/``/g; + if (!$dbh->do("ALTER TABLE `$table` ENGINE=$opt_engine")) { print STDERR "Can't convert $table: Error $DBI::errstr\n"; exit(1) if (!$opt_force); @@ -103,7 +104,7 @@ sub usage print < Date: Tue, 28 Apr 2009 11:19:58 -0700 Subject: Update list of sorting options in mysqldumpslow (Bug #20454) --- scripts/mysqldumpslow.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index ce2670b2abd..1e942b035cb 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -20,7 +20,7 @@ GetOptions(\%opt, 'v|verbose+',# verbose 'help+', # write usage info 'd|debug+', # debug - 's=s', # what to sort by (t, at, l, al, r, ar etc) + 's=s', # what to sort by (al, at, ar, c, t, l, r) 'r!', # reverse the sort order (largest last instead of first) 't=i', # just show the top n queries 'a!', # don't abstract all numbers to N and strings to 'S' @@ -163,7 +163,7 @@ Parse and summarize the MySQL slow query log. Options are -v verbose -d debug - -s ORDER what to sort by (t, at, l, al, r, ar etc), 'at' is default + -s ORDER what to sort by (al, at, ar, c, t, l, r), 'at' is default -r reverse the sort order (largest last instead of first) -t NUM just show the top n queries -a don't abstract all numbers to N and strings to 'S' -- cgit v1.2.1 From bdb7a3e8a90b2ba1feccf980d8adadb05f5c3a5c Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Tue, 28 Apr 2009 11:28:03 -0700 Subject: mysqld_multi still had mentions of safe_mysqld instead of mysqld_safe, as well as some unclear example paths. (Bug #28094) --- scripts/mysqld_multi.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 3cb4665eb1c..f35be69c151 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -316,11 +316,11 @@ sub start_mysqlds() $tmp.= " $options[$j]"; } } - if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) + if ($opt_verbose && $com =~ m/\/(safe_mysqld|mysqld_safe)$/ && !$info_sent) { - print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "WARNING: $1 is being used to start mysqld. In this case you "; print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; - print "safe_mysqld in order to find the actual mysqld binary.\n"; + print "$1 in order to find the actual mysqld binary.\n"; print "ledir (library executable directory) should be the path to the "; print "wanted mysqld binary.\n\n"; $info_sent= 1; @@ -670,9 +670,9 @@ language = @datadir@/mysql/english user = unix_user1 [mysqld3] -mysqld = /path/to/safe_mysqld/safe_mysqld +mysqld = /path/to/mysqld_safe ledir = /path/to/mysqld-binary/ -mysqladmin = /path/to/mysqladmin/mysqladmin +mysqladmin = /path/to/mysqladmin socket = /tmp/mysql.sock3 port = 3308 pid-file = @localstatedir@3/hostname.pid3 -- cgit v1.2.1 From 2006881ab69e1c38f4cdfeb7e1e0129071028260 Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Tue, 28 Apr 2009 11:47:34 -0700 Subject: Add support for wildcards in mysql_convert_table_format, and add short options for all of the long options. (Bug #30373, original contribution by Tobias Asplund) --- scripts/mysql_convert_table_format.sh | 61 +++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index e49c702d1df..6f586d0e8e0 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -27,9 +27,21 @@ $opt_engine="MYISAM"; $opt_port=0; $exit_status=0; -GetOptions("force","help","host=s","password=s","user=s","engine|type=s","verbose","version","socket=s", "port=i") || - usage(0); +GetOptions( + "e|engine|type=s" => \$opt_type, + "f|force" => \$opt_force, + "help|?" => \$opt_help, + "h|host=s" => \$opt_host, + "p|password=s" => \$opt_password, + "u|user=s" => \$opt_user, + "v|verbose" => \$opt_verbose, + "V|version" => \$opt_version, + "S|socket=s" => \$opt_socket, + "P|port=i" => \$opt_port +) || usage(0); + usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version); + $opt_database=shift(@ARGV); if (grep { /^$opt_engine$/i } qw(HEAP MEMORY BLACKHOLE)) @@ -54,21 +66,29 @@ $dbh = DBI->connect("DBI:mysql:$opt_database:${opt_host}$connect_opt", { PrintError => 0}) || die "Can't connect to database $opt_database: $DBI::errstr\n"; -if ($#ARGV < 0) +my @tables; + +push(@ARGV, "%") if(!@ARGV); + +foreach $pattern (@ARGV) { - # Fetch all table names from the database my ($sth,$row); - $sth=$dbh->prepare("show tables"); - $sth->execute || die "Can't get tables from $opt_database; $DBI::errstr\n"; + $sth=$dbh->prepare("SHOW TABLES LIKE ?"); + $rv= $sth->execute($pattern); + if(!int($rv)) + { + warn "Can't get tables matching '$pattern' from $opt_database; $DBI::errstr\n"; + exit(1) unless $opt_force; + } while (($row = $sth->fetchrow_arrayref)) { - push(@ARGV,$row->[0]); + push(@tables, $row->[0]); } $sth->finish; } print "Converting tables:\n" if ($opt_verbose); -foreach $table (@ARGV) +foreach $table (@tables) { my ($sth,$row); @@ -106,40 +126,41 @@ sub usage Conversion of a MySQL tables to other storage engines - Usage: $0 database [tables] + Usage: $0 database [table[ table ...]] If no tables has been specifed, all tables in the database will be converted. + You can also use wildcards, ie "my%" The following options are available: ---force +-f, --force Continue even if there is some error. ---help +-?, --help Shows this help ---engine='engine' +-e, --engine=ENGINE Converts tables to the given storage engine (Default: $opt_engine) ---host='host name' (Default $opt_host) - Host name where the database server is located. +-h, --host=HOST + Host name where the database server is located. (Default: $opt_host) ---password='password' +-p, --password=PASSWORD Password for the current user. ---port=port +-P, --port=PORT TCP/IP port to connect to if host is not "localhost". ---socket='/path/to/socket' +-S, --socket=SOCKET Socket to connect with. ---user='user_name' +-u, --user=USER User name to log into the SQL server. ---verbose +-v, --verbose This is a test specific option that is only used when debugging a test. Print more information about what is going on. ---version +-V, --version Shows the version of this program. EOF exit(1); -- cgit v1.2.1 From 5b66e5fe4bcf107f9d962f6e891bd36e9616460f Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Thu, 7 May 2009 10:40:00 -0700 Subject: =?UTF-8?q?Add=20explanation=20of=20the=20possible=20-s=20values?= =?UTF-8?q?=20for=20mysqldumpslow.=20(Bug=20#35663,=20based=20on=20a=20con?= =?UTF-8?q?tribution=20by=20Ask=20Bj=C3=B8rn=20Hansen)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/mysqldumpslow.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 1e942b035cb..8580b8e6203 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -163,7 +163,14 @@ Parse and summarize the MySQL slow query log. Options are -v verbose -d debug - -s ORDER what to sort by (al, at, ar, c, t, l, r), 'at' is default + -s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default + al: average lock time + ar: average rows sent + at: average query time + c: count + l: lock time + r: rows sent + t: query time -r reverse the sort order (largest last instead of first) -t NUM just show the top n queries -a don't abstract all numbers to N and strings to 'S' -- cgit v1.2.1 From d11523624832dc4dc802e412bc4e933a1c99453d Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Thu, 7 May 2009 17:25:23 -0700 Subject: mysqld_safe could generate filenames with spaces and then didn't properly quote them in later use. (Bug #33685, based on a patch by Hartmut Holzgraefe) --- scripts/mysqld_safe.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 960c3e39bab..34dc019a82a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -391,8 +391,8 @@ then fi # Change the err log to the right user, if it is in use if [ $want_syslog -eq 0 ]; then - touch $err_log - chown $user $err_log + touch "$err_log" + chown $user "$err_log" fi if test -n "$open_files" then @@ -509,9 +509,9 @@ fi # # If there exists an old pid file, check if the daemon is already running # Note: The switches to 'ps' may depend on your operating system -if test -f $pid_file +if test -f "$pid_file" then - PID=`cat $pid_file` + PID=`cat "$pid_file"` if @CHECK_PID@ then if @FIND_PROC@ @@ -520,8 +520,8 @@ then exit 1 fi fi - rm -f $pid_file - if test -f $pid_file + rm -f "$pid_file" + if test -f "$pid_file" then log_error "Fatal error: Can't remove the pid file: $pid_file @@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" log_notice "Starting $MYSQLD daemon with databases from $DATADIR" while true do - rm -f $safe_mysql_unix_port $pid_file # Some extra safety + rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety eval_log_error "$cmd" - if test ! -f $pid_file # This is removed if normal shutdown + if test ! -f "$pid_file" # This is removed if normal shutdown then break fi -- cgit v1.2.1 From 16ef088112e9a5016638d2856c1a2ca469749596 Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Thu, 7 May 2009 17:53:03 -0700 Subject: The arguments to use for ps on Mac OS X were mis-detected by the mysql_zap utility. (Bug #41883, patch by Nicklas Westerlund) --- scripts/mysql_zap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index 6c05afb772c..3bb92aaec2e 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -27,8 +27,8 @@ $opt_f= 0; $opt_t= 0; $opt_a = ""; -$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin'; -$LINUX = $^O eq 'linux'; +$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; +$LINUX = $^O eq 'linux' || $^O eq 'darwin'; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; open(TTYIN, " Date: Sat, 9 May 2009 23:43:48 +0200 Subject: Use /usr/bin/perl as standard Perl install path (bug#44643) --- scripts/mysql_find_rows.sh | 2 +- scripts/mysql_fix_extensions.sh | 2 +- scripts/mysql_setpermission.sh | 2 +- scripts/mysql_zap.sh | 2 +- scripts/mysqlaccess.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 77eacc8a9b4..967a8196ebd 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2000, 2004 MySQL AB # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh index fbc72406f5e..6d4e017f678 100644 --- a/scripts/mysql_fix_extensions.sh +++ b/scripts/mysql_fix_extensions.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # This is a utility for MySQL. It is not needed by any standard part # of MySQL. diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 1f5509f9955..9b49345175a 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl ## Emacs, this is -*- perl -*- mode? :-) ## ## Permission setter for MySQL diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index 6c05afb772c..258e60dc356 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2000-2002, 2004 MySQL AB # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index bcaf9f8af8e..0153a3afa7c 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # **************************** package MySQLaccess; #use strict; -- cgit v1.2.1 From 986bcb5fc687f9f0c8db530534bb28c87264d56e Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Mon, 25 May 2009 18:21:40 +0200 Subject: Bug #44736 mysqld_safe's my_which() is broken and doesn't find 'logger' Due to a variable quoting mistake, the $PATH environment variable isn't parsed correctly when searching for the existence of the desired executable(s) (logger in this case). This patch removes the quotes. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 34dc019a82a..23b5efcaf2b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -67,7 +67,7 @@ my_which () ret=0 for file do - for dir in "$PATH" + for dir in $PATH do if [ -f "$dir/$file" ] then -- cgit v1.2.1 From 8ad237190a8d3ae259570a9018de06cad76becc6 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 4 Jun 2009 18:47:38 +0200 Subject: Some portability fixes. include/Makefile.am: use @PERL@ to call scripts/dheadgen.pl - don't rely on #! /usr/bin/perl scripts/dheadgen.pl: use 2-arg open() for compatibility with older Perl versions storage/innobase/srv/srv0srv.c: Don't use C++-style comments in C code --- scripts/dheadgen.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl index 5ead0f90a31..374b232a04e 100755 --- a/scripts/dheadgen.pl +++ b/scripts/dheadgen.pl @@ -267,23 +267,23 @@ usage() if ($infile !~ /(.+)\.d$/); # If the system has native support for DTrace, we'll use that binary instead. # if (-x '/usr/sbin/dtrace' && !$force) { - open(my $dt, '-|', "/usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") + open(DTRACE, "-| /usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") or die "can't invoke dtrace(1M)"; - while (<$dt>) { + while () { emit_dtrace($_); } - close($dt); + close(DTRACE); exit(0); } emit_prologue($infile); -open(my $d, '<', $infile) or die "couldn't open $infile"; -@lines = <$d>; -close($d); +open(D, "< $infile") or die "couldn't open $infile"; +@lines = ; +close(D); while (1) { my $nl = 0; -- cgit v1.2.1 From c5d904ebbe274453a39f145522d6af9a792f61e7 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 19 Jun 2009 15:52:20 +0300 Subject: Bug #36654: mysqld_multi cannot start instances with different versions occasionally. mysql_multi can call mysqld_safe. In doing this it's not changing the current working directory. This may cause confusion in the case where mysqld_multi is handling instances of servers of different versions and the current working directory is the installation directory of one of these servers. Fixed by enhancing the meaning of basedir in [mysqldN] sections of mysqld_multi. If specified, mysqld_multi will change the current working directory to the basedir directory before starting the server in mysqld_multi ... start ... and then change it back to what it was. --- scripts/mysqld_multi.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 3cb4665eb1c..a6330055f99 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,7 +1,7 @@ #!/usr/bin/perl use Getopt::Long; -use POSIX qw(strftime); +use POSIX qw(strftime getcwd); $|=1; $VER="2.16"; @@ -295,6 +295,7 @@ sub start_mysqlds() { @options = defaults_for_group($groups[$i]); + $basedir_found= 0; # The default $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); $com= "$mysqld"; @@ -310,6 +311,14 @@ sub start_mysqlds() $com= $options[$j]; $mysqld_found= 1; } + elsif ("--basedir=" eq substr($options[$j], 0, 10)) + { + $basedir= $options[$j]; + $basedir =~ s/^--basedir=//; + $basedir_found= 1; + $options[$j]= quote_shell_word($options[$j]); + $tmp.= " $options[$j]"; + } else { $options[$j]= quote_shell_word($options[$j]); @@ -337,7 +346,16 @@ sub start_mysqlds() print "group [$groups[$i]] separately.\n"; exit(1); } + if ($basedir_found) + { + $curdir=getcwd(); + chdir($basedir) or die "Can't change to datadir $basedir"; + } system($com); + if ($basedir_found) + { + chdir($curdir) or die "Can't change back to original dir $curdir"; + } } if (!$i && !$opt_no_log) { -- cgit v1.2.1 From e76c5c8cb03d183734cb3f653fcda927564219d2 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 26 Jun 2009 11:58:19 +0200 Subject: This is a fix for bug#37808 "make_binary_distribution" does not always generate correct names Originally, we solved deficiencies of the predefined "autoconf" macros (at least on OS X 10.5, they do not correctly differ between "x86" and "x86_64") by providing explicit "--platform" arguments. With this patch, "make_binary_distribution" evaluates CFLAGS, so it "just works" because CFLAGS contains information about the target CPU. This patch is accompanied by a change in our build tools that drops the setting of "--platform" arguments. --- scripts/make_binary_distribution.sh | 50 +++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f156ea3b986..1be5d253e2f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -28,6 +28,12 @@ SOURCE=`pwd` CP="cp -p" MV="mv" +# There are platforms, notably OS X on Intel (x86 + x86_64), +# for which "uname" does not provide sufficient information. +# The value of CFLAGS as used during compilation is the most exact info +# we can get - after all, we care about _what_ we built, not _where_ we did it. +cflags="@CFLAGS@" + STRIP=1 DEBUG=0 SILENT=0 @@ -71,10 +77,44 @@ system=`echo $system | sed -e 's/linux-gnu/linux/g'` system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` +# Get the "machine", which really is the CPU architecture (including the size). +# The precedence is: +# 1) use an explicit argument, if given; +# 2) use platform-specific fixes, if there are any (see bug#37808); +# 3) stay with the default (determined during "configure", using predefined macros). if [ x"$MACHINE" != x"" ] ; then machine=$MACHINE +else + case $system in + osx* ) + # Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty! + cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'` + case "$cflag_arch" in + i386 ) case $system in + osx10.4 ) machine=i686 ;; # Used a different naming + * ) machine=x86 ;; + esac ;; + x86_64 ) machine=x86_64 ;; + ppc ) ;; # No treatment needed with PPC + ppc64 ) ;; + * ) # No matching compiler flag? "--platform" is needed + if [ x"$PLATFORM" != x"" ] ; then + : # See below: "$PLATFORM" will take precedence anyway + elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then + : # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch" + else + echo "On system '$system' only specific '-arch' values are expected." + echo "It is taken from the 'CFLAGS' whose value is:" + echo "$cflags" + echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT" + exit 1 + fi ;; + esac # "$cflag_arch" + ;; + esac # $system fi +# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence. if [ x"$PLATFORM" != x"" ] ; then platform="$PLATFORM" else @@ -117,10 +157,10 @@ which_1 () do for file in $d/$cmd do - if [ -x $file -a ! -d $file ] ; then - echo $file - exit 0 - fi + if [ -x $file -a ! -d $file ] ; then + echo $file + exit 0 + fi done done done @@ -354,7 +394,7 @@ if [ $BASE_SYSTEM = "netware" ] ; then $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ - $BASE/support-files/MySQL-shared-compat.spec \ + $BASE/support-files/MySQL-shared-compat.spec \ $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY fi -- cgit v1.2.1 From 1213dd1e2af64f7813a85a49e0c7fcc70551ad98 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 18 Aug 2009 16:23:15 +0200 Subject: Install innodb_plugin on Windows. --- scripts/make_win_bin_dist | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 3360d8459f8..ce89ea28303 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -279,6 +279,7 @@ cp include/mysql/plugin.h $DESTDIR/include/mysql/ # ---------------------------------------------------------------------- mkdir -p $DESTDIR/lib/opt +mkdir -p $DESTDIR/lib/plugin cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ libmysql/$TARGET/mysqlclient.lib \ @@ -286,6 +287,8 @@ cp libmysql/$TARGET/libmysql.dll \ regex/$TARGET/regex.lib \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ +cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ + $DESTDIR/lib/plugin/ if [ x"$TARGET" != x"release" ] ; then cp libmysql/$TARGET/libmysql.pdb \ @@ -294,11 +297,15 @@ if [ x"$TARGET" != x"release" ] ; then regex/$TARGET/regex.pdb \ strings/$TARGET/strings.pdb \ zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/ + cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/ fi + if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/lib/debug + mkdir -p $DESTDIR/lib/plugin/debug cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ libmysql/debug/libmysql.pdb \ @@ -312,6 +319,10 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ strings/debug/strings.pdb \ zlib/debug/zlib.lib \ zlib/debug/zlib.pdb $DESTDIR/lib/debug/ + cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \ + storage/innodb_plugin/debug/ha_innodb_plugin.lib \ + storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/debug/ fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From 0c8690e5694ba0f70ef3a5deedad910d161c36ba Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 19 Aug 2009 10:59:17 +0300 Subject: backport of Chad's fix for bug #39326 to 5.0-bugteam --- scripts/mysqld_safe.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e6b015e7d16..71b833c80cf 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -113,16 +113,27 @@ parse_arguments() { MY_PWD=`pwd` # Check for the directories we would expect from a binary release install -if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld +if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION" +then + # BASEDIR is already overridden on command line. Do not re-set. + + # Use BASEDIR to discover le. + if test -x "$MY_BASEDIR_VERSION/libexec/mysqld" + then + ledir="$MY_BASEDIR_VERSION/libexec" + else + ledir="$MY_BASEDIR_VERSION/bin" + fi +elif test -f ./share/mysql/english/errmsg.sys -a -x "$MY_PWD/bin/mysqld" then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is + ledir="$MY_PWD/bin" # Where mysqld is # Check for the directories we would expect from a source install -elif test -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld +elif test -f ./share/mysql/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld" then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are - ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is + ledir="$MY_PWD/libexec" # Where mysqld is # Since we didn't find anything, used the compiled-in defaults else MY_BASEDIR_VERSION=@prefix@ @@ -181,7 +192,10 @@ err_log= # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments -if test -x ./bin/my_print_defaults +if test -x "$MY_BASEDIR_VERSION/bin/my_print_defaults" +then + print_defaults="$MY_BASEDIR_VERSION/bin/my_print_defaults" +elif test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" elif test -x @bindir@/my_print_defaults -- cgit v1.2.1 From 0af1cf8ef9b05b40e46480fb0f0f6e294bdc2087 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 1 Sep 2009 08:40:13 +0200 Subject: Only install the innodb plugin if the plugin directory exists. --- scripts/make_win_bin_dist | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index ce89ea28303..9c17c26b445 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -287,8 +287,10 @@ cp libmysql/$TARGET/libmysql.dll \ regex/$TARGET/regex.lib \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ -cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ - $DESTDIR/lib/plugin/ +if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ + $DESTDIR/lib/plugin/ +fi if [ x"$TARGET" != x"release" ] ; then cp libmysql/$TARGET/libmysql.pdb \ @@ -297,8 +299,10 @@ if [ x"$TARGET" != x"release" ] ; then regex/$TARGET/regex.pdb \ strings/$TARGET/strings.pdb \ zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/ - cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ - $DESTDIR/lib/plugin/ + if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/ + fi fi @@ -319,10 +323,12 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ strings/debug/strings.pdb \ zlib/debug/zlib.lib \ zlib/debug/zlib.pdb $DESTDIR/lib/debug/ - cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \ - storage/innodb_plugin/debug/ha_innodb_plugin.lib \ - storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ - $DESTDIR/lib/plugin/debug/ + if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \ + storage/innodb_plugin/debug/ha_innodb_plugin.lib \ + storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/debug/ + fi fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From c90e971d1689d6aa9aa60f3f436af114af88165e Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 4 Sep 2009 17:45:07 +0200 Subject: Install mysqld.lib --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9c17c26b445..fdb34f2f48d 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -280,6 +280,7 @@ cp include/mysql/plugin.h $DESTDIR/include/mysql/ mkdir -p $DESTDIR/lib/opt mkdir -p $DESTDIR/lib/plugin +cp sql/$TARGET/mysqld.lib $DESTDIR/lib/ cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ libmysql/$TARGET/mysqlclient.lib \ -- cgit v1.2.1 From d141e840a2ee7764d6cc8b7e0a104d802141af52 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 8 Sep 2009 15:35:01 +0200 Subject: This is the 5.4 version of the fix for bug#47007 Unresolved reference to 'innodb_system_libs' in "mysql_config" In 5.4.2, we use InnoDB 1.0.4 which does file IO via separate threads, opposed to the use of asynchronous IO previously. So there is no InnoDB call to "aio_read()" which was searched in "librt", causing a "-lrt" value of "innodb_system_libs", that whole variable is gone. This fix was applied in the build of 5.4.2-beta. --- scripts/Makefile.am | 1 - scripts/mysql_config.pl.in | 2 +- scripts/mysql_config.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e493c68827c..cd758370388 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -169,7 +169,6 @@ SUFFIXES = .sh -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ - -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ -e 's!@''openssl_libs''@!@openssl_libs@!' \ -e 's!@''VERSION''@!@VERSION@!' \ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in index 21896711fa8..415c0d3040e 100644 --- a/scripts/mysql_config.pl.in +++ b/scripts/mysql_config.pl.in @@ -202,7 +202,7 @@ $flags->{libs} = $flags->{libs_r} = [@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@']; $flags->{embedded_libs} = - [@ldflags,@lib_e_opts,'@LIBDL@','@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@']; + [@ldflags,@lib_e_opts,'@LIBDL@','@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@openssl_libs@']; $flags->{include} = ["-I$pkgincludedir"]; $flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')]; diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index efc82544bc0..4118856af19 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -107,7 +107,7 @@ fi libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " +embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " if [ -r "$pkglibdir/libmygcc.a" ]; then # When linking against the static library with a different version of GCC -- cgit v1.2.1 From 768f2cdb6a7be8a747495bc9c4fad74d22346c5d Mon Sep 17 00:00:00 2001 From: "timothy.smith@sun.com" <> Date: Wed, 23 Sep 2009 01:26:08 +0200 Subject: Add --malloc-lib=LIB option to mysqld_safe to LD_PRELOAD a shared library for mysqld --- scripts/mysql_config.sh | 13 +++++ scripts/mysqld_safe.sh | 133 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 145 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 4118856af19..d2699726a25 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -167,6 +167,10 @@ Options: --port [$port] --version [$version] --libmysqld-libs [$embedded_libs] + --variable=VAR VAR is one of: + pkgincludedir [$pkgincludedir] + pkglibdir [$pkglibdir] + plugindir [$plugindir] EOF exit 1 } @@ -184,6 +188,15 @@ while test $# -gt 0; do --port) echo "$port" ;; --version) echo "$version" ;; --embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;; + --variable=*) + var=`echo "$1" | sed 's,^[^=]*=,,'` + case "$var" in + pkgincludedir) echo "$pkgincludedir" ;; + pkglibdir) echo "$pkglibdir" ;; + plugindir) echo "$plugindir" ;; + *) usage ;; + esac + ;; *) usage ;; esac diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 23b5efcaf2b..95c4419273f 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -11,9 +11,13 @@ # mysql.server works by first doing a cd to the base directory and from there # executing mysqld_safe +# Initialize script globals KILL_MYSQLD=1; MYSQLD= niceness=0 +mysqld_ld_preload= +mysqld_ld_library_path= + # Initial logging status: error log is not open, and not using syslog logging=init want_syslog=0 @@ -46,6 +50,7 @@ Usage: $0 [OPTIONS] --open-files-limit=LIMIT Limit the number of open files --core-file-size=LIMIT Limit core files to the specified size --timezone=TZ Set the system timezone + --malloc-lib=LIB Preload shared library LIB if available --mysqld=FILE Use the specified file as mysqld --mysqld-version=VERSION Use "mysqld-VERSION" as mysqld --nice=NICE Set the scheduling priority of mysqld @@ -172,6 +177,7 @@ parse_arguments() { # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])! --core-file-size=*) core_file_size="$val" ;; --ledir=*) ledir="$val" ;; + --malloc-lib=*) set_malloc_lib "$val" ;; --mysqld=*) MYSQLD="$val" ;; --mysqld-version=*) if test -n "$val" @@ -202,6 +208,131 @@ parse_arguments() { } +# Add a single shared library to the list of libraries which will be added to +# LD_PRELOAD for mysqld +# +# Since LD_PRELOAD is a space-separated value (for historical reasons), if a +# shared lib's path contains spaces, that path will be prepended to +# LD_LIBRARY_PATH and stripped from the lib value. +add_mysqld_ld_preload() { + lib_to_add="$1" + log_notice "Adding '$lib_to_add' to LD_PRELOAD for mysqld" + + case "$lib_to_add" in + *' '*) + # Must strip path from lib, and add it to LD_LIBRARY_PATH + lib_file=`basename "$lib_to_add"` + case "$lib_file" in + *' '*) + # The lib file itself has a space in its name, and can't + # be used in LD_PRELOAD + log_error "library name '$lib_to_add' contains spaces and can not be used with LD_PRELOAD" + exit 1 + ;; + esac + lib_path=`dirname "$lib_to_add"` + lib_to_add="$lib_file" + [ -n "$mysqld_ld_library_path" ] && mysqld_ld_library_path="$mysqld_ld_library_path:" + mysqld_ld_library_path="$mysqld_ld_library_path$lib_path" + ;; + esac + + # LD_PRELOAD is a space-separated + [ -n "$mysqld_ld_preload" ] && mysqld_ld_preload="$mysqld_ld_preload " + mysqld_ld_preload="${mysqld_ld_preload}$lib_to_add" +} + + +# Returns LD_PRELOAD (and LD_LIBRARY_PATH, if needed) text, quoted to be +# suitable for use in the eval that calls mysqld. +# +# All values in mysqld_ld_preload are prepended to LD_PRELOAD. +mysqld_ld_preload_text() { + text= + + if [ -n "$mysqld_ld_preload" ]; then + new_text="$mysqld_ld_preload" + [ -n "$LD_PRELOAD" ] && new_text="$new_text $LD_PRELOAD" + text="${text}LD_PRELOAD="`shell_quote_string "$new_text"`' ' + fi + + if [ -n "$mysqld_ld_library_path" ]; then + new_text="$mysqld_ld_library_path" + [ -n "$LD_LIBRARY_PATH" ] && new_text="$new_text:$LD_LIBRARY_PATH" + text="${text}LD_LIBRARY_PATH="`shell_quote_string "$new_text"`' ' + fi + + echo "$text" +} + + +mysql_config= +get_mysql_config() { + if [ -z "$mysql_config" ]; then + mysql_config=`echo "$0" | sed 's,/[^/][^/]*$,/mysql_config,'` + if [ ! -x "$mysql_config" ]; then + log_error "Can not run mysql_config $@ from '$mysql_config'" + exit 1 + fi + fi + + "$mysql_config" "$@" +} + + +# set_malloc_lib LIB +# - If LIB is empty, do nothing and return +# - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib +# then pkglibdir. tcmalloc is part of the Google perftools project. +# - If LIB is an absolute path, assume it is a malloc shared library +# +# Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when +# running mysqld. See ld.so for details. +set_malloc_lib() { + malloc_lib="$1" + + if [ "$malloc_lib" = tcmalloc ]; then + pkglibdir=`get_mysql_config --variable=pkglibdir` + malloc_lib= + # This list is kept intentionally simple. Simply set --malloc-lib + # to a full path if another location is desired. + for libdir in /usr/lib "$pkglibdir"; do + for flavor in _minimal '' _and_profiler _debug; do + tmp="$libdir/libtcmalloc$flavor.so" + #log_notice "DEBUG: Checking for malloc lib '$tmp'" + [ -r "$tmp" ] || continue + malloc_lib="$tmp" + break 2 + done + done + + if [ -z "$malloc_lib" ]; then + log_error "no shared library for --malloc-lib=tcmalloc found in /usr/lib or $pkglibdir" + exit 1 + fi + fi + + # Allow --malloc-lib='' to override other settings + [ -z "$malloc_lib" ] && return + + case "$malloc_lib" in + /*) + if [ ! -r "$malloc_lib" ]; then + log_error "--malloc-lib '$malloc_lib' can not be read and will not be used" + exit 1 + fi + ;; + *) + log_error "--malloc-lib must be an absolute path or 'tcmalloc'; " \ + "ignoring value '$malloc_lib'" + exit 1 + ;; + esac + + add_mysqld_ld_preload "$malloc_lib" +} + + # # First, try to find BASEDIR and ledir (where mysqld is) # @@ -549,7 +680,7 @@ fi # ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems #fi -cmd="$NOHUP_NICENESS" +cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "$USER_OPTION" -- cgit v1.2.1 From d86e8b7c64567bd475ab840be6e4ac28ac069234 Mon Sep 17 00:00:00 2001 From: "timothy.smith@sun.com" <> Date: Tue, 29 Sep 2009 08:58:32 +0200 Subject: make_binary_distribution and mysql.spec: add options to copy a shared library, for use by mysqld_safe, into pkglibdir during package creation --- scripts/make_binary_distribution.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index bf22267cf42..27fe2acb447 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -64,6 +64,7 @@ cflags="@CFLAGS@" STRIP=1 # Option ignored SILENT=0 +MALLOC_LIB= PLATFORM="" TMP=/tmp NEW_NAME="" # Final top directory and TAR package name @@ -76,6 +77,7 @@ for arg do --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;; + --inject-malloc-lib=*) MALLOC_LIB=`echo "$arg" | sed -e 's;^[^=]*=;;'` ;; --no-strip) STRIP=0 ;; --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; @@ -293,6 +295,12 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then fi fi + # If requested, add a malloc library .so into pkglibdir for use + # by mysqld_safe + if [ -n "$MALLOC_LIB" ]; then + cp "$MALLOC_LIB" '@pkglibdir@' + fi + # FIXME let this script be in "bin/", where it is in the RPMs? # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html mkdir $DEST/scripts -- cgit v1.2.1 From 92485639d636a0455f8d8a4a58f3f63d31ba5eaa Mon Sep 17 00:00:00 2001 From: "timothy.smith@sun.com" <> Date: Tue, 29 Sep 2009 21:11:41 +0200 Subject: make_binary_distribution.sh: fix path for installing the MALLOC_LIB (to $DEST/lib) --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 27fe2acb447..bd0f4f99ca6 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -298,7 +298,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then # If requested, add a malloc library .so into pkglibdir for use # by mysqld_safe if [ -n "$MALLOC_LIB" ]; then - cp "$MALLOC_LIB" '@pkglibdir@' + cp "$MALLOC_LIB" "$DEST/lib/" fi # FIXME let this script be in "bin/", where it is in the RPMs? -- cgit v1.2.1 From 46d04ebdefe05377b86e851d73df22c069d63246 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Sep 2009 03:39:37 +0200 Subject: Backport of the patch http://lists.mysql.com/commits/57725 Vladislav Vaintroub 2008-11-03 Cleanup CMakeLists.txt(s) - remove winsock2 (ws2_32) from TARGET_LINK_LIBRARIES. Every exe or dll linked with mysys needs ws2_32, because mysys uses winsock function WSAStartup in my_init(). However, there is no need to explicitely add ws2_32 to the list of TARGET_LINK_LIBRARIES multiple times. Visual Studio comes with a handy pragma that tells linker to add library. So patch replaces bunch of ws2_32 in CMakeLists with single pragma comment(lib,"ws2_32") in my_init.c Additionally, reference to non-existing "debug" library has been removed from TARGET_LINK_LIBRARIES. The correct name of the library is "dbug". --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index f0db25be79a..25cdae2b522 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -24,7 +24,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl # Build comp_sql - used for embedding SQL in C or C++ programs ADD_EXECUTABLE(comp_sql comp_sql.c) -TARGET_LINK_LIBRARIES(comp_sql debug dbug mysys strings) +TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) # Use comp_sql to build mysql_fix_privilege_tables_sql.c GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) -- cgit v1.2.1 From e1f4344e68e8208ff6e625f2723687a9fcb515b4 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 30 Sep 2009 14:46:47 +0100 Subject: bug#41546: mysql-stress-run.pl is not packaged on Windows Copy mysql-stress-run.pl into noinstall package. --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index fdb34f2f48d..c65439181ef 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -338,6 +338,7 @@ fi mkdir $DESTDIR/mysql-test cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ +cp mysql-test/mysql-stress-test.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/ -- cgit v1.2.1 From 04e99c10096e9cfe72f9823fc73b9f4eee80c1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Bl=C3=A5udd?= Date: Wed, 7 Oct 2009 15:42:16 +0200 Subject: Bug#42589 mysql_fix_privilege_tables.sh to be deprecated - Remove remnants of "mysql_fix_privilege_tables.sh"(again) --- scripts/Makefile.am | 3 - scripts/mysql_fix_privilege_tables.sh | 223 ---------------------------------- scripts/mysql_system_tables_fix.sql | 4 - 3 files changed, 230 deletions(-) delete mode 100644 scripts/mysql_fix_privilege_tables.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index cd758370388..09280aef2ab 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -23,7 +23,6 @@ EXTRA_PROGRAMS = comp_sql bin_SCRIPTS = @server_scripts@ \ msql2mysql \ mysql_config \ - mysql_fix_privilege_tables \ mysql_fix_extensions \ mysql_setpermission \ mysql_secure_installation \ @@ -45,7 +44,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_config.pl.in \ - mysql_fix_privilege_tables.sh \ mysql_fix_extensions.sh \ mysql_install_db.sh \ mysql_install_db.pl.in \ @@ -82,7 +80,6 @@ CLEANFILES = @server_scripts@ \ make_sharedlib_distribution \ msql2mysql \ mysql_config \ - mysql_fix_privilege_tables \ mysql_fix_extensions \ mysql_setpermission \ mysql_secure_installation \ diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh deleted file mode 100644 index 3b179957932..00000000000 --- a/scripts/mysql_fix_privilege_tables.sh +++ /dev/null @@ -1,223 +0,0 @@ -#!/bin/sh -# Copyright (C) 2000-2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# This script is a wrapper to pipe the mysql_fix_privilege_tables.sql -# through the mysql client program to the mysqld server - -# Default values (Can be changed in my.cnf) -password="" -host="localhost" -user="root" -sql_only=0 -basedir="@prefix@" -verbose=0 -args="" -# no elaborate fallback here; with no argument, it will happen in "mysql" -port="" -socket="" -database="mysql" -bindir="" -pkgdatadir="@pkgdatadir@" -print_defaults_bindir="." - -file=mysql_fix_privilege_tables.sql - -# The following test is to make this script compatible with the 4.0 where -# the single argument could be a password -if test "$#" = 1 -then - case "$1" in - --*) ;; - *) old_style_password="$1" ; shift ;; - esac -fi - -# The following code is almost identical to the code in mysql_install_db.sh - -case "$1" in - --no-defaults|--defaults-file=*|--defaults-extra-file=*) - defaults="$1"; shift - ;; -esac - -parse_arguments() { - # We only need to pass arguments through to the server if we don't - # handle them here. So, we collect unrecognized options (passed on - # the command line) into the args variable. - pick_args= - if test "$1" = PICK-ARGS-FROM-ARGV - then - pick_args=1 - shift - fi - - for arg do - case "$arg" in - --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --sql|--sql-only) sql_only=1 ;; - --verbose) verbose=1 ;; - --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; - --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; - --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; - --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` - print_defaults_bindir=$bindir - ;; - *) - if test -n "$pick_args" - then - # This sed command makes sure that any special chars are quoted, - # so the arg gets passed exactly to the server. - args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'` - fi - ;; - esac - done -} - -# Get first arguments from the my.cfg file, groups [mysqld] and -# [mysql_install_db], and then merge with the command line arguments - -print_defaults=my_print_defaults -for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra -do - if test -x $dir/my_print_defaults - then - print_defaults="$dir/my_print_defaults" - break - fi -done - -parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` -parse_arguments PICK-ARGS-FROM-ARGV "$@" - -if test -z "$password" -then - password=$old_style_password -fi - -# Find where 'mysql' command is located - -dirname=`dirname "$0"` - -if test -z "$bindir" -then - for i in @bindir@ $basedir/bin "$dirname/../client" - do - if test -f $i/mysql - then - bindir=$i - break - fi - done -fi - -if test -z "$bindir" -then - echo "Could not find MySQL command-line client (mysql)." - echo "Please use --basedir to specify the directory where MySQL is installed." - exit 1 -fi - -cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" -if test ! -z "$port"; then - cmd="$cmd --port=$port" -fi -if test ! -z "$socket"; then - cmd="$cmd --socket=$socket" -fi -cmd="$cmd --database=$database" - -if test $sql_only = 1 -then - cmd="cat" -fi - -# Find where first mysql_fix_privilege_tables.sql is located -for i in $basedir/support-files $basedir/share $basedir/share/mysql \ - $basedir/scripts $pkgdatadir . "$dirname" -do - if test -f $i/$file - then - pkgdatadir=$i - break - fi -done - -sql_file="$pkgdatadir/$file" -if test ! -f $sql_file -then - echo "Could not find file '$file'." - echo "Please use --basedir to specify the directory where MySQL is installed" - exit 1 -fi - -s_echo() -{ - if test $sql_only = 0 - then - echo $1 - fi -} - -s_echo "This script updates all the mysql privilege tables to be usable by" -s_echo "the current version of MySQL" -s_echo "" - -if test $verbose = 1 -then - s_echo "You can safely ignore all 'Duplicate column' and 'Unknown column' errors" - s_echo "because these just mean that your tables are already up to date." - s_echo "This script is safe to run even if your tables are already up to date!" - s_echo "" -fi - -run_cmd() { - # Password argument is added here to allow for spaces in password. - - if test ! -z "$password" - then - cat $sql_file | $cmd --password="$password" - else - cat $sql_file | $cmd - fi -} - -if test $verbose = 0 -then - run_cmd > /dev/null 2>&1 -else - run_cmd > /dev/null -fi -if test $? = 0 -then - s_echo "done" -else - s_echo "Got a failure from command:" - s_echo "cat $sql_file | $cmd" - s_echo "Please check the above output and try again." - if test $verbose = 0 - then - s_echo "" - s_echo "Running the script with the --verbose option may give you some information" - s_echo "of what went wrong." - fi - s_echo "" - s_echo "If you get an 'Access denied' error, you should run this script again and" - s_echo "give the MySQL root user password as an argument with the --password= option" -fi diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a6497f57f0a..8f6f6a38a68 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -5,10 +5,6 @@ # because these just mean that your tables are already up to date. # This script is safe to run even if your tables are already up to date! -# On unix, you should use the mysql_fix_privilege_tables script to execute -# this sql script. -# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' - set sql_mode=''; set storage_engine=MyISAM; -- cgit v1.2.1 From ca77f18064f734a6704daf63b24504572de53395 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Fri, 9 Oct 2009 17:35:07 +0200 Subject: Bug #34197 CREATE PROCEDURE fails when COMMENT truncated in non strict SQL mode The problem was that a COMMENT longer than 64 characters caused CREATE PROCEDURE to fail. This patch fixed the problem by changing the COMMENT field in mysql.proc from char(64) to text. The corresponding ROUTINE_COMMENT field in INFORMATION_SCHEMA.ROUTINES is also changed from varchar(64) to longtext. mysql_system_tables.sql and mysql_system_tables_fix.sql updated. Test case added to sp.test and affected result-files updated. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 67e18517915..280249732fd 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a6497f57f0a..450bfa98ae6 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -427,6 +427,9 @@ ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL AFTER db_collation; ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL; +# Change comment from char(64) to text +ALTER TABLE proc MODIFY comment + text collate utf8_bin NOT NULL; # # EVENT privilege -- cgit v1.2.1 From 132ef2e2ef9e1bdb111c9f0054d8059ae6986039 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Sat, 10 Oct 2009 00:01:10 +0400 Subject: A backporting patch for WL#4300 (Define privileges for tablespaces). Original revision in 6.0: ------------------------------------------------------------ revno: 2630.13.11 committer: Alexander Nozdrin branch nick: 6.0-rt-wl4300 timestamp: Thu 2008-07-24 11:44:21 +0400 message: A patch for WL#4300: Define privileges for tablespaces. ------------------------------------------------------------ per-file messages: mysql-test/r/grant.result Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user. mysql-test/r/ps.result Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user. mysql-test/r/system_mysql_db.result Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user. mysql-test/suite/falcon/r/falcon_tablespace_priv.result Test case for WL#4300. mysql-test/suite/falcon/t/falcon_tablespace_priv.test Test case for WL#4300. mysql-test/suite/ndb/r/ndb_dd_ddl.result Test case for WL#4300. mysql-test/suite/ndb/t/ndb_dd_ddl.test Test case for WL#4300. scripts/mysql_system_tables.sql New columm 'Create_tablespace_priv' has been added to mysql.user. scripts/mysql_system_tables_data.sql 'CREATE TABLESPACE' is granted by default to the root user. scripts/mysql_system_tables_fix.sql Grant 'CREATE TABLESPACE' privilege during system table upgrade if a user had SUPER privilege. sql/sql_acl.cc Added CREATE TABLESPACE privilege. sql/sql_acl.h Added CREATE TABLESPACE privilege. sql/sql_parse.cc Check global 'CREATE TABLESPACE' privilege for the following SQL statements: - CREATE | ALTER | DROP TABLESPACE - CREATE | ALTER | DROP LOGFILE GROUP sql/sql_show.cc Added CREATE TABLESPACE privilege. sql/sql_yacc.yy Added CREATE TABLESPACE privilege. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_data.sql | 6 +++--- scripts/mysql_system_tables_fix.sql | 12 ++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 280249732fd..c07686b793b 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -13,7 +13,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 9a3a3f7bb84..03136fe9361 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -21,9 +21,9 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; set @current_hostname= @@hostname; -INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; -REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 450bfa98ae6..a5a9d4e0a84 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -540,6 +540,18 @@ ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; +# +# user.Create_tablespace_priv +# + +SET @hadCreateTablespacePriv := 0; +SELECT @hadCreateTablespacePriv :=1 FROM user WHERE Create_tablespace_priv LIKE '%'; + +ALTER TABLE user ADD Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Trigger_priv; +ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Trigger_priv; + +UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From df59e27b4e46d9ec990d87ce93991ff58b6ba24d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Oct 2009 20:15:10 +0200 Subject: bug#33731 - INSTALL/UNINSTALL PLUGIN: Inconsistent handling of identifier case indexed column in mysql.plugin table should use case-insensitive collation for index lookups to work (backport from 6.0) --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 67e18517915..3dd4b7a7a8c 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -22,7 +22,7 @@ set @had_user_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl char(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='MySQL plugins'; +CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins'; CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a6497f57f0a..71d18de8898 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -229,6 +229,11 @@ SET GLOBAL slow_query_log = 'OFF'; ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; SET GLOBAL slow_query_log = @old_log_state; +ALTER TABLE plugin + MODIFY name varchar(64) COLLATE utf8_general_ci NOT NULL DEFAULT '', + MODIFY dl varchar(128) COLLATE utf8_general_ci NOT NULL DEFAULT '', + CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; + # # Detect whether we had Create_view_priv # -- cgit v1.2.1 From 7741d9b50df4fabebea41c16183ce0b4584f718a Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Thu, 15 Oct 2009 17:23:43 +0500 Subject: WL#751 Error message construction, backport --- scripts/mysql_install_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 20b7973cb4e..7e9b8a69677 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -313,7 +313,7 @@ then cannot_find_file "$langdir/errmsg.sys" exit 1 fi - mysqld_opt="--language=$langdir" + mysqld_opt="--lc-messages-dir=$langdir/.." fi # Try to determine the hostname -- cgit v1.2.1 From 46f554e5b4f8dcd0101671dcd55d8e02e85dfcf5 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 23 Oct 2009 13:31:14 +0500 Subject: Postfix for WL#1349. Don't do character set autodetection when running mysql from mysql_fix_privilege_tables. --- scripts/mysql_fix_privilege_tables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 3b179957932..dd5edb699a0 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -134,7 +134,7 @@ then exit 1 fi -cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" +cmd="$bindir/mysql --no-defaults --default-character-set=latin1 --force --user=$user --host=$host" if test ! -z "$port"; then cmd="$cmd --port=$port" fi -- cgit v1.2.1 From 58b7761ed85079dc3edb69467feb060ae810cabe Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 27 Oct 2009 12:09:19 +0400 Subject: Bug#41049 does syntax "grant" case insensitive? Problem 1: column_priv_hash uses utf8_general_ci collation for the key comparison. The key consists of user name, db name and table name. Thus user with privileges on table t1 is able to perform the same operation on T1 (the similar situation with user name & db name, see acl_cache). So collation which is used for column_priv_hash and acl_cache should be case sensitive. The fix: replace system_charset_info with my_charset_utf8_bin for column_priv_hash and acl_cache Problem 2: The same situation with proc_priv_hash, func_priv_hash, the only difference is that Routine name is case insensitive. So the fix is to use my_charset_utf8_bin for proc_priv_hash & func_priv_hash and convert routine name into lower case before writing the element into the hash and before looking up the key. Additional fix: mysql.procs_priv Routine_name field collation is changed to utf8_general_ci. It's necessary for REVOKE command (to find a field by routine hash element values). Note: It's safe for lower-case-table-names mode too because db name & table name are converted into lower case (see GRANT_NAME::GRANT_NAME). --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 31eb205eed0..aca87b01bc3 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -57,5 +57,5 @@ CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint sign CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; -CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index c8334339b32..cfd03b7c45d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -323,6 +323,10 @@ ALTER TABLE procs_priv MODIFY Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER IGNORE TABLE procs_priv + MODIFY Routine_name char(64) + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + ALTER TABLE procs_priv ADD Routine_type enum('FUNCTION','PROCEDURE') COLLATE utf8_general_ci NOT NULL AFTER Routine_name; -- cgit v1.2.1 From 61973d671f76517378ccaba15f8ed8f9c566ab87 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Fri, 30 Oct 2009 14:28:33 -0600 Subject: Bug#35106: mysql_secure_installation fails on Windows, missing "use Term::ReadKey" Add the missing module import. Also, while here, fix a few glaring problems with the script, and ensure that it behaves properly. It seems this script may have never been working correctly (e.g., reading password didn't chomp() the result, so password was set with \n at the end; comparing the re-typed password to original was done with inverted test). Add END { cleanup(); } block to ensure the script removes temporary working files. Add SIG{INT} / SIG{QUIT} handler. Do a bit of reorganization to make the code easier to understand. Limit failed connection attempts to 3. Use ./bin/mysql if it exists, and then fall back on mysql in PATH (before it assumed 'mysql' in the path). Print a nicer error if 'mysql' can't be called. This has been tested on Windows (ActivePerl from cmd.exe, no cygwin needed) and Linux. --- scripts/mysql_secure_installation.pl.in | 169 +++++++++++++++++--------------- 1 file changed, 92 insertions(+), 77 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 4eeb50e6d2f..281f3558808 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -17,16 +17,41 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use Fcntl; +use File::Spec; +use if $^O eq 'MSWin32', 'Term::ReadKey' => qw/ReadMode/; use strict; my $config = ".my.cnf.$$"; my $command = ".mysql.$$"; my $hadpass = 0; +my $mysql; # How to call the mysql client +my $rootpass = ""; -# FIXME -# trap "interrupt" 2 -my $rootpass = ""; +$SIG{QUIT} = $SIG{INT} = sub { + print "\nAborting!\n\n"; + echo_on(); + cleanup(); + exit 1; +}; + + +END { + # Remove temporary files, even if exiting via die(), etc. + cleanup(); +} + + +sub read_without_echo { + my ($prompt) = @_; + print $prompt; + echo_off(); + my $answer = ; + echo_on(); + print "\n"; + chomp($answer); + return $answer; +} sub echo_on { if ($^O eq 'MSWin32') { @@ -55,6 +80,25 @@ sub write_file { } sub prepare { + # Locate the mysql client; look in current directory first, then + # in path + our $SAVEERR; # Suppress Perl warning message + open SAVEERR, ">& STDERR"; + close STDERR; + for my $m (File::Spec->catfile('bin', 'mysql'), 'mysql') { + # mysql --version should always work + qx($m --no-defaults --version); + next unless $? == 0; + + $mysql = $m; + last; + } + open STDERR, ">& SAVEERR"; + + die "Can't find a 'mysql' client in PATH or ./bin\n" + unless $mysql; + + # Create safe files to avoid leaking info to other users foreach my $file ( $config, $command ) { next if -f $file; # Already exists local *FILE; @@ -67,8 +111,9 @@ sub prepare { sub do_query { my $query = shift; write_file($command, $query); - system("mysql --defaults-file=$config < $command"); - return $?; + my $rv = system("$mysql --defaults-file=$config < $command"); + die "Failed to execute mysql client '$mysql'\n" if $rv == -1; + return ($rv == 0 ? 1 : undef); } sub make_config { @@ -82,12 +127,9 @@ sub make_config { } sub get_root_password { - my $status = 1; - while ( $status == 1 ) { - echo_off(); - print "Enter current password for root (enter for none): "; - my $password = ; - echo_on(); + my $attempts = 3; + for (;;) { + my $password = read_without_echo("Enter current password for root (enter for none): "); if ( $password ) { $hadpass = 1; } else { @@ -95,64 +137,56 @@ sub get_root_password { } $rootpass = $password; make_config($rootpass); - do_query(""); - $status = $?; + last if do_query(""); + + die "Unable to connect to the server as root user, giving up.\n" + if --$attempts == 0; } print "OK, successfully used password, moving on...\n\n"; } sub set_root_password { - echo_off(); - print "New password: "; - my $password1 = ; - print "\nRe-enter new password: "; - my $password2 = ; - print "\n"; - echo_on(); + my $password1; + for (;;) { + $password1 = read_without_echo("New password: "); - if ( $password1 eq $password2 ) { - print "Sorry, passwords do not match.\n\n"; - return 1; - } + if ( !$password1 ) { + print "Sorry, you can't use an empty password here.\n\n"; + next; + } - if ( !$password1 ) { - print "Sorry, you can't use an empty password here.\n\n"; - return 1; - } + my $password2 = read_without_echo("Re-enter new password: "); - do_query("UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';"); - if ( $? == 0 ) { - print "Password updated successfully!\n"; - print "Reloading privilege tables..\n"; - if ( !reload_privilege_tables() ) { - exit 1; + if ( $password1 ne $password2 ) { + print "Sorry, passwords do not match.\n\n"; + next; } - print "\n"; - $rootpass = $password1; - make_config($rootpass); - } else { - print "Password update failed!\n"; - exit 1; + + last; } - return 0; + # FIXME: Quote password1 properly for SQL + do_query("UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';") + or die "Password update failed!\n"; + + print "Password updated successfully!\n"; + print "Reloading privilege tables..\n"; + reload_privilege_tables() + or die "Can not continue.\n"; + + print "\n"; + $rootpass = $password1; + make_config($rootpass); } sub remove_anonymous_users { - do_query("DELETE FROM mysql.user WHERE User='';"); - if ( $? == 0 ) { - print " ... Success!\n"; - } else { - print " ... Failed!\n"; - exit 1; - } - - return 0; + do_query("DELETE FROM mysql.user WHERE User='';") + or die print " ... Failed!\n"; + print " ... Success!\n"; } sub remove_remote_root { - do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';"); - if ( $? == 0 ) { + if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';")) { print " ... Success!\n"; } else { print " ... Failed!\n"; @@ -161,44 +195,31 @@ sub remove_remote_root { sub remove_test_database { print " - Dropping test database...\n"; - do_query("DROP DATABASE test;"); - if ( $? == 0 ) { + if (do_query("DROP DATABASE test;")) { print " ... Success!\n"; } else { print " ... Failed! Not critical, keep moving...\n"; } print " - Removing privileges on test database...\n"; - do_query("DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"); - if ( $? == 0 ) { + if (do_query("DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'")) { print " ... Success!\n"; } else { print " ... Failed! Not critical, keep moving...\n"; } - - return 0; } sub reload_privilege_tables { - do_query("FLUSH PRIVILEGES;"); - if ( $? == 0 ) { + if (do_query("FLUSH PRIVILEGES;")) { print " ... Success!\n"; - return 0; + return 1; } else { print " ... Failed!\n"; - return 1; + return undef; } } -sub interrupt { - print "\nAborting!\n\n"; - cleanup(); - echo_on(); - exit 1; -} - sub cleanup { - print "Cleaning up...\n"; unlink($config,$command); } @@ -242,11 +263,7 @@ my $reply = ; if ( $reply =~ /n/i ) { print " ... skipping.\n"; } else { - my $status = 1; - while ( $status == 1 ) { - set_root_password(); - $status = $?; - } + set_root_password(); } print "\n"; @@ -334,8 +351,6 @@ if ( $reply =~ /n/i ) { } print "\n"; -cleanup(); - print < Date: Tue, 3 Nov 2009 13:32:12 -0700 Subject: Bug#48086: mysql_secure_installation does NOT work on Solaris Remove a bash-ism (if ! ...). --- scripts/mysql_secure_installation.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 6c2d88d6d29..597f6cac83f 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -98,9 +98,7 @@ set_root_password() { if [ $? -eq 0 ]; then echo "Password updated successfully!" echo "Reloading privilege tables.." - if ! reload_privilege_tables; then - exit 1 - fi + reload_privilege_tables || exit 1 echo rootpass=$password1 make_config -- cgit v1.2.1 From 3aff1e9570522241b46e8c4c43585b5725fc12f2 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 3 Nov 2009 13:50:28 -0700 Subject: Bug#48031: mysql_secure_installation -- bash bug regarding passwords with special chars This script failed when the user tried passwords with multiple spaces, \, # or ' characters. Now proper escaping and quoting is used in all contexts. This problem occurs in the Perl version of this script, too, so fix it in both places. --- scripts/mysql_secure_installation.pl.in | 24 +++++++++++++++++++++--- scripts/mysql_secure_installation.sh | 30 +++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 281f3558808..255416763ef 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -108,6 +108,23 @@ sub prepare { } } +# Simple escape mechanism (\-escape any ' and \), suitable for two contexts: +# - single-quoted SQL strings +# - single-quoted option values on the right hand side of = in my.cnf +# +# These two contexts don't handle escapes identically. SQL strings allow +# quoting any character (\C => C, for any C), but my.cnf parsing allows +# quoting only \, ' or ". For example, password='a\b' quotes a 3-character +# string in my.cnf, but a 2-character string in SQL. +# +# This simple escape works correctly in both places. +sub basic_single_escape { + my ($str) = @_; + # Inside a character class, \ is not special; this escapes both \ and ' + $str =~ s/([\'])/\\$1/g; + return $str; +} + sub do_query { my $query = shift; write_file($command, $query); @@ -119,11 +136,12 @@ sub do_query { sub make_config { my $password = shift; + my $esc_pass = basic_single_escape($rootpass); write_file($config, "# mysql_secure_installation config file", "[mysql]", "user=root", - "password=$rootpass"); + "password='$esc_pass'"); } sub get_root_password { @@ -165,8 +183,8 @@ sub set_root_password { last; } - # FIXME: Quote password1 properly for SQL - do_query("UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';") + my $esc_pass = basic_single_escape($password1); + do_query("UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root';") or die "Password update failed!\n"; print "Password updated successfully!\n"; diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 597f6cac83f..25d6343ee2c 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -38,16 +38,39 @@ prepare() { } do_query() { - echo $1 >$command + echo "$1" >$command + #sed 's,^,> ,' < $command # Debugging mysql --defaults-file=$config <$command return $? } +# Simple escape mechanism (\-escape any ' and \), suitable for two contexts: +# - single-quoted SQL strings +# - single-quoted option values on the right hand side of = in my.cnf +# +# These two contexts don't handle escapes identically. SQL strings allow +# quoting any character (\C => C, for any C), but my.cnf parsing allows +# quoting only \, ' or ". For example, password='a\b' quotes a 3-character +# string in my.cnf, but a 2-character string in SQL. +# +# This simple escape works correctly in both places. +basic_single_escape () { + # The quoting on this sed command is a bit complex. Single-quoted strings + # don't allow *any* escape mechanism, so they cannot contain a single + # quote. The string sed gets (as argv[1]) is: s/\(['\]\)/\\\1/g + # + # Inside a character class, \ and ' are not special, so the ['\] character + # class is balanced and contains two characters. + echo "$1" | sed 's/\(['"'"'\]\)/\\\1/g' +} + make_config() { echo "# mysql_secure_installation config file" >$config echo "[mysql]" >>$config echo "user=root" >>$config - echo "password=$rootpass" >>$config + esc_pass=`basic_single_escape "$rootpass"` + echo "password='$esc_pass'" >>$config + #sed 's,^,> ,' < $config # Debugging } get_root_password() { @@ -94,7 +117,8 @@ set_root_password() { return 1 fi - do_query "UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';" + esc_pass=`basic_single_escape "$password1"` + do_query "UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root';" if [ $? -eq 0 ]; then echo "Password updated successfully!" echo "Reloading privilege tables.." -- cgit v1.2.1 From 3fbed5522a69882e3969fd6d62b748dbe9e51658 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 3 Nov 2009 14:34:01 -0700 Subject: Add a few comments to clarify do_query() return values in mysql_secure_installation.pl --- scripts/mysql_secure_installation.pl.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 255416763ef..25339f9b916 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -129,7 +129,11 @@ sub do_query { my $query = shift; write_file($command, $query); my $rv = system("$mysql --defaults-file=$config < $command"); + # system() returns -1 if exec fails (e.g., command not found, etc.); die + # in this case because nothing is going to work die "Failed to execute mysql client '$mysql'\n" if $rv == -1; + # Return true if query executed OK, or false if there was some problem + # (for example, SQL error or wrong password) return ($rv == 0 ? 1 : undef); } -- cgit v1.2.1 From 6e068a9cf8cc9943f2ef5f3a71bba3ee522349a1 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 4 Nov 2009 12:28:20 +0000 Subject: BUG#48048: Deprecated constructs need removal in Betony NOTE: Backport of: bzr log -r revid:sp1r-serg@sergbook.mysql.com-20070505200319-38337 ------------------------------------------------------------ revno: 2469.263.4 committer: serg@sergbook.mysql.com timestamp: Sat 2007-05-05 13:03:19 -0700 message: Removing deprecated features: --master-XXX command-line options log_bin_trust_routine_creators table_type BACKUP TABLE ... RESTORE TABLE ... SHOW PLUGIN LOAD TABLE ... FROM MASTER LOAD DATA FROM MASTER SHOW INNODB STATUS SHOW MUTEX STATUS SHOW TABLE TYPES ... TIMESTAMP(N) ... TYPE=engine RESET SLAVE don't reset connection parameters anymore LOAD DATA: check opt_secure_file_priv before access(filename) improved WARN_DEPRECATED macro --- scripts/mysql_system_tables.sql | 6 +++--- scripts/mysql_system_tables_fix.sql | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 67e18517915..1d7e80658fd 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,9 +28,9 @@ CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; -CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; +CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; @@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint sign CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; -CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- Create general_log if CSV is enabled. diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a6497f57f0a..6f5e385f87d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -342,7 +342,7 @@ ALTER TABLE procs_priv COLLATE utf8_general_ci NOT NULL AFTER Routine_name; ALTER TABLE procs_priv - MODIFY Timestamp timestamp(14) AFTER Proc_priv; + MODIFY Timestamp timestamp AFTER Proc_priv; # # proc -- cgit v1.2.1 From 13cd7170ccadbc596146175c0674956f49aed830 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 9 Nov 2009 12:32:48 +0100 Subject: WL#5161 : Cross-platform build with CMake --- scripts/CMakeLists.txt | 280 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 236 insertions(+), 44 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 25cdae2b522..de3e4c661f6 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -13,65 +13,257 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# Build mysql_fix_privilege_tables.sql -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql - COMMAND copy /b - mysql_system_tables.sql + mysql_system_tables_fix.sql - mysql_fix_privilege_tables.sql - DEPENDS - ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql - ${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql) +IF(UNIX) + # FIND_PROC and CHECK_PID are used by mysqld_safe +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET (FIND_PROC + "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() +IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET (FIND_PROC + "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() + +IF(NOT FIND_PROC) + # BSD style + EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC + "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +IF(NOT FIND_PROC) + # SysV style + EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) +IF(result3 MATCHES 0) + SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") +ELSE() + EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) + IF(result4 MATCHES 0) + SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") + ELSE() + SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") + ENDIF() +ENDIF() + +ENDIF(UNIX) + # Build comp_sql - used for embedding SQL in C or C++ programs -ADD_EXECUTABLE(comp_sql comp_sql.c) -TARGET_LINK_LIBRARIES(comp_sql dbug mysys strings) +IF(NOT CMAKE_CROSSCOMPILING) + ADD_EXECUTABLE(comp_sql comp_sql.c) + TARGET_LINK_LIBRARIES(comp_sql) +ENDIF() + +SET(FIX_PRIVS_IN + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql +) +SET(FIX_PRIVILEGES_SQL + ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql +) -# Use comp_sql to build mysql_fix_privilege_tables_sql.c -GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION) +# Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) +ADD_CUSTOM_COMMAND( + OUTPUT ${FIX_PRIVILEGES_SQL} + COMMAND ${CMAKE_COMMAND} "-DIN=${FIX_PRIVS_IN}" "-DOUT=${FIX_PRIVILEGES_SQL}" + -P "${CMAKE_SOURCE_DIR}/cmake/cat.cmake" + VERBATIM + DEPENDS ${FIX_PRIVS_IN} +) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c - COMMAND ${COMP_SQL_EXE} - mysql_fix_privilege_tables - mysql_fix_privilege_tables.sql - mysql_fix_privilege_tables_sql.c - DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql) +# Build mysql_fix_privilege_tables.c +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.c + COMMAND comp_sql + mysql_fix_privilege_tables + mysql_fix_privilege_tables.sql + mysql_fix_privilege_tables_sql.c + DEPENDS comp_sql ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) -# Add dummy target for the above to be built +# Add target for the above to be built ADD_CUSTOM_TARGET(GenFixPrivs - ALL - DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c) + ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.c +) # ---------------------------------------------------------------------- # Replace some variables @foo@ in the .in/.sh file, and write the new script # ---------------------------------------------------------------------- -SET(CFLAGS "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}") -SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}") -SET(sysconfdir ${prefix}) -SET(bindir ${prefix}/bin) -SET(libexecdir ${prefix}/bin) -SET(scriptdir ${prefix}/bin) -SET(datadir ${prefix}/share) -SET(pkgdatadir ${prefix}/share) -SET(localstatedir ${prefix}/data) +SET(CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") +SET(CXXFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") +SET(LDFLAGS "${CMAKE_SHARED_LIBRARY_LINK_FLAGS}") + +IF(WIN32) + SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}") +ELSE() + set(prefix "${CMAKE_INSTALL_PREFIX}/mysql") +ENDIF() + +SET(sysconfdir ${prefix}) +SET(bindir ${prefix}/bin) +SET(libexecdir ${prefix}/bin) +SET(scriptdir ${prefix}/bin) +SET(datadir ${prefix}/share) +SET(pkgdatadir ${prefix}/share) +SET(pkgincludedir ${prefix}/include) +SET(pkglibdir ${prefix}/lib) +SET(pkgplugindir ${prefix}/lib/plugin) +SET(localstatedir ${prefix}/data) + +# Use cmake variables to inspect dependencies for +# mysqlclient library +SET(CLIENT_LIBS "") +SET(LIBS "") +FOREACH(lib ${mysqlclient_LIB_DEPENDS}) + # Filter out general, it is CMake hint + # not real + IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ENDIF() +ENDFOREACH() +FOREACH(lib ${mysqlserver_LIB_DEPENDS}) + IF(NOT lib STREQUAL "general" AND NOT LIBS MATCHES "-l${lib} ") + SET(LIBS "${LIBS}-l${lib} " ) + ENDIF() +ENDFOREACH() +IF(MSVC) + STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") + STRING(REPLACE "-l" "" LIBS "${LIBS}" ) +ENDIF() + +SET(NON_THREADED_LIBS ${CLIENT_LIBS}) + +IF(WIN32) + # On Windows, some .sh and some .pl.in files are configured + # The resulting files will have .pl extension (those are perl scripts) + + # Input files with pl.in extension + SET(PLIN_FILES mysql_config mysql_secure_installation) + # Input files with .sh extension + SET(SH_FILES mysql_convert_table_format mysqld_multi) + + FOREACH(file ${PLIN_FILES}) + CONFIGURE_FILE(${file}.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + ENDFOREACH() + + FOREACH(file ${SH_FILES}) + CONFIGURE_FILE(${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + ENDFOREACH() +ELSE() + # On Unix, most of the files end up in the bin directory + SET(BIN_SCRIPTS + msql2mysql + mysql_config + mysql_fix_extensions + mysql_setpermission + mysql_secure_installation + mysql_zap + mysqlaccess + mysqlbug + mysql_convert_table_format + mysql_find_rows + mysqlhotcopy + mysqldumpslow + mysqld_multi + mysqlaccess + mysqlaccess.conf + mysql_install_db + ) + FOREACH(file ${BIN_SCRIPTS}) + IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) + ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} + ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY) + ELSE() + MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " + "${CMAKE_CURRENT_SOURCE_DIR}" ) + ENDIF() + + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + ENDFOREACH() + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) + + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + + # For some reason, mysqld_safe needs to be also in scripts directory + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db + DESTINATION scripts + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +ENDIF() -CONFIGURE_FILE(mysql_config.pl.in - scripts/mysql_config.pl ESCAPE_QUOTES @ONLY) +INSTALL(FILES mysql_test_data_timezone.sql DESTINATION share) -CONFIGURE_FILE(mysql_convert_table_format.sh - scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY) +IF(UNIX) + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution + "cd ${CMAKE_BINARY_DIR} && ${CMAKE_CPACK_COMMAND} -G TGZ --config CPackConfig.cmake" ) + EXECUTE_PROCESS( + COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution +) +ENDIF() -CONFIGURE_FILE(mysql_install_db.pl.in - scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY) +# Install libgcc as mylibgcc.a +IF(CMAKE_COMPILER_IS_GNUCXX) + IF(NOT LIBGCC_LOCATION) + EXECUTE_PROCESS ( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} + ${CMAKE_CXX_FLAGS} --print-libgcc + OUTPUT_VARIABLE LIBGCC_LOCATION + RESULT_VARIABLE RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) + SET(LIBGCC_LOCATION "${LIBGCC_LOCATION}" CACHE INTERNAL + "location of libgcc" ) + ENDIF() + ENDIF() + + IF(LIBGCC_LOCATION) + INSTALL (CODE "CONFIGURE_FILE (${LIBGCC_LOCATION} + ${CMAKE_CURRENT_BINARY_DIR}/libmygcc.a COPYONLY)") + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmygcc.a DESTINATION lib + OPTIONAL) + ENDIF() +ENDIF() -CONFIGURE_FILE(mysql_secure_installation.pl.in - scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY) -CONFIGURE_FILE(mysqld_multi.sh - scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY) +INSTALL (FILES + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql + ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql + DESTINATION share +) -CONFIGURE_FILE(mysqldumpslow.sh - scripts/mysqldumpslow.pl ESCAPE_QUOTES @ONLY) +# TCMalloc hacks +IF($ENV{MALLOC_LIB}) + SET(MALLOC_LIB $ENV{MALLOC_LIB} CACHE STRING "malloc library") +ENDIF() -CONFIGURE_FILE(mysqlhotcopy.sh - scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY) +IF(MALLOC_LIB) + INSTALL(FILES ${MALLOC_LIB} DESTINATION lib OPTIONAL) +ENDIF() -- cgit v1.2.1 From 9edb94c69e4f77d29dddc9fde49c4b5edf7e129f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 14 Nov 2009 14:29:14 +0100 Subject: fix make install/ mysqld_safe --- scripts/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index de3e4c661f6..0403a1bb5ae 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -55,7 +55,12 @@ ENDIF() ENDIF(UNIX) - +# some scripts use @TARGET_LINUX@ +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(TARGET_LINUX 1) +ELSE() + SET(TARGET_LINUX 0) +ENDIF() # Build comp_sql - used for embedding SQL in C or C++ programs IF(NOT CMAKE_CROSSCOMPILING) ADD_EXECUTABLE(comp_sql comp_sql.c) @@ -107,7 +112,7 @@ SET(LDFLAGS "${CMAKE_SHARED_LIBRARY_LINK_FLAGS}") IF(WIN32) SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}") ELSE() - set(prefix "${CMAKE_INSTALL_PREFIX}/mysql") + set(prefix "${CMAKE_INSTALL_PREFIX}") ENDIF() SET(sysconfdir ${prefix}) -- cgit v1.2.1 From fbd542013fc72aa6b681d656a782615514f9a40a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 16 Nov 2009 14:45:06 +0100 Subject: Fixes for cmake2.8 --- scripts/CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 0403a1bb5ae..8d246e6a38a 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -76,13 +76,12 @@ SET(FIX_PRIVILEGES_SQL ) # Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) -ADD_CUSTOM_COMMAND( - OUTPUT ${FIX_PRIVILEGES_SQL} - COMMAND ${CMAKE_COMMAND} "-DIN=${FIX_PRIVS_IN}" "-DOUT=${FIX_PRIVILEGES_SQL}" - -P "${CMAKE_SOURCE_DIR}/cmake/cat.cmake" - VERBATIM - DEPENDS ${FIX_PRIVS_IN} -) +FILE(WRITE ${FIX_PRIVILEGES_SQL} "") +FOREACH(FILENAME ${FIX_PRIVS_IN}) + FILE(READ "${FILENAME}" CONTENTS) + FILE(APPEND ${FIX_PRIVILEGES_SQL} "${CONTENTS}") +ENDFOREACH() + # Build mysql_fix_privilege_tables.c ADD_CUSTOM_COMMAND( @@ -91,7 +90,7 @@ ADD_CUSTOM_COMMAND( mysql_fix_privilege_tables mysql_fix_privilege_tables.sql mysql_fix_privilege_tables_sql.c - DEPENDS comp_sql ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql + DEPENDS comp_sql WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -- cgit v1.2.1 From 7f0a3d092e24b6bda59c48cd6e105751ee977f72 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 17 Nov 2009 17:49:24 +0100 Subject: Include the "mysql-test/collections" directory when creating windows ZIP archive --- scripts/make_win_bin_dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 24e869fe6a4..9e3fc010885 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -332,7 +332,7 @@ fi mkdir $DESTDIR/mysql-test cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ -cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/ +cp -R mysql-test/{t,r,include,suite,std_data,lib,collections} $DESTDIR/mysql-test/ # Note that this will not copy "extra" if a soft link if [ -d mysql-test/extra ] ; then -- cgit v1.2.1 From 408dd52a6ad1698619fb933b62966fa8b843f859 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 18 Nov 2009 21:36:17 +0100 Subject: Backport of the fix for BUG#40368 "mysqld_safe not honouring underscore same as dash on server options" from 6.0 (revision-id:guilhem@mysql.com-20090505113602-l12kxupeatve18dh). Such bug led "mysqld_safe --core_file_size=#" to not work because mysqld_safe wouldn't recognize that "ulimit -c" is needed; only --core-file-size=# worked. Same for --open_files_limit and other options with _ where mysqld_safe needs to do something more than passing to mysqld. Original fix by Erik Ljungstrom erik at ibiblio dot org ; slightly modified here. Tested on all internally accessible Unix. --- scripts/mysqld_safe.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 95c4419273f..70b9b9f630e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -160,7 +160,13 @@ parse_arguments() { fi for arg do - val=`echo "$arg" | sed -e "s;--[^=]*=;;"` + # the parameter after "=", or the whole $arg if no match + val=`echo "$arg" | sed -e 's;^--[^=]*=;;'` + # what's before "=", or the whole $arg if no match + optname=`echo "$arg" | sed -e 's/^\(--[^=]*\)=.*$/\1/'` + # replace "_" by "-" ; mysqld_safe must accept "_" like mysqld does. + optname_subst=`echo "$optname" | sed 's/_/-/g'` + arg=`echo $arg | sed "s/^$optname/$optname_subst/"` case "$arg" in # these get passed explicitly to mysqld --basedir=*) MY_BASEDIR_VERSION="$val" ;; -- cgit v1.2.1 From 2ca14303dba220237bd73fc141b6020ed869573c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 23 Nov 2009 13:34:39 +0000 Subject: bug#36462: mysql_install_db fails when run as user root and root-directory not writable Rather than use the -w test, attempt the chown and bail out if it fails. --- scripts/mysql_install_db.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 7e9b8a69677..b4cfc054b35 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -358,9 +358,15 @@ do mkdir -p $dir chmod 700 $dir fi - if test -w / -a ! -z "$user" + if test -n "$user" then chown $user $dir + if test $? -ne 0 + then + echo "Cannot change ownership of the database directories to the '$user'" + echo "user. Check that you have the necessary permissions and try again." + exit 1 + fi fi done -- cgit v1.2.1 From 90f2a469c98f8235edb1d94a71c326c0ce459375 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 25 Nov 2009 13:53:23 +0300 Subject: Backport of WL#798 (MySQL IPv6 support) from 6.0. The following 6.0 revisions were analyzed: - sp1r-brian@zim.(none)-20071228102738-21894 - sp1r-brian@zim.(none)-20071228121841-56447 - sp1r-brian@zim.(none)-20071228205403-56423 - sp1r-brian@zim.(none)-20071228221139-55341 - sp1r-brian@zim.(none)-20071228233443-55352 - sp1r-brian@zim.(none)-20071229094527-61763 - sp1r-brian@zim.(none)-20071230203739-61746 - sp1r-brian@zim.(none)-20080102213805-61741 - sp1r-brian@zim.(none)-20080103201041-61746 - sp1r-brian@zim.(none)-20080104234927-59875 - sp1r-brian@zim.(none)-20080105005827-59874 - sp1r-brian@zim.(none)-20080105012020-59865 - sp1r-brian@zim.(none)-20080106003858-59857 - sp1r-brian@zim.(none)-20080123195552-31680 - sp1r-brian@zim.(none)-20080124201848-29999 - sp1r-brian@zim.(none)-20080129075144-36991 - sp1r-cbell/Chuck@mysql_cab_desk.-20080215041806-21954 - sp1r-vvaintroub@wva.-20080212124547-06272 - sp1r-dfischer/mysqldev@mysql.com/production.mysql.com-20071223184258-15140 - sp1r-brian@zim.(none)-20080206122216-35774 - sp1r-baker@bk-internal.mysql.com-20080209005622-35947 - sp1r-baker@bk-internal.mysql.com-20080224215608-24613 - sp1r-baker@bk-internal.mysql.com-20080307170710-63543 - sp1r-baker@bk-internal.mysql.com-20080312233205-13069 - sp1r-Reggie@core.-20080402175211-28643 - kpettersson@mysql.com-20080901101150-4ne74r8v0492vv42 - alik@sun.com-20090805173811-9fzt0ymcp9tsvn7k - alik@sun.com-20090805173937-fcv1fdveodq5x9gb - alik@sun.com-20090805175009-g1od16i3t1xkw2qr - kostja@sun.com-20090805200643-j9i4fy7ii8ijho5c - alik@sun.com-20090807195303-j4fb5m4l1dgdahwo - alik@sun.com-20090808114848-3rkzr9kifrijzaqy - alik@sun.com-20090810041739-ugmx34h34uid8mox - alik@sun.com-20090810105306-rf43rfyzzblsy5e7 - alik@sun.com-20090810123113-ccdjwai68b5woqdm - alik@sun.com-20090811080423-gb7pibec1znaydzy - alik@sun.com-20090811082130-5uckar1vx3kdsw7g - alik@sun.com-20090812202051-uqkfwwxxcjvo5ean The following bugfixes are also backported within this patch: - Bug#34292: netdb.h missing in hostname.cc - Bug#39153: Failing to lookup a host name can lead to crash in current IPv6 implementation - Bug#38247: Server does not resolve connecting ip's - Bug#43006: main.skip_name_resolve fails on Windows in PB2 - Bug#45606: ACL requires IPv4-mapped addresses to be used - Bug#45584: Host name cache does not work as a cache --- scripts/mysql_system_tables_data.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 03136fe9361..a7988b5198e 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -24,6 +24,7 @@ set @current_hostname= @@hostname; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; -- cgit v1.2.1 From dba1a7ccd91621432f51d4663ce450e5dc1af1ff Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 26 Nov 2009 18:40:45 +0100 Subject: Delay configuring scripts like mysql_install_db until CPack runs (to handle DESTDIR correctly) --- scripts/CMakeLists.txt | 204 ++------------------------------------- scripts/Makefile.am | 3 +- scripts/install_scripts.cmake.in | 196 +++++++++++++++++++++++++++++++++++++ 3 files changed, 206 insertions(+), 197 deletions(-) create mode 100644 scripts/install_scripts.cmake.in (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8d246e6a38a..113948dc3d4 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -13,54 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -IF(UNIX) - # FIND_PROC and CHECK_PID are used by mysqld_safe -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET (FIND_PROC - "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") -ENDIF() -IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") - SET (FIND_PROC - "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") -ENDIF() - -IF(NOT FIND_PROC) - # BSD style - EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) - IF(result MATCHES 0) - SET( FIND_PROC - "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") - ENDIF() -ENDIF() - -IF(NOT FIND_PROC) - # SysV style - EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) - IF(result MATCHES 0) - SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") - ENDIF() -ENDIF() - -EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) -IF(result3 MATCHES 0) - SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") -ELSE() - EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) - IF(result4 MATCHES 0) - SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") - ELSE() - SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") - ENDIF() -ENDIF() - -ENDIF(UNIX) -# some scripts use @TARGET_LINUX@ -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(TARGET_LINUX 1) -ELSE() - SET(TARGET_LINUX 0) -ENDIF() # Build comp_sql - used for embedding SQL in C or C++ programs IF(NOT CMAKE_CROSSCOMPILING) ADD_EXECUTABLE(comp_sql comp_sql.c) @@ -100,128 +53,6 @@ ADD_CUSTOM_TARGET(GenFixPrivs DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.c ) -# ---------------------------------------------------------------------- -# Replace some variables @foo@ in the .in/.sh file, and write the new script -# ---------------------------------------------------------------------- - -SET(CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") -SET(CXXFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") -SET(LDFLAGS "${CMAKE_SHARED_LIBRARY_LINK_FLAGS}") - -IF(WIN32) - SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}") -ELSE() - set(prefix "${CMAKE_INSTALL_PREFIX}") -ENDIF() - -SET(sysconfdir ${prefix}) -SET(bindir ${prefix}/bin) -SET(libexecdir ${prefix}/bin) -SET(scriptdir ${prefix}/bin) -SET(datadir ${prefix}/share) -SET(pkgdatadir ${prefix}/share) -SET(pkgincludedir ${prefix}/include) -SET(pkglibdir ${prefix}/lib) -SET(pkgplugindir ${prefix}/lib/plugin) -SET(localstatedir ${prefix}/data) - -# Use cmake variables to inspect dependencies for -# mysqlclient library -SET(CLIENT_LIBS "") -SET(LIBS "") -FOREACH(lib ${mysqlclient_LIB_DEPENDS}) - # Filter out general, it is CMake hint - # not real - IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ENDIF() -ENDFOREACH() -FOREACH(lib ${mysqlserver_LIB_DEPENDS}) - IF(NOT lib STREQUAL "general" AND NOT LIBS MATCHES "-l${lib} ") - SET(LIBS "${LIBS}-l${lib} " ) - ENDIF() -ENDFOREACH() -IF(MSVC) - STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") - STRING(REPLACE "-l" "" LIBS "${LIBS}" ) -ENDIF() - -SET(NON_THREADED_LIBS ${CLIENT_LIBS}) - -IF(WIN32) - # On Windows, some .sh and some .pl.in files are configured - # The resulting files will have .pl extension (those are perl scripts) - - # Input files with pl.in extension - SET(PLIN_FILES mysql_config mysql_secure_installation) - # Input files with .sh extension - SET(SH_FILES mysql_convert_table_format mysqld_multi) - - FOREACH(file ${PLIN_FILES}) - CONFIGURE_FILE(${file}.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) - ENDFOREACH() - - FOREACH(file ${SH_FILES}) - CONFIGURE_FILE(${file}.sh - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) - ENDFOREACH() -ELSE() - # On Unix, most of the files end up in the bin directory - SET(BIN_SCRIPTS - msql2mysql - mysql_config - mysql_fix_extensions - mysql_setpermission - mysql_secure_installation - mysql_zap - mysqlaccess - mysqlbug - mysql_convert_table_format - mysql_find_rows - mysqlhotcopy - mysqldumpslow - mysqld_multi - mysqlaccess - mysqlaccess.conf - mysql_install_db - ) - FOREACH(file ${BIN_SCRIPTS}) - IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh - ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) - ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} - ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY) - ELSE() - MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " - "${CMAKE_CURRENT_SOURCE_DIR}" ) - ENDIF() - - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - ENDFOREACH() - - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) - - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - - # For some reason, mysqld_safe needs to be also in scripts directory - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) -ENDIF() - -INSTALL(FILES mysql_test_data_timezone.sql DESTINATION share) - IF(UNIX) FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution "cd ${CMAKE_BINARY_DIR} && ${CMAKE_CPACK_COMMAND} -G TGZ --config CPackConfig.cmake" ) @@ -230,36 +61,11 @@ IF(UNIX) ) ENDIF() -# Install libgcc as mylibgcc.a -IF(CMAKE_COMPILER_IS_GNUCXX) - IF(NOT LIBGCC_LOCATION) - EXECUTE_PROCESS ( - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} - ${CMAKE_CXX_FLAGS} --print-libgcc - OUTPUT_VARIABLE LIBGCC_LOCATION - RESULT_VARIABLE RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) - SET(LIBGCC_LOCATION "${LIBGCC_LOCATION}" CACHE INTERNAL - "location of libgcc" ) - ENDIF() - ENDIF() - - IF(LIBGCC_LOCATION) - INSTALL (CODE "CONFIGURE_FILE (${LIBGCC_LOCATION} - ${CMAKE_CURRENT_BINARY_DIR}/libmygcc.a COPYONLY)") - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmygcc.a DESTINATION lib - OPTIONAL) - ENDIF() -ENDIF() - - -INSTALL (FILES +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql DESTINATION share ) @@ -271,3 +77,9 @@ ENDIF() IF(MALLOC_LIB) INSTALL(FILES ${MALLOC_LIB} DESTINATION lib OPTIONAL) ENDIF() + +# install_scripts.cmake delays configuring scripts (e.g mysql_install_db) +# until cpack runs (necessary to handle DESTDIR correctly) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/install_scripts.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/install_scripts.cmake @ONLY) +INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install_scripts.cmake) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index cd758370388..88b1e5f92a2 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -69,7 +69,8 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ make_win_bin_dist \ mysql_fix_privilege_tables_sql.c \ mysql_system_tables_fix.sql \ - CMakeLists.txt + CMakeLists.txt \ + install_scripts.cmake.in dist_pkgdata_DATA = fill_help_tables.sql \ mysql_fix_privilege_tables.sql \ diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in new file mode 100644 index 00000000000..145c5405de3 --- /dev/null +++ b/scripts/install_scripts.cmake.in @@ -0,0 +1,196 @@ +SET(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@) +SET(UNIX @UNIX@) +SET(WIN32 @WIN32@) +SET(MSVC @MSVC@) +SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") +SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") +SET(LDFLAGS "@CMAKE_SHARED_LIBRARY_LINK_FLAGS@") +SET(mysqlclient_LIB_DEPENDS "@mysqlclient_LIB_DEPENDS@") +SET(mysqlclient_LIB_DEPENDS "@mysqlserver_LIB_DEPENDS@") +SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") +SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") +SET(CMAKE_COMPILER_IS_GNUCXX "@CMAKE_COMPILER_IS_GNUCXX@") +SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") +SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") + +IF(UNIX) + # FIND_PROC and CHECK_PID are used by mysqld_safe +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET (FIND_PROC + "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() +IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET (FIND_PROC + "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() + +IF(NOT FIND_PROC) + # BSD style + EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC + "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +IF(NOT FIND_PROC) + # SysV style + EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) +IF(result3 MATCHES 0) + SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") +ELSE() + EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) + IF(result4 MATCHES 0) + SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") + ELSE() + SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") + ENDIF() +ENDIF() + +ENDIF(UNIX) + + + + +set(prefix "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}") + +SET(sysconfdir ${prefix}) +SET(bindir ${prefix}/bin) +SET(libexecdir ${prefix}/bin) +SET(scriptdir ${prefix}/bin) +SET(datadir ${prefix}/share) +SET(pkgdatadir ${prefix}/share) +SET(pkgincludedir ${prefix}/include) +SET(pkglibdir ${prefix}/lib) +SET(pkgplugindir ${prefix}/lib/plugin) +SET(localstatedir ${prefix}/data) +# some scripts use @TARGET_LINUX@ +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(TARGET_LINUX 1) +ELSE() + SET(TARGET_LINUX 0) +ENDIF() + +# Use cmake variables to inspect dependencies for +# mysqlclient library (add -l stuff) +SET(CLIENT_LIBS "") +SET(LIBS "") +FOREACH(lib ${mysqlclient_LIB_DEPENDS}) + # Filter out "general", it is not a library, just CMake hint + IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ENDIF() +ENDFOREACH() +FOREACH(lib ${mysqlserver_LIB_DEPENDS}) + IF(NOT lib STREQUAL "general" AND NOT LIBS MATCHES "-l${lib} ") + SET(LIBS "${LIBS}-l${lib} " ) + ENDIF() +ENDFOREACH() +IF(MSVC) + STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") + STRING(REPLACE "-l" "" LIBS "${LIBS}" ) +ENDIF() + +SET(NON_THREADED_LIBS ${CLIENT_LIBS}) + +IF(WIN32) + # On Windows, some .sh and some .pl.in files are configured + # The resulting files will have .pl extension (those are perl scripts) + + # Input files with pl.in extension + SET(PLIN_FILES mysql_config mysql_secure_installation) + # Input files with .sh extension + SET(SH_FILES mysql_convert_table_format mysqld_multi) + + FOREACH(file ${PLIN_FILES}) + CONFIGURE_FILE(${file}.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + ENDFOREACH() + + FOREACH(file ${SH_FILES}) + CONFIGURE_FILE(${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + ENDFOREACH() +ELSE() + # On Unix, most of the files end up in the bin directory + SET(BIN_SCRIPTS + msql2mysql + mysql_config + mysql_fix_extensions + mysql_setpermission + mysql_secure_installation + mysql_zap + mysqlaccess + mysqlbug + mysql_convert_table_format + mysql_find_rows + mysqlhotcopy + mysqldumpslow + mysqld_multi + mysqlaccess + mysqlaccess.conf + mysql_install_db + ) + FOREACH(file ${BIN_SCRIPTS}) + IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) + ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} + ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY) + ELSE() + MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " + "${CMAKE_CURRENT_SOURCE_DIR}" ) + ENDIF() + + FILE(INSTALL DESTINATION + "${CMAKE_INSTALL_PREFIX}/bin" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES + "${CMAKE_CURRENT_BINARY_DIR}/${file}") + ENDFOREACH() + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) + + FILE(INSTALL DESTINATION + "${CMAKE_INSTALL_PREFIX}/bin" TYPE FILE + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE FILES + "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" + ) + + # For some reason, mysqld_safe needs to be also in scripts directory + FILE(INSTALL DESTINATION + "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE FILES + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db") + +ENDIF() + +# Install libgcc as mylibgcc.a +IF(CMAKE_COMPILER_IS_GNUCXX) + EXECUTE_PROCESS ( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} + ${CMAKE_CXX_FLAGS} --print-libgcc + OUTPUT_VARIABLE LIBGCC_LOCATION + RESULT_VARIABLE RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" + TYPE FILE OPTIONAL FILES "${LIBGCC_LOCATION}") + ENDIF() +ENDIF() + -- cgit v1.2.1 From be59f7ff542af9f0ee30845528120918db05b208 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 26 Nov 2009 19:55:33 +0100 Subject: Handle the "semisync" plugin in - binary distributions for Windows, - "generic" RPM packages. --- scripts/make_win_bin_dist | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index bf148c45150..34d9c560006 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -290,6 +290,11 @@ if [ -d storage/innodb_plugin ]; then cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ $DESTDIR/lib/plugin/ fi +if [ -d plugin/semisync ]; then + cp plugin/semisync/$TARGET/semisync_master.dll \ + plugin/semisync/$TARGET/semisync_slave.dll \ + $DESTDIR/lib/plugin/ +fi if [ x"$TARGET" != x"release" ] ; then cp libmysql/$TARGET/libmysql.pdb \ @@ -302,6 +307,11 @@ if [ x"$TARGET" != x"release" ] ; then cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ $DESTDIR/lib/plugin/ fi + if [ -d plugin/semisync ]; then + cp plugin/semisync/$TARGET/semisync_master.pdb \ + plugin/semisync/$TARGET/semisync_slave.pdb \ + $DESTDIR/lib/plugin/ + fi fi @@ -328,6 +338,15 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ $DESTDIR/lib/plugin/debug/ fi + if [ -d plugin/semisync ]; then + cp plugin/semisync/debug/semisync_master.dll \ + plugin/semisync/debug/semisync_master.lib \ + plugin/semisync/debug/semisync_master.pdb \ + plugin/semisync/debug/semisync_slave.dll \ + plugin/semisync/debug/semisync_slave.lib \ + plugin/semisync/debug/semisync_slave.pdb \ + $DESTDIR/lib/plugin/debug/ + fi fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From 870e78c86cd624180930c6fe7d78805915f23cbc Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 2 Dec 2009 17:17:14 +0100 Subject: Fix "command install() is not scriptable" cmake error --- scripts/install_scripts.cmake.in | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index 145c5405de3..8d6d17ce1b5 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -109,15 +109,26 @@ IF(WIN32) SET(SH_FILES mysql_convert_table_format mysqld_multi) FOREACH(file ${PLIN_FILES}) - CONFIGURE_FILE(${file}.pl.in + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + + FILE(INSTALL DESTINATION + "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE FILES + "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl") ENDFOREACH() FOREACH(file ${SH_FILES}) - CONFIGURE_FILE(${file}.sh + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts) + FILE(INSTALL DESTINATION + "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE FILES + "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl") ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory -- cgit v1.2.1 From 99654c27f07a22fcd291d46e97cb01b68e1249fb Mon Sep 17 00:00:00 2001 From: "lars-erik.bjork@sun.com" <> Date: Thu, 3 Dec 2009 17:15:47 +0100 Subject: This is a patch for bug#41569. "mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table but does not set values". mysql_upgrade (ver 5.1) adds 3 fields (character_set_client, collation_connection and db_collation) to the mysql.proc table, but does not set any values. When we run stored procedures, which were created with mysql 5.0, a warning is logged into the error log. The solution to this is for mysql_upgrade to set default best guess values for these fields. A warning is also written during upgrade, to make the user aware that default values are set. --- scripts/mysql_system_tables_fix.sql | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 1844860c84d..4260aee9142 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -415,18 +415,48 @@ ALTER TABLE proc ADD character_set_client ALTER TABLE proc MODIFY character_set_client char(32) collate utf8_bin DEFAULT NULL; +SELECT CASE WHEN COUNT(*) > 0 THEN +CONCAT ("WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (", @@character_set_client, "). Please verify if necessary.") +ELSE NULL +END +AS value FROM proc WHERE character_set_client IS NULL; + +UPDATE proc SET character_set_client = @@character_set_client + WHERE character_set_client IS NULL; + ALTER TABLE proc ADD collation_connection char(32) collate utf8_bin DEFAULT NULL AFTER character_set_client; ALTER TABLE proc MODIFY collation_connection char(32) collate utf8_bin DEFAULT NULL; +SELECT CASE WHEN COUNT(*) > 0 THEN +CONCAT ("WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (", @@collation_connection, "). Please verify if necessary.") +ELSE NULL +END +AS value FROM proc WHERE collation_connection IS NULL; + +UPDATE proc SET collation_connection = @@collation_connection + WHERE collation_connection IS NULL; + ALTER TABLE proc ADD db_collation char(32) collate utf8_bin DEFAULT NULL AFTER collation_connection; ALTER TABLE proc MODIFY db_collation char(32) collate utf8_bin DEFAULT NULL; +SELECT CASE WHEN COUNT(*) > 0 THEN +CONCAT ("WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.") +ELSE NULL +END +AS value FROM proc WHERE db_collation IS NULL; + +UPDATE proc AS p SET db_collation = + ( SELECT DEFAULT_COLLATION_NAME + FROM INFORMATION_SCHEMA.SCHEMATA + WHERE SCHEMA_NAME = p.db) + WHERE db_collation IS NULL; + ALTER TABLE proc ADD body_utf8 longblob DEFAULT NULL AFTER db_collation; ALTER TABLE proc MODIFY body_utf8 longblob DEFAULT NULL; -- cgit v1.2.1 From 8c09ac87b28b8ba9b28b5e51a7b07f7e2f8834b2 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 7 Dec 2009 15:07:26 +0100 Subject: fix small stuff in mysql_config --- scripts/install_scripts.cmake.in | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index 8d6d17ce1b5..6e43e726be5 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -6,12 +6,19 @@ SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") SET(LDFLAGS "@CMAKE_SHARED_LIBRARY_LINK_FLAGS@") SET(mysqlclient_LIB_DEPENDS "@mysqlclient_LIB_DEPENDS@") -SET(mysqlclient_LIB_DEPENDS "@mysqlserver_LIB_DEPENDS@") +SET(mysqlserver_LIB_DEPENDS "@mysqlserver_LIB_DEPENDS@") SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") SET(CMAKE_COMPILER_IS_GNUCXX "@CMAKE_COMPILER_IS_GNUCXX@") SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") +SET(VERSION "@VERSION@") +SET(MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@") +SET(MYSQL_TCP_PORT_DEFAULT "@MYSQL_TCP_PORT_DEFAULT@") +SET(MYSQL_TCP_PORT "@MYSQL_TCP_PORT@") +SET(LIBDL "@LIBDL@") +SET(LIBWRAP "@LIBWRAP@") + IF(UNIX) # FIND_PROC and CHECK_PID are used by mysqld_safe @@ -81,17 +88,34 @@ ENDIF() # mysqlclient library (add -l stuff) SET(CLIENT_LIBS "") SET(LIBS "") +LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) FOREACH(lib ${mysqlclient_LIB_DEPENDS}) # Filter out "general", it is not a library, just CMake hint IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ENDIF() -ENDFOREACH() -FOREACH(lib ${mysqlserver_LIB_DEPENDS}) - IF(NOT lib STREQUAL "general" AND NOT LIBS MATCHES "-l${lib} ") - SET(LIBS "${LIBS}-l${lib} " ) + IF (lib MATCHES "^\\-l") + SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") + ELSEIF(lib MATCHES "^/") + # Full path, convert to just filename, strip "lib" prefix and extension + GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) + STRING(REGEX REPLACE "^lib" "" lib "${lib}") + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ELSE() + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ENDIF() ENDIF() ENDFOREACH() + + +IF(LIBDL AND NOT LIBDL MATCHES "-l") + SET(LIBDL "-l${LIBDL}") +ENDIF() + +IF(LIBWRAP) + SET(WRAPLIBS "-lwrap") +ENDIF() + +SET(LIBS "${CLIENT_LIBS}") + IF(MSVC) STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") STRING(REPLACE "-l" "" LIBS "${LIBS}" ) @@ -106,6 +130,7 @@ IF(WIN32) # Input files with pl.in extension SET(PLIN_FILES mysql_config mysql_secure_installation) # Input files with .sh extension + SET(SH_FILES mysql_convert_table_format mysqld_multi) FOREACH(file ${PLIN_FILES}) -- cgit v1.2.1 From 01b671fbde92449e8d30b4051c61289a5dd56713 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 7 Dec 2009 15:56:15 +0100 Subject: Deal with empty elements in LIB_DEPENDS list (in some older 2.6 version empty element produces a warning) --- scripts/install_scripts.cmake.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index 6e43e726be5..25c2f0f237f 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -1,3 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) + SET(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@) SET(UNIX @UNIX@) SET(WIN32 @WIN32@) @@ -88,6 +90,7 @@ ENDIF() # mysqlclient library (add -l stuff) SET(CLIENT_LIBS "") SET(LIBS "") +LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) FOREACH(lib ${mysqlclient_LIB_DEPENDS}) # Filter out "general", it is not a library, just CMake hint -- cgit v1.2.1 From 5b1c0f285d512fae7489d2c2704f76f2c628f05c Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 7 Dec 2009 17:42:21 +0100 Subject: fix cmake warning about included scripts setting their minimum required version --- scripts/install_scripts.cmake.in | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index 25c2f0f237f..e4f84472fb0 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -1,5 +1,3 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) - SET(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@) SET(UNIX @UNIX@) SET(WIN32 @WIN32@) -- cgit v1.2.1 From 9b31158e3cc634e9ffc68cb4d98799562cfcb054 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 7 Dec 2009 22:01:03 +0100 Subject: simplify some tests, silence warning in script install --- scripts/install_scripts.cmake.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index e4f84472fb0..f2f64351469 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -88,6 +88,15 @@ ENDIF() # mysqlclient library (add -l stuff) SET(CLIENT_LIBS "") SET(LIBS "") + +# Avoid compatibility warning about lists with empty elements +IF(POLICY CMP0011) + CMAKE_POLICY(SET CMP0011 NEW) +ENDIF() +IF(POLICY CMP0007) + CMAKE_POLICY(SET CMP0007 OLD) +ENDIF() + LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) FOREACH(lib ${mysqlclient_LIB_DEPENDS}) -- cgit v1.2.1 From 2ae8acc2949039ff3c9e7248a86e0644956cdc36 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 16 Dec 2009 11:24:30 +0300 Subject: Remove .cvsignore files (attempt #2). --- scripts/.cvsignore | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 scripts/.cvsignore (limited to 'scripts') diff --git a/scripts/.cvsignore b/scripts/.cvsignore deleted file mode 100644 index b8444752a0d..00000000000 --- a/scripts/.cvsignore +++ /dev/null @@ -1,15 +0,0 @@ -Makefile -Makefile.in -make_binary_distribution -msql2mysql -mysql_config -mysql_convert_table_format -mysql_find_rows -mysql_fix_privilege_tables -mysql_install_db -mysql_setpermission -mysql_zap -mysqlaccess -mysqlbug -mysqlhotcopy -safe_mysqld -- cgit v1.2.1 From 67a48e1a4cfd73875e54f9416afa7328d676d7bd Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 11 Jan 2010 18:47:27 -0700 Subject: WL#2360 Performance schema Part V: performance schema implementation --- scripts/mysql_system_tables.sql | 359 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index e3ddf7ffc30..bcbedae4d0f 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2008-2009 Sun Microsystems, Inc +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + -- -- The system tables of MySQL Server -- @@ -85,3 +100,347 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; + +-- +-- The performance schema database. +-- This database is always created, even in --without-perfschema builds, +-- so that the database name is always reserved by the MySQL implementation. +-- + +set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO'); + +DROP DATABASE IF EXISTS performance_schema; + +CREATE DATABASE performance_schema character set utf8; + +-- +-- TABLE COND_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.COND_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_CURRENT +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_CURRENT("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="EVENT_ID BIGINT unsigned not null,"; +SET @l4="EVENT_NAME VARCHAR(128) not null,"; +SET @l5="SOURCE VARCHAR(64),"; +SET @l6="TIMER_START BIGINT unsigned,"; +SET @l7="TIMER_END BIGINT unsigned,"; +SET @l8="TIMER_WAIT BIGINT unsigned,"; +SET @l9="SPINS INTEGER unsigned,"; +SET @l10="OBJECT_SCHEMA VARCHAR(64),"; +SET @l11="OBJECT_NAME VARCHAR(512),"; +SET @l12="OBJECT_TYPE VARCHAR(64),"; +SET @l13="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l14="NESTING_EVENT_ID BIGINT unsigned,"; +SET @l15="OPERATION VARCHAR(16) not null,"; +SET @l16="NUMBER_OF_BYTES BIGINT unsigned,"; +SET @l17="FLAGS INTEGER unsigned"; +SET @l18=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_HISTORY +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY("; +-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_HISTORY_LONG +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG("; +-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="COUNT_STAR BIGINT unsigned not null,"; +SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l5="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="COUNT_STAR BIGINT unsigned not null,"; +SET @l5="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l8="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l9=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="COUNT_STAR BIGINT unsigned not null,"; +SET @l5="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l8="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l9=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.FILE_INSTANCES("; +SET @l2="FILE_NAME VARCHAR(512) not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="OPEN_COUNT INTEGER unsigned not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_SUMMARY_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="COUNT_READ BIGINT unsigned not null,"; +SET @l4="COUNT_WRITE BIGINT unsigned not null,"; +SET @l5="SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"; +SET @l6="SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"; +SET @l7=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_SUMMARY_BY_INSTANCE +-- + +SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE("; +SET @l2="FILE_NAME VARCHAR(512) not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="COUNT_READ BIGINT unsigned not null,"; +SET @l5="COUNT_WRITE BIGINT unsigned not null,"; +SET @l6="SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"; +SET @l7="SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE MUTEX_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.MUTEX_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="LOCKED_BY_THREAD_ID INTEGER"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE PERFORMANCE_TIMERS +-- + +SET @l1="CREATE TABLE performance_schema.PERFORMANCE_TIMERS("; +SET @l2="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"; +SET @l3="TIMER_FREQUENCY BIGINT,"; +SET @l4="TIMER_RESOLUTION BIGINT,"; +SET @l5="TIMER_OVERHEAD BIGINT"; +SET @l6=") ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE PROCESSLIST +-- + +SET @l1="CREATE TABLE performance_schema.PROCESSLIST("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="ID INTEGER not null,"; +SET @l4="NAME VARCHAR(64) not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE RWLOCK_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.RWLOCK_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="WRITE_LOCKED_BY_THREAD_ID INTEGER,"; +SET @l5="READ_LOCKED_BY_COUNT INTEGER unsigned not null"; +SET @l6=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_CONSUMERS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_CONSUMERS("; +SET @l2="NAME VARCHAR(64) not null,"; +SET @l3="ENABLED ENUM ('YES', 'NO') not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_INSTRUMENTS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_INSTRUMENTS("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="ENABLED ENUM ('YES', 'NO') not null,"; +SET @l4="TIMED ENUM ('YES', 'NO') not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_OBJECTS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_OBJECTS("; +SET @l2="OBJECT_TYPE VARCHAR(64),"; +SET @l3="OBJECT_SCHEMA VARCHAR(64),"; +SET @l4="OBJECT_NAME VARCHAR(64),"; +SET @l5="ENABLED ENUM ('YES', 'NO') not null,"; +SET @l6="TIMED ENUM ('YES', 'NO') not null,"; +SET @l7="AGGREGATED ENUM ('YES', 'NO') not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_TIMERS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS("; +SET @l2="NAME VARCHAR(64) not null,"; +SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + -- cgit v1.2.1 From 912ce798ff440ca327cdd93c7832443f851226d7 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 14 Jan 2010 00:35:07 +0000 Subject: Fix CFLAGS passed to mysql_config, in case makefile generator is Makefile based --- scripts/install_scripts.cmake.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in index f2f64351469..5a590d15b74 100644 --- a/scripts/install_scripts.cmake.in +++ b/scripts/install_scripts.cmake.in @@ -2,8 +2,16 @@ SET(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@) SET(UNIX @UNIX@) SET(WIN32 @WIN32@) SET(MSVC @MSVC@) -SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") -SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") +SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") +IF(CMAKE_GENERATOR MATCHES "Makefiles") + # No multiconfig build - use CMAKE_C_FLAGS + SET(CFLAGS "@CMAKE_C_FLAGS@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") +ELSE() + # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO + SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") +ENDIF() SET(LDFLAGS "@CMAKE_SHARED_LIBRARY_LINK_FLAGS@") SET(mysqlclient_LIB_DEPENDS "@mysqlclient_LIB_DEPENDS@") SET(mysqlserver_LIB_DEPENDS "@mysqlserver_LIB_DEPENDS@") -- cgit v1.2.1 From 742ef94290f678daffe1776fbe2663eb87de83c5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 14 Jan 2010 14:54:32 +0100 Subject: Remove support for "make install" DESTDIR - did not work as expected --- scripts/CMakeLists.txt | 238 ++++++++++++++++++++++++++++++++++++- scripts/Makefile.am | 3 +- scripts/install_scripts.cmake.in | 250 --------------------------------------- 3 files changed, 234 insertions(+), 257 deletions(-) delete mode 100644 scripts/install_scripts.cmake.in (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 113948dc3d4..8c471fd36a3 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -78,8 +78,236 @@ IF(MALLOC_LIB) INSTALL(FILES ${MALLOC_LIB} DESTINATION lib OPTIONAL) ENDIF() -# install_scripts.cmake delays configuring scripts (e.g mysql_install_db) -# until cpack runs (necessary to handle DESTDIR correctly) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/install_scripts.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/install_scripts.cmake @ONLY) -INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install_scripts.cmake) +IF(CMAKE_GENERATOR MATCHES "Makefiles") + # No multiconfig build - use CMAKE_C_FLAGS + SET(CFLAGS "@CMAKE_C_FLAGS@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") +ELSE() + # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO + SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") +ENDIF() + +IF(UNIX) + # FIND_PROC and CHECK_PID are used by mysqld_safe +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET (FIND_PROC + "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() +IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") + SET (FIND_PROC + "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") +ENDIF() + +IF(NOT FIND_PROC) + # BSD style + EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC + "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +IF(NOT FIND_PROC) + # SysV style + EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) + IF(result MATCHES 0) + SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + ENDIF() +ENDIF() + +EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) +IF(result3 MATCHES 0) + SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") +ELSE() + EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) + IF(result4 MATCHES 0) + SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") + ELSE() + SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") + ENDIF() +ENDIF() + +ENDIF(UNIX) + + + + +set(prefix "${CMAKE_INSTALL_PREFIX}") + +SET(sysconfdir ${prefix}) +SET(bindir ${prefix}/bin) +SET(libexecdir ${prefix}/bin) +SET(scriptdir ${prefix}/bin) +SET(datadir ${prefix}/share) +SET(pkgdatadir ${prefix}/share) +SET(pkgincludedir ${prefix}/include) +SET(pkglibdir ${prefix}/lib) +SET(pkgplugindir ${prefix}/lib/plugin) +SET(localstatedir ${prefix}/data) +# some scripts use @TARGET_LINUX@ +IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(TARGET_LINUX 1) +ELSE() + SET(TARGET_LINUX 0) +ENDIF() + +# Use cmake variables to inspect dependencies for +# mysqlclient library (add -l stuff) +SET(CLIENT_LIBS "") +SET(LIBS "") + +# Avoid compatibility warning about lists with empty elements +IF(POLICY CMP0011) + CMAKE_POLICY(SET CMP0011 NEW) +ENDIF() +IF(POLICY CMP0007) + CMAKE_POLICY(SET CMP0007 OLD) +ENDIF() + +LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") +LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) +FOREACH(lib ${mysqlclient_LIB_DEPENDS}) + # Filter out "general", it is not a library, just CMake hint + IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") + IF (lib MATCHES "^\\-l") + SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") + ELSEIF(lib MATCHES "^/") + # Full path, convert to just filename, strip "lib" prefix and extension + GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) + STRING(REGEX REPLACE "^lib" "" lib "${lib}") + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ELSE() + SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) + ENDIF() + ENDIF() +ENDFOREACH() + + +IF(LIBDL AND NOT LIBDL MATCHES "-l") + SET(LIBDL "-l${LIBDL}") +ENDIF() + +IF(LIBWRAP) + SET(WRAPLIBS "-lwrap") +ENDIF() + +SET(LIBS "${CLIENT_LIBS}") + +IF(MSVC) + STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") + STRING(REPLACE "-l" "" LIBS "${LIBS}" ) +ENDIF() + +SET(NON_THREADED_LIBS ${CLIENT_LIBS}) + +IF(WIN32) + # On Windows, some .sh and some .pl.in files are configured + # The resulting files will have .pl extension (those are perl scripts) + + # Input files with pl.in extension + SET(PLIN_FILES mysql_config mysql_secure_installation) + # Input files with .sh extension + + SET(SH_FILES mysql_convert_table_format mysqld_multi) + + FOREACH(file ${PLIN_FILES}) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + + INSTALL(FILES + "CMAKE_CURRENT_BINARY_DIR}/${file}.pl" + DESTINATION scripts + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) + ENDFOREACH() + + FOREACH(file ${SH_FILES}) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) + INSTALL(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl" + DESTINATION scripts + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE FILES + ) + ENDFOREACH() +ELSE() + # On Unix, most of the files end up in the bin directory + SET(BIN_SCRIPTS + msql2mysql + mysql_config + mysql_fix_extensions + mysql_setpermission + mysql_secure_installation + mysql_zap + mysqlaccess + mysqlbug + mysql_convert_table_format + mysql_find_rows + mysqlhotcopy + mysqldumpslow + mysqld_multi + mysqlaccess + mysqlaccess.conf + mysql_install_db + ) + FOREACH(file ${BIN_SCRIPTS}) + IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh + ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) + ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} + ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY) + ELSE() + MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " + "${CMAKE_CURRENT_SOURCE_DIR}" ) + ENDIF() + + INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${file} + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) + ENDFOREACH() + + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) + + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) + + # For some reason, mysqld_safe needs to be also in scripts directory + INSTALL(FILES + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" + DESTINATION scripts + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) +ENDIF() + +# Install libgcc as mylibgcc.a +IF(CMAKE_COMPILER_IS_GNUCXX) + EXECUTE_PROCESS ( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} + ${CMAKE_CXX_FLAGS} --print-libgcc + OUTPUT_VARIABLE LIBGCC_LOCATION + RESULT_VARIABLE RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) + INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION lib) + ENDIF() +ENDIF() + diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 88b1e5f92a2..dac073d00c1 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -69,8 +69,7 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ make_win_bin_dist \ mysql_fix_privilege_tables_sql.c \ mysql_system_tables_fix.sql \ - CMakeLists.txt \ - install_scripts.cmake.in + CMakeLists.txt dist_pkgdata_DATA = fill_help_tables.sql \ mysql_fix_privilege_tables.sql \ diff --git a/scripts/install_scripts.cmake.in b/scripts/install_scripts.cmake.in deleted file mode 100644 index 5a590d15b74..00000000000 --- a/scripts/install_scripts.cmake.in +++ /dev/null @@ -1,250 +0,0 @@ -SET(CMAKE_SYSTEM_NAME @CMAKE_SYSTEM_NAME@) -SET(UNIX @UNIX@) -SET(WIN32 @WIN32@) -SET(MSVC @MSVC@) -SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@") -IF(CMAKE_GENERATOR MATCHES "Makefiles") - # No multiconfig build - use CMAKE_C_FLAGS - SET(CFLAGS "@CMAKE_C_FLAGS@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") -ELSE() - # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO - SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") -ENDIF() -SET(LDFLAGS "@CMAKE_SHARED_LIBRARY_LINK_FLAGS@") -SET(mysqlclient_LIB_DEPENDS "@mysqlclient_LIB_DEPENDS@") -SET(mysqlserver_LIB_DEPENDS "@mysqlserver_LIB_DEPENDS@") -SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") -SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") -SET(CMAKE_COMPILER_IS_GNUCXX "@CMAKE_COMPILER_IS_GNUCXX@") -SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") -SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") -SET(VERSION "@VERSION@") -SET(MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@") -SET(MYSQL_TCP_PORT_DEFAULT "@MYSQL_TCP_PORT_DEFAULT@") -SET(MYSQL_TCP_PORT "@MYSQL_TCP_PORT@") -SET(LIBDL "@LIBDL@") -SET(LIBWRAP "@LIBWRAP@") - - -IF(UNIX) - # FIND_PROC and CHECK_PID are used by mysqld_safe -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET (FIND_PROC - "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") -ENDIF() -IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") - SET (FIND_PROC - "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") -ENDIF() - -IF(NOT FIND_PROC) - # BSD style - EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) - IF(result MATCHES 0) - SET( FIND_PROC - "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") - ENDIF() -ENDIF() - -IF(NOT FIND_PROC) - # SysV style - EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) - IF(result MATCHES 0) - SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") - ENDIF() -ENDIF() - -EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) -IF(result3 MATCHES 0) - SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") -ELSE() - EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) - IF(result4 MATCHES 0) - SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") - ELSE() - SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") - ENDIF() -ENDIF() - -ENDIF(UNIX) - - - - -set(prefix "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}") - -SET(sysconfdir ${prefix}) -SET(bindir ${prefix}/bin) -SET(libexecdir ${prefix}/bin) -SET(scriptdir ${prefix}/bin) -SET(datadir ${prefix}/share) -SET(pkgdatadir ${prefix}/share) -SET(pkgincludedir ${prefix}/include) -SET(pkglibdir ${prefix}/lib) -SET(pkgplugindir ${prefix}/lib/plugin) -SET(localstatedir ${prefix}/data) -# some scripts use @TARGET_LINUX@ -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(TARGET_LINUX 1) -ELSE() - SET(TARGET_LINUX 0) -ENDIF() - -# Use cmake variables to inspect dependencies for -# mysqlclient library (add -l stuff) -SET(CLIENT_LIBS "") -SET(LIBS "") - -# Avoid compatibility warning about lists with empty elements -IF(POLICY CMP0011) - CMAKE_POLICY(SET CMP0011 NEW) -ENDIF() -IF(POLICY CMP0007) - CMAKE_POLICY(SET CMP0007 OLD) -ENDIF() - -LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") -LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) -FOREACH(lib ${mysqlclient_LIB_DEPENDS}) - # Filter out "general", it is not a library, just CMake hint - IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") - IF (lib MATCHES "^\\-l") - SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") - ELSEIF(lib MATCHES "^/") - # Full path, convert to just filename, strip "lib" prefix and extension - GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib "${lib}") - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ELSE() - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ENDIF() - ENDIF() -ENDFOREACH() - - -IF(LIBDL AND NOT LIBDL MATCHES "-l") - SET(LIBDL "-l${LIBDL}") -ENDIF() - -IF(LIBWRAP) - SET(WRAPLIBS "-lwrap") -ENDIF() - -SET(LIBS "${CLIENT_LIBS}") - -IF(MSVC) - STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") - STRING(REPLACE "-l" "" LIBS "${LIBS}" ) -ENDIF() - -SET(NON_THREADED_LIBS ${CLIENT_LIBS}) - -IF(WIN32) - # On Windows, some .sh and some .pl.in files are configured - # The resulting files will have .pl extension (those are perl scripts) - - # Input files with pl.in extension - SET(PLIN_FILES mysql_config mysql_secure_installation) - # Input files with .sh extension - - SET(SH_FILES mysql_convert_table_format mysqld_multi) - - FOREACH(file ${PLIN_FILES}) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - - FILE(INSTALL DESTINATION - "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE FILES - "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl") - ENDFOREACH() - - FOREACH(file ${SH_FILES}) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - FILE(INSTALL DESTINATION - "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE FILES - "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl") - ENDFOREACH() -ELSE() - # On Unix, most of the files end up in the bin directory - SET(BIN_SCRIPTS - msql2mysql - mysql_config - mysql_fix_extensions - mysql_setpermission - mysql_secure_installation - mysql_zap - mysqlaccess - mysqlbug - mysql_convert_table_format - mysql_find_rows - mysqlhotcopy - mysqldumpslow - mysqld_multi - mysqlaccess - mysqlaccess.conf - mysql_install_db - ) - FOREACH(file ${BIN_SCRIPTS}) - IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh - ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) - ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} - ${CMAKE_CURRENT_BINARY_DIR}/${file} COPYONLY) - ELSE() - MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " - "${CMAKE_CURRENT_SOURCE_DIR}" ) - ENDIF() - - FILE(INSTALL DESTINATION - "${CMAKE_INSTALL_PREFIX}/bin" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES - "${CMAKE_CURRENT_BINARY_DIR}/${file}") - ENDFOREACH() - - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) - - FILE(INSTALL DESTINATION - "${CMAKE_INSTALL_PREFIX}/bin" TYPE FILE - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE FILES - "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" - ) - - # For some reason, mysqld_safe needs to be also in scripts directory - FILE(INSTALL DESTINATION - "${CMAKE_INSTALL_PREFIX}/scripts" TYPE FILE - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE FILES - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db") - -ENDIF() - -# Install libgcc as mylibgcc.a -IF(CMAKE_COMPILER_IS_GNUCXX) - EXECUTE_PROCESS ( - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} - ${CMAKE_CXX_FLAGS} --print-libgcc - OUTPUT_VARIABLE LIBGCC_LOCATION - RESULT_VARIABLE RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) - FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" - TYPE FILE OPTIONAL FILES "${LIBGCC_LOCATION}") - ENDIF() -ENDIF() - -- cgit v1.2.1 From f0a32f40270c583d3d072899300eadc4ac89165f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 14 Jan 2010 15:02:27 +0100 Subject: fix syntax error in INSTALL cmake command --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 8c471fd36a3..1acbe944599 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -232,7 +232,7 @@ IF(WIN32) DESTINATION scripts PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE FILES + WORLD_READ WORLD_EXECUTE ) ENDFOREACH() ELSE() -- cgit v1.2.1 From 4e04b863552da3ffc885a71aa4a093b575a40d8a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 15 Jan 2010 01:21:43 +0100 Subject: port some mysql_binary_distribution hacks to cmake --- scripts/CMakeLists.txt | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 1acbe944599..98fa00d01ea 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -133,8 +133,30 @@ ENDIF(UNIX) -set(prefix "${CMAKE_INSTALL_PREFIX}") +# Really ugly, one script, "mysql_install_db", needs prefix set to ".", +# i.e. makes access relative the current directory. This matches +# the documentation, so better not change this. + +SET(prefix .) +SET(bindir ./bin) +SET(sbindir ./bin) +SET(scriptdir ./bin) +SET(libexecdir ./bin) +SET(pkgdatadir ./share) +SET(localstatedir ./data) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) + +INSTALL(FILES + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + ) + +SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) SET(bindir ${prefix}/bin) SET(libexecdir ${prefix}/bin) @@ -253,7 +275,6 @@ ELSE() mysqld_multi mysqlaccess mysqlaccess.conf - mysql_install_db ) FOREACH(file ${BIN_SCRIPTS}) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) @@ -288,7 +309,7 @@ ELSE() # For some reason, mysqld_safe needs to be also in scripts directory INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" + "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" DESTINATION scripts PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE -- cgit v1.2.1 From ce59ee8098e22d99f402eea1b9d2d5de62a0caaf Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 18 Jan 2010 21:19:24 +0100 Subject: Fix some problems found by kent. -lm is sometimes not linked, which causes errors about undefined rint() - FreeBSD embedded library does not link with the flags returned by mysql_config (added -lcrypt to LIBS, whereby causing overlinking in case of normal non-embedded client) --- scripts/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 98fa00d01ea..0b574fc0621 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -216,6 +216,10 @@ ENDIF() SET(LIBS "${CLIENT_LIBS}") +IF(LIBCRYPT) + SET(LIBS "${LIBS} -l${LIBCRYPT}") +ENDIF() + IF(MSVC) STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") STRING(REPLACE "-l" "" LIBS "${LIBS}" ) -- cgit v1.2.1 From 0482b6ebca43fa168550005ecb7f94e3c0729923 Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Thu, 21 Jan 2010 09:10:05 +0100 Subject: WL#5154 Remove deprecated 4.1 features Several items said to be deprecated in the 4.1 manual have never been removed. This worklog adds deprecation warnings when these items are used, and warns the user that the items will be removed in MySQL 5.6. A couple of previously deprecation decision have been reversed (see single file comments) --- scripts/mysqld_multi.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 430c74874eb..528a1ca2e98 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -68,7 +68,10 @@ sub main # than a correct --defaults-extra-file option unshift @defaults_options, "--defaults-extra-file=$1"; + print "WARNING: --config-file is deprecated and will be removed\n"; + print "in MySQL 5.6. Please use --defaults-extra-file instead\n"; } + } } foreach (@defaults_options) -- cgit v1.2.1 From c827968a2df5ad35e64cea0116abf862776cef26 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 24 Jan 2010 16:23:16 +0100 Subject: Handle different installation layouts. using cmake option INSTALL_LAYOUT=STANDALONE would produce the layout as in tar.gz or zip packages. INSTALL_LAYOUT=UNIX will produce unixish install layout (with mysqld being in sbin subdirectory , libs in lib/mysql etc). This layout is used for RPM packages. Subtle differences in both packages unfortunately lead to the need to recompile MySQL to use with other package type - as otherwise for example default plugins or data directories would be wrong set. There are numerous other variables that allow fine-tuning packaging layout. (INSTALL_BINDIR, INSTALL_LIBDIR , INSTALL_PLUGINDIR etc). This options are different from autotools as they do not expect full paths to directories, but only subdirectory of CMAKE_INSTALL_PREFIX. There are 2 special options that expect full directory paths - MYSQL_DATADIR that defines default MYSQL data directory (autotools equivalent is --localstatedir) - SYSCONFDIR can be added to search my.cnf search path (autotools equivalent is --sysconfdir) --- scripts/CMakeLists.txt | 76 ++++++++++++++++++++++---------------------------- scripts/mysqld_safe.sh | 7 +++++ 2 files changed, 41 insertions(+), 42 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 0b574fc0621..44de52f254f 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -66,7 +66,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql - DESTINATION share + DESTINATION ${INSTALL_MYSQLSHAREDIR} ) # TCMalloc hacks @@ -137,13 +137,23 @@ ENDIF(UNIX) # i.e. makes access relative the current directory. This matches # the documentation, so better not change this. -SET(prefix .) -SET(bindir ./bin) -SET(sbindir ./bin) -SET(scriptdir ./bin) -SET(libexecdir ./bin) -SET(pkgdatadir ./share) -SET(localstatedir ./data) +IF(INSTALL_LAYOUT MATCHES "STANDALONE") + SET(prefix ".") +ELSE() + SET(prefix "${CMAKE_INSTALL_PREFIX}") +ENDIF() + +SET(bindir ${prefix}/${INSTALL_BINDIR}) +SET(sbindir ${prefix}/${INSTALL_SBINDIR}) +SET(scriptdir ${prefix}/${INSTALL_BINDIR}) +SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) +SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) +IF(INSTALL_LAYOUT MATCHES "STANDALONE") + SET(localstatedir ${prefix}/data) +ELSE() + SET(localstatedir ${MYSQL_DATADIR}) +ENDIF() + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) @@ -158,15 +168,16 @@ INSTALL(FILES SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) -SET(bindir ${prefix}/bin) -SET(libexecdir ${prefix}/bin) -SET(scriptdir ${prefix}/bin) -SET(datadir ${prefix}/share) -SET(pkgdatadir ${prefix}/share) -SET(pkgincludedir ${prefix}/include) -SET(pkglibdir ${prefix}/lib) -SET(pkgplugindir ${prefix}/lib/plugin) -SET(localstatedir ${prefix}/data) +SET(bindir ${prefix}/${INSTALL_BINDIR}) +SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) +SET(scriptdir ${prefix}/${INSTALL_BINDIR}) +SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) +SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) +SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR}) +SET(pkglibdir ${prefix}/${INSTALL_LIBDIR}) +SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR}) +SET(localstatedir ${MYSQL_DATADIR}) + # some scripts use @TARGET_LINUX@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(TARGET_LINUX 1) @@ -242,7 +253,7 @@ IF(WIN32) ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) INSTALL(FILES - "CMAKE_CURRENT_BINARY_DIR}/${file}.pl" + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE @@ -254,7 +265,7 @@ IF(WIN32) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${file}.pl" + ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl DESTINATION scripts PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE @@ -279,6 +290,7 @@ ELSE() mysqld_multi mysqlaccess mysqlaccess.conf + mysqld_safe ) FOREACH(file ${BIN_SCRIPTS}) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) @@ -291,38 +303,18 @@ ELSE() MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " "${CMAKE_CURRENT_SOURCE_DIR}" ) ENDIF() - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} - DESTINATION bin + DESTINATION ${INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) ENDFOREACH() - - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqld_safe.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe @ONLY) - - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" - DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) - - # For some reason, mysqld_safe needs to be also in scripts directory - INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe" - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) ENDIF() # Install libgcc as mylibgcc.a -IF(CMAKE_COMPILER_IS_GNUCXX) +IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_FLAGS MATCHES "-static") EXECUTE_PROCESS ( COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS} --print-libgcc @@ -332,7 +324,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX) ERROR_QUIET ) IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) - INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION lib) + INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR}) ENDIF() ENDIF() diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 70b9b9f630e..f08e870d5e0 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -361,6 +361,9 @@ then if test -x "$MY_BASEDIR_VERSION/libexec/mysqld" then ledir="$MY_BASEDIR_VERSION/libexec" + elif test -x "$MY_BASEDIR_VERSION/sbin/mysqld" + then + ledir="$MY_BASEDIR_VERSION/sbin" else ledir="$MY_BASEDIR_VERSION/bin" fi @@ -373,6 +376,10 @@ elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld" then MY_BASEDIR_VERSION="$MY_PWD" # Where libexec, share and var are ledir="$MY_PWD/libexec" # Where mysqld is +elif test -f "$relpkgdata"/english/errmsg.sys -a -x "$MY_PWD/sbin/mysqld" +then + MY_BASEDIR_VERSION="$MY_PWD" # Where sbin, share and var are + ledir="$MY_PWD/sbin" # Where mysqld is # Since we didn't find anything, used the compiled-in defaults else MY_BASEDIR_VERSION='@prefix@' -- cgit v1.2.1 From 065dfb3f5d6d82d782602dcad806967b7902378a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 4 Feb 2010 02:17:18 +0100 Subject: - Optionally, copy mysqld renamed to mysqld-debug from debug build directory into resulting package - Fix to mysql_install_db.pl to the correct place on Windows ( under scripts directory) --- scripts/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 44de52f254f..dd9c5785dcb 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -154,12 +154,21 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() +IF(UNIX) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_BINDIR}) + SET(EXT) +ELSE() + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db.pl ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_SCRIPTDIR}) + SET(EXT ".pl") +ENDIF() INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" - DESTINATION bin + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" + DESTINATION ${DEST} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE -- cgit v1.2.1 From 890c52d889231c7854c52d7b649d2be24e509e69 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 10 Feb 2010 20:23:24 +0100 Subject: Add components to INSTALL, some eraly Wix support --- scripts/CMakeLists.txt | 46 +++++++++++++++++----------------------------- scripts/make_win_bin_dist | 2 +- 2 files changed, 18 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index dd9c5785dcb..28b14661265 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -66,7 +66,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql - DESTINATION ${INSTALL_MYSQLSHAREDIR} + DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server ) # TCMalloc hacks @@ -166,12 +166,10 @@ ELSE() SET(EXT ".pl") ENDIF() -INSTALL(FILES +INSTALL_SCRIPT( "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" - DESTINATION ${DEST} - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE + DESTINATION ${INSTALL_BINDIR} + COMPONENT Server ) @@ -260,29 +258,17 @@ IF(WIN32) FOREACH(file ${PLIN_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl) ENDFOREACH() FOREACH(file ${SH_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl) ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory + SET(mysql_config_COMPONENT COMPONENT Development) SET(BIN_SCRIPTS msql2mysql mysql_config @@ -312,13 +298,14 @@ ELSE() MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " "${CMAKE_CURRENT_SOURCE_DIR}" ) ENDIF() - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file} - DESTINATION ${INSTALL_BINDIR} - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + IF(NOT ${file}_COMPONENT) + SET(${file}_COMPONENT Server) + ENDIF() + INSTALL_SCRIPT( + ${CMAKE_CURRENT_BINARY_DIR}/${file} + DESTINATION ${INSTALL_BINDIR} + COMPONENT ${${file}_COMPONENT} + ) ENDFOREACH() ENDIF() @@ -333,7 +320,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_FLAGS MATCHES "-static") ERROR_QUIET ) IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) - INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR}) + INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR} + COMPONENT Development) ENDIF() ENDIF() diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 51271a3dad0..0cbbd5db283 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -158,7 +158,7 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map +cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map || /bin/true if [ x"$TARGET" != x"release" ] ; then cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb fi -- cgit v1.2.1 From 9947636bbaede8996ac81b37f84c779c7fadd5df Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 12 Feb 2010 18:28:35 +0200 Subject: Bug #35250: readline check breaks when doing vpath build Fixed several (obvious) places that don't work with vpath build. --- scripts/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 0292617c7a5..1aa24c5d432 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -110,7 +110,8 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ mysql_system_tables_fix.sql @echo "Building $@"; - @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ + @cat $(srcdir)/mysql_system_tables.sql \ + $(srcdir)/mysql_system_tables_fix.sql > $@ # # Build mysql_fix_privilege_tables_sql.c from @@ -123,7 +124,7 @@ mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql sleep 2 $(top_builddir)/scripts/comp_sql$(EXEEXT) \ mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ + $(top_builddir)/scripts/mysql_fix_privilege_tables.sql $@ SUFFIXES = .sh -- cgit v1.2.1 From 7e01172ce3737d5ab621c3f4ffd06af00b416df8 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 16 Feb 2010 16:06:57 +0100 Subject: Fix a couple fo things replated to MSI --- scripts/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 28b14661265..58412a9140e 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -244,6 +244,7 @@ IF(MSVC) ENDIF() SET(NON_THREADED_LIBS ${CLIENT_LIBS}) +SET(mysql_config_COMPONENT COMPONENT Development) IF(WIN32) # On Windows, some .sh and some .pl.in files are configured @@ -256,15 +257,18 @@ IF(WIN32) SET(SH_FILES mysql_convert_table_format mysqld_multi) FOREACH(file ${PLIN_FILES}) + IF(NOT ${file}_COMPONENT) + SET(${file}_COMPONENT Server_Scripts) + ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT}) ENDFOREACH() FOREACH(file ${SH_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT}) ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory -- cgit v1.2.1 From 1f7f620f3042a5b9c08912ae64b92c129e03065f Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Wed, 17 Feb 2010 10:18:17 +0100 Subject: WL#5154 Remove deprecated 4.1 features A set of program options and variables was deprecated in MySQL 5.1, and is hereby removed. --- scripts/mysqld_multi.sh | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 430c74874eb..588c48fae4c 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -59,18 +59,6 @@ sub main push @defaults_options, (shift @ARGV); } - # Handle deprecated --config-file option: convert to --defaults-extra-file - foreach my $arg (@ARGV) - { - if ($arg =~ m/^--config-file=(.*)/) - { - # Put it at the beginning of the list, so it has lower precedence - # than a correct --defaults-extra-file option - - unshift @defaults_options, "--defaults-extra-file=$1"; - } - } - foreach (@defaults_options) { $_ = quote_shell_word($_); @@ -79,11 +67,6 @@ sub main # Add [mysqld_multi] options to front of @ARGV, ready for GetOptions() unshift @ARGV, defaults_for_group('mysqld_multi'); - # The --config-file option can be ignored; if passed on the command - # line, it's already handled; if specified in the configuration file, - # it's redundant and not useful - @ARGV= grep { not /^--config-file=/ } @ARGV; - # We've already handled --no-defaults, --defaults-file, etc. if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s", "user=s", "password=s", "log=s", "no-log", @@ -740,8 +723,8 @@ from both [mysqld_multi] and [mysqld#], a group that is tried to be used, $my_progname will abort with an error. $my_progname will search for groups named [mysqld#] from my.cnf (or -the given --config-file=...), where '#' can be any positive integer -starting from 1. These groups should be the same as the regular +the given --defaults-extra-file=...), where '#' can be any positive +integer starting from 1. These groups should be the same as the regular [mysqld] group, but with those port, socket and any other options that are to be used with each separate mysqld process. The number in the group name has another function; it can be used for starting, @@ -767,7 +750,6 @@ These options must be given before any others: standard system-wide and user-specific files Using: @{[join ' ', @defaults_options]} ---config-file=... Deprecated, please use --defaults-extra-file instead --example Give an example of a config file with extra information. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: -- cgit v1.2.1 From df555c117cb9415e6076c48c94189c421837f4b0 Mon Sep 17 00:00:00 2001 From: "hery.ramilison@sun.com" <> Date: Wed, 17 Feb 2010 18:39:28 +0100 Subject: configure.in - Changes to the banner text - Use older AC_PROG_LIBTOOL (Bug#51009) scripts/mysql_install_db.sh - Changes to banner text --- scripts/mysql_install_db.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 20b7973cb4e..c5e4a1f1cba 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -410,8 +410,7 @@ else echo "Try 'mysqld --help' if you have problems with paths. Using --log" echo "gives you a log in $ldata that may be helpful." echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com/. Please consult the MySQL manual section" + echo "Please consult the MySQL manual section" echo "'Problems running mysql_install_db', and the manual section that" echo "describes problems on your OS. Another information source are the" echo "MySQL email archives available at http://lists.mysql.com/." @@ -470,9 +469,6 @@ then echo echo "Please report any problems with the $scriptdir/mysqlbug script!" echo - echo "The latest information about MySQL is available at http://www.mysql.com/" - echo "Support MySQL by buying support/licenses from http://shop.mysql.com/" - echo fi exit 0 -- cgit v1.2.1 From 0563ac784eedbdfe8a061d73895a01d98289d267 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 19 Feb 2010 18:30:08 +0100 Subject: Fix some glitches with INSTALL_LAYOUT=STANDALONE - mysql_install_db is in scripts dir now - sql-bench is installed -some extra support-files (e.g ini) are in support-files --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index dd9c5785dcb..315103db4b0 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -157,7 +157,7 @@ ENDIF() IF(UNIX) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) - SET(DEST ${INSTALL_BINDIR}) + SET(DEST ${INSTALL_SCRIPTDIR}) SET(EXT) ELSE() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in -- cgit v1.2.1 From 00ce21159caa8b5bc01d7563b6757108d18f6ca5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 25 Feb 2010 21:40:15 +0100 Subject: Bug#51502: building with cmake creates an invalid mysqld_safe. The problem was incorrect escaping used inside a strnig : in \"$MYSQLD\" was written as "\MYSQL\" (backslash and quote characters transposed), when defining FIND_PROC variable for BSD or SysV style "ps" command- Additionally fixed obvious code duplication and random naming in CHECK_PID test. --- scripts/CMakeLists.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 92cba86fc8a..f838d27a241 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -103,9 +103,9 @@ ENDIF() IF(NOT FIND_PROC) # BSD style EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) - IF(result MATCHES 0) + IF(result MATCHES 0) SET( FIND_PROC - "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null") ENDIF() ENDIF() @@ -113,20 +113,15 @@ IF(NOT FIND_PROC) # SysV style EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) IF(result MATCHES 0) - SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- "\$MYSQLD\" | grep \" $PID \" > /dev/null") + SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null") ENDIF() ENDIF() -EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result2) -IF(result3 MATCHES 0) +EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) +IF(result MATCHES 0) SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null") ELSE() - EXECUTE_PROCESS(COMMAND sh -c "kill -s 0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result3) - IF(result4 MATCHES 0) - SET(CHECK_PID "kill -s 0 $PID > /dev/null 2> /dev/null") - ELSE() - SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") - ENDIF() + SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") ENDIF() ENDIF(UNIX) -- cgit v1.2.1 From 5dd3b617d447658b6fe373975a24a1437a04af4e Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 26 Feb 2010 09:22:48 -0300 Subject: Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL The problem was that the CSV storage engine does not support NULL fields, yet in some early 5.1 version the log tables (general_log and slow_log) were created with null fields. On top of this, when altering a CSV table column, all fields of the table must be NOT NULL otherwise the alteration fails. The solution is to ensure that during upgrade all columns of the log tables are NOT NULL. --- scripts/mysql_system_tables_fix.sql | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 4260aee9142..deeb4d4de82 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -221,12 +221,29 @@ ALTER TABLE func SET @old_log_state = @@global.general_log; SET GLOBAL general_log = 'OFF'; -ALTER TABLE general_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; +ALTER TABLE general_log + MODIFY event_time TIMESTAMP NOT NULL, + MODIFY user_host MEDIUMTEXT NOT NULL, + MODIFY thread_id INTEGER NOT NULL, + MODIFY server_id INTEGER UNSIGNED NOT NULL, + MODIFY command_type VARCHAR(64) NOT NULL, + MODIFY argument MEDIUMTEXT NOT NULL; SET GLOBAL general_log = @old_log_state; SET @old_log_state = @@global.slow_query_log; SET GLOBAL slow_query_log = 'OFF'; -ALTER TABLE slow_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL; +ALTER TABLE slow_log + MODIFY start_time TIMESTAMP NOT NULL, + MODIFY user_host MEDIUMTEXT NOT NULL, + MODIFY query_time TIME NOT NULL, + MODIFY lock_time TIME NOT NULL, + MODIFY rows_sent INTEGER NOT NULL, + MODIFY rows_examined INTEGER NOT NULL, + MODIFY db VARCHAR(512) NOT NULL, + MODIFY last_insert_id INTEGER NOT NULL, + MODIFY insert_id INTEGER NOT NULL, + MODIFY server_id INTEGER UNSIGNED NOT NULL, + MODIFY sql_text MEDIUMTEXT NOT NULL; SET GLOBAL slow_query_log = @old_log_state; # -- cgit v1.2.1 From 6f51e9e4f8e1d9615952788c722389fa36dda4c8 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 26 Feb 2010 14:49:13 +0200 Subject: Bug #51468: mysqld_multi is broken in 5.1.44 Fixed a syntax error in mysqld_multi.sh --- scripts/mysqld_multi.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 528a1ca2e98..3d3853bcb22 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -71,7 +71,6 @@ sub main print "WARNING: --config-file is deprecated and will be removed\n"; print "in MySQL 5.6. Please use --defaults-extra-file instead\n"; } - } } foreach (@defaults_options) -- cgit v1.2.1 From 73c4dc36994847b5608ed1a242f7883e3f45f729 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 28 Feb 2010 23:49:29 +0400 Subject: Bug#42465 mysqlhotcopy fails with "Table '' was locked with a READ lock" error message. Since 5.5 FLUSH TABLES requires unlocked tables so the old LOCK TABLES/FLUSH TABLES model fails. Use atomic FLUSH TABLES WITH READ LOCK instead. per-file comments: scripts/mysqlhotcopy.sh Bug#42465 mysqlhotcopy fails with "Table '' was locked with a READ lock" error message. Use FLUSH TABLES WITH READ LOCK instead of LOCK TABLES / FLUSH TABLES pair. Keep the old scheme for older servers. --- scripts/mysqlhotcopy.sh | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 21fca0c0848..90f759739d0 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -56,6 +56,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory] -h, --host=# hostname for local server when connecting over TCP/IP -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server + --old_server connect to old MySQL-server (before v5.5) which + doesn't have FLUSH TABLES WITH READ LOCK fully implemented. --allowold don\'t abort if target dir already exists (rename it _old) --addtodest don\'t rename target dir if it exists, just add files to it @@ -103,6 +105,7 @@ GetOptions( \%opt, "password|p=s", "port|P=s", "socket|S=s", + "old_server", "allowold!", "keepold!", "addtodest!", @@ -441,21 +444,37 @@ if ( $opt{checkpoint} || $opt{record_log_pos} ) { my $hc_started = time; # count from time lock is granted if ( $opt{dryrun} ) { - print "LOCK TABLES $hc_locks\n"; - print "FLUSH TABLES /*!32323 $hc_tables */\n"; + if ( $opt{old_server} ) { + print "LOCK TABLES $hc_locks\n"; + print "FLUSH TABLES /*!32323 $hc_tables */\n"; + } + else { + print "FLUSH TABLES $hc_tables WITH READ LOCK\n"; + } + print "FLUSH LOGS\n" if ( $opt{flushlog} ); print "RESET MASTER\n" if ( $opt{resetmaster} ); print "RESET SLAVE\n" if ( $opt{resetslave} ); } else { my $start = time; - $dbh->do("LOCK TABLES $hc_locks"); - printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; - $hc_started = time; # count from time lock is granted + if ( $opt{old_server} ) { + $dbh->do("LOCK TABLES $hc_locks"); + printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; + $hc_started = time; # count from time lock is granted + + # flush tables to make on-disk copy up to date + $start = time; + $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + } + else { + $dbh->do("FLUSH TABLES $hc_tables WITH READ LOCK"); + printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; + $hc_started = time; # count from time lock is granted - # flush tables to make on-disk copy up to date - $start = time; - $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + # flush tables to make on-disk copy up to date + $start = time; + } printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); @@ -975,6 +994,10 @@ when using the --host option. UNIX domain socket to use when connecting to local server. +=item --old_server + +Use old server (pre v5.5) commands. + =item --noindices Don\'t include index files in copy. Only up to the first 2048 bytes -- cgit v1.2.1 From 746965b7e93946d8e4156c5504b831f3c7f9d848 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 1 Mar 2010 23:40:24 +0100 Subject: Bug #49022: Plugins included into bin release cannot be installed on debug version of server When starting a server using mysqld_safe with the option --mysqld-version=debug, the debug version of the server is started. When attempting to load a plugin that is not debug-built, the load will fail because a non-debug built plugin use, e.g., fastmutex while the debug-built server uses safemutex. To solve this problem, mysqld_safe will set the plugin-dir to use a directory where debug-built plugins are placed. This patch sets the plugin dir to /whatever, when mysqld-version=whatever, and just otherwise. --- scripts/mysqld_safe.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f08e870d5e0..a4ce5f9575b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -54,6 +54,8 @@ Usage: $0 [OPTIONS] --mysqld=FILE Use the specified file as mysqld --mysqld-version=VERSION Use "mysqld-VERSION" as mysqld --nice=NICE Set the scheduling priority of mysqld + --plugin-dir=DIR Plugins are under DIR or DIR/VERSION, if + VERSION is given --skip-kill-mysqld Don't try to kill stray mysqld processes --syslog Log messages to syslog with 'logger' --skip-syslog Log messages to error log (default) @@ -172,6 +174,7 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION="$val" ;; --datadir=*) DATADIR="$val" ;; --pid-file=*) pid_file="$val" ;; + --plugin-dir=*) PLUGIN_DIR="$val" ;; --user=*) user="$val"; SET_USER=1 ;; # these might have been set in a [mysqld_safe] section of my.cnf @@ -189,6 +192,7 @@ parse_arguments() { if test -n "$val" then MYSQLD="mysqld-$val" + PLUGIN_VARIANT="/$val" else MYSQLD="mysqld" fi @@ -695,8 +699,10 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" +plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}" + for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ - "--datadir=$DATADIR" "$USER_OPTION" + "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" do cmd="$cmd "`shell_quote_string "$i"` done -- cgit v1.2.1 From 273d74eaa586117951113a372249c1cd0bbdb842 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 3 Mar 2010 12:29:34 +0100 Subject: Bug #51488 :missing features and change behavior in cmake runs compared to autotools runs - Fix recognition of --with-debug=full in configure wrapper - Remove CMakeCache.txt in configure wrapper, to match the original - Fix recognition of max-no-ndb - Fix broken dependencies of mysql_fix_privilege_table.sql from mysql_system_tables.sql and mysql_system_tables_fix.sql - Add "distclean target" that informs user about appropriate bzr command --- scripts/CMakeLists.txt | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index f838d27a241..26dfb243897 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -20,31 +20,41 @@ IF(NOT CMAKE_CROSSCOMPILING) TARGET_LINK_LIBRARIES(comp_sql) ENDIF() -SET(FIX_PRIVS_IN - ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql - ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql -) -SET(FIX_PRIVILEGES_SQL - ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql -) # Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) -FILE(WRITE ${FIX_PRIVILEGES_SQL} "") -FOREACH(FILENAME ${FIX_PRIVS_IN}) - FILE(READ "${FILENAME}" CONTENTS) - FILE(APPEND ${FIX_PRIVILEGES_SQL} "${CONTENTS}") -ENDFOREACH() +IF(NOT WIN32 OR CMAKE_CROSSCOMPILING) + FIND_PROGRAM(CAT_EXECUTABLE cat DOC "path to the executable") +ENDIF() +IF(CAT_EXECUTABLE) + SET(CAT_COMMAND COMMAND + ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} + ${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql > + ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql + ) +ELSEIF(WIN32) + FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql + native_outfile ) + SET(CAT_COMMAND + COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} + cmd /c copy /b mysql_system_tables.sql + mysql_system_tables_fix.sql + ${native_outfile} ) +ELSE() + MESSAGE(FATAL_ERROR "Cannot concatenate files") +ENDIF() # Build mysql_fix_privilege_tables.c ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.c + ${CAT_COMMAND} COMMAND comp_sql mysql_fix_privilege_tables mysql_fix_privilege_tables.sql mysql_fix_privilege_tables_sql.c - DEPENDS comp_sql WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS comp_sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql + ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql ) # Add target for the above to be built -- cgit v1.2.1 From 51f7f7f43ec456720bc4b24a1d898483e274ad80 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 5 Mar 2010 08:31:01 -0700 Subject: Bug#45194 mysql_upgrade deletes existing data in performance_schema database/schema Before this fix, mysql_upgrade would always drop and re create the performance_schema database. This in theory could destroy user data created using 5.1 or older versions. With this fix, mysql_upgrade checks the content of the performance_schema database before droping it. --- scripts/mysql_system_tables.sql | 84 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index bcbedae4d0f..69d6d6d7feb 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,4 +1,4 @@ --- Copyright (C) 2008-2009 Sun Microsystems, Inc +-- Copyright (C) 2008, 2010 Oracle and/or its affiliates. All rights reserved. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -100,18 +100,92 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +-- +-- PERFORMANCE SCHEMA INSTALLATION +-- Note that this script is also reused by mysql_upgrade, +-- so we have to be very careful here to not destroy any +-- existing database named 'performance_schema' if it +-- can contain user data. +-- In case of downgrade, it's ok to drop unknown tables +-- from a future version, as long as they belong to the +-- performance schema engine. +-- + +set @have_old_pfs= (select count(*) from information_schema.schemata where schema_name='performance_schema'); + +SET @l1="SET @broken_tables = (select count(*) from information_schema.tables"; +SET @l2=" where engine != \'PERFORMANCE_SCHEMA\' and table_schema=\'performance_schema\')"; +SET @cmd=concat(@l1,@l2); + +-- Work around for bug#49542 +SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_tables = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +SET @l1="SET @broken_views = (select count(*) from information_schema.views"; +SET @l2=" where table_schema='performance_schema')"; +SET @cmd=concat(@l1,@l2); + +-- Work around for bug#49542 +SET @str = IF(@have_old_pfs = 1, @cmd, 'SET @broken_views = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +SET @broken_routines = (select count(*) from mysql.proc where db='performance_schema'); + +SET @broken_events = (select count(*) from mysql.event where db='performance_schema'); + +SET @broken_pfs= (select @broken_tables + @broken_views + @broken_routines + @broken_events); -- -- The performance schema database. --- This database is always created, even in --without-perfschema builds, +-- Only drop and create the database if this is safe (no broken_pfs). +-- This database is created, even in --without-perfschema builds, -- so that the database name is always reserved by the MySQL implementation. -- -set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO'); +SET @cmd= "DROP DATABASE IF EXISTS performance_schema"; + +SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; -DROP DATABASE IF EXISTS performance_schema; +SET @cmd= "CREATE DATABASE performance_schema character set utf8"; -CREATE DATABASE performance_schema character set utf8; +SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- Unlike 'performance_schema', the 'mysql' database is reserved already, +-- so no user procedure is supposed to be there +-- +drop procedure if exists mysql.die; +create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.'; + +-- +-- For broken upgrades, SIGNAL the error +-- + +SET @cmd="call mysql.die()"; + +SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +drop procedure mysql.die; + +-- +-- From this point, only create the performance schema tables +-- if the server is build with performance schema +-- + +set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO'); -- -- TABLE COND_INSTANCES -- cgit v1.2.1 From a774c83c2f6936dbafbe4e1149a2305bb691f040 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 9 Mar 2010 17:51:31 +0200 Subject: Bug #35250: readline check breaks when doing vpath build MySQL uses two source layouts when building : the bzr layout and the source package layout. The previous fix for bug 35250 contained 1 change that is valid for both modes and a number of changes that are valid only for the bzr source layout. The important thing was to fix the source package layout. And for this the change in configure.in was sufficient. It's not trivial (and not requested by this bug) to support VPATH builds from the bzr trees. This is why the other changes are reverted and the change to fix the VPATH build for source distributions is left intact. --- scripts/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 1aa24c5d432..0292617c7a5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -110,8 +110,7 @@ mysqlbug: ${top_builddir}/config.status mysqlbug.sh mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ mysql_system_tables_fix.sql @echo "Building $@"; - @cat $(srcdir)/mysql_system_tables.sql \ - $(srcdir)/mysql_system_tables_fix.sql > $@ + @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ # # Build mysql_fix_privilege_tables_sql.c from @@ -124,7 +123,7 @@ mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql sleep 2 $(top_builddir)/scripts/comp_sql$(EXEEXT) \ mysql_fix_privilege_tables \ - $(top_builddir)/scripts/mysql_fix_privilege_tables.sql $@ + $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ SUFFIXES = .sh -- cgit v1.2.1 From 2b1846473f9b6b542a6c0ae0278ecff642e681a1 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 11 Mar 2010 15:41:45 +0100 Subject: Bug#51949 - make_binary_distribution fails on Mac. Unquoted ${CMAKE_CPACK_COMMAND} is used in this script. This variable resolves to cpack's real path with spaces, e.g /Applications/CMake 2.6.4-app/Contents/bin/cpack. Script fails due to lack of quotes. Fix is to use quotes around ${CMAKE_CPACK_COMMAND}. --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 26dfb243897..3352eb23a73 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -65,7 +65,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs IF(UNIX) FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution - "cd ${CMAKE_BINARY_DIR} && ${CMAKE_CPACK_COMMAND} -G TGZ --config CPackConfig.cmake" ) + "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake" ) EXECUTE_PROCESS( COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution ) -- cgit v1.2.1 From d21fa1426ad3cfdf9d768abd2e13e6125fb941c2 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Sun, 14 Mar 2010 21:11:19 +0100 Subject: Bug #51938 plugin_dir gets bad default value When building the script directory using a CMake-based build, both the variables in config.h.cmake (including PLUGINDIR) and the variables in CMakeList.txt (which includes pkgplugindir). However, for autotools-based builds, only pkgplugindir is substituted, which means that the plugin-path is not substituted. This patch solves the problem by using pkgplugindir, which works on both CMake-based and autotools-based builds, instead of PLUGINDIR. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a4ce5f9575b..5420ebd908e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -699,7 +699,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From 0905a08a62c9a82af73ad92b741f6568d24fe8cb Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 15 Mar 2010 19:13:37 +0100 Subject: Fix for bug#51938, extracted from a work-in-progress development branch just for the build of 5.5.3-m3. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a4ce5f9575b..5420ebd908e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -699,7 +699,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From 4a39f83ff7ebca7881850b10bfe9d1ca9da7f556 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 19 Mar 2010 18:33:48 +0100 Subject: Fix errors when building release - package some more perl scripts on Windows (mysqlhotcopy and mysqldumpslow) - do not try to pack .map files (no more produced) - (CMake-unrelated) fix debug build on FreeBSD, trying to use uninitialized attribute MY_MUTEX_INIT_FAST --- scripts/CMakeLists.txt | 3 ++- scripts/make_win_bin_dist | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 3352eb23a73..ad0f5652b1c 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -261,7 +261,8 @@ IF(WIN32) SET(PLIN_FILES mysql_config mysql_secure_installation) # Input files with .sh extension - SET(SH_FILES mysql_convert_table_format mysqld_multi) + SET(SH_FILES mysql_convert_table_format mysqld_multi mysqldumpslow + mysqlhotcopy) FOREACH(file ${PLIN_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 51271a3dad0..e54a14cc66e 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -158,7 +158,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$TARGET" != x"release" ] ; then cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb fi @@ -167,7 +166,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map fi # ---------------------------------------------------------------------- -- cgit v1.2.1 From 82b4452bd5e4c3fd3853d3e5435bba3e9701f598 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 22 Mar 2010 16:02:31 +0100 Subject: Some fixes for the build on Windows as found necessary during the release build of 5.5.3-m3. --- scripts/CMakeLists.txt | 3 ++- scripts/make_win_bin_dist | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 26dfb243897..e6ce5717d95 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -261,7 +261,8 @@ IF(WIN32) SET(PLIN_FILES mysql_config mysql_secure_installation) # Input files with .sh extension - SET(SH_FILES mysql_convert_table_format mysqld_multi) + SET(SH_FILES mysql_convert_table_format mysqld_multi mysqldumpslow + mysqlhotcopy) FOREACH(file ${PLIN_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 51271a3dad0..7e8428bfe5c 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -158,7 +158,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$TARGET" != x"release" ] ; then cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb fi @@ -167,7 +166,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map fi # ---------------------------------------------------------------------- @@ -397,15 +395,15 @@ cp scripts/*.sql $DESTDIR/share/ # Clean up from possibly copied SCCS directories # ---------------------------------------------------------------------- -rm -rf `find $DISTDIR -type d -name SCCS -print` +rm -rf `find $DESTDIR -type d -name SCCS -print` # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- for arg do - dst=`echo $arg | sed 's/=.*$//'` - src=`echo $arg | sed 's/^.*=//'` + dst=`echo $arg | sed -n 's/=.*$//p'` + src=`echo $arg | sed -n 's/^.*=//p'` if [ x"$dst" = x"" -o x"$src" = x"" ] ; then echo "Invalid specification of what to copy" -- cgit v1.2.1 From f0856cc114a198a8cb269989db439c9f33a46532 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 31 Mar 2010 23:52:49 +0200 Subject: Try a bunch of fixes. --- scripts/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e6ce5717d95..e85928a5c42 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -298,14 +298,13 @@ ELSE() mysql_secure_installation mysql_zap mysqlaccess + mysqlaccess.conf mysqlbug mysql_convert_table_format mysql_find_rows mysqlhotcopy mysqldumpslow mysqld_multi - mysqlaccess - mysqlaccess.conf mysqld_safe ) FOREACH(file ${BIN_SCRIPTS}) -- cgit v1.2.1 From 8c750455fce32cec5885823b3cb1e8df854c3321 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 1 Apr 2010 10:32:29 +0200 Subject: Just put libs in %{_libdir}. Can't see how mysqld_safe can work with current setup, so make it look in $pkglibdir/mysql too. Other cleanups. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5420ebd908e..019706467b0 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -306,7 +306,7 @@ set_malloc_lib() { malloc_lib= # This list is kept intentionally simple. Simply set --malloc-lib # to a full path if another location is desired. - for libdir in /usr/lib "$pkglibdir"; do + for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do for flavor in _minimal '' _and_profiler _debug; do tmp="$libdir/libtcmalloc$flavor.so" #log_notice "DEBUG: Checking for malloc lib '$tmp'" -- cgit v1.2.1 From bbe86d08ba83425423c70b29d1ca757bf57a5e34 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 1 Apr 2010 20:47:19 +0200 Subject: Expand @HOSTNAME@. --- scripts/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e85928a5c42..bfe65a0acd8 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -134,10 +134,9 @@ ELSE() SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") ENDIF() -ENDIF(UNIX) - - +SET(HOSTNAME "hostname") +ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches -- cgit v1.2.1 From 17a21c4f35812eba71a44e906e18ec947517cf35 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 9 Apr 2010 14:47:18 +0300 Subject: Bug #47095: Can't open_files_limit really be larger than 65535? Several problems addressed: 1. The maximum value for --open_files_limit on non-windows boxes is now raised to UINT_MAX (the maximum possible without significant changes in the code). The maximum value on windows is kept to be 2048 due to a known limitation (bug 24509). 2. mysqld_safe now supports --open_files_limit=xx in addition to --open-files-limit=xx 3. mysqld_safe always passes through --open[_-]files[_-]limit to the underlying mysqld. It used to pass it through only if it the user running the script has access to the root directory or there was an --user argument specified. 4. Fixed a prototype in my_file.c to match its counterpart in the other #ifdef branch. --- scripts/mysqld_safe.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 23b5efcaf2b..e4e5f1a1510 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -183,6 +183,7 @@ parse_arguments() { ;; --nice=*) niceness="$val" ;; --open-files-limit=*) open_files="$val" ;; + --open_files_limit=*) open_files="$val" ;; --skip-kill-mysqld*) KILL_MYSQLD=0 ;; --syslog) want_syslog=1 ;; --skip-syslog) want_syslog=0 ;; @@ -397,10 +398,14 @@ then if test -n "$open_files" then ulimit -n $open_files - append_arg_to_args "--open-files-limit=$open_files" fi fi +if test -n "$open_files" +then + append_arg_to_args "--open-files-limit=$open_files" +fi + safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` -- cgit v1.2.1 From 20ef52e61209d149ad3c69e0a07773e4dc34dc2f Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 12 Apr 2010 11:56:28 +0300 Subject: Bug #43594: mysqlhotcopy does not ignore log tables and others in mysql database Added a filter to mysqlhotcopy to filter out the same tables in the 'mysql' database that mysqldump filters out. --- scripts/mysqlhotcopy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 21fca0c0848..398573875d9 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -267,6 +267,14 @@ foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; my @dbh_tables = get_list_of_tables( $db ); + ## filter out certain system non-lockable tables. + ## keep in sync with mysqldump. + if ($db =~ m/^mysql$/i) + { + @dbh_tables = grep + { !/^(apply_status|schema|general_log|slow_log)$/ } @dbh_tables + } + ## generate regex for tables/files my $t_regex; my $negated; -- cgit v1.2.1 From f3635be0314e6a66ef5f9b51f9cdba761d6ed5ad Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 14 Apr 2010 20:40:04 +0400 Subject: A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)). The problem was that the code that works with stored routines was present in mysql_system_tables.sql. This is wrong because until upgrade is finished, stored routines may be (and were) not available. The fix is to move that code to the end of mysql_system_tables_fix.sql. --- scripts/mysql_system_tables.sql | 22 +-------------------- scripts/mysql_system_tables_fix.sql | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 69d6d6d7feb..b5ee4d6dd41 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -11,7 +11,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- The system tables of MySQL Server @@ -160,26 +160,6 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; --- --- Unlike 'performance_schema', the 'mysql' database is reserved already, --- so no user procedure is supposed to be there --- -drop procedure if exists mysql.die; -create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.'; - --- --- For broken upgrades, SIGNAL the error --- - -SET @cmd="call mysql.die()"; - -SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0'); -PREPARE stmt FROM @str; -EXECUTE stmt; -DROP PREPARE stmt; - -drop procedure mysql.die; - -- -- From this point, only create the performance schema tables -- if the server is build with performance schema diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index f91277a83f6..3b6f0cccf20 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2008, 2010 Oracle and/or its affiliates. All rights reserved. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + # This part converts any old privilege tables to privilege tables suitable # for current version of MySQL @@ -604,6 +619,29 @@ ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_genera UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0; +-- +-- Unlike 'performance_schema', the 'mysql' database is reserved already, +-- so no user procedure is supposed to be there. +-- +-- NOTE: until upgrade is finished, stored routines are not available, +-- because system tables (e.g. mysql.proc) might be not usable. +-- +drop procedure if exists mysql.die; +create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.'; + +-- +-- For broken upgrades, SIGNAL the error +-- + +SET @cmd="call mysql.die()"; + +SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +drop procedure mysql.die; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From 29f098f2d3b8cabe352bd255567c4eae4bcfea00 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Fri, 16 Apr 2010 10:27:18 +0200 Subject: Make the libraries we produce on Windows actually usable --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 7e8428bfe5c..9af722f7afc 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -249,6 +249,7 @@ cp include/mysql.h \ include/decimal.h \ include/errmsg.h \ include/my_global.h \ + include/my_config.h \ include/my_net.h \ include/my_getopt.h \ include/sslopt-longopts.h \ -- cgit v1.2.1 From b9303c87e3841cd75a8f95fc752497eca14a7c2c Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 27 Apr 2010 22:21:48 +0200 Subject: On Mac OS X, add the "-arch" option to the 'mysql_config' output --- scripts/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index bfe65a0acd8..7f7baecc6c1 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -93,6 +93,10 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") # No multiconfig build - use CMAKE_C_FLAGS SET(CFLAGS "@CMAKE_C_FLAGS@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) + SET(CFLAGS "${CFLAGS} -arch ${ARCH}") + SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") + ENDFOREACH() ELSE() # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") -- cgit v1.2.1 From 7f514f45e6ca6b0e3b5428343e1c21304e316053 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Tue, 11 May 2010 15:55:52 +0200 Subject: Bug #52737: plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe Plugin dir was set to a hard-coded path instead of relative the base dir. This patch fixes this by using a path relative the basedir instead of the plugin directory indicated by the configuration. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5420ebd908e..59e7e8b7ef7 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -699,7 +699,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/plugin}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From 5b85121ca6a08b7070f98ccd7d5bf0974a4ebeee Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 12 May 2010 12:51:23 +0100 Subject: Changes to build using CMake according to existing release packages: - Update/fix file layouts for each package type, add new types for native package formats including deb, rpm and svr4. - Build all plugins, including debug versions - Update compiler flags to match current release - Add missing @VAR@ expansions - Install correct mysqclient library symlinks - Fix icc/ia64 builds - Fix install of libmysqld-debug - Don't include mysql_embedded - Remove unpackaged manual pages to avoid missing files warnings - Don't install mtr's test suite --- scripts/CMakeLists.txt | 12 +++++++----- scripts/mysqld_safe.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index f39224b9457..fc55a2923f2 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -93,6 +93,10 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") # No multiconfig build - use CMAKE_C_FLAGS SET(CFLAGS "@CMAKE_C_FLAGS@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) + SET(CFLAGS "${CFLAGS} -arch ${ARCH}") + SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") + ENDFOREACH() ELSE() # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") @@ -134,10 +138,9 @@ ELSE() SET(CHECK_PID "kill -s SIGCONT $PID > /dev/null 2> /dev/null") ENDIF() -ENDIF(UNIX) - - +SET(HOSTNAME "hostname") +ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches @@ -298,14 +301,13 @@ ELSE() mysql_secure_installation mysql_zap mysqlaccess + mysqlaccess.conf mysqlbug mysql_convert_table_format mysql_find_rows mysqlhotcopy mysqldumpslow mysqld_multi - mysqlaccess - mysqlaccess.conf mysqld_safe ) FOREACH(file ${BIN_SCRIPTS}) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 59e7e8b7ef7..4514b5437b7 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -306,7 +306,7 @@ set_malloc_lib() { malloc_lib= # This list is kept intentionally simple. Simply set --malloc-lib # to a full path if another location is desired. - for libdir in /usr/lib "$pkglibdir"; do + for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do for flavor in _minimal '' _and_profiler _debug; do tmp="$libdir/libtcmalloc$flavor.so" #log_notice "DEBUG: Checking for malloc lib '$tmp'" -- cgit v1.2.1 From 091bcacc79f76878c6842d54cc18a133d5f8e902 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 19 May 2010 17:00:23 +0400 Subject: Another incarnation of the patch for Bug#30708 (make relies GNU extentions). The patch was partially backport from 6.0. Original comment: bug#30708: make relies GNU extensions. Now that we no longer use BitKeeper we can safely remove the SCCS handling with no loss of functionality. --- scripts/Makefile.am | 4 ---- 1 file changed, 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4d89718f9f0..0200410fd8f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -190,7 +190,3 @@ SUFFIXES = .sh $< > $@-t @CHMOD@ +x $@-t @MV@ $@-t $@ - - -# Don't update the files from bitkeeper -%::SCCS/s.% -- cgit v1.2.1 From 89205a3bf6bba245e312078b23168ff5f8560759 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Fri, 28 May 2010 16:50:23 +0200 Subject: post-merge fix 1 --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 483e4bcef65..633b9b8ff90 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -177,7 +177,7 @@ ENDIF() INSTALL_SCRIPT( "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" - DESTINATION ${INSTALL_BINDIR} + DESTINATION ${DEST} COMPONENT Server ) -- cgit v1.2.1 From c7170276efa491d4c6a04a454710701ae78eb53d Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 16 Jun 2010 11:25:55 +0200 Subject: BUG#52737: plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe Incremental patch to fix plugin_dir from .../lib/plugin to .../lib/mysql/plugin. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5d7f0760b82..562732e7387 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -704,7 +704,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/plugin}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/mysql/plugin}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From d4c4bd6e2f75677161e005ba161d2d01e2cbdf19 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Thu, 17 Jun 2010 19:47:38 +0200 Subject: Bug#54590 "make_binary_distribution" fails because a command line exceeds the limit The number and/or names of our files for the main test suite (contents of "mysql-test/t/") now exceeds the command line length limit on AIX. Solve the problem by using separate "cp" commands for the various file name extensions. --- scripts/make_binary_distribution.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1be5d253e2f..a089e8ef55d 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -336,9 +336,11 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/t/*.test mysql-test/t/*.imtest \ - mysql-test/t/*.disabled mysql-test/t/*.opt \ - mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t +# Attention: when the wildcards expand to a line that is very long, +# it may exceed the command line length limit on some platform(s). Bug#54590 +$CP mysql-test/t/*.test mysql-test/t/*.imtest $BASE/mysql-test/t +$CP mysql-test/t/*.disabled mysql-test/t/*.opt $BASE/mysql-test/t +$CP mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -- cgit v1.2.1 From 699c31cf514c6d3adec8c717af95aca7c568c7ab Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 14:59:15 +0100 Subject: Expand some variables for mysqlbug. --- scripts/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 84472c3a5c3..af8c214503f 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -140,6 +140,19 @@ ENDIF() SET(HOSTNAME "hostname") +# Required for mysqlbug until autotools are deprecated, once done remove these +# and expand default cmake variables +SET(CC ${CMAKE_C_COMPILER}) +SET(CXX ${CMAKE_CXX_COMPILER}) +#XXX don't set CFLAGS, has already been done earlier +#XXX don't set CXXFLAGS, has already been done earlier +SET(SAVE_CC ${CMAKE_C_COMPILER}) +SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) +SET(SAVE_CFLAGS ${CFLAGS}) +SET(SAVE_CXXFLAGS ${CXXFLAGS}) +# XXX no cmake equivalent for this, just make one up +SET(CONFIGURE_LINE "Built using CMake") + ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", -- cgit v1.2.1 From c179a23cb5f4692f524c8f2b1401215f3627f300 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 17:44:12 +0100 Subject: Try to fix more mysqlbug problems. --- scripts/CMakeLists.txt | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index af8c214503f..97ba9f93f13 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -144,17 +144,55 @@ SET(HOSTNAME "hostname") # and expand default cmake variables SET(CC ${CMAKE_C_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER}) -#XXX don't set CFLAGS, has already been done earlier -#XXX don't set CXXFLAGS, has already been done earlier +# Override CFLAGS for mysqlbug then reset +SET(BACKUP_CFLAGS ${CFLAGS}) +SET(BACKUP_CXXFLAGS ${CXXFLAGS}) +SET(CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) +SET(CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) +# SET(SAVE_CC ${CMAKE_C_COMPILER}) SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CFLAGS ${CFLAGS}) -SET(SAVE_CXXFLAGS ${CXXFLAGS}) +SET(SAVE_CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) +SET(SAVE_CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) # XXX no cmake equivalent for this, just make one up SET(CONFIGURE_LINE "Built using CMake") +# Also required for mysqlbug, autoconf only supports --version so for now we +# just explicitly require GNU +IF(CMAKE_COMPILER_IS_GNUCC) + EXECUTE_PROCESS( + COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version + COMMAND grep -i version + OUTPUT_VARIABLE CC_VERSION) +ELSE() + SET(CC_VERSION "") +ENDIF() +IF(CMAKE_COMPILER_IS_GNUCXX) + EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version + COMMAND grep -i version + OUTPUT_VARIABLE CXX_VERSION) +ELSE() + SET(CXX_VERSION "") +ENDIF() ENDIF(UNIX) +IF(UNIX) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_SCRIPTDIR}) +ENDIF() + +INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" + DESTINATION ${DEST} + COMPONENT Server + ) + +# Reset CFLAGS/CXXFLAGS back +SET(CFLAGS ${BACKUP_CFLAGS}) +SET(CXXFLAGS ${BACKUP_CXXFLAGS}) + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches # the documentation, so better not change this. @@ -305,7 +343,6 @@ ELSE() mysql_zap mysqlaccess mysqlaccess.conf - mysqlbug mysql_convert_table_format mysql_find_rows mysqlhotcopy -- cgit v1.2.1 From e74d4c2b37eaa7f81d961f9bd34c8741307a7a8e Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 18:30:53 +0100 Subject: mysqlbug is Unix-only. --- scripts/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 97ba9f93f13..90261501452 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -175,13 +175,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX) ELSE() SET(CXX_VERSION "") ENDIF() -ENDIF(UNIX) -IF(UNIX) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) -ENDIF() INSTALL_SCRIPT( "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" @@ -193,6 +190,8 @@ INSTALL_SCRIPT( SET(CFLAGS ${BACKUP_CFLAGS}) SET(CXXFLAGS ${BACKUP_CXXFLAGS}) +ENDIF(UNIX) + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches # the documentation, so better not change this. -- cgit v1.2.1 From 0b7b897dec0abebe3f86aae2cbb4dcdec0da5bbd Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 29 Jun 2010 19:21:59 +0100 Subject: Copy-pasted the wrong line from configure.in, fix gcc detection. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 90261501452..e2a39dcf814 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -162,7 +162,7 @@ SET(CONFIGURE_LINE "Built using CMake") IF(CMAKE_COMPILER_IS_GNUCC) EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version - COMMAND grep -i version + COMMAND sed 1q OUTPUT_VARIABLE CC_VERSION) ELSE() SET(CC_VERSION "") @@ -170,7 +170,7 @@ ENDIF() IF(CMAKE_COMPILER_IS_GNUCXX) EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version - COMMAND grep -i version + COMMAND sed 1q OUTPUT_VARIABLE CXX_VERSION) ELSE() SET(CXX_VERSION "") -- cgit v1.2.1 From 18cd34153c857d54edaee48b077a328e6e557167 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 30 Jun 2010 12:19:54 +0100 Subject: bug#52737 plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe Rather than hardcode the plugin directory, enhance mysql_config to fix plugin path when running a relocated install, and use it to provide the plugin directory to mysqld_safe. --- scripts/mysql_config.sh | 2 ++ scripts/mysqld_safe.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index d2699726a25..593d19fb91c 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -88,6 +88,8 @@ pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` fix_path pkglibdir $pkglibdir_rel lib/mysql lib plugindir='@pkgplugindir@' +plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` +fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin pkgincludedir='@pkgincludedir@' fix_path pkgincludedir include/mysql include diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 562732e7387..d96091b685a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -704,7 +704,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/mysql/plugin}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-`get_mysql_config --variable=plugindir`}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From f342706ccda6480763bd36bb2e529798ee377869 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 30 Jun 2010 18:47:42 +0100 Subject: Put mysqlbug back into bin/ --- scripts/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e2a39dcf814..025bce0bbcf 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -178,11 +178,8 @@ ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) - SET(DEST ${INSTALL_SCRIPTDIR}) - -INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" - DESTINATION ${DEST} +INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug + DESTINATION ${INSTALL_BINDIR} COMPONENT Server ) -- cgit v1.2.1 From 5787f0f20e6773b5e63cc8b9e2c18e4d5df6d708 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 1 Jul 2010 12:05:09 +0300 Subject: Bug #53613: mysql_upgrade incorrectly revokes TRIGGER privilege on given table Fixed an incomplete historical ALTER TABLE MODIFY trimming the trigger privilege bit from mysql.tables_priv.Table_priv column. Removed the duplicate ALTER TABLE MODIFY. Test suite added. --- scripts/mysql_system_tables_fix.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index deeb4d4de82..90bdbdae338 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -58,7 +58,7 @@ ALTER TABLE tables_priv COLLATE utf8_general_ci DEFAULT '' NOT NULL, MODIFY Table_priv set('Select','Insert','Update','Delete','Create', 'Drop','Grant','References','Index','Alter', - 'Create View','Show view') + 'Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, COMMENT='Table privileges'; @@ -584,8 +584,6 @@ ALTER TABLE host MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAU ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; # Activate the new, possible modified privilege tables -- cgit v1.2.1 From 245645e225b677ab18fc1f612d58377f0052ae46 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 3 Jul 2010 20:17:03 -0300 Subject: Unset the execute bit where it's not needed. --- scripts/CMakeLists.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/CMakeLists.txt (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt old mode 100755 new mode 100644 -- cgit v1.2.1 From 261c543610ca98208ca10695a6dde804448fb189 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 12:53:03 +0100 Subject: bug#54991: mysqld_safe reports syntax error and skips part of logic while restarting server TARGET_LINUX must be 'true' or 'false'. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 025bce0bbcf..4513b4619f8 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -243,9 +243,9 @@ SET(localstatedir ${MYSQL_DATADIR}) # some scripts use @TARGET_LINUX@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(TARGET_LINUX 1) + SET(TARGET_LINUX "true") ELSE() - SET(TARGET_LINUX 0) + SET(TARGET_LINUX "false") ENDIF() # Use cmake variables to inspect dependencies for -- cgit v1.2.1 From daf738448b8243af7a9a3741d8893cec0f579a58 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 15:44:40 +0100 Subject: No need to save/restore C*FLAGS, they are only used for one script. Use CMAKE_*_FLAGS_RELWITHDEBINFO for C*FLAGS expansion, they are the most likely to contain the flags we need. --- scripts/CMakeLists.txt | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 4513b4619f8..6ea81d8a484 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -90,15 +90,13 @@ IF(MALLOC_LIB) ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") - # No multiconfig build - use CMAKE_C_FLAGS - SET(CFLAGS "@CMAKE_C_FLAGS@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") ENDFOREACH() ELSE() - # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") ENDIF() @@ -144,16 +142,10 @@ SET(HOSTNAME "hostname") # and expand default cmake variables SET(CC ${CMAKE_C_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER}) -# Override CFLAGS for mysqlbug then reset -SET(BACKUP_CFLAGS ${CFLAGS}) -SET(BACKUP_CXXFLAGS ${CXXFLAGS}) -SET(CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) -SET(CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) -# SET(SAVE_CC ${CMAKE_C_COMPILER}) SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) -SET(SAVE_CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) +SET(SAVE_CFLAGS ${CFLAGS}) +SET(SAVE_CXXFLAGS ${CXXFLAGS}) # XXX no cmake equivalent for this, just make one up SET(CONFIGURE_LINE "Built using CMake") @@ -183,10 +175,6 @@ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug COMPONENT Server ) -# Reset CFLAGS/CXXFLAGS back -SET(CFLAGS ${BACKUP_CFLAGS}) -SET(CXXFLAGS ${BACKUP_CXXFLAGS}) - ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", -- cgit v1.2.1 From ad8399acf5d68d45c72c15c434377668dd7c848a Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 19:32:46 +0100 Subject: Include CMAKE_{C,CXX}_FLAGS. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6ea81d8a484..dfe0090eaca 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -90,8 +90,8 @@ IF(MALLOC_LIB) ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") - SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") + SET(CFLAGS "@CMAKE_C_FLAGS@ @CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_RELWITHDEBINFO@") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") -- cgit v1.2.1 From 8f1b8816163ff24d005dda51482f2cb761eb8766 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 22:19:14 +0100 Subject: We can't rely on mysql_config for core functionality like plugins as it may be part of a separate package. Work out the likliest plugin directory using similar logic to the data directory, and avoid the dependancy. --- scripts/mysqld_safe.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d96091b685a..a537bf27aad 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -413,6 +413,29 @@ else DATADIR=@localstatedir@ fi +# +# Try to find the plugin directory +# + +# Use user-supplied argument +if [ -n "${PLUGIN_DIR}" ]; then + plugin_dir="${PLUGIN_DIR}" +else + # Try to find plugin dir relative to basedir + for dir in lib/mysql/plugin lib/plugin + do + if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then + plugin_dir="${MY_BASEDIR_VERSION}/${dir}" + break + fi + done + # Give up and use compiled-in default + if [ -z "${plugin_dir}" ]; then + plugin_dir='@pkgplugindir@' + fi +fi +plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" + if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" @@ -704,8 +727,6 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-`get_mysql_config --variable=plugindir`}${PLUGIN_VARIANT}" - for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" do -- cgit v1.2.1 From a10ae35328ec800eff63c0bbb06d279e44c0a5a1 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 8 Jul 2010 18:20:08 -0300 Subject: Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled Essentially, the problem is that safemalloc is excruciatingly slow as it checks all allocated blocks for overrun at each memory management primitive, yielding a almost exponential slowdown for the memory management functions (malloc, realloc, free). The overrun check basically consists of verifying some bytes of a block for certain magic keys, which catches some simple forms of overrun. Another minor problem is violation of aliasing rules and that its own internal list of blocks is prone to corruption. Another issue with safemalloc is rather the maintenance cost as the tool has a significant impact on the server code. Given the magnitude of memory debuggers available nowadays, especially those that are provided with the platform malloc implementation, maintenance of a in-house and largely obsolete memory debugger becomes a burden that is not worth the effort due to its slowness and lack of support for detecting more common forms of heap corruption. Since there are third-party tools that can provide the same functionality at a lower or comparable performance cost, the solution is to simply remove safemalloc. Third-party tools can provide the same functionality at a lower or comparable performance cost. The removal of safemalloc also allows a simplification of the malloc wrappers, removing quite a bit of kludge: redefinition of my_malloc, my_free and the removal of the unused second argument of my_free. Since free() always check whether the supplied pointer is null, redudant checks are also removed. Also, this patch adds unit testing for my_malloc and moves my_realloc implementation into the same file as the other memory allocation primitives. --- scripts/mysql_config.pl.in | 3 +-- scripts/mysql_config.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in index 415c0d3040e..58482691213 100644 --- a/scripts/mysql_config.pl.in +++ b/scripts/mysql_config.pl.in @@ -42,8 +42,7 @@ use Cwd; use strict; my @exclude_cflags = - qw/DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX - DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS + qw/DDBUG_OFF DSAFE_MUTEX DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS DEXTRA_DEBUG DHAVE_purify O O[0-9] xO[0-9] W[-A-Za-z]* Xa xstrconst xc99=none unroll2 ip mp restrict/; diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index d2699726a25..0840a99e6e2 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -127,8 +127,7 @@ include="-I$pkgincludedir" # and -xstrconst to make --cflags usable for Sun Forte C++ # FIXME until we have a --cxxflags, we need to remove -AC99 # to make --cflags usable for HP C++ (aCC) -for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ - DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ +for remove in DDBUG_OFF DSAFE_MUTEX DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ 'mtune=[-A-Za-z0-9]*' 'mcpu=[-A-Za-z0-9]*' 'march=[-A-Za-z0-9]*' \ Xa xstrconst "xc99=none" AC99 \ -- cgit v1.2.1 From 0f3493a490fbd903cb3f13719c1091e02925b70b Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 9 Jul 2010 14:11:12 +0300 Subject: Bug #52274 : Missing path to mysql in mysql_secure_installation Added some code to try to find the mysql command line in the most common places and stop if it's not there. --- scripts/mysql_secure_installation.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 25d6343ee2c..188cd030dba 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -17,6 +17,7 @@ config=".my.cnf.$$" command=".mysql.$$" +mysql_client="" trap "interrupt" 2 @@ -37,10 +38,26 @@ prepare() { chmod 600 $config $command } +find_mysql_client() +{ + for n in ./bin/mysql mysql + do + $n --no-defaults --help > /dev/null 2>&1 + status=$? + if test $status -eq 0 + then + mysql_client=$n + return + fi + done + echo "Can't find a 'mysql' client in PATH or ./bin" + exit 1 +} + do_query() { echo "$1" >$command #sed 's,^,> ,' < $command # Debugging - mysql --defaults-file=$config <$command + $mysql_client --defaults-file=$config <$command return $? } @@ -204,6 +221,7 @@ cleanup() { # The actual script starts here prepare +find_mysql_client set_echo_compat echo -- cgit v1.2.1 From edf16dbeb3a7ee5baa5fc8da385e980a32ca9d6c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 14 Jul 2010 13:53:49 +0300 Subject: Bug #54004 : mysql_secure_installation identifies "local host" incorrectly The removal of non-local root users is overzealous in mysql_secure_installation. (Bug #54004) --- scripts/mysql_secure_installation.pl.in | 2 +- scripts/mysql_secure_installation.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 25339f9b916..0cd99267cdb 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -208,7 +208,7 @@ sub remove_anonymous_users { } sub remove_remote_root { - if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';")) { + if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');")) { print " ... Success!\n"; } else { print " ... Failed!\n"; diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 188cd030dba..ed789677bf0 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -164,7 +164,7 @@ remove_anonymous_users() { } remove_remote_root() { - do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" + do_query "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" if [ $? -eq 0 ]; then echo " ... Success!" else -- cgit v1.2.1 From f54a1182494db9bababccfa83692630bec51ca95 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 15 Jul 2010 08:13:30 -0300 Subject: WL#5486: Remove code for unsupported platforms Remove Netware specific code. --- scripts/make_binary_distribution.sh | 397 +++++++++--------------------------- scripts/mysqlhotcopy.sh | 20 +- 2 files changed, 101 insertions(+), 316 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index aed758da620..951699317fd 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -162,10 +162,6 @@ fi # Print the platform name for build logs echo "PLATFORM NAME: $PLATFORM" -case $PLATFORM in - *netware*) BASE_SYSTEM="netware" ;; -esac - # Change the distribution to a long descriptive name # For the cluster product, concentrate on the second part VERSION_NAME=@VERSION@ @@ -226,318 +222,121 @@ fi # ############################################################################## -if [ x"$BASE_SYSTEM" != x"netware" ] ; then - - # ---------------------------------------------------------------------- - # Terminate on any base level error - # ---------------------------------------------------------------------- - set -e - - # ---------------------------------------------------------------------- - # Really ugly, one script, "mysql_install_db", needs prefix set to ".", - # i.e. makes access relative the current directory. This matches - # the documentation, so better not change this. And for another script, - # "mysql.server", we make some relative, others not. - # ---------------------------------------------------------------------- - - cd scripts - rm -f mysql_install_db - @MAKE@ mysql_install_db \ - prefix=. \ - bindir=./bin \ - sbindir=./bin \ - scriptdir=./bin \ - libexecdir=./bin \ - pkgdatadir=./share \ - localstatedir=./data - cd .. - - cd support-files - rm -f mysql.server - @MAKE@ mysql.server \ - bindir=./bin \ - sbindir=./bin \ - scriptdir=./bin \ - libexecdir=./bin \ - pkgdatadir=@pkgdatadir@ - cd .. - - # ---------------------------------------------------------------------- - # Do a install that we later are to pack. Use the same paths as in - # the build for the relevant directories. - # ---------------------------------------------------------------------- - @MAKE@ DESTDIR=$BASE install \ - pkglibdir=@pkglibdir@ \ - pkgincludedir=@pkgincludedir@ \ - pkgdatadir=@pkgdatadir@ \ - pkgplugindir=@pkgplugindir@ \ - pkgsuppdir=@pkgsuppdir@ \ - mandir=@mandir@ \ - infodir=@infodir@ - - # ---------------------------------------------------------------------- - # Rename top directory, and set DEST to the new directory - # ---------------------------------------------------------------------- - mv $BASE@prefix@ $BASE/$NEW_NAME - DEST=$BASE/$NEW_NAME - - # ---------------------------------------------------------------------- - # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a - # ---------------------------------------------------------------------- - if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true - if [ -z "$gcclib" ] ; then - echo "Warning: Compiler doesn't tell libgcc.a!" - elif [ -f "$gcclib" ] ; then - $CP $gcclib $DEST/lib/libmygcc.a - else - echo "Warning: Compiler result '$gcclib' not found / no file!" - fi - fi - - # If requested, add a malloc library .so into pkglibdir for use - # by mysqld_safe - if [ -n "$MALLOC_LIB" ]; then - cp "$MALLOC_LIB" "$DEST/lib/" - fi - - # FIXME let this script be in "bin/", where it is in the RPMs? - # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html - mkdir $DEST/scripts - mv $DEST/bin/mysql_install_db $DEST/scripts/ - - # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 +# ---------------------------------------------------------------------- +# Terminate on any base level error +# ---------------------------------------------------------------------- +set -e - # Copy readme and license files - cp README Docs/INSTALL-BINARY $DEST/ - if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then - cp COPYING EXCEPTIONS-CLIENT $DEST/ - elif [ -f LICENSE.mysql ] ; then - cp LICENSE.mysql $DEST/ - else - echo "ERROR: no license files found" - exit 1 - fi +# ---------------------------------------------------------------------- +# Really ugly, one script, "mysql_install_db", needs prefix set to ".", +# i.e. makes access relative the current directory. This matches +# the documentation, so better not change this. And for another script, +# "mysql.server", we make some relative, others not. +# ---------------------------------------------------------------------- - # FIXME should be handled by make file, and to other dir - mkdir -p $DEST/bin $DEST/support-files - cp scripts/mysqlaccess.conf $DEST/bin/ - cp support-files/magic $DEST/support-files/ +cd scripts +rm -f mysql_install_db +@MAKE@ mysql_install_db \ + prefix=. \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=./share \ + localstatedir=./data +cd .. + +cd support-files +rm -f mysql.server +@MAKE@ mysql.server \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=@pkgdatadir@ +cd .. - # Create empty data directories, set permission (FIXME why?) - mkdir $DEST/data $DEST/data/mysql $DEST/data/test - chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test +# ---------------------------------------------------------------------- +# Do a install that we later are to pack. Use the same paths as in +# the build for the relevant directories. +# ---------------------------------------------------------------------- +@MAKE@ DESTDIR=$BASE install \ + pkglibdir=@pkglibdir@ \ + pkgincludedir=@pkgincludedir@ \ + pkgdatadir=@pkgdatadir@ \ + pkgplugindir=@pkgplugindir@ \ + pkgsuppdir=@pkgsuppdir@ \ + mandir=@mandir@ \ + infodir=@infodir@ - # ---------------------------------------------------------------------- - # Create the result tar file - # ---------------------------------------------------------------------- +# ---------------------------------------------------------------------- +# Rename top directory, and set DEST to the new directory +# ---------------------------------------------------------------------- +mv $BASE@prefix@ $BASE/$NEW_NAME +DEST=$BASE/$NEW_NAME - echo "Using $tar to create archive" - OPT=cvf - if [ x$SILENT = x1 ] ; then - OPT=cf +# ---------------------------------------------------------------------- +# If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a +# ---------------------------------------------------------------------- +if [ x"@GXX@" = x"yes" ] ; then + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true + if [ -z "$gcclib" ] ; then + echo "Warning: Compiler doesn't tell libgcc.a!" + elif [ -f "$gcclib" ] ; then + $CP $gcclib $DEST/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" fi - - echo "Creating and compressing archive" - rm -f $NEW_NAME.tar.gz - (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz - echo "$NEW_NAME.tar.gz created" - - echo "Removing temporary directory" - rm -rf $BASE - exit 0 fi +# If requested, add a malloc library .so into pkglibdir for use +# by mysqld_safe +if [ -n "$MALLOC_LIB" ]; then + cp "$MALLOC_LIB" "$DEST/lib/" +fi -############################################################################## -# -# Handle the Netware case, until integrated above -# -############################################################################## +# FIXME let this script be in "bin/", where it is in the RPMs? +# http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html +mkdir $DEST/scripts +mv $DEST/bin/mysql_install_db $DEST/scripts/ -BS=".nlm" -MYSQL_SHARE=$BASE/share - -mkdir $BASE $BASE/bin $BASE/docs \ - $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ - $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ - $BASE/mysql-test/suite - -# Copy files if they exists, warn for those that don't. -# Note that when listing files to copy, we might list the file name -# twice, once in the directory location where it is built, and a -# second time in the ".libs" location. In the case the first one -# is a wrapper script, the second one will overwrite it with the -# binary file. -copyfileto() -{ - destdir=$1 - shift - for i - do - if [ -f $i ] ; then - $CP $i $destdir - elif [ -d $i ] ; then - echo "Warning: Will not copy directory \"$i\"" - else - echo "Warning: Listed file not found \"$i\"" - fi - done -} +# Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 -copyfileto $BASE/docs ChangeLog Docs/mysql.info - -copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - EXCEPTIONS-CLIENT LICENSE.mysql - -# Non platform-specific bin dir files: -BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ - extra/resolveip$BS extra/my_print_defaults$BS \ - extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ - storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ - sql/mysqld$BS sql/mysqld-debug$BS \ - sql/mysql_tzinfo_to_sql$BS \ - client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ - client/mysqlslap$BS \ - client/mysqldump$BS client/mysqlimport$BS \ - client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS client/mysql_upgrade$BS \ - tests/mysql_client_test$BS \ - libmysqld/examples/mysql_client_test_embedded$BS \ - libmysqld/examples/mysqltest_embedded$BS \ - "; - -# Platform-specific bin dir files: -BIN_FILES="$BIN_FILES \ - netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql \ - netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ - "; - -copyfileto $BASE/bin $BIN_FILES - -$CP netware/*.pl $BASE/scripts -$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl - -copyfileto $BASE/lib \ - libmysql/.libs/libmysqlclient.a \ - libmysql/.libs/libmysqlclient.so* \ - libmysql/.libs/libmysqlclient.sl* \ - libmysql/.libs/libmysqlclient*.dylib \ - libmysql/libmysqlclient.* \ - libmysql_r/.libs/libmysqlclient_r.a \ - libmysql_r/.libs/libmysqlclient_r.so* \ - libmysql_r/.libs/libmysqlclient_r.sl* \ - libmysql_r/.libs/libmysqlclient_r*.dylib \ - libmysql_r/libmysqlclient_r.* \ - libmysqld/.libs/libmysqld.a \ - libmysqld/.libs/libmysqld.so* \ - libmysqld/.libs/libmysqld.sl* \ - libmysqld/.libs/libmysqld*.dylib \ - mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ - libmysqld/libmysqld.a netware/libmysql.imp \ - zlib/.libs/libz.a - -# convert the .a to .lib for NetWare -for i in $BASE/lib/*.a -do - libname=`basename $i .a` - $MV $i $BASE/lib/$libname.lib -done -rm -f $BASE/lib/*.la - - -copyfileto $BASE/include config.h include/* - -rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h - -# In a NetWare binary package, these tools and their manuals are not useful -rm -f $BASE/man/man1/make_win_* - -copyfileto $BASE/support-files support-files/* - -copyfileto $BASE/share scripts/*.sql - -$CP -r sql/share/* $MYSQL_SHARE -rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD - -copyfileto $BASE/mysql-test \ - mysql-test/mysql-test-run mysql-test/install_test_db \ - mysql-test/mysql-test-run.pl mysql-test/README \ - mysql-test/mysql-stress-test.pl \ - mysql-test/valgrind.supp \ - netware/mysql_test_run.nlm netware/install_test_db.ncf - -$CP mysql-test/lib/*.pl $BASE/mysql-test/lib -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/include/*.sql $BASE/mysql-test/include -$CP mysql-test/include/*.test $BASE/mysql-test/include -$CP mysql-test/t/*.def $BASE/mysql-test/t -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ - mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ - mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ - mysql-test/std_data/Index.xml \ - mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ - mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ - $BASE/mysql-test/std_data -# Attention: when the wildcards expand to a line that is very long, -# it may exceed the command line length limit on some platform(s). Bug#54590 -$CP mysql-test/t/*.test mysql-test/t/*.imtest $BASE/mysql-test/t -$CP mysql-test/t/*.disabled mysql-test/t/*.opt $BASE/mysql-test/t -$CP mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t -$CP mysql-test/r/*.result mysql-test/r/*.require \ - $BASE/mysql-test/r - -# Copy the additional suites "as is", they are in flux -$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) -# Clean up if we did this from a bk tree -if [ -d mysql-test/SCCS ] ; then - find $BASE/mysql-test -name SCCS -print | xargs rm -rf +# Copy readme and license files +cp README Docs/INSTALL-BINARY $DEST/ +if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then + cp COPYING EXCEPTIONS-CLIENT $DEST/ +elif [ -f LICENSE.mysql ] ; then + cp LICENSE.mysql $DEST/ +else + echo "ERROR: no license files found" + exit 1 fi -rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ - $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ - $BASE/bin/make_win_* \ - $BASE/bin/setsomevars $BASE/support-files/Makefile* \ - $BASE/support-files/*.sh +# FIXME should be handled by make file, and to other dir +mkdir -p $DEST/bin $DEST/support-files +cp scripts/mysqlaccess.conf $DEST/bin/ +cp support-files/magic $DEST/support-files/ -# -# Copy system dependent files -# -./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +# Create empty data directories, set permission (FIXME why?) +mkdir $DEST/data $DEST/data/mysql $DEST/data/test +chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test -# -# Remove system dependent files -# -rm -f $BASE/support-files/magic \ - $BASE/support-files/mysql.server \ - $BASE/support-files/mysql*.spec \ - $BASE/support-files/mysql-log-rotate \ - $BASE/support-files/binary-configure \ - $BASE/support-files/build-tags \ - $BASE/support-files/MySQL-shared-compat.spec \ - $BASE/INSTALL-BINARY - -# Clean up if we did this from a bk tree -if [ -d $BASE/sql-bench/SCCS ] ; then - find $BASE/share -name SCCS -print | xargs rm -rf - find $BASE/sql-bench -name SCCS -print | xargs rm -rf -fi +# ---------------------------------------------------------------------- +# Create the result tar file +# ---------------------------------------------------------------------- -BASE2=$TMP/$NEW_NAME -rm -rf $BASE2 -mv $BASE $BASE2 -BASE=$BASE2 +echo "Using $tar to create archive" +OPT=cvf +if [ x$SILENT = x1 ] ; then + OPT=cf +fi -# -# Create a zip file for NetWare users -# -rm -f $NEW_NAME.zip -(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) -echo "$NEW_NAME.zip created" +echo "Creating and compressing archive" +rm -f $NEW_NAME.tar.gz +(cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz +echo "$NEW_NAME.tar.gz created" echo "Removing temporary directory" rm -rf $BASE +exit 0 diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index aea7a657c9e..a08db77ac56 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -234,10 +234,6 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) { elsif ( $opt{suffix} ) { print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; } -elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.')) -{ - $tgt_dirname = $tgt_name; -} else { $tgt_name="" if (!defined($tgt_name)); @@ -423,11 +419,8 @@ foreach my $rdb ( @db_desc ) { else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" unless -d $tgt_dirpath; - if ($^O !~ m/^(NetWare)$/) - { - my @f_info= stat "$datadir/$rdb->{src}"; - chown $f_info[4], $f_info[5], $tgt_dirpath; - } + my @f_info= stat "$datadir/$rdb->{src}"; + chown $f_info[4], $f_info[5], $tgt_dirpath; } } @@ -598,14 +591,7 @@ sub copy_files { my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; - if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower) - { - foreach my $file ( @$files ) - { - copy($file, $target."/".basename($file)); - } - } - elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags + if ($method =~ /^s?cp\b/) # cp or scp with optional flags { my $cp = $method; # add option to preserve mod time etc of copied files -- cgit v1.2.1 From 125315b4e4f2fc8b54df927bb77e896826a8e507 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 15 Jul 2010 17:16:24 -0300 Subject: Strip maintainer mode options from the flags written to mysql_config. Those are mainly warning options intended to monitor the server code and shouldn't be leaked to client code. --- scripts/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 84472c3a5c3..be25386c68f 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -91,16 +91,18 @@ ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") # No multiconfig build - use CMAKE_C_FLAGS - SET(CFLAGS "@CMAKE_C_FLAGS@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + # Strip maintainer mode options if necessary + STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS}") + STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS}") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") ENDFOREACH() ELSE() # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO - SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") + # Strip maintainer mode options if necessary + STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ENDIF() IF(UNIX) -- cgit v1.2.1 From fb91a923306ae845977bbdcc7e6de1836b3dadd9 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 23 Jul 2010 17:14:04 -0300 Subject: WL#5498: Remove dead and unused source code Remove Windows related files which aren't used anymore. --- scripts/make_win_bin_dist | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9af722f7afc..4fb57b06d71 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -264,7 +264,6 @@ cp include/mysql.h \ include/sql_state.h \ include/mysqld_ername.h \ include/mysql_version.h \ - include/config-win.h \ libmysql/libmysql.def \ $DESTDIR/include/ -- cgit v1.2.1 From ff1ee261074f62d67ec173a22216dddb5e59d697 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 5 Aug 2010 18:38:24 +0200 Subject: Build cleanups - Simplify sql-bench installation, do not try to resolve names : this leads to probem if builddir is symlink located on different filesystem. (reported by alik) - Make WITHOUT_XXX (disabling plugin) work for DEFAULT plugins. Prior to the patch is behaved just like MANDATORY. - LINK_LIBRARIES in MYSQL_ADD_PLUGIN had no effect for statically linked plugins. - Fix constant rebuild of initdb target on Windows. --- scripts/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index ced207da98b..188bd4bdaa5 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -24,6 +24,7 @@ ENDIF() # Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) IF(NOT WIN32 OR CMAKE_CROSSCOMPILING) FIND_PROGRAM(CAT_EXECUTABLE cat DOC "path to the executable") + MARK_AS_ADVANCED(CAT_EXECUTABLE) ENDIF() IF(CAT_EXECUTABLE) -- cgit v1.2.1 From 881a76699ee68bbfddec0c413c0caf769d32f3c1 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 9 Aug 2010 11:32:50 +0300 Subject: WL#1054: Pluggable authentication support Merged the implementation to a new base tree. --- scripts/mysql_system_tables.sql | 6 +++++- scripts/mysql_system_tables_data.sql | 14 ++++++++++---- scripts/mysql_system_tables_fix.sql | 5 +++++ 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index b5ee4d6dd41..c7abf3d82a1 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,7 +28,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; @@ -498,3 +498,7 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; +CREATE TABLE IF NOT EXISTS proxy_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_Host char(16) binary DEFAULT '' NOT NULL, Proxied_User char(60) binary DEFAULT '' NOT NULL, With_Grant BOOL DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User,Proxied_Host,Proxied_User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; + +-- Remember for later if proxy_priv table already existed +set @had_proxy_priv_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index a7988b5198e..293baa46523 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -21,11 +21,17 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; set @current_hostname= @@hostname; -INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; -REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); +REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'',''); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; + +CREATE TEMPORARY TABLE tmp_proxy_priv LIKE proxy_priv; +INSERT INTO tmp_proxy_priv VALUES ('localhost', 'root', '', '', TRUE); +REPLACE INTO tmp_proxy_priv SELECT @current_hostname, 'root', '', '', TRUE FROM DUAL WHERE LOWER (@current_hostname) != 'localhost'; +INSERT INTO proxy_priv SELECT * FROM tmp_proxy_priv WHERE @had_proxy_priv_table=0; +DROP TABLE tmp_proxy_priv; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 2020971fb1a..ceb910676ab 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -640,6 +640,11 @@ DROP PREPARE stmt; drop procedure mysql.die; +ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; +ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; + +CREATE TABLE IF NOT EXISTS proxy_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_User char(60) binary DEFAULT '' NOT NULL, Proxied_Host char(16) binary DEFAULT '' NOT NULL, With_Grant BOOL DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User,Proxied_Host,Proxied_User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From 9ae1b1d157e8f79c52eb8122f0e177cdccf61297 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 9 Aug 2010 14:27:04 +0100 Subject: Apply wlad's fix for bug#55215 --- scripts/CMakeLists.txt | 64 ++++++++++++++++++++++--------------------------- scripts/mysql_config.sh | 2 +- 2 files changed, 30 insertions(+), 36 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index ced207da98b..5831679828c 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,3 @@ -# Copyright (C) 2006 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -251,43 +250,38 @@ IF(POLICY CMP0007) CMAKE_POLICY(SET CMP0007 OLD) ENDIF() -LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") -LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) -FOREACH(lib ${mysqlclient_LIB_DEPENDS}) - # Filter out "general", it is not a library, just CMake hint - IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") - IF (lib MATCHES "^\\-l") - SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") - ELSEIF(lib MATCHES "^/") - # Full path, convert to just filename, strip "lib" prefix and extension - GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib "${lib}") - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ELSE() - SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) - ENDIF() +# Extract dependencies using CMake's internal ${target}_LIB_DEPENDS variable +# returned string in ${var} is can be passed to linker's command line +MACRO(EXTRACT_LINK_LIBRARIES target var) + LIST(REMOVE_ITEM ${target}_LIB_DEPENDS "") + LIST(REMOVE_DUPLICATES ${target}_LIB_DEPENDS) + FOREACH(lib ${${target}_LIB_DEPENDS}) + # Filter out "general", it is not a library, just CMake hint + # Also, remove duplicates + IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ") + IF (lib MATCHES "^\\-l") + SET(${var} "${${var}} ${lib} ") + ELSEIF(lib MATCHES "^/") + # Full path, convert to just filename, strip "lib" prefix and extension + GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) + STRING(REGEX REPLACE "^lib" "" lib "${lib}") + SET(${var} "${${var}}-l${lib} " ) + ELSE() + SET(${var} "${${var}}-l${lib} " ) + ENDIF() + ENDIF() + ENDFOREACH() + IF(MSVC) + STRING(REPLACE "-l" "" ${var} "${${var}}") ENDIF() -ENDFOREACH() - - -IF(LIBDL AND NOT LIBDL MATCHES "-l") - SET(LIBDL "-l${LIBDL}") -ENDIF() +ENDMACRO() -IF(LIBWRAP) - SET(WRAPLIBS "-lwrap") -ENDIF() - -SET(LIBS "${CLIENT_LIBS}") +EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS) +EXTRACT_LINK_LIBRARIES(mysqlserver LIBS) -IF(LIBCRYPT) - SET(LIBS "${LIBS} -l${LIBCRYPT}") -ENDIF() - -IF(MSVC) - STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") - STRING(REPLACE "-l" "" LIBS "${LIBS}" ) -ENDIF() +# mysql_config evaluates ${LIBDL}, we want to avoid it +# as our CLIENT_LIBS and LIBS are already correct +SET(LIBDL) SET(NON_THREADED_LIBS ${CLIENT_LIBS}) SET(mysql_config_COMPONENT COMPONENT Development) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 10755fc698b..69ec88d6724 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -108,7 +108,7 @@ fi # We intentionally add a space to the beginning and end of lib strings, simplifies replace later libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " +libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " if [ -r "$pkglibdir/libmygcc.a" ]; then -- cgit v1.2.1 From aeea7b6d251fdb78de032bb7c58d33ede6432558 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 9 Aug 2010 15:41:15 +0100 Subject: Don't try to remove from an empty list. --- scripts/CMakeLists.txt | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5831679828c..e97b664d106 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -253,24 +253,26 @@ ENDIF() # Extract dependencies using CMake's internal ${target}_LIB_DEPENDS variable # returned string in ${var} is can be passed to linker's command line MACRO(EXTRACT_LINK_LIBRARIES target var) - LIST(REMOVE_ITEM ${target}_LIB_DEPENDS "") - LIST(REMOVE_DUPLICATES ${target}_LIB_DEPENDS) - FOREACH(lib ${${target}_LIB_DEPENDS}) - # Filter out "general", it is not a library, just CMake hint - # Also, remove duplicates - IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ") - IF (lib MATCHES "^\\-l") - SET(${var} "${${var}} ${lib} ") - ELSEIF(lib MATCHES "^/") - # Full path, convert to just filename, strip "lib" prefix and extension - GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib "${lib}") - SET(${var} "${${var}}-l${lib} " ) - ELSE() - SET(${var} "${${var}}-l${lib} " ) + IF(${target}_LIB_DEPENDS) + LIST(REMOVE_ITEM ${target}_LIB_DEPENDS "") + LIST(REMOVE_DUPLICATES ${target}_LIB_DEPENDS) + FOREACH(lib ${${target}_LIB_DEPENDS}) + # Filter out "general", it is not a library, just CMake hint + # Also, remove duplicates + IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ") + IF (lib MATCHES "^\\-l") + SET(${var} "${${var}} ${lib} ") + ELSEIF(lib MATCHES "^/") + # Full path, convert to just filename, strip "lib" prefix and extension + GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) + STRING(REGEX REPLACE "^lib" "" lib "${lib}") + SET(${var} "${${var}}-l${lib} " ) + ELSE() + SET(${var} "${${var}}-l${lib} " ) + ENDIF() ENDIF() - ENDIF() - ENDFOREACH() + ENDFOREACH() + ENDIF() IF(MSVC) STRING(REPLACE "-l" "" ${var} "${${var}}") ENDIF() -- cgit v1.2.1 From 7dd46008503e7e4be844f32071a30db69abe9dc5 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 12 Aug 2010 08:08:52 -0600 Subject: Bug#55416 Renaming of performance_schema tables for 5.5 Removed table SETUP_OBJECTS. Renamed table PROCESSLIST to THREADS. Renamed table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME to EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. Adjusted Makefiles, code and tests accordingly. --- scripts/mysql_system_tables.sql | 86 ++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 53 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index b5ee4d6dd41..dd620b80475 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -241,26 +241,6 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; --- --- TABLE EVENTS_WAITS_SUMMARY_BY_EVENT_NAME --- - -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME("; -SET @l2="EVENT_NAME VARCHAR(128) not null,"; -SET @l3="COUNT_STAR BIGINT unsigned not null,"; -SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,"; -SET @l5="MIN_TIMER_WAIT BIGINT unsigned not null,"; -SET @l6="AVG_TIMER_WAIT BIGINT unsigned not null,"; -SET @l7="MAX_TIMER_WAIT BIGINT unsigned not null"; -SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; - -SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); - -SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); -PREPARE stmt FROM @str; -EXECUTE stmt; -DROP PREPARE stmt; - -- -- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE -- @@ -303,6 +283,26 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; +-- +-- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="COUNT_STAR BIGINT unsigned not null,"; +SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l5="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + -- -- TABLE FILE_INSTANCES -- @@ -394,23 +394,6 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; --- --- TABLE PROCESSLIST --- - -SET @l1="CREATE TABLE performance_schema.PROCESSLIST("; -SET @l2="THREAD_ID INTEGER not null,"; -SET @l3="ID INTEGER not null,"; -SET @l4="NAME VARCHAR(64) not null"; -SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; - -SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); - -SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); -PREPARE stmt FROM @str; -EXECUTE stmt; -DROP PREPARE stmt; - -- -- TABLE RWLOCK_INSTANCES -- @@ -463,19 +446,15 @@ EXECUTE stmt; DROP PREPARE stmt; -- --- TABLE SETUP_OBJECTS +-- TABLE SETUP_TIMERS -- -SET @l1="CREATE TABLE performance_schema.SETUP_OBJECTS("; -SET @l2="OBJECT_TYPE VARCHAR(64),"; -SET @l3="OBJECT_SCHEMA VARCHAR(64),"; -SET @l4="OBJECT_NAME VARCHAR(64),"; -SET @l5="ENABLED ENUM ('YES', 'NO') not null,"; -SET @l6="TIMED ENUM ('YES', 'NO') not null,"; -SET @l7="AGGREGATED ENUM ('YES', 'NO') not null"; -SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; +SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS("; +SET @l2="NAME VARCHAR(64) not null,"; +SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; -SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); +SET @cmd=concat(@l1,@l2,@l3,@l4); SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); PREPARE stmt FROM @str; @@ -483,15 +462,16 @@ EXECUTE stmt; DROP PREPARE stmt; -- --- TABLE SETUP_TIMERS +-- TABLE THREADS -- -SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS("; -SET @l2="NAME VARCHAR(64) not null,"; -SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"; -SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; +SET @l1="CREATE TABLE performance_schema.THREADS("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="ID INTEGER not null,"; +SET @l4="NAME VARCHAR(64) not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; -SET @cmd=concat(@l1,@l2,@l3,@l4); +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); PREPARE stmt FROM @str; -- cgit v1.2.1 From 13ec2a1625c29d13746b978fe42b8e914f85e75b Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Thu, 12 Aug 2010 19:19:57 +0400 Subject: Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect). Fixing copyright text. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5180206c529..c7eafac2781 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,3 +1,4 @@ +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -10,8 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Build comp_sql - used for embedding SQL in C or C++ programs IF(NOT CMAKE_CROSSCOMPILING) -- cgit v1.2.1 From e1d285d1e019ac8920beb7a1a1f7e7e4c4046af7 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 19 Aug 2010 17:11:31 +0500 Subject: Bug#54129 Missing the execute bit for scripts files for cmake had some minor bugs causing this. per-file comments: mysql-test/CMakeLists.txt Bug#54129 Missing the execute bit for scripts use same permissions as in the source folder mysql-test/t/disabled.def Bug#54129 Missing the execute bit for scripts mysqlhotcopy tests enabled scripts/CMakeLists.txt Bug#54129 Missing the execute bit for scripts chmod +x for the script files --- scripts/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index c7eafac2781..4fc5f3f9b0d 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -344,6 +344,7 @@ ELSE() MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " "${CMAKE_CURRENT_SOURCE_DIR}" ) ENDIF() + EXECUTE_PROCESS(COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/${file}) IF(NOT ${file}_COMPONENT) SET(${file}_COMPONENT Server) ENDIF() -- cgit v1.2.1 From a73b734949dde2725ed0bddaceef79c9be581ff8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 24 Aug 2010 10:48:45 -0300 Subject: Bug#55846: Link tests fail on Windows - my_compiler.h missing Make the my_compiler.h header, like my_attribute.h, part of the distribution. This is required due to the dependency of the former on the latter (which can undefine __attribute__). --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index a08a41bb283..22970c95ddd 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -263,6 +263,7 @@ cp include/mysql.h \ include/keycache.h \ include/m_ctype.h \ include/my_attribute.h \ + include/my_compiler.h \ include/mysqld_error.h \ include/sql_state.h \ include/mysqld_ername.h \ -- cgit v1.2.1 From f919f9e327020121579b4d54e9a6ede05cedf5f4 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 31 Aug 2010 18:33:19 +0400 Subject: Cherry-picking patch for Bug#55846. Original changeset: ------------------------------------------------------------ revno: 3186 revision-id: davi.arnaut@oracle.com-20100831142822-2qhufn3hho4xqr4p parent: gshchepa@mysql.com-20100830222201-ie7n43mjy4irlllk committer: Davi Arnaut branch nick: mysql-5.5-merge timestamp: Tue 2010-08-31 11:28:22 -0300 message: Bug#55846: Link tests fail on Windows - my_compiler.h missing Make the my_compiler.h header, like my_attribute.h, part of the distribution. This is required due to the dependency of the former on the latter (which can undefine __attribute__). ------------------------------------------------------------ --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 4fb57b06d71..aa106a3dfc4 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -260,6 +260,7 @@ cp include/mysql.h \ include/keycache.h \ include/m_ctype.h \ include/my_attribute.h \ + include/my_compiler.h \ include/mysqld_error.h \ include/sql_state.h \ include/mysqld_ername.h \ -- cgit v1.2.1 From e6a3c8c458bc626f8c7977868afdb6b9ae8019c3 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 7 Sep 2010 17:05:16 +0200 Subject: Fix bug#56574: After installation from RPM, server is run under root, not mysql user The problem was that in the cmake way of building the variable "MYSQLD_USER" was not set and propagated. In the script "mysqld_safe" its value is used as the name of the user who should run the server process. The fix is to explicitly set this variable to "mysql" and propagate it in the build process. It was analyzed and proposed by Jonathan Perkin. --- scripts/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 4fc5f3f9b0d..0c9177c79c5 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -139,6 +139,7 @@ ELSE() ENDIF() SET(HOSTNAME "hostname") +SET(MYSQLD_USER "mysql") # Required for mysqlbug until autotools are deprecated, once done remove these # and expand default cmake variables -- cgit v1.2.1 From 7cb89424f984bf3299b596a0e512591f4390a9c2 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Sun, 3 Oct 2010 18:24:45 +0200 Subject: Fix bug#56267: tcmalloc lib (libtcmalloc_minimal.so) is missing from mysql 5.5 binary Ensure that a "-DMALLOC_LIB=/foo/bar/libtcmalloc_minimal.so" will ensure that this library gets included in the tar.gz binary package. It depends on the build environment to set this variable to the correct path name, if it is available. --- scripts/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 0c9177c79c5..9b4b598a682 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -81,12 +81,11 @@ INSTALL(FILES ) # TCMalloc hacks -IF($ENV{MALLOC_LIB}) - SET(MALLOC_LIB $ENV{MALLOC_LIB} CACHE STRING "malloc library") -ENDIF() - IF(MALLOC_LIB) - INSTALL(FILES ${MALLOC_LIB} DESTINATION lib OPTIONAL) + MESSAGE("Using tcmalloc '${MALLOC_LIB}'") + INSTALL(FILES ${MALLOC_LIB} DESTINATION ${INSTALL_LIBDIR} OPTIONAL) +ELSE() + MESSAGE("No 'MALLOC_LIB' variable") ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") -- cgit v1.2.1 From c6de6320bac2faec6f25facb684141b1a646b146 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 4 Oct 2010 21:25:53 +0200 Subject: Fix compile error on Windows after WL#1054 push. The error was introduced by typo in variable name (errormsg instead of correct errmsg) - Also, precache HAVE_PEERCRED to OFF in cmake\os\WindowsCache.cmake (to avoid useless system check). - Also, add missing check for errors from FormatMessage(). - Also, remove annoying CMake debug printout of MALLOC_LIB if this is not set. --- scripts/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 9b4b598a682..0a8d4f9658d 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -84,8 +84,6 @@ INSTALL(FILES IF(MALLOC_LIB) MESSAGE("Using tcmalloc '${MALLOC_LIB}'") INSTALL(FILES ${MALLOC_LIB} DESTINATION ${INSTALL_LIBDIR} OPTIONAL) -ELSE() - MESSAGE("No 'MALLOC_LIB' variable") ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") -- cgit v1.2.1 From 4c929d53fa1259e6a89ca73d77d351b66f079939 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 6 Oct 2010 18:03:27 -0600 Subject: Bug#57154 Rename THREADS.ID to THREADS.PROCESSLIST_ID in 5.5 This change is to align the 5.5 performance_schema.THREADS table definition with the 5.6 performance_schema.THREADS table, to facilitate the 5.5 -> 5.6 migration later. In the table performance_schema.THREADS: - renamed ID to PROCESSLIST_ID, removed not null - changed NAME from varchar(64) to varchar(128) to match the columns definitions from 5.6 Adjusted the test cases accordingly. Note: this fix is for 5.5 only, to null merge into 5.6 --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 977907c9c14..d5dd20542ff 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -467,8 +467,8 @@ DROP PREPARE stmt; SET @l1="CREATE TABLE performance_schema.THREADS("; SET @l2="THREAD_ID INTEGER not null,"; -SET @l3="ID INTEGER not null,"; -SET @l4="NAME VARCHAR(64) not null"; +SET @l3="PROCESSLIST_ID INTEGER,"; +SET @l4="NAME VARCHAR(128) not null"; SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); -- cgit v1.2.1 From b69f9b397ac78836a7ac963554ee84763bff49b8 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 2 Nov 2010 17:45:26 +0200 Subject: Bug #57916: Fix the naming of the proxy_priv table 1. Fixed the name of the table to proxies_priv 2. Fixed the column names to be of the form Capitalized_lowecarse instead of Capitalized_Capitalized 3. Added Timestamp and Grantor columns 4. Added tests to plugin_auth to check the table structure 5. Updated the existing tests --- scripts/mysql_system_tables.sql | 6 +++--- scripts/mysql_system_tables_data.sql | 10 +++++----- scripts/mysql_system_tables_fix.sql | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index d5dd20542ff..02c5389f8d3 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -478,7 +478,7 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -CREATE TABLE IF NOT EXISTS proxy_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_Host char(16) binary DEFAULT '' NOT NULL, Proxied_User char(60) binary DEFAULT '' NOT NULL, With_Grant BOOL DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User,Proxied_Host,Proxied_User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; +CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; --- Remember for later if proxy_priv table already existed -set @had_proxy_priv_table= @@warning_count != 0; +-- Remember for later if proxies_priv table already existed +set @had_proxies_priv_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 293baa46523..bc5ffae2063 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -30,8 +30,8 @@ INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOW INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; -CREATE TEMPORARY TABLE tmp_proxy_priv LIKE proxy_priv; -INSERT INTO tmp_proxy_priv VALUES ('localhost', 'root', '', '', TRUE); -REPLACE INTO tmp_proxy_priv SELECT @current_hostname, 'root', '', '', TRUE FROM DUAL WHERE LOWER (@current_hostname) != 'localhost'; -INSERT INTO proxy_priv SELECT * FROM tmp_proxy_priv WHERE @had_proxy_priv_table=0; -DROP TABLE tmp_proxy_priv; +CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv; +INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now()); +REPLACE INTO tmp_proxies_priv SELECT @current_hostname, 'root', '', '', TRUE, '', now() FROM DUAL WHERE LOWER (@current_hostname) != 'localhost'; +INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; +DROP TABLE tmp_proxies_priv; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index ceb910676ab..b51e4c6f549 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -643,7 +643,7 @@ drop procedure mysql.die; ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; -CREATE TABLE IF NOT EXISTS proxy_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_User char(60) binary DEFAULT '' NOT NULL, Proxied_Host char(16) binary DEFAULT '' NOT NULL, With_Grant BOOL DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User,Proxied_Host,Proxied_User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above -- cgit v1.2.1 From 7f35b15ada5c5b2e63256423c37ce0c907181d85 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 3 Nov 2010 16:42:33 +0100 Subject: Bug#57609 performance_schema does not work with lower_case_table_names Before this fix, the performance schema tables were defined in UPPERCASE. This was incompatible with the lowercase_table_names option, and caused issues with the install / upgrade process, when changing the lower case table names setting *after* the install or upgrade. With this fix, all performance schema tables are exposed with lowercase names. As a result, the name of the performance schema table is always lowercase, no matter how / if / when the lowercase_table_names setting if changed. --- scripts/mysql_system_tables.sql | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index d5dd20542ff..96f1fd2db88 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -171,7 +171,7 @@ set @have_pfs= (select count(engine) from information_schema.engines where engin -- TABLE COND_INSTANCES -- -SET @l1="CREATE TABLE performance_schema.COND_INSTANCES("; +SET @l1="CREATE TABLE performance_schema.cond_instances("; SET @l2="NAME VARCHAR(128) not null,"; SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null"; SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; @@ -187,7 +187,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_CURRENT -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_CURRENT("; +SET @l1="CREATE TABLE performance_schema.events_waits_current("; SET @l2="THREAD_ID INTEGER not null,"; SET @l3="EVENT_ID BIGINT unsigned not null,"; SET @l4="EVENT_NAME VARCHAR(128) not null,"; @@ -217,7 +217,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_HISTORY -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY("; +SET @l1="CREATE TABLE performance_schema.events_waits_history("; -- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); @@ -231,7 +231,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_HISTORY_LONG -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG("; +SET @l1="CREATE TABLE performance_schema.events_waits_history_long("; -- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); @@ -245,7 +245,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE("; +SET @l1="CREATE TABLE performance_schema.events_waits_summary_by_instance("; SET @l2="EVENT_NAME VARCHAR(128) not null,"; SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; SET @l4="COUNT_STAR BIGINT unsigned not null,"; @@ -266,7 +266,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME("; +SET @l1="CREATE TABLE performance_schema.events_waits_summary_by_thread_by_event_name("; SET @l2="THREAD_ID INTEGER not null,"; SET @l3="EVENT_NAME VARCHAR(128) not null,"; SET @l4="COUNT_STAR BIGINT unsigned not null,"; @@ -287,7 +287,7 @@ DROP PREPARE stmt; -- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME -- -SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME("; +SET @l1="CREATE TABLE performance_schema.events_waits_summary_global_by_event_name("; SET @l2="EVENT_NAME VARCHAR(128) not null,"; SET @l3="COUNT_STAR BIGINT unsigned not null,"; SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,"; @@ -307,7 +307,7 @@ DROP PREPARE stmt; -- TABLE FILE_INSTANCES -- -SET @l1="CREATE TABLE performance_schema.FILE_INSTANCES("; +SET @l1="CREATE TABLE performance_schema.file_instances("; SET @l2="FILE_NAME VARCHAR(512) not null,"; SET @l3="EVENT_NAME VARCHAR(128) not null,"; SET @l4="OPEN_COUNT INTEGER unsigned not null"; @@ -324,7 +324,7 @@ DROP PREPARE stmt; -- TABLE FILE_SUMMARY_BY_EVENT_NAME -- -SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME("; +SET @l1="CREATE TABLE performance_schema.file_summary_by_event_name("; SET @l2="EVENT_NAME VARCHAR(128) not null,"; SET @l3="COUNT_READ BIGINT unsigned not null,"; SET @l4="COUNT_WRITE BIGINT unsigned not null,"; @@ -343,7 +343,7 @@ DROP PREPARE stmt; -- TABLE FILE_SUMMARY_BY_INSTANCE -- -SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE("; +SET @l1="CREATE TABLE performance_schema.file_summary_by_instance("; SET @l2="FILE_NAME VARCHAR(512) not null,"; SET @l3="EVENT_NAME VARCHAR(128) not null,"; SET @l4="COUNT_READ BIGINT unsigned not null,"; @@ -363,7 +363,7 @@ DROP PREPARE stmt; -- TABLE MUTEX_INSTANCES -- -SET @l1="CREATE TABLE performance_schema.MUTEX_INSTANCES("; +SET @l1="CREATE TABLE performance_schema.mutex_instances("; SET @l2="NAME VARCHAR(128) not null,"; SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; SET @l4="LOCKED_BY_THREAD_ID INTEGER"; @@ -380,7 +380,7 @@ DROP PREPARE stmt; -- TABLE PERFORMANCE_TIMERS -- -SET @l1="CREATE TABLE performance_schema.PERFORMANCE_TIMERS("; +SET @l1="CREATE TABLE performance_schema.performance_timers("; SET @l2="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"; SET @l3="TIMER_FREQUENCY BIGINT,"; SET @l4="TIMER_RESOLUTION BIGINT,"; @@ -398,7 +398,7 @@ DROP PREPARE stmt; -- TABLE RWLOCK_INSTANCES -- -SET @l1="CREATE TABLE performance_schema.RWLOCK_INSTANCES("; +SET @l1="CREATE TABLE performance_schema.rwlock_instances("; SET @l2="NAME VARCHAR(128) not null,"; SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; SET @l4="WRITE_LOCKED_BY_THREAD_ID INTEGER,"; @@ -416,7 +416,7 @@ DROP PREPARE stmt; -- TABLE SETUP_CONSUMERS -- -SET @l1="CREATE TABLE performance_schema.SETUP_CONSUMERS("; +SET @l1="CREATE TABLE performance_schema.setup_consumers("; SET @l2="NAME VARCHAR(64) not null,"; SET @l3="ENABLED ENUM ('YES', 'NO') not null"; SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; @@ -432,7 +432,7 @@ DROP PREPARE stmt; -- TABLE SETUP_INSTRUMENTS -- -SET @l1="CREATE TABLE performance_schema.SETUP_INSTRUMENTS("; +SET @l1="CREATE TABLE performance_schema.setup_instruments("; SET @l2="NAME VARCHAR(128) not null,"; SET @l3="ENABLED ENUM ('YES', 'NO') not null,"; SET @l4="TIMED ENUM ('YES', 'NO') not null"; @@ -449,7 +449,7 @@ DROP PREPARE stmt; -- TABLE SETUP_TIMERS -- -SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS("; +SET @l1="CREATE TABLE performance_schema.setup_timers("; SET @l2="NAME VARCHAR(64) not null,"; SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"; SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; @@ -465,7 +465,7 @@ DROP PREPARE stmt; -- TABLE THREADS -- -SET @l1="CREATE TABLE performance_schema.THREADS("; +SET @l1="CREATE TABLE performance_schema.threads("; SET @l2="THREAD_ID INTEGER not null,"; SET @l3="PROCESSLIST_ID INTEGER,"; SET @l4="NAME VARCHAR(128) not null"; -- cgit v1.2.1 From a6b4be252261647afd1cdc04a839331261bb3e8a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 13 Nov 2010 23:16:52 +0100 Subject: add missing COMPONENT to all CMake INSTALL commands --- scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 0a8d4f9658d..56b7f779bb0 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -310,7 +310,7 @@ IF(WIN32) FOREACH(file ${SH_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT}) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts) ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory -- cgit v1.2.1 From bb642a5cc0b0d3cc7728eeb482a61dc87fe5b407 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 19 Nov 2010 16:35:04 +0200 Subject: Bug #57551: Live upgrade fails between 5.1.52 -> 5.5.7-rc Updated the server to treat a missing mysql.proxies_priv table as empty. Added some grants to make sure tables are correctly opened when they must be opened. Fixed a mysql_upgrade omission not adding rights to root to execute GRANT PROXY on other users. Removed a redundant CREATE TABLE from mysql_system_tables_fix.sql since it's always executed after mysql_system_tables.sql and the first file has CREATE TABLE in it. Added a test case for the above. Fixed error handling code to close the cursor --- scripts/mysql_system_tables_fix.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index b51e4c6f549..399c42b1b2d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -643,7 +643,14 @@ drop procedure mysql.die; ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; -CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; +-- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from +-- older versions + +CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv; +INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now()); +INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; +DROP TABLE tmp_proxies_priv; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above -- cgit v1.2.1 From f6deb00a56b2e87287d606aba3bcd71290d876ae Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 20 Nov 2010 12:47:50 -0200 Subject: WL#5665: Removal of the autotools-based build system The autotools-based build system has been superseded and is being removed in order to ease the maintenance burden on developers tweaking and maintaining the build system. In order to support tools that need to extract the server version, a new file that (only) contains the server version, called VERSION, is introduced. The file contents are human and machine-readable. The format is: MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=8 MYSQL_VERSION_EXTRA=-rc The CMake based version extraction in cmake/mysql_version.cmake is changed to extract the version from this file. The configure to CMake wrapper is retained for backwards compatibility and to support the BUILD/ scripts. Also, a new a makefile target show-dist-name that prints the server version is introduced. --- scripts/Makefile.am | 192 --------------------------------- scripts/make_sharedlib_distribution.sh | 136 ----------------------- 2 files changed, 328 deletions(-) delete mode 100644 scripts/Makefile.am delete mode 100644 scripts/make_sharedlib_distribution.sh (limited to 'scripts') diff --git a/scripts/Makefile.am b/scripts/Makefile.am deleted file mode 100644 index 0200410fd8f..00000000000 --- a/scripts/Makefile.am +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright (C) 2000-2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -## Process this file with automake to create Makefile.in - -BUILT_SOURCES = mysql_fix_privilege_tables.sql \ - mysql_fix_privilege_tables_sql.c - -EXTRA_PROGRAMS = comp_sql - -bin_SCRIPTS = @server_scripts@ \ - msql2mysql \ - mysql_config \ - mysql_fix_extensions \ - mysql_setpermission \ - mysql_secure_installation \ - mysql_zap \ - mysqlaccess \ - mysqlbug \ - mysql_convert_table_format \ - mysql_find_rows \ - mysqlhotcopy \ - mysqldumpslow \ - mysqld_multi - -noinst_SCRIPTS = make_binary_distribution \ - make_sharedlib_distribution \ - dheadgen.pl - -EXTRA_SCRIPTS = make_binary_distribution.sh \ - make_sharedlib_distribution.sh \ - msql2mysql.sh \ - mysql_config.sh \ - mysql_config.pl.in \ - mysql_fix_extensions.sh \ - mysql_install_db.sh \ - mysql_install_db.pl.in \ - mysql_setpermission.sh \ - mysql_secure_installation.sh \ - mysql_secure_installation.pl.in \ - mysql_zap.sh \ - mysqlaccess.sh \ - mysqlbug.sh \ - mysql_convert_table_format.sh \ - mysql_find_rows.sh \ - mysqlhotcopy.sh \ - mysqldumpslow.sh \ - mysqld_multi.sh \ - mysqld_safe.sh \ - dheadgen.pl - -EXTRA_DIST = $(EXTRA_SCRIPTS) \ - mysqlaccess.conf \ - mysqlbug \ - make_win_bin_dist \ - mysql_fix_privilege_tables_sql.c \ - mysql_system_tables_fix.sql \ - CMakeLists.txt - -dist_pkgdata_DATA = fill_help_tables.sql \ - mysql_fix_privilege_tables.sql \ - mysql_system_tables.sql \ - mysql_system_tables_data.sql \ - mysql_test_data_timezone.sql - -CLEANFILES = @server_scripts@ \ - make_binary_distribution \ - make_sharedlib_distribution \ - msql2mysql \ - mysql_config \ - mysql_fix_extensions \ - mysql_setpermission \ - mysql_secure_installation \ - mysql_zap \ - mysqlaccess \ - mysql_convert_table_format \ - mysql_find_rows \ - mysqlhotcopy \ - mysqldumpslow \ - mysqld_multi - -pkgplugindir = $(pkglibdir)/plugin - -# Default same as 'pkgdatadir', but we can override it -pkgsuppdir = $(datadir)/@PACKAGE@ - -# mysqlbug should be distributed built so that people can report build -# failures with it. -DISTCLEANFILES = $(BUILT_SOURCES) mysqlbug - -# We want the right version and configure comand line in mysqlbug -mysqlbug: ${top_builddir}/config.status mysqlbug.sh - -# Build mysql_fix_privilege_tables.sql from the files that contain -# the system tables for this version of MySQL plus any commands -# needed to upgrade the system tables from an older version -mysql_fix_privilege_tables.sql: mysql_system_tables.sql \ - mysql_system_tables_fix.sql - @echo "Building $@"; - @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@ - -# -# Build mysql_fix_privilege_tables_sql.c from -# mysql_fix_privileges_tables.sql using comp_sql -# The "sleep" ensures the generated file has a younger timestamp than its source -# (which may have been generated in this very same "make" run). -# -mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 2 - $(top_builddir)/scripts/comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ - - -SUFFIXES = .sh - -.sh: - @RM@ -f $@ $@-t - @SED@ \ - -e 's!@''bindir''@!$(bindir)!g' \ - -e 's!@''sbindir''@!$(sbindir)!g' \ - -e 's!@''scriptdir''@!$(bindir)!g' \ - -e 's!@''prefix''@!$(prefix)!g' \ - -e 's!@''datadir''@!$(datadir)!g' \ - -e 's!@''localstatedir''@!$(localstatedir)!g' \ - -e 's!@''libexecdir''@!$(libexecdir)!g' \ - -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ - -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ - -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ - -e 's!@''pkgplugindir''@!$(pkgplugindir)!g' \ - -e 's!@''pkgsuppdir''@!$(pkgsuppdir)!g' \ - -e 's!@''sysconfdir''@!$(sysconfdir)!g' \ - -e 's!@''mandir''@!$(mandir)!g' \ - -e 's!@''infodir''@!$(infodir)!g' \ - -e 's!@''CC''@!@CC@!'\ - -e 's!@''CXX''@!@CXX@!'\ - -e 's!@''GXX''@!@GXX@!'\ - -e 's!@''SAVE_CC''@!@SAVE_CC@!'\ - -e 's!@''SAVE_CXX''@!@SAVE_CXX@!'\ - -e 's!@''CC_VERSION''@!@CC_VERSION@!'\ - -e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\ - -e 's!@''PERL''@!@PERL@!' \ - -e 's!@''SAVE_ASFLAGS''@!@SAVE_ASFLAGS@!'\ - -e 's!@''SAVE_CFLAGS''@!@SAVE_CFLAGS@!'\ - -e 's!@''SAVE_CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ - -e 's!@''SAVE_LDFLAGS''@!@SAVE_LDFLAGS@!'\ - -e 's!@''ASFLAGS''@!@ASFLAGS@!'\ - -e 's!@''CFLAGS''@!@CFLAGS@!'\ - -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\ - -e 's!@''LDFLAGS''@!@LDFLAGS@!'\ - -e 's!@''LIBDL''@!@LIBDL@!'\ - -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ - -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ - -e 's!@''LIBS''@!@LIBS@!' \ - -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ - -e 's!@''openssl_libs''@!@openssl_libs@!' \ - -e 's!@''VERSION''@!@VERSION@!' \ - -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ - -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ - -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \ - -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \ - -e 's!@''HOSTNAME''@!@HOSTNAME@!' \ - -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \ - -e 's!@''CHECK_PID''@!@CHECK_PID@!' \ - -e 's!@''FIND_PROC''@!@FIND_PROC@!' \ - -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \ - -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ - -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ - -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \ - -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \ - -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ - -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ - -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ - -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \ - -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \ - -e "s!@MAKE@!$(MAKE)!" \ - $< > $@-t - @CHMOD@ +x $@-t - @MV@ $@-t $@ diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh deleted file mode 100644 index f6669788233..00000000000 --- a/scripts/make_sharedlib_distribution.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/sh -# Copyright (C) 2003-2004, 2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# The default path should be /usr/local - -# Get some info from configure -# chmod +x ./scripts/setsomevars - -machine=@MACHINE_TYPE@ -system=@SYSTEM_TYPE@ -version=@VERSION@ -export machine system version -SOURCE=`pwd` -CP="cp -p" -MV="mv" - -STRIP=1 -DEBUG=0 -SILENT=0 -TMP=/tmp -SUFFIX="" - -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=;;"` ;; - --no-strip) STRIP=0 ;; - --silent) SILENT=1 ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} - -parse_arguments "$@" - -BASE=$TMP/my_dist$SUFFIX - -if [ -d $BASE ] ; then - rm -r -f $BASE -fi - -mkdir -p $BASE/lib - -for i in \ - libmysql/.libs/libmysqlclient.so* \ - libmysql/.libs/libmysqlclient.sl* \ - libmysql/.libs/libmysqlclient*.dylib \ - libmysql_r/.libs/libmysqlclient_r.so* \ - libmysql_r/.libs/libmysqlclient_r.sl* \ - libmysql_r/.libs/libmysqlclient_r*.dylib -do - if [ -f $i ] - then - $CP $i $BASE/lib - fi -done - -# Change the distribution to a long descriptive name -NEW_NAME=mysql-shared-$version-$system-$machine$SUFFIX -BASE2=$TMP/$NEW_NAME -rm -r -f $BASE2 -mv $BASE $BASE2 -BASE=$BASE2 - -#if we are debugging, do not do tar/gz -if [ x$DEBUG = x1 ] ; then - exit -fi - -# This is needed to prefer 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 tar file -# - -tar=`which_1 gnutar gtar` -if test "$?" = "1" -o "$tar" = "" -then - tar=tar -fi - -echo "Using $tar to create archive" -cd $TMP - -OPT=cvf -if [ x$SILENT = x1 ] ; then - OPT=cf -fi - -$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME -cd $SOURCE -echo "Compressing archive" -gzip -9 $NEW_NAME.tar -echo "Removing temporary directory" -rm -r -f $BASE - -echo "$NEW_NAME.tar.gz created" -- cgit v1.2.1 From 174a6962dafe030759fd27dc8404f2c972e589e6 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 24 Nov 2010 12:53:39 +0300 Subject: A follow-up for Bug#58340 (Remove Server GPL EXCEPTIONS-CLIENT file) -- remove all EXCEPTIONS-CLIENT from all the places. --- scripts/make_binary_distribution.sh | 2 +- scripts/make_win_bin_dist | 4 ++-- scripts/make_win_src_distribution_old.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index a089e8ef55d..93a78037843 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -211,7 +211,7 @@ copyfileto() copyfileto $BASE/docs ChangeLog Docs/mysql.info copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - EXCEPTIONS-CLIENT LICENSE.mysql + LICENSE.mysql # Non platform-specific bin dir files: BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 9e3fc010885..34134ccd977 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -200,8 +200,8 @@ cp ChangeLog $DESTDIR/Docs/ || /bin/true cp support-files/my-*.ini $DESTDIR/ if [ -f COPYING ] ; then - cp COPYING EXCEPTIONS-CLIENT $DESTDIR/ - cp COPYING $DESTDIR/Docs/ + cp COPYING $DESTDIR/ + cp COPYING $DESTDIR/Docs/ fi # ---------------------------------------------------------------------- diff --git a/scripts/make_win_src_distribution_old.sh b/scripts/make_win_src_distribution_old.sh index dfb43585a21..f319bad6d55 100644 --- a/scripts/make_win_src_distribution_old.sh +++ b/scripts/make_win_src_distribution_old.sh @@ -312,7 +312,7 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ +for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/INSTALL-BINARY Docs/manual.chm @@ -376,7 +376,7 @@ fi # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name COPYING -o -name ChangeLog \ -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ -o -name "*.dsp" -o -name "*.dsw" \ -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ -- cgit v1.2.1 From a3deb16810cef3181350e77c87f33fc044ced0b1 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 17 Dec 2010 23:08:43 +0000 Subject: bug#51925: 5.5 installed header file layout is incorrect The 'mysql' include sub-directory was copied directly into include/ rather than retaining its own directory. Fix this, and update mysql_config which needs additional logic to detect the correct prefix for includes. --- scripts/mysql_config.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 69ec88d6724..97a8a723043 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,7 +92,11 @@ plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin pkgincludedir='@pkgincludedir@' -fix_path pkgincludedir include/mysql include +if [ -f $basedir/include/mysql/mysql.h ]; then + pkgincludedir="$basedir/include/mysql" +elif [ -f $basedir/include/mysql.h ]; then + pkgincludedir="$basedir/include" +fi version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' -- cgit v1.2.1 From 6c70c33f12534917c68e691f20be574007cff589 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 17 Dec 2010 23:13:33 +0000 Subject: bug#51925: 5.5 installed header file layout is incorrect Additional space-in-directory-name protection. --- scripts/mysql_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 97a8a723043..67484ec13b7 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -92,9 +92,9 @@ plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin pkgincludedir='@pkgincludedir@' -if [ -f $basedir/include/mysql/mysql.h ]; then +if [ -f "$basedir/include/mysql/mysql.h" ]; then pkgincludedir="$basedir/include/mysql" -elif [ -f $basedir/include/mysql.h ]; then +elif [ -f "$basedir/include/mysql.h" ]; then pkgincludedir="$basedir/include" fi -- cgit v1.2.1 From fddb1f1b1342026bbe39e5ae880c775fc5f189c1 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 28 Dec 2010 19:57:23 +0100 Subject: - Added/updated copyright headers - Removed files specific to compiling on OS/2 - Removed files specific to SCO Unix packaging - Removed "libmysqld/copyright", text is included in documentation - Removed LaTeX headers for NDB Doxygen documentation - Removed obsolete NDB files - Removed "mkisofs" binaries - Removed the "cvs2cl.pl" script - Changed a few GPL texts to use "program" instead of "library" --- scripts/fill_help_tables.sql | 15 +++++++++++++++ scripts/make_binary_distribution.sh | 2 +- scripts/make_win_bin_dist | 2 +- scripts/make_win_src_distribution_old.sh | 4 ++-- scripts/mysql_fix_extensions.sh | 18 ++++++++++++++++++ scripts/mysql_prepare_privilege_tables_for_5.sql | 14 ++++++++++++++ scripts/mysql_setpermission.sh | 18 ++++++++++++++++++ scripts/mysql_system_tables.sql | 15 +++++++++++++++ scripts/mysql_system_tables_data.sql | 15 +++++++++++++++ scripts/mysql_system_tables_fix.sql | 15 +++++++++++++++ scripts/mysql_tableinfo.sh | 17 +++++++++++++++++ scripts/mysql_test_data_timezone.sql | 15 +++++++++++++++ scripts/mysqlaccess.sh | 18 ++++++++++++++++++ scripts/mysqld_multi.sh | 17 +++++++++++++++++ scripts/mysqldumpslow.sh | 18 ++++++++++++++++++ scripts/mysqlhotcopy.sh | 17 +++++++++++++++++ 16 files changed, 216 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index 9f527c288e9..d32dfaac408 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2005 MySQL AB +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + -- fill_help_tables.sql - this file is a placeholder to satisfy build dependencies - -- it will be replaced with the appropriate content by the Boostrap script that -- creates the official source distribution. diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 93a78037843..cafd550f839 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2000-2006 MySQL AB +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 34134ccd977..c1d01a0342d 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/make_win_src_distribution_old.sh b/scripts/make_win_src_distribution_old.sh index f319bad6d55..68a29d1d59f 100644 --- a/scripts/make_win_src_distribution_old.sh +++ b/scripts/make_win_src_distribution_old.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2003-2006 MySQL AB +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ # new CMake build was added. The new build obsoletes this script, Unix # and Windows share the same source TAR/ZIP. # Also note that the old build from source created by this script is -# no longer tested by MySQL AB and may not work. Please use the new +# no longer tested by Oracle and may not work. Please use the new # CMake based build. # Terminate loudly on error, we don't want partial package diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh index 6d4e017f678..74a47fdf4a1 100644 --- a/scripts/mysql_fix_extensions.sh +++ b/scripts/mysql_fix_extensions.sh @@ -1,4 +1,22 @@ #!/usr/bin/perl + +# Copyright (C) 2001 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + # This is a utility for MySQL. It is not needed by any standard part # of MySQL. diff --git a/scripts/mysql_prepare_privilege_tables_for_5.sql b/scripts/mysql_prepare_privilege_tables_for_5.sql index a9b6d43aee0..5101ac3c6fb 100644 --- a/scripts/mysql_prepare_privilege_tables_for_5.sql +++ b/scripts/mysql_prepare_privilege_tables_for_5.sql @@ -1,3 +1,17 @@ +-- Copyright (C) 2003 MySQL AB +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use mysql; diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 9b49345175a..d2a5a00cd3e 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -1,5 +1,23 @@ #!/usr/bin/perl ## Emacs, this is -*- perl -*- mode? :-) + +# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + ## ## Permission setter for MySQL ## diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index aca87b01bc3..f3c1a0f7c61 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2007, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + -- -- The system tables of MySQL Server -- diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index b70a8a13f6e..e934ff927cb 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2007, 2008 MySQL AB +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + -- -- The inital data for system tables of MySQL Server -- diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index cfd03b7c45d..b390aa33385 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -1,3 +1,18 @@ +# Copyright (C) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # This part converts any old privilege tables to privilege tables suitable # for current version of MySQL diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh index c90c410ca78..9bbb78a700e 100644 --- a/scripts/mysql_tableinfo.sh +++ b/scripts/mysql_tableinfo.sh @@ -1,5 +1,22 @@ #!/usr/bin/perl +# Copyright (C) 2002, 2007 MySQL AB +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + use strict; use Getopt::Long; use DBI; diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql index e52df2149f2..6bf28148e5e 100644 --- a/scripts/mysql_test_data_timezone.sql +++ b/scripts/mysql_test_data_timezone.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2007 MySQL AB +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1) ,(1, -1663455600, 2) ,(1, -1650150000, 3) ,(1, -1632006000, 2) ,(1, -1618700400, 3) ,(1, -938905200, 2) ,(1, -857257200, 3) ,(1, -844556400, 2) ,(1, -828226800, 3) ,(1, -812502000, 2) ,(1, -796777200, 3) ,(1, 228877200, 2) ,(1, 243997200, 3) ,(1, 260326800, 2) ,(1, 276051600, 3) ,(1, 291776400, 2) ,(1, 307501200, 3) ,(1, 323830800, 2) ,(1, 338950800, 3) ,(1, 354675600, 2) ,(1, 370400400, 3) ,(1, 386125200, 2) ,(1, 401850000, 3) ,(1, 417574800, 2) ,(1, 433299600, 3) ,(1, 449024400, 2) ,(1, 465354000, 3) ,(1, 481078800, 2) ,(1, 496803600, 3) ,(1, 512528400, 2) ,(1, 528253200, 3) ,(1, 543978000, 2) ,(1, 559702800, 3) ,(1, 575427600, 2) ,(1, 591152400, 3) ,(1, 606877200, 2) ,(1, 622602000, 3) ,(1, 638326800, 2) ,(1, 654656400, 3) ,(1, 670381200, 2) ,(1, 686106000, 3) ,(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8) ,(5, -1009875600, 1); diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 0153a3afa7c..4e208e6c16e 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -1,4 +1,22 @@ #!/usr/bin/perl + +# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + # **************************** package MySQLaccess; #use strict; diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index a6330055f99..87eb35a52fc 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,5 +1,22 @@ #!/usr/bin/perl +# Copyright (C) 2000, 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + use Getopt::Long; use POSIX qw(strftime getcwd); diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index 009745fd896..d1bb23370b7 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -1,4 +1,22 @@ #!/usr/bin/perl + +# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + # mysqldumpslow - parse and summarize the MySQL slow query log # Original version by Tim Bunce, sometime in 2000. diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 21fca0c0848..30359f4bb29 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -1,5 +1,22 @@ #!/usr/bin/perl +# Copyright (C) 2000, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + use strict; use Getopt::Long; use Data::Dumper; -- cgit v1.2.1 From fb18601ee8c2e6cf8d2a9bfbaf6f7ca317b982af Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 8 Feb 2011 17:36:25 +0200 Subject: Bug #59815: Missing License information with enterprise GPL packages on behalf of Kent: Include the README into the binary packages --- scripts/make_win_bin_dist | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index c1d01a0342d..7859f42ca29 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -198,6 +198,7 @@ cp Docs/INSTALL-BINARY $DESTDIR/Docs/ cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true cp ChangeLog $DESTDIR/Docs/ || /bin/true cp support-files/my-*.ini $DESTDIR/ +cp README $DESTDIR/ if [ -f COPYING ] ; then cp COPYING $DESTDIR/ -- cgit v1.2.1 From ba8b8ccb789fb97d3573fcff867f6af85ef5830b Mon Sep 17 00:00:00 2001 From: Chuck Bell Date: Fri, 11 Mar 2011 10:15:57 -0500 Subject: BUG#59752 : mysql.user.plugin length (60) vs. mysql.plugin.name length (64) This patch corrects the problem by fixing the definition and alterations of the mysql.user table in the .sql files. Also included are new result files for tests that examine the name column of the mysql.user table. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 70e1d4fcdce..f5448b7caa6 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,7 +28,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 362464d5b60..90dd49c254a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -640,8 +640,8 @@ DROP PREPARE stmt; drop procedure mysql.die; -ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; -ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; +ALTER TABLE user ADD plugin char(64) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; +ALTER TABLE user MODIFY plugin char(64) DEFAULT '' NOT NULL; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions -- cgit v1.2.1 From 52edb4a5b95de617d0627e8476785e404f380eeb Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 18 Mar 2011 16:16:17 +0200 Subject: Bug # 11766011: mysql.user.authentication_string column causes configuration wizard to fail Made the fields mysql.user.plugin and mysql.user.authentication_string nullable to conform with some older clients doing inserts instead of using the commands. --- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f5448b7caa6..547803fe34f 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -28,7 +28,7 @@ set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) DEFAULT '', authentication_string TEXT, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 90dd49c254a..c57b3be5fae 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -640,8 +640,8 @@ DROP PREPARE stmt; drop procedure mysql.die; -ALTER TABLE user ADD plugin char(64) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; -ALTER TABLE user MODIFY plugin char(64) DEFAULT '' NOT NULL; +ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; +ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions -- cgit v1.2.1 From 9fddc97e6d3bac740200da53a02a617d6754fa57 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 31 Mar 2011 16:08:31 +0300 Subject: Merged the fix for bug #11936829 to 5.5.11 release Bug #11936829: DIFF. BETWEEN MYSQL.USER (AUTHENTICATION_STRING) IN FRESH AND UPGRADED 5.5.11 There was no modification for pre 5.5.11 builds that had authentication_string. Thus the column was not upgraded by mysql_upgrade. Fixed by adding an ALTER TABLE MODIFY to update an existing column to the latest type version. Test suite added. --- scripts/mysql_system_tables_fix.sql | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index c57b3be5fae..7e6ffb466a9 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -642,6 +642,7 @@ drop procedure mysql.die; ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; +ALTER TABLE user MODIFY authentication_string TEXT; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions -- cgit v1.2.1 From e5ce023f5716212aa1d20c757ebc8c6cecdf055a Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Thu, 30 Jun 2011 17:31:31 +0200 Subject: Updated/added copyright headers --- scripts/mysql_find_rows.sh | 3 ++- scripts/mysql_fix_extensions.sh | 7 ++++--- scripts/mysql_secure_installation.pl.in | 5 +++-- scripts/mysql_secure_installation.sh | 5 +++-- scripts/mysql_setpermission.sh | 7 ++++--- scripts/mysql_system_tables.sql | 5 +++-- scripts/mysql_system_tables_data.sql | 5 +++-- scripts/mysql_system_tables_fix.sql | 5 +++-- scripts/mysql_zap.sh | 3 ++- scripts/mysqlaccess.sh | 7 ++++--- scripts/mysqld_multi.sh | 7 ++++--- scripts/mysqldumpslow.sh | 7 ++++--- scripts/mysqlhotcopy.sh | 7 ++++--- 13 files changed, 43 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 967a8196ebd..48c4915ae00 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -1,5 +1,6 @@ #!/usr/bin/perl -# Copyright (C) 2000, 2004 MySQL AB +# Copyright (c) 2000, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh index 74a47fdf4a1..2a50bfe22bb 100644 --- a/scripts/mysql_fix_extensions.sh +++ b/scripts/mysql_fix_extensions.sh @@ -1,6 +1,7 @@ #!/usr/bin/perl -# Copyright (C) 2001 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2001 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -14,8 +15,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA # This is a utility for MySQL. It is not needed by any standard part # of MySQL. diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 25339f9b916..00f57dbb643 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -1,7 +1,8 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (C) 2002 MySQL AB and Jeremy Cole +# Copyright (c) 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use Fcntl; use File::Spec; diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 25d6343ee2c..098f9bc5ba2 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -1,6 +1,7 @@ #!/bin/sh -# Copyright (C) 2002 MySQL AB and Jeremy Cole +# Copyright (c) 2002, 2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA config=".my.cnf.$$" command=".mysql.$$" diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index d2a5a00cd3e..aa2afb9e62a 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -1,7 +1,8 @@ #!/usr/bin/perl ## Emacs, this is -*- perl -*- mode? :-) -# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -15,8 +16,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA ## ## Permission setter for MySQL diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f3c1a0f7c61..b8547350426 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2007, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +-- Copyright (c) 2007, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +-- Use is subject to license terms. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -11,7 +12,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- The system tables of MySQL Server diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index e934ff927cb..7e30277b1d1 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2007, 2008 MySQL AB +-- Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc. +-- Use is subject to license terms. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -11,7 +12,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- The inital data for system tables of MySQL Server diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index b390aa33385..ae7ccb2b1ae 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -1,4 +1,5 @@ -# Copyright (C) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -11,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This part converts any old privilege tables to privilege tables suitable # for current version of MySQL diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index 258e60dc356..46d62d47e4f 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -1,5 +1,6 @@ #!/usr/bin/perl -# Copyright (C) 2000-2002, 2004 MySQL AB +# Copyright (c) 2000-2002, 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 4e208e6c16e..bab0dbf5b87 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -1,6 +1,7 @@ #!/usr/bin/perl -# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -14,8 +15,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA # **************************** package MySQLaccess; diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 87eb35a52fc..c71e345ed38 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,6 +1,7 @@ #!/usr/bin/perl -# Copyright (C) 2000, 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -14,8 +15,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA use Getopt::Long; use POSIX qw(strftime getcwd); diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index d1bb23370b7..9216fff5d6b 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -1,6 +1,7 @@ #!/usr/bin/perl -# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -14,8 +15,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA # mysqldumpslow - parse and summarize the MySQL slow query log diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 30359f4bb29..04f8d40d6f0 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -1,6 +1,7 @@ #!/usr/bin/perl -# Copyright (C) 2000, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +# Copyright (c) 2000, 2008 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -14,8 +15,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA use strict; use Getopt::Long; -- cgit v1.2.1 From e7b37d7258249a66f0a417bf46741b3946aee323 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 2 Sep 2011 16:52:04 +0530 Subject: BUG#11878394 - MYSQLD_SAFE TEST FOR ALREADY RUNNING PROCESS FAILS, CAUSING CLOBBERED SOCKET A check for running mysqld instances was failing in mysqld_safe because of an incorrect shell command generated by cmake. The problem is that cmake retains the '\' of escaped double-quote, so the generated mysqld_safe script's command contained \" in the shell command, and hence the failure. Fixed the command in scripts\CMakeLists.txt. --- scripts/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 56b7f779bb0..2efb348fcd5 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -104,11 +104,11 @@ IF(UNIX) # FIND_PROC and CHECK_PID are used by mysqld_safe IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET (FIND_PROC - "ps wwwp $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") + "ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null") ENDIF() IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS") SET (FIND_PROC - "ps -p $PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" > /dev/null") + "ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null") ENDIF() IF(NOT FIND_PROC) @@ -116,7 +116,7 @@ IF(NOT FIND_PROC) EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) IF(result MATCHES 0) SET( FIND_PROC - "ps -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null") + "ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null") ENDIF() ENDIF() @@ -124,7 +124,7 @@ IF(NOT FIND_PROC) # SysV style EXECUTE_PROCESS(COMMAND ps -ef OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result) IF(result MATCHES 0) - SET( FIND_PROC "ps -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"$MYSQLD\" | grep \" $PID \" > /dev/null") + SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null") ENDIF() ENDIF() -- cgit v1.2.1 From ecdc6cc21a3b199c64ecf906d66117c0060d38c0 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 6 Sep 2011 21:06:09 +0530 Subject: Bug#11765888 58898: MYSQL_INSTALL_DB: NOT ALL OPTIONS DOCUMENTED (EG: --DEFAULTS-FILE ) Added help message for the missing options (--no-defaults, --defaults-file and --defaults-extra-file). --- scripts/mysql_install_db.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b9b31a2d78e..6fe9712b23a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -46,10 +46,16 @@ Usage: $0 [OPTIONS] --cross-bootstrap For internal use. Used when building the MySQL system tables on a different host than the target. --datadir=path The path to the MySQL data directory. + --defaults-extra-file=name + Read this file after the global files are read. + + --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally use hostnames will use IP addresses. + --help Display this help and exit. --ldata=path The path to the MySQL data directory. Same as --datadir. + --no-defaults Don't read default options from any option file. --rpm For internal use. This option is used by RPM files during the MySQL installation process. --skip-name-resolve Use IP addresses rather than hostnames when creating -- cgit v1.2.1 From 5485967706a71431d9de5c3081dd36e40a420abc Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 6 Sep 2011 21:25:28 +0530 Subject: Removing a stray line, went into the last push. --- scripts/mysql_install_db.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 6fe9712b23a..9782a37c462 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -48,7 +48,6 @@ Usage: $0 [OPTIONS] --datadir=path The path to the MySQL data directory. --defaults-extra-file=name Read this file after the global files are read. - --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally -- cgit v1.2.1 From c6b1828886f09bae99db9f8b00b792cf6b754136 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 6 Sep 2011 21:50:04 +0530 Subject: Bug#11765888 58898: MYSQL_INSTALL_DB: NOT ALL OPTIONS DOCUMENTED (EG: --DEFAULTS-FILE ) Updating help message in scripts/mysql_install_db.pl.in file. --- scripts/mysql_install_db.pl.in | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 18bd713c041..7bc1e97e7be 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -61,10 +61,15 @@ Usage: $0 [OPTIONS] --cross-bootstrap For internal use. Used when building the MySQL system tables on a different host than the target. --datadir=path The path to the MySQL data directory. + --defaults-extra-file=name + Read this file after the global files are read. + --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally use hostnames will use IP addresses. + --help Display this help and exit. --ldata=path The path to the MySQL data directory. Same as --datadir. + --no-defaults Don't read default options from any option file. --rpm For internal use. This option is used by RPM files during the MySQL installation process. --skip-name-resolve Use IP addresses rather than hostnames when creating -- cgit v1.2.1 From 07d898ab619e9565b35c19e1d864aaf32f92d6c3 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 13 Sep 2011 12:32:53 +0200 Subject: Bug #58241 Please exclude make_binary_distribution from the distribution With cmake (5.5 and up), "make package" will do it, or cpack. The (generated) "scripts/make_binary_distribution" is just a wrapper around a "cpack" call, with path names set at build time. Similar, "make_win_bin_dist" is not needed any more. --- scripts/CMakeLists.txt | 4 +- scripts/make_binary_distribution.sh | 342 ----------------------------- scripts/make_win_bin_dist | 425 ------------------------------------ 3 files changed, 2 insertions(+), 769 deletions(-) delete mode 100644 scripts/make_binary_distribution.sh delete mode 100755 scripts/make_win_bin_dist (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 2efb348fcd5..424d92e31e1 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ ADD_CUSTOM_TARGET(GenFixPrivs IF(UNIX) FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution - "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake" ) + "cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake\n" ) EXECUTE_PROCESS( COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution ) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh deleted file mode 100644 index 5ccdb2b914c..00000000000 --- a/scripts/make_binary_distribution.sh +++ /dev/null @@ -1,342 +0,0 @@ -#!/bin/sh -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -############################################################################## -# -# This is a script to create a TAR or ZIP binary distribution out of a -# built source tree. The output file will be put at the top level of -# the source tree, as "mysql-....{tar.gz,zip}" -# -# Note that the structure created by this script is slightly different from -# what a normal "make install" would produce. No extra "mysql" sub directory -# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or -# "$prefix/share/mysql". This is because the build system explicitly calls -# make with pkgdatadir=, etc. -# -# In GNU make/automake terms -# -# "pkglibdir" is set to the same as "libdir" -# "pkgincludedir" is set to the same as "includedir" -# "pkgdatadir" is set to the same as "datadir" -# "pkgplugindir" is set to "$pkglibdir/plugin" -# "pkgsuppdir" is set to "@prefix@/support-files", -# normally the same as "datadir" -# -# The temporary directory path given to "--tmp=" has to be -# absolute and with no spaces. -# -# Note that for best result, the original "make" should be done with -# the same arguments as used for "make install" below, especially the -# 'pkglibdir', as the RPATH should to be set correctly. -# -############################################################################## - -############################################################################## -# -# Read the command line arguments that control this script -# -############################################################################## - -machine=@MACHINE_TYPE@ -system=@SYSTEM_TYPE@ -SOURCE=`pwd` -CP="cp -p" -MV="mv" - -# There are platforms, notably OS X on Intel (x86 + x86_64), -# for which "uname" does not provide sufficient information. -# The value of CFLAGS as used during compilation is the most exact info -# we can get - after all, we care about _what_ we built, not _where_ we did it. -cflags="@CFLAGS@" - -STRIP=1 # Option ignored -SILENT=0 -MALLOC_LIB= -PLATFORM="" -TMP=/tmp -NEW_NAME="" # Final top directory and TAR package name -SUFFIX="" -SHORT_PRODUCT_TAG="" # If don't want server suffix in package name -NDBCLUSTER="" # Option ignored - -for arg do - case "$arg" in - --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; - --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; - --short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;; - --inject-malloc-lib=*) MALLOC_LIB=`echo "$arg" | sed -e 's;^[^=]*=;;'` ;; - --no-strip) STRIP=0 ;; - --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; - --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; - --silent) SILENT=1 ;; - --with-ndbcluster) NDBCLUSTER=1 ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac -done - -# ---------------------------------------------------------------------- -# Adjust "system" output from "uname" to be more human readable -# ---------------------------------------------------------------------- - -if [ x"$PLATFORM" = x"" ] ; then - # FIXME move this to the build tools - # Remove vendor from $system - system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` - - # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) - system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` - system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` - system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` - system=`echo $system | sed -e 's/darwin9.*/osx10.5/g'` - system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` - system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` - system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` - system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` - system=`echo $system | sed -e 's/osf5.1b/tru64/g'` - system=`echo $system | sed -e 's/linux-gnu/linux/g'` - system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` - system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` -fi - -# Get the "machine", which really is the CPU architecture (including the size). -# The precedence is: -# 1) use an explicit argument, if given; -# 2) use platform-specific fixes, if there are any (see bug#37808); -# 3) stay with the default (determined during "configure", using predefined macros). - -if [ x"$MACHINE" != x"" ] ; then - machine=$MACHINE -else - case $system in - osx* ) - # Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty! - cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'` - case "$cflag_arch" in - i386 ) case $system in - osx10.4 ) machine=i686 ;; # Used a different naming - * ) machine=x86 ;; - esac ;; - x86_64 ) machine=x86_64 ;; - ppc ) ;; # No treatment needed with PPC - ppc64 ) ;; - * ) # No matching compiler flag? "--platform" is needed - if [ x"$PLATFORM" != x"" ] ; then - : # See below: "$PLATFORM" will take precedence anyway - elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then - : # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch" - else - echo "On system '$system' only specific '-arch' values are expected." - echo "It is taken from the 'CFLAGS' whose value is:" - echo "$cflags" - echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT" - exit 1 - fi ;; - esac # "$cflag_arch" - ;; - esac # $system -fi - -# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence. -if [ x"$PLATFORM" != x"" ] ; then - : -else - PLATFORM="$system-$machine" -fi - -# Print the platform name for build logs -echo "PLATFORM NAME: $PLATFORM" - -# Change the distribution to a long descriptive name -# For the cluster product, concentrate on the second part -VERSION_NAME=@VERSION@ -case $VERSION_NAME in - *-ndb-* ) VERSION_NAME=`echo $VERSION_NAME | sed -e 's/[.0-9]*-ndb-//'` ;; -esac -if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then - NEW_NAME=mysql-$SHORT_PRODUCT_TAG-$VERSION_NAME-$PLATFORM$SUFFIX -else - NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$VERSION_NAME-$PLATFORM$SUFFIX -fi - -# ---------------------------------------------------------------------- -# Define BASE, and remove the old BASE directory if any -# ---------------------------------------------------------------------- -BASE=$TMP/my_dist$SUFFIX -if [ -d $BASE ] ; then - rm -rf $BASE -fi - -# ---------------------------------------------------------------------- -# Find the TAR to use -# ---------------------------------------------------------------------- - -# This is needed to prefer GNU tar over platform tar because that 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 [ -x $file -a ! -d $file ] ; then - echo $file - exit 0 - fi - done - done - done - exit 1 -} - -tar=`which_1 gnutar gtar` -if [ $? -ne 0 -o x"$tar" = x"" ] ; then - tar=tar -fi - - -############################################################################## -# -# Handle the Unix/Linux packaging using "make install" -# -############################################################################## - -# ---------------------------------------------------------------------- -# Terminate on any base level error -# ---------------------------------------------------------------------- -set -e - -# ---------------------------------------------------------------------- -# Really ugly, one script, "mysql_install_db", needs prefix set to ".", -# i.e. makes access relative the current directory. This matches -# the documentation, so better not change this. And for another script, -# "mysql.server", we make some relative, others not. -# ---------------------------------------------------------------------- - -cd scripts -rm -f mysql_install_db -@MAKE@ mysql_install_db \ - prefix=. \ - bindir=./bin \ - sbindir=./bin \ - scriptdir=./bin \ - libexecdir=./bin \ - pkgdatadir=./share \ - localstatedir=./data -cd .. - -cd support-files -rm -f mysql.server -@MAKE@ mysql.server \ - bindir=./bin \ - sbindir=./bin \ - scriptdir=./bin \ - libexecdir=./bin \ - pkgdatadir=@pkgdatadir@ -cd .. - -# ---------------------------------------------------------------------- -# Do a install that we later are to pack. Use the same paths as in -# the build for the relevant directories. -# ---------------------------------------------------------------------- -@MAKE@ DESTDIR=$BASE install \ - pkglibdir=@pkglibdir@ \ - pkgincludedir=@pkgincludedir@ \ - pkgdatadir=@pkgdatadir@ \ - pkgplugindir=@pkgplugindir@ \ - pkgsuppdir=@pkgsuppdir@ \ - mandir=@mandir@ \ - infodir=@infodir@ - -# ---------------------------------------------------------------------- -# Rename top directory, and set DEST to the new directory -# ---------------------------------------------------------------------- -mv $BASE@prefix@ $BASE/$NEW_NAME -DEST=$BASE/$NEW_NAME - -# ---------------------------------------------------------------------- -# If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a -# ---------------------------------------------------------------------- -if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true - if [ -z "$gcclib" ] ; then - echo "Warning: Compiler doesn't tell libgcc.a!" - elif [ -f "$gcclib" ] ; then - $CP $gcclib $DEST/lib/libmygcc.a - else - echo "Warning: Compiler result '$gcclib' not found / no file!" - fi -fi - -# If requested, add a malloc library .so into pkglibdir for use -# by mysqld_safe -if [ -n "$MALLOC_LIB" ]; then - cp "$MALLOC_LIB" "$DEST/lib/" -fi - -# FIXME let this script be in "bin/", where it is in the RPMs? -# http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html -mkdir $DEST/scripts -mv $DEST/bin/mysql_install_db $DEST/scripts/ - -# Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 - -# Copy readme and license files -cp README Docs/INSTALL-BINARY $DEST/ -if [ -f COPYING ] ; then - cp COPYING $DEST/ -elif [ -f LICENSE.mysql ] ; then - cp LICENSE.mysql $DEST/ -else - echo "ERROR: no license files found" - exit 1 -fi - -# FIXME should be handled by make file, and to other dir -mkdir -p $DEST/bin $DEST/support-files -cp scripts/mysqlaccess.conf $DEST/bin/ -cp support-files/magic $DEST/support-files/ - -# Create empty data directories, set permission (FIXME why?) -mkdir $DEST/data $DEST/data/mysql $DEST/data/test -chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test - -# ---------------------------------------------------------------------- -# Create the result tar file -# ---------------------------------------------------------------------- - -echo "Using $tar to create archive" -OPT=cvf -if [ x$SILENT = x1 ] ; then - OPT=cf -fi - -echo "Creating and compressing archive" -rm -f $NEW_NAME.tar.gz -(cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz -echo "$NEW_NAME.tar.gz created" - -echo "Removing temporary directory" -rm -rf $BASE -exit 0 diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist deleted file mode 100755 index 00ef9186d48..00000000000 --- a/scripts/make_win_bin_dist +++ /dev/null @@ -1,425 +0,0 @@ -#!/bin/sh -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Exit if failing to copy, we want exact specifications, not -# just "what happen to be built". -set -e - -# ---------------------------------------------------------------------- -# Read first argument that is the base name of the resulting TAR file. -# See usage() function below for a description on the arguments. -# -# NOTE: We will read the rest of the command line later on. -# NOTE: Pattern matching with "{..,..}" can't be used, not portable. -# ---------------------------------------------------------------------- - -# FIXME why "libmysql.dll" installed both in "bin" and "lib/opt"? - -usage() -{ - echo < Date: Thu, 17 Nov 2011 09:13:43 +0100 Subject: fix for bug 11748060/34981 --- scripts/mysqld_safe.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a537bf27aad..0d2045a65a6 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -464,6 +464,9 @@ export MYSQL_HOME if test -x "$MY_BASEDIR_VERSION/bin/my_print_defaults" then print_defaults="$MY_BASEDIR_VERSION/bin/my_print_defaults" +elif test -x `dirname $0`/my_print_defaults +then + print_defaults="`dirname $0`/my_print_defaults" elif test -x ./bin/my_print_defaults then print_defaults="./bin/my_print_defaults" -- cgit v1.2.1 From c083b122c1061deecadd774d472c0cdfa9a0b995 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 10 Nov 2011 15:46:51 +0200 Subject: Bug #11761530: 54035: MSYQLD_SAFE BEHAVIOUR CONSUMES TOO MUCH CPU IF IT IS UNABLE TO RESTART MY Added a trottling mechanism to mysqld_safe. On every 5 sub-second restarts it will wait for a second before attempting again. Note that this requires 'sleep' and 'date' command line utilities. The code would adjust and will do nothing if any of them is not present. --- scripts/mysqld_safe.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 0d2045a65a6..37e0e351ccd 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -740,17 +740,55 @@ cmd="$cmd $args" test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" log_notice "Starting $MYSQLD daemon with databases from $DATADIR" + +# variable to track the current number of "fast" (a.k.a. subsecond) restarts +fast_restart=0 +# maximum number of restarts before trottling kicks in +max_fast_restarts=5 +# flag whether a usable sleep command exists +have_sleep=1 + while true do rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety + start_time=`date +%M%S` + eval_log_error "$cmd" + end_time=`date +%M%S` + if test ! -f "$pid_file" # This is removed if normal shutdown then break fi + + # sanity check if time reading is sane and there's sleep + if test $end_time -gt 0 -a $have_sleep -gt 0 + then + # throttle down the fast restarts + if test $end_time -eq $start_time + then + fast_restart=`expr $fast_restart + 1` + if test $fast_restart -ge $max_fast_restarts + then + log_notice "The server is respawning too fast. Sleeping for 1 second." + sleep 1 + sleep_state=$? + if test $sleep_state -gt 0 + then + log_notice "The server is respawning too fast and no working sleep command. Turning off trottling." + have_sleep=0 + fi + + fast_restart=0 + fi + else + fast_restart=0 + fi + fi + if @TARGET_LINUX@ && test $KILL_MYSQLD -eq 1 then # Test if one process was hanging. -- cgit v1.2.1 From b89363de1d13526f6f034775d9ddb7cd18c7d273 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 26 Jul 2012 21:47:03 +0530 Subject: Bug#13741677 MYSQL_SECURE_INSTALLATION DOES NOT WORK + SAVES ROOT PASSWORD TO DISK! The secure installation scripts connect to the server by storing the password in a temporary option file. Now, if the script gets killed or fails for some reason, the removal of the option file may not take place. This patch introduces following enhancements : * (.sh) Made sure that cleanup happens at every call to 'exit 1'. This is performed implicitly by END{} in pl.in. * (.pl.in) Added a warning in case unlink fails to delete the option/query files. * (.sh/.pl.in) Added more signals to the signal handler list. SIG# 1, 3, 6, 15 --- scripts/mysql_secure_installation.pl.in | 10 +++++++--- scripts/mysql_secure_installation.sh | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 543b8d1b1c0..278fffe7322 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ my $mysql; # How to call the mysql client my $rootpass = ""; -$SIG{QUIT} = $SIG{INT} = sub { +$SIG{QUIT} = $SIG{INT} = $SIG{TERM} = $SIG{ABRT} = $SIG{HUP} = sub { print "\nAborting!\n\n"; echo_on(); cleanup(); @@ -242,7 +242,11 @@ sub reload_privilege_tables { } sub cleanup { - unlink($config,$command); + print "Cleaning up...\n"; + + foreach my $file ($config, $command) { + unlink $file or warn "Warning: Could not unlink $file: $!\n"; + } } diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 5e84a92a76c..c92cb1262df 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ config=".my.cnf.$$" command=".mysql.$$" mysql_client="" -trap "interrupt" 2 +trap "interrupt" 1 2 3 6 15 rootpass="" echo_n= @@ -139,13 +139,16 @@ set_root_password() { if [ $? -eq 0 ]; then echo "Password updated successfully!" echo "Reloading privilege tables.." - reload_privilege_tables || exit 1 + reload_privilege_tables + if [ $? -eq 1 ]; then + clean_and_exit + fi echo rootpass=$password1 make_config else echo "Password update failed!" - exit 1 + clean_and_exit fi return 0 @@ -157,7 +160,7 @@ remove_anonymous_users() { echo " ... Success!" else echo " ... Failed!" - exit 1 + clean_and_exit fi return 0 @@ -217,6 +220,11 @@ cleanup() { rm -f $config $command } +# Remove the files before exiting. +clean_and_exit() { + cleanup + exit 1 +} # The actual script starts here -- cgit v1.2.1 From 37d22846c1ebdebab98580ac693deb72ab68c28a Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Tue, 14 Aug 2012 15:13:30 +0530 Subject: Bug #12992993 MYSQLHOTCOPY FAILS IF VIEW EXISTS Problem description: mysqlhotcopy fails if a view presents in the database. Analysis: Before 5.5 'FLUSH TABLES ... WITH READ LOCK' will able to get lock for all tables (i.e. base tables and view tables). In 5.5 onwards 'FLUSH TABLES ... WITH READ LOCK' for 'view tables' will not work, because taking flush locks on view tables is not valid. Fix: Take flush lock for 'base tables' and read lock for 'view table' separately. Note: most of the patch has been backported from bug#13006947's patch --- scripts/mysqlhotcopy.sh | 88 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index aaa77ec181c..a7f465dc891 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -272,23 +272,28 @@ if ( defined $opt{regexp} ) { } } -# --- get list of tables to hotcopy --- +# --- get list of tables and views to hotcopy --- my $hc_locks = ""; my $hc_tables = ""; +my $hc_base_tables = ""; +my $hc_views = ""; +my $num_base_tables = 0; +my $num_views = 0; my $num_tables = 0; my $num_files = 0; foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; - my @dbh_tables = get_list_of_tables( $db ); + my @dbh_base_tables = get_list_of_tables( $db ); + my @dbh_views = get_list_of_views( $db ); ## filter out certain system non-lockable tables. ## keep in sync with mysqldump. if ($db =~ m/^mysql$/i) { - @dbh_tables = grep - { !/^(apply_status|schema|general_log|slow_log)$/ } @dbh_tables + @dbh_base_tables = grep + { !/^(apply_status|schema|general_log|slow_log)$/ } @dbh_base_tables } ## generate regex for tables/files @@ -303,11 +308,20 @@ foreach my $rdb ( @db_desc ) { ## filter (out) tables specified in t_regex print "Filtering tables with '$t_regex'\n" if $opt{debug}; - @dbh_tables = ( $negated - ? grep { $_ !~ $t_regex } @dbh_tables - : grep { $_ =~ $t_regex } @dbh_tables ); + @dbh_base_tables = ( $negated + ? grep { $_ !~ $t_regex } @dbh_base_tables + : grep { $_ =~ $t_regex } @dbh_base_tables ); + + ## filter (out) views specified in t_regex + print "Filtering tables with '$t_regex'\n" if $opt{debug}; + @dbh_views = ( $negated + ? grep { $_ !~ $t_regex } @dbh_views + : grep { $_ =~ $t_regex } @dbh_views ); } + ## Now concatenate the base table and view arrays. + my @dbh_tables = (@dbh_base_tables, @dbh_views); + ## get list of files to copy my $db_dir = "$datadir/$db"; opendir(DBDIR, $db_dir ) @@ -347,15 +361,25 @@ foreach my $rdb ( @db_desc ) { $rdb->{files} = [ @db_files ]; $rdb->{index} = [ @index_files ]; - my @hc_tables = map { quote_names("$db.$_") } @dbh_tables; + my @hc_base_tables = map { quote_names("$db.$_") } @dbh_base_tables; + my @hc_views = map { quote_names("$db.$_") } @dbh_views; + + my @hc_tables = (@hc_base_tables, @hc_views); $rdb->{tables} = [ @hc_tables ]; $hc_locks .= ", " if ( length $hc_locks && @hc_tables ); $hc_locks .= join ", ", map { "$_ READ" } @hc_tables; - $hc_tables .= ", " if ( length $hc_tables && @hc_tables ); - $hc_tables .= join ", ", @hc_tables; - $num_tables += scalar @hc_tables; + $hc_base_tables .= ", " if ( length $hc_base_tables && @hc_base_tables ); + $hc_base_tables .= join ", ", @hc_base_tables; + $hc_views .= ", " if ( length $hc_views && @hc_views ); + $hc_views .= join " READ, ", @hc_views; + + @hc_tables = (@hc_base_tables, @hc_views); + + $num_base_tables += scalar @hc_base_tables; + $num_views += scalar @hc_views; + $num_tables += $num_base_tables + $num_views; $num_files += scalar @{$rdb->{files}}; } @@ -467,7 +491,10 @@ if ( $opt{dryrun} ) { print "FLUSH TABLES /*!32323 $hc_tables */\n"; } else { - print "FLUSH TABLES $hc_tables WITH READ LOCK\n"; + # Lock base tables and views separately. + print "FLUSH TABLES $hc_base_tables WITH READ LOCK\n" + if ( $hc_base_tables ); + print "LOCK TABLES $hc_views READ\n" if ( $hc_views ); } print "FLUSH LOGS\n" if ( $opt{flushlog} ); @@ -484,16 +511,24 @@ else { # flush tables to make on-disk copy up to date $start = time; $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); + printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; } else { - $dbh->do("FLUSH TABLES $hc_tables WITH READ LOCK"); - printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; - $hc_started = time; # count from time lock is granted + # Lock base tables and views separately, as 'FLUSH TABLES + # ... WITH READ LOCK' (introduced in 5.5) would fail for views. + # Also, flush tables to make on-disk copy up to date + $dbh->do("FLUSH TABLES $hc_base_tables WITH READ LOCK") + if ( $hc_base_tables ); + printf "Flushed $num_base_tables tables with read lock ($hc_base_tables) in %d seconds.\n", + time-$start unless $opt{quiet}; - # flush tables to make on-disk copy up to date $start = time; + $dbh->do("LOCK TABLES $hc_views READ") if ( $hc_views ); + printf "Locked $num_views views ($hc_views) in %d seconds.\n", + time-$start unless $opt{quiet}; + + $hc_started = time; # count from time lock is granted } - printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; $dbh->do( "FLUSH LOGS" ) if ( $opt{flushlog} ); $dbh->do( "RESET MASTER" ) if ( $opt{resetmaster} ); $dbh->do( "RESET SLAVE" ) if ( $opt{resetslave} ); @@ -802,14 +837,29 @@ sub get_list_of_tables { my $tables = eval { - $dbh->selectall_arrayref('SHOW TABLES FROM ' . - $dbh->quote_identifier($db)) + $dbh->selectall_arrayref('SHOW FULL TABLES FROM ' . + $dbh->quote_identifier($db) . + ' WHERE Table_type = \'BASE TABLE\'') } || []; warn "Unable to retrieve list of tables in $db: $@" if $@; return (map { $_->[0] } @$tables); } +sub get_list_of_views { + my ( $db ) = @_; + + my $views = + eval { + $dbh->selectall_arrayref('SHOW FULL TABLES FROM ' . + $dbh->quote_identifier($db) . + ' WHERE Table_type = \'VIEW\'') + } || []; + warn "Unable to retrieve list of views in $db: $@" if $@; + + return (map { $_->[0] } @$views); +} + sub quote_names { my ( $name ) = @_; # given a db.table name, add quotes -- cgit v1.2.1 From 9c227f4f920b41fb820f5e309551f0faaad7f284 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 24 Aug 2012 15:01:31 +0300 Subject: Bug #14181049: MYSQL_INSTALL_DB.PL CREATES EMPTY SYSTEM TABLES FOR MYSQL The script is different from what's used on unixes. It was not playing the table insertion script (mysql_system_tables_data.sql), although it was checking for the presence of this script. Fixed by re-enabling the lookup for this file and replaying it at bootstrap time. Note that on the Unixes "SELECT @@hostname" does return a fully qualified name, whereas on Windows it returns only a hostname. So by default we're filtering records in the mysql.user table until we ensure this is fixed. --- scripts/mysql_install_db.pl.in | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index c63da6df537..12cd6a21ad1 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -423,10 +423,11 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap, "--bootstrap", "--basedir=$opt->{basedir}", "--datadir=$opt->{ldata}", - "--skip-innodb", - "--skip-bdb", - "--skip-ndbcluster", + "--log-warnings=0", + "--loose-skip-innodb", + "--loose-skip-ndbcluster", "--max_allowed_packet=8M", + "--default-storage-engine=MyISAM", "--net_buffer_length=16K", @args, ); @@ -439,6 +440,8 @@ report_verbose_wait($opt,"Installing MySQL system tables..."); open(SQL, $create_system_tables) or error($opt,"can't open $create_system_tables for reading: $!"); +open(SQL2, $fill_system_tables) + or error($opt,"can't open $fill_system_tables for reading: $!"); # FIXME > /dev/null ? if ( open(PIPE, "| $mysqld_install_cmd_line") ) { @@ -452,8 +455,20 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) print PIPE $_; } + while ( ) + { + # TODO: make it similar to the above condition when we're sure + # @@hostname returns a fqdn + # When doing a "cross bootstrap" install, no reference to the current + # host should be added to the system tables. So we filter out any + # lines which contain the current host name. + next if /\@current_hostname/; + + print PIPE $_; + } close PIPE; close SQL; + close SQL2; report_verbose($opt,"OK"); -- cgit v1.2.1 From 92d2f60e1265c6c0c71d0eef90dde919e4981ba7 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 27 Aug 2012 15:30:58 +0300 Subject: Bug #13548161: MYSQLD_SAFE IMPROVEMENTS FOR 5.5 ALLWAYS SETS PLUGIN_DIR TO DEFAULT IGNOR The test in mysqld_safe for the presence of the --plugin-dir and assigning a default value to it were performed before the actual argument parsing. This is wrong, as PLUGIN_DIR mysqld_safe code also uses MY_BASEDIR_VERSION to look for version specific plugin directory if present. Fixed by moving the PLUGIN_DIR logic after the parse_arguments() call. --- scripts/mysqld_safe.sh | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 37e0e351ccd..1f67e2fe271 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -413,29 +413,6 @@ else DATADIR=@localstatedir@ fi -# -# Try to find the plugin directory -# - -# Use user-supplied argument -if [ -n "${PLUGIN_DIR}" ]; then - plugin_dir="${PLUGIN_DIR}" -else - # Try to find plugin dir relative to basedir - for dir in lib/mysql/plugin lib/plugin - do - if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then - plugin_dir="${MY_BASEDIR_VERSION}/${dir}" - break - fi - done - # Give up and use compiled-in default - if [ -z "${plugin_dir}" ]; then - plugin_dir='@pkgplugindir@' - fi -fi -plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" - if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" @@ -496,6 +473,31 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" + +# +# Try to find the plugin directory +# + +# Use user-supplied argument +if [ -n "${PLUGIN_DIR}" ]; then + plugin_dir="${PLUGIN_DIR}" +else + # Try to find plugin dir relative to basedir + for dir in lib/mysql/plugin lib/plugin + do + if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then + plugin_dir="${MY_BASEDIR_VERSION}/${dir}" + break + fi + done + # Give up and use compiled-in default + if [ -z "${plugin_dir}" ]; then + plugin_dir='@pkgplugindir@' + fi +fi +plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" + + # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested -- cgit v1.2.1 From c0a1b2c8915556be516b4bfea30e01fa792c7943 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 11 Sep 2012 20:56:22 +0200 Subject: Backport this change from MySQL 5.5 to 5.1: Bug #14181049: MYSQL_INSTALL_DB.PL CREATES EMPTY SYSTEM TABLES FOR MYSQL The script is different from what's used on unixes. It was not playing the table insertion script (mysql_system_tables_data.sql), although it was checking for the presence of this script. Fixed by re-enabling the lookup for this file and replaying it at bootstrap time. Note that on the Unixes "SELECT @@hostname" does return a fully qualified name, whereas on Windows it returns only a hostname. So by default we're filtering records in the mysql.user table until we ensure this is fixed. The change was coded in 5.5 by Georgi Kodinov --- scripts/mysql_install_db.pl.in | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index c63da6df537..12cd6a21ad1 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -423,10 +423,11 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap, "--bootstrap", "--basedir=$opt->{basedir}", "--datadir=$opt->{ldata}", - "--skip-innodb", - "--skip-bdb", - "--skip-ndbcluster", + "--log-warnings=0", + "--loose-skip-innodb", + "--loose-skip-ndbcluster", "--max_allowed_packet=8M", + "--default-storage-engine=MyISAM", "--net_buffer_length=16K", @args, ); @@ -439,6 +440,8 @@ report_verbose_wait($opt,"Installing MySQL system tables..."); open(SQL, $create_system_tables) or error($opt,"can't open $create_system_tables for reading: $!"); +open(SQL2, $fill_system_tables) + or error($opt,"can't open $fill_system_tables for reading: $!"); # FIXME > /dev/null ? if ( open(PIPE, "| $mysqld_install_cmd_line") ) { @@ -452,8 +455,20 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) print PIPE $_; } + while ( ) + { + # TODO: make it similar to the above condition when we're sure + # @@hostname returns a fqdn + # When doing a "cross bootstrap" install, no reference to the current + # host should be added to the system tables. So we filter out any + # lines which contain the current host name. + next if /\@current_hostname/; + + print PIPE $_; + } close PIPE; close SQL; + close SQL2; report_verbose($opt,"OK"); -- cgit v1.2.1 From a5fa073727a30fcd2fa3f99dbd937d6d810eaa32 Mon Sep 17 00:00:00 2001 From: Tatjana Azundris Nuernberg Date: Wed, 17 Oct 2012 07:22:06 +0100 Subject: Bug#11764559: UMASK IS IGNORED BY ERROR LOG mysqld_safe script did not heed MySQL specific environment variable $UMASK, leading to divergent behavior between mysqld and mysqld_safe. Patch adds an approximation of mysqld's behavior to mysqld_safe, within the bounds dictated by attempt to have mysqld_safe run on even the most basic of shells (proper '70s sh, not just bash with a fancy symlink). Patch also adds approximation of said behavior to mysqld_multi (in perl). --- scripts/mysqld_multi.sh | 22 ++++++++++++++++++++++ scripts/mysqld_safe.sh | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 8a4d0d44203..5bf59ae27be 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -47,6 +47,28 @@ $homedir = $ENV{HOME}; $my_progname = $0; $my_progname =~ s/.*[\/]//; + +if (defined($ENV{UMASK})) { + my $UMASK = $ENV{UMASK}; + my $m; + my $fmode = "0640"; + + if(($UMASK =~ m/[^0246]/) || ($UMASK =~ m/^[^0]/) || (length($UMASK) != 4)) { + printf("UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.\n"); + printf("The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.\n"); } + else { + $fmode= substr $UMASK, 2, 2; + $fmode= "06${fmode}"; } + + if($fmode != $UMASK) { + printf("UMASK corrected from $UMASK to $fmode ...\n"); } + + $fmode= oct($fmode); + + umask($fmode); +} + + main(); #### diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e4e5f1a1510..75589a2d004 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -27,7 +27,28 @@ syslog_tag_mysqld_safe=mysqld_safe trap '' 1 2 3 15 # we shouldn't let anyone kill us -umask 007 +# MySQL-specific environment variable. First off, it's not really a umask, +# it's the desired mode. Second, it follows umask(2), not umask(3) in that +# octal needs to be explicit. Our shell might be a proper sh without printf, +# multiple-base arithmetic, and binary arithmetic, so this will get ugly. +# We reject decimal values to keep things at least half-sane. +umask 007 # fallback +UMASK="${UMASK-0640}" +fmode=`echo "$UMASK" | sed -e 's/[^0246]//g'` +octalp=`echo "$fmode"|cut -c1` +fmlen=`echo "$fmode"|wc -c|sed -e 's/ //g'` +if [ "x$octalp" != "x0" -o "x$UMASK" != "x$fmode" -o "x$fmlen" != "x5" ] +then + fmode=0640 + echo "UMASK must be a 3-digit mode with an additional leading 0 to indicate octal." >&2 + echo "The first digit will be corrected to 6, the others may be 0, 2, 4, or 6." >&2 +fi +fmode=`echo "$fmode"|cut -c3-4` +fmode="6$fmode" +if [ "x$UMASK" != "x0$fmode" ] +then + echo "UMASK corrected from $UMASK to 0$fmode ..." +fi defaults= case "$1" in @@ -371,6 +392,12 @@ then # Log to err_log file log_notice "Logging to '$err_log'." logging=file + + if [ ! -e "$err_log" ]; then # if error log already exists, + touch "$err_log" # we just append. otherwise, + chmod "$fmode" "$err_log" # fix the permissions here! + fi + else if [ -n "$syslog_tag" ] then @@ -572,6 +599,12 @@ do eval_log_error "$cmd" + if [ $want_syslog -eq 0 -a ! -e "$err_log" ]; then + touch "$err_log" # hypothetical: log was renamed but not + chown $user "$err_log" # flushed yet. we'd recreate it with + chmod "$fmode" "$err_log" # wrong owner next time we log, so set + fi # it up correctly while we can! + if test ! -f "$pid_file" # This is removed if normal shutdown then break -- cgit v1.2.1 From 3dbf1b3e5fd3a3d280e59b3712529af7e5bd182a Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 27 Dec 2012 17:33:34 +0530 Subject: Bug#16046140 BIN/MYSQLD_SAFE: TEST: ARGUMENT EXPECTED Some shell interpreters do not support '-e' test primary to construct conditions. man test 1 (on S10) ...skip... -e file True if file exists. (Not available in sh.) ...skip... Hence, check for the existence of a file using '-e' might result in a syntax error on such shell programs. Fixed by replacing it by '-f'. --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 75589a2d004..48c98f2fde3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -393,7 +393,7 @@ then log_notice "Logging to '$err_log'." logging=file - if [ ! -e "$err_log" ]; then # if error log already exists, + if [ ! -f "$err_log" ]; then # if error log already exists, touch "$err_log" # we just append. otherwise, chmod "$fmode" "$err_log" # fix the permissions here! fi @@ -599,7 +599,7 @@ do eval_log_error "$cmd" - if [ $want_syslog -eq 0 -a ! -e "$err_log" ]; then + if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then touch "$err_log" # hypothetical: log was renamed but not chown $user "$err_log" # flushed yet. we'd recreate it with chmod "$fmode" "$err_log" # wrong owner next time we log, so set -- cgit v1.2.1 From bda79b0564efe1cdb3bff115f2c1f90d14789234 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Tue, 19 Feb 2013 14:31:11 +0530 Subject: Bug#11746817:MYSQL_INSTALL_DB CREATES WILDCARD GRANTS WHEN HOST HAS '_' IN THE HOSTNAME Problem: ======= '_' and '%' are treated as a wildcards by the ACL code and this is documented in the manual. The problem with mysql_install_db is that it does not take this into account when creating the initial GRANT tables: --- cut --- REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','', 0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; --- cut --- If @current_hostname contains any wildcard characters, then a wildcard entry will be defined for the 'root' user, which is a flaw. Analysis: ======== As per the bug description when we have a hostname with a wildcard character in it, it allows clients from several other hosts with similar name pattern to connect to the server as root. For example, if the hostname is like 'host_.com' then the same name is logged in mysql.user table. This allows 'root' users from other hosts like 'host1.com', 'host2.com' ... to connect to the server as root user. While creating the intial GRANT tables we do not have a check for wildcard characters in hostname. Fix: === As part of fix escape character "\" is added before wildcard character to make it a plain character, so that the one and only host with the exact name will be able to connect to the server. --- scripts/mysql_system_tables_data.sql | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index e82d5412d75..7203e250656 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc. +-- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. -- Use is subject to license terms. -- -- This program is free software; you can redistribute it and/or modify @@ -21,7 +21,12 @@ -- When setting up a "cross bootstrap" database (e.g., creating data on a Unix -- host which will later be included in a Windows zip file), any lines -- containing "@current_hostname" are filtered out by mysql_install_db. -set @current_hostname= @@hostname; + +-- Get the hostname, if the hostname has any wildcard character like "_" or "%" +-- add escape character in front of wildcard character to convert "_" or "%" to +-- a plain character +SET @get_hostname= @@hostname; +SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname; -- Fill "db" table with default grants for anyone to @@ -33,10 +38,9 @@ INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0; DROP TABLE tmp_db; --- Fill "users" table with default users allowing root access --- from local machine if "users" table didn't exist before +-- Fill "user" table with default users allowing root access +-- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; -set @current_hostname= @@hostname; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -- cgit v1.2.1 From 69d8812a617a450e7188b17be818b7aa9d878cfc Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Mon, 25 Feb 2013 15:26:00 +0100 Subject: Updated/added copyright headers. --- scripts/CMakeLists.txt | 2 +- scripts/comp_sql.c | 2 +- scripts/make_binary_distribution.sh | 2 +- scripts/mysql_fix_privilege_tables.sh | 2 +- scripts/mysql_install_db.pl.in | 2 +- scripts/mysqlbug.sh | 2 +- scripts/mysqld_multi.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index f0db25be79a..de566a81ad9 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006-2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 88e88e632b6..88a3c08216a 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (c) 2004, 2007 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2ccd4f51b69..8c86c179bcd 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 3b179957932..24e745e42dd 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2000-2006 MySQL AB +# Copyright (c) 2000-2007 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 12cd6a21ad1..b47a6045fc6 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 64804b5de19..4291f60bd36 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2000-2002, 2004 MySQL AB +# Copyright (c) 2000-2002, 2004, 2006, 2007 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 5bf59ae27be..1aa4fdb09a3 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public -- cgit v1.2.1 From d20a70fb55114bd858754a67d863cce573b8333d Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Tue, 19 Mar 2013 13:29:12 +0100 Subject: Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER --- scripts/comp_sql.c | 2 +- scripts/fill_help_tables.sql | 2 +- scripts/mysql_test_data_timezone.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 88a3c08216a..d489767a6c0 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Written by Magnus Svensson diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index d32dfaac408..06249ecac14 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -11,7 +11,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -- fill_help_tables.sql - this file is a placeholder to satisfy build dependencies - -- it will be replaced with the appropriate content by the Boostrap script that diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql index 6bf28148e5e..6fe0ae4c4d3 100644 --- a/scripts/mysql_test_data_timezone.sql +++ b/scripts/mysql_test_data_timezone.sql @@ -11,7 +11,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); -- cgit v1.2.1 From d978016d93a9e607cf9f75458ca94d1326223597 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Tue, 19 Mar 2013 15:53:48 +0100 Subject: Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER --- scripts/comp_sql.c | 2 +- scripts/fill_help_tables.sql | 2 +- scripts/mysql_test_data_timezone.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 88e88e632b6..9c134440c19 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Written by Magnus Svensson diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index d32dfaac408..06249ecac14 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -11,7 +11,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -- fill_help_tables.sql - this file is a placeholder to satisfy build dependencies - -- it will be replaced with the appropriate content by the Boostrap script that diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql index 6bf28148e5e..6fe0ae4c4d3 100644 --- a/scripts/mysql_test_data_timezone.sql +++ b/scripts/mysql_test_data_timezone.sql @@ -11,7 +11,7 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); -- cgit v1.2.1 From f8f88bee8406d17c3be031d0c44ee2c606ef4b22 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 21 Mar 2013 23:36:02 +0530 Subject: Bug#12671635 HELP-TABLEFORMAT DOESN'T MATCH HELP-FILES As current size limit of 'url' field of help_topic table is no longer sufficient for the contents of the fill_help_tables-5.1.sql. So, loading the contents in the table might result in warning (or error with stricter modes). Updated the type for 'url' field of help_topic as well as help_category tables from char(128) to text. --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 80cba6e5736..7f5f21e7823 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -49,10 +49,10 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NUL CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; -CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; +CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; -CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; +CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; -- cgit v1.2.1 From 8977c8fa988d1d3004cbcf2478741d9bb8d1625c Mon Sep 17 00:00:00 2001 From: Anirudh Mangipudi Date: Mon, 12 Aug 2013 21:54:50 +0530 Subject: Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY Problem Description: A mysqld_safe instance is started. An InnoDB crash recovery begins which takes few seconds to complete. During this crash recovery process happening, another mysqld_safe instance is started with the same server startup parameters. Since the mysqld's pid file is absent during the crash recovery process the second instance assumes there is no other process and tries to acquire a lock on the ibdata files in the datadir. But this step fails and the 2nd instance keeps retrying 100 times each with a delay of 1 second. Now after the 100 attempts, the server goes down, but while going down it hits the mysqld_safe script's cleanup section and without any check it blindly deletes the socket and pid files. Since no lock is placed on the socket file, it gets deleted. Solution: We create a mysqld_safe.pid file in the datadir, which protects the presence server instance resources by storing the mysqld_safe's process id in it. We place a check if the mysqld_safe.pid file is existing in the datadir. If yes then we check if the pid it contains is an active pid or not. If yes again, then the scripts logs an error saying "A mysqld_safe instance is already running". Otherwise it will log the present mysqld_safe's pid into the mysqld_safe.pid file. --- scripts/mysqld_safe.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 48c98f2fde3..f3759cbbf6b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -343,6 +343,32 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" +# A pid file is created for the mysqld_safe process. This file protects the +# server instance resources during race conditions. +safe_pid="$DATADIR/mysqld_safe.pid" +if test -f $safe_pid +then + PID=`cat "$safe_pid"` + if @CHECK_PID@ + then + if @FIND_PROC@ + then + log_error "A mysqld_safe process already exists" + exit 1 + fi + fi + rm -f "$safe_pid" + if test -f "$safe_pid" + then + log_error "Fatal error: Can't remove the mysqld_safe pid file" + exit 1 + fi +fi + +# Insert pid proerply into the pid file. +ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid +# End of mysqld_safe pid(safe_pid) check. + # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -352,6 +378,7 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -456,6 +483,7 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -549,6 +577,7 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -559,6 +588,7 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" + rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -644,3 +674,5 @@ done log_notice "mysqld from pid file $pid_file ended" +rm -f "$safe_pid" # Some Extra Safety. File is deleted + # once the mysqld process ends. -- cgit v1.2.1 From cdec34bcd0b85a84ff5d4745d987a6e39acdcbae Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Mon, 9 Sep 2013 20:32:50 +0530 Subject: Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY Reverting the patch. Because this change is not to me made for GA versions. --- scripts/mysqld_safe.sh | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f3759cbbf6b..48c98f2fde3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -343,32 +343,6 @@ fi parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# A pid file is created for the mysqld_safe process. This file protects the -# server instance resources during race conditions. -safe_pid="$DATADIR/mysqld_safe.pid" -if test -f $safe_pid -then - PID=`cat "$safe_pid"` - if @CHECK_PID@ - then - if @FIND_PROC@ - then - log_error "A mysqld_safe process already exists" - exit 1 - fi - fi - rm -f "$safe_pid" - if test -f "$safe_pid" - then - log_error "Fatal error: Can't remove the mysqld_safe pid file" - exit 1 - fi -fi - -# Insert pid proerply into the pid file. -ps -e | grep [m]ysqld_safe | awk '{print $1}' | sed -n 1p > $safe_pid -# End of mysqld_safe pid(safe_pid) check. - # Determine what logging facility to use # Ensure that 'logger' exists, if it's requested @@ -378,7 +352,6 @@ then if [ $? -ne 0 ] then log_error "--syslog requested, but no 'logger' program found. Please ensure that 'logger' is in your PATH, or do not specify the --syslog option to mysqld_safe." - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -483,7 +456,6 @@ does not exist or is not executable. Please cd to the mysql installation directory and restart this script from there as follows: ./bin/mysqld_safe& See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi @@ -577,7 +549,6 @@ then if @FIND_PROC@ then # The pid contains a mysqld process log_error "A mysqld process already exists" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -588,7 +559,6 @@ then $pid_file Please remove it manually and start $0 again; mysqld daemon not started" - rm -f "$safe_pid" # Clean Up of mysqld_safe.pid file. exit 1 fi fi @@ -674,5 +644,3 @@ done log_notice "mysqld from pid file $pid_file ended" -rm -f "$safe_pid" # Some Extra Safety. File is deleted - # once the mysqld process ends. -- cgit v1.2.1 From 39a87704d8a3f747e8a036460d3d044741db1764 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Mon, 30 Sep 2013 13:01:17 +0530 Subject: Bug #16619754 - MYSQL_INSTALL_DB.PL FAILS TO CREATE DATABASE ON WINDOWS. As this mysql_install_db.pl file has always generated lots of confusion on Windows. This fix will make sure to get it removed only from Windows --- scripts/CMakeLists.txt | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 424d92e31e1..d5a3311d942 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -198,24 +198,17 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() -IF(UNIX) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) +IF(NOT WIN32) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) - SET(EXT) -ELSE() - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db.pl ESCAPE_QUOTES @ONLY) - SET(DEST ${INSTALL_SCRIPTDIR}) - SET(EXT ".pl") -ENDIF() -INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" - DESTINATION ${DEST} - COMPONENT Server + INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" + DESTINATION ${DEST} + COMPONENT Server ) - +ENDIF() SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) -- cgit v1.2.1 From b7f272ccaf66b8052d1becc9f4a5f5c983e62f31 Mon Sep 17 00:00:00 2001 From: "Sreedhar.S" Date: Wed, 9 Oct 2013 17:08:45 +0530 Subject: BUG 17560050 - MYSQL_INSTALL_DB SCRIPT FAILING WITH RESOLVEIP ISSUES. --- scripts/CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index d5a3311d942..16d820e147e 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -198,17 +198,23 @@ ELSE() SET(localstatedir ${MYSQL_DATADIR}) ENDIF() -IF(NOT WIN32) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) +IF(UNIX) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) + SET(EXT) +ELSE() + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db.pl ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_SCRIPTDIR}) + SET(EXT ".pl") +ENDIF() - INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" - DESTINATION ${DEST} - COMPONENT Server +INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" + DESTINATION ${DEST} + COMPONENT Server ) -ENDIF() SET(prefix "${CMAKE_INSTALL_PREFIX}") SET(sysconfdir ${prefix}) -- cgit v1.2.1 From 46b617d24f93e96696fa278f5043c74d8b3d8b76 Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Thu, 31 Oct 2013 23:02:44 +0530 Subject: Bug #12917164 DROP USER CAN'T DROP USERS WITH LEGACY UPPER CASE HOST NAME ANYMORE Description: It is not possible to drop users with host names with upper case letters in them. i.e DROP USER 'root'@'Tmp_Host_Name'; is failing with error. Analysis: Since the fix 11748570 we came up with lower case hostnames as standard. But in the current bug the hostname is created by mysql_install_db script is still having upper case hostnames. So, if we have the hostname with upper case letters like(Tmp_Host_Name) then we will have as it is stored in the mysql.user table. In this case if use "'DROP USER 'root'@'Tmp_Host_Name';" it gives error because we do compare with the lower case of hostname since the 11748570 fix. Fix: We need to convert the hostname to lower case before storing into the mysql.user table when we run the mysql_install_db script. --- scripts/mysql_system_tables_data.sql | 7 +++---- scripts/mysql_system_tables_fix.sql | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 7203e250656..82b185ebefc 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -25,8 +25,7 @@ -- Get the hostname, if the hostname has any wildcard character like "_" or "%" -- add escape character in front of wildcard character to convert "_" or "%" to -- a plain character -SET @get_hostname= @@hostname; -SELECT REPLACE((SELECT REPLACE(@get_hostname,'_','\_')),'%','\%') INTO @current_hostname; +SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; -- Fill "db" table with default grants for anyone to @@ -42,9 +41,9 @@ DROP TABLE tmp_db; -- from local machine if "user" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost'; +REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE @current_hostname != 'localhost'; REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost'; +INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 09f66c79c3f..56f6a64211a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -601,6 +601,9 @@ ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; +# Convering the host name to lower case for existing users +UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above # changes was correct -- cgit v1.2.1 From a5eccbc33a11db49f85c4a84108b70d8ae3ad3ef Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Sat, 14 Dec 2013 13:05:36 +0100 Subject: Bug#29716 : Bug#11746921 : MYSQL_INSTALL_DB REFERS TO THE (OBSOLETE) MYSQLBUG SCRIPT DURING INSTALLATION Bug#68742 : Bug#16530527 : OBSOLETE BUGREPORT ADDRESSES --- scripts/mysql_install_db.pl.in | 7 ++++--- scripts/mysql_install_db.sh | 6 +++--- scripts/mysqlaccess.sh | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 12cd6a21ad1..50c7a3f3de8 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -537,7 +537,7 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) " cd mysql-test ; perl mysql-test-run.pl"); } report($opt, - "Please report any problems with the " . '@scriptdir@' . "/mysqlbug script!", + "Please report any problems at http://bugs.mysql.com/", "", "The latest information about MySQL is available on the web at", "", @@ -570,8 +570,9 @@ else "Please consult the MySQL manual section: 'Problems running mysql_install_db',", "and the manual section that describes problems on your OS.", "Another information source is the MySQL email archive.", - "Please check all of the above before mailing us!", - "And if you do mail us, you MUST use the " . '@scriptdir@' . "/mysqlbug script!") + "", + "Please check all of the above before submitting a bug report", + "at http://bugs.mysql.com/") } ############################################################################## diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 96f82198d3a..d937e3c84bb 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -426,8 +426,8 @@ else echo "describes problems on your OS. Another information source are the" echo "MySQL email archives available at http://lists.mysql.com/." echo - echo "Please check all of the above before mailing us! And remember, if" - echo "you do mail us, you MUST use the $scriptdir/mysqlbug script!" + echo "Please check all of the above before submitting a bug report" + echo "at http://bugs.mysql.com/" echo exit 1 fi @@ -478,7 +478,7 @@ then fi echo - echo "Please report any problems with the $scriptdir/mysqlbug script!" + echo "Please report any problems at http://bugs.mysql.com/" echo fi diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index bab0dbf5b87..3d6dc90e596 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2423,7 +2423,7 @@ sub Print_Header { sub Print_Footer { if ($MySQLaccess::CMD) { #command-line mode print "\n" - ."BUGs can be reported by email to bugs\@mysql.com\n"; + ."BUGs can be reported at http://bugs.mysql.com/\n"; } if ($MySQLaccess::CGI) { #CGI-BIN mode if ($MySQLaccess::Param{'brief'}) { @@ -2431,7 +2431,7 @@ sub Print_Footer { } print "
\n" ."
\n" - ."BUGs can be reported by email to bugs\@mysql.com
\n" + ."BUGs can be reported at http://bugs.mysql.com/
\n" # ."Don't forget to mention the version $VERSION!
\n" ."
\n" ."\n" -- cgit v1.2.1 From 496abd0814af68dbedc2ea734b76e69db122a5c2 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Mon, 6 Jan 2014 10:52:35 +0530 Subject: Updated/added copyright headers --- scripts/CMakeLists.txt | 2 +- scripts/comp_sql.c | 2 +- scripts/mysql_install_db.pl.in | 2 +- scripts/mysql_install_db.sh | 2 +- scripts/mysql_system_tables.sql | 2 +- scripts/mysql_system_tables_fix.sql | 2 +- scripts/mysqlaccess.sh | 3 +-- 7 files changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 16d820e147e..b91c50a9614 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 9c134440c19..d489767a6c0 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (c) 2004, 2007 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 50c7a3f3de8..9d908c850c5 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index d937e3c84bb..6f896965948 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 6ba1f16679d..21359159316 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 4cfc7c3ede5..23c8b7f7e5a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 3d6dc90e596..4ca3b2d3686 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -1,7 +1,6 @@ #!/usr/bin/perl -# Copyright (c) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc. -# Use is subject to license terms. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public -- cgit v1.2.1 From 88ae49a401fdc2d56742fa89d255b50fd03bf693 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Mon, 3 Feb 2014 16:04:44 +0100 Subject: Bug#11751526 / Bug#42421 - MYSQL_INSTALL_DB.PL NOT RELOCATABLE ON WINDOWS Corrected how to find "resolveip" --- scripts/mysql_install_db.pl.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index 9d908c850c5..da097120f10 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -365,7 +365,7 @@ my $hostname = hostname(); my $resolved; if ( !$opt->{'cross-bootstrap'} and !$opt->{rpm} and !$opt->{force} ) { - my $resolveip; + my $resolveip = "$extra_bindir/resolveip"; $resolved = `$resolveip $hostname 2>&1`; if ( $? != 0 ) @@ -375,14 +375,14 @@ if ( !$opt->{'cross-bootstrap'} and !$opt->{rpm} and !$opt->{force} ) { error($opt, "Neither host '$hostname' nor 'localhost' could be looked up with", - "$bindir/resolveip", + "$resolveip", "Please configure the 'hostname' command to return a correct", "hostname.", "If you want to solve this at a later stage, restart this script", "with the --force option"); } warning($opt, - "The host '$hostname' could not be looked up with resolveip.", + "The host '$hostname' could not be looked up with $resolveip.", "This probably means that your libc libraries are not 100 % compatible", "with this binary MySQL version. The MySQL daemon, mysqld, should work", "normally with the exception that host name resolving will not work.", -- cgit v1.2.1 From 42bfa908743f9c6c0347073d49ca807606575aff Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Mon, 17 Feb 2014 18:19:04 +0530 Subject: Updated/added copyright header. Added line "use is subject to license terms" to copyright header. --- scripts/comp_sql.c | 1 + scripts/fill_help_tables.sql | 1 + scripts/msql2mysql.sh | 1 + scripts/mysql_test_data_timezone.sql | 1 + scripts/mysqlbug.sh | 1 + 5 files changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index d489767a6c0..ec0a65a94d0 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -1,4 +1,5 @@ /* Copyright (c) 2004, 2007 MySQL AB + Use is subject to license terms This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index 06249ecac14..ea8f52c1ff6 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -1,4 +1,5 @@ -- Copyright (C) 2005 MySQL AB +-- Use is subject to license terms -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by diff --git a/scripts/msql2mysql.sh b/scripts/msql2mysql.sh index 3c802d63705..d5f1e55af34 100644 --- a/scripts/msql2mysql.sh +++ b/scripts/msql2mysql.sh @@ -1,5 +1,6 @@ #!/bin/sh # Copyright (C) 1979-2007 MySQL AB +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql index 6fe0ae4c4d3..091d4f00a97 100644 --- a/scripts/mysql_test_data_timezone.sql +++ b/scripts/mysql_test_data_timezone.sql @@ -1,4 +1,5 @@ -- Copyright (C) 2007 MySQL AB +-- Use is subject to license terms -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh index 64804b5de19..30ac6fbf238 100644 --- a/scripts/mysqlbug.sh +++ b/scripts/mysqlbug.sh @@ -1,5 +1,6 @@ #!/bin/sh # Copyright (C) 2000-2002, 2004 MySQL AB +# Use is subject to license terms # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.1 From bec1ce66447ad659a579fb75ec791a457710ca50 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 25 Feb 2014 09:07:44 +0100 Subject: Bug#18235669 MYSQL_CONFIG TO PROVIDE R FLAG ON SOLARIS 'mysql_config --libs' outputs -L/path/to/library on SunOS we also want it to output '-R/path/to/library' in order to find libraries at runtime. --- scripts/CMakeLists.txt | 10 +++++++++- scripts/mysql_config.pl.in | 4 ++-- scripts/mysql_config.sh | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index b91c50a9614..6596396191a 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -228,6 +228,11 @@ SET(pkglibdir ${prefix}/${INSTALL_LIBDIR}) SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR}) SET(localstatedir ${MYSQL_DATADIR}) +SET(RPATH_OPTION "") +IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + SET(RPATH_OPTION "-R$pkglibdir") +ENDIF() + # some scripts use @TARGET_LINUX@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(TARGET_LINUX "true") @@ -312,6 +317,9 @@ IF(WIN32) INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts) ENDFOREACH() ELSE() + # Configure this one, for testing, but do not install it. + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_config.pl.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql_config.pl ESCAPE_QUOTES @ONLY) # On Unix, most of the files end up in the bin directory SET(mysql_config_COMPONENT COMPONENT Development) SET(BIN_SCRIPTS diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in index 78200278833..bced4a16360 100644 --- a/scripts/mysql_config.pl.in +++ b/scripts/mysql_config.pl.in @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- # -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -189,7 +189,7 @@ if ( $^O eq "MSWin32" ) } else { - my $linkpath = "-L$pkglibdir"; + my $linkpath = "-L$pkglibdir @RPATH_OPTION@"; @lib_opts = ($linkpath,"-lmysqlclient"); @lib_r_opts = ($linkpath,"-lmysqlclient_r"); @lib_e_opts = ($linkpath,"-lmysqld"); diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 92960756777..327b03504cd 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -110,10 +110,10 @@ fi # Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later -libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" +libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " -libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ " -embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " +libs_r=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ " +embedded_libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ " if [ -r "$pkglibdir/libmygcc.a" ]; then # When linking against the static library with a different version of GCC -- cgit v1.2.1 From 5228395a310e7f57911a76c1dc1542c0d0df87cb Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 12 May 2014 15:21:23 +0200 Subject: Backport from trunk: Bug #18382225 MYSQL_CONFIG CAN'T HANDLE RELOCABLE PACKAGES THAT USES "LIB64" OR "-64" SUFFIX 'lib' is hardcoded into mysql_config, so 'cmake -DINSTALL_LIBDIR=lib64' will not work. Use INSTALL_LIBDIR when generating mysql_config. mysql_config may be renamed to e.g. mysql_config-32, fix the basedir pattern matching. --- scripts/CMakeLists.txt | 1 + scripts/mysql_config.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6596396191a..5e03acb654b 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -223,6 +223,7 @@ SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) SET(scriptdir ${prefix}/${INSTALL_BINDIR}) SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) +SET(libsubdir ${INSTALL_LIBDIR}) SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR}) SET(pkglibdir ${prefix}/${INSTALL_LIBDIR}) SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR}) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 327b03504cd..b7c00cc4125 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -76,7 +76,8 @@ get_full_path () me=`get_full_path $0` -basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` +# Script might have been renamed but assume mysql_config +basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'` ldata='@localstatedir@' execdir='@libexecdir@' @@ -85,11 +86,11 @@ bindir='@bindir@' # If installed, search for the compiled in directory first (might be "lib64") pkglibdir='@pkglibdir@' pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` -fix_path pkglibdir $pkglibdir_rel lib/mysql lib +fix_path pkglibdir $pkglibdir_rel @libsubdir@/mysql @libsubdir@ plugindir='@pkgplugindir@' plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` -fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin +fix_path plugindir $plugindir_rel @libsubdir@/mysql/plugin @libsubdir@/plugin pkgincludedir='@pkgincludedir@' if [ -f "$basedir/include/mysql/mysql.h" ]; then -- cgit v1.2.1 From 5c4937c101a9f4127ee3f5e21447c872e4406209 Mon Sep 17 00:00:00 2001 From: Terje Rosten Date: Wed, 25 Jun 2014 12:35:50 +0200 Subject: Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BIT Bug#16415173 CRLF INSTEAD OF LF IN SQL-BENCH SCRIPTS Correct perms and converts from Windows style to UNIX style line endings on some files. Fix perms on installed ini files. (MySQL 5.5 version) --- scripts/mysqlaccess.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/mysqlaccess.conf (limited to 'scripts') diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100755 new mode 100644 -- cgit v1.2.1 From b2c2656b6296e81ca3af0fda25c07b19f4906390 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Fri, 27 Jun 2014 17:04:08 +0530 Subject: Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS. Backporting patch committed for bug 18008907 to 5.5 and 5.6. --- scripts/mysqlaccess.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/mysqlaccess.conf (limited to 'scripts') diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100644 new mode 100755 -- cgit v1.2.1 From 2f6fab4d545f1ae00a09534c3debac041a697563 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Fri, 27 Jun 2014 17:17:04 +0530 Subject: Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS. Post-push patch. Changing file permission of "scripts/mysqlaccess.conf". --- scripts/mysqlaccess.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/mysqlaccess.conf (limited to 'scripts') diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100755 new mode 100644 -- cgit v1.2.1 From 7879b3eefd888a4f8b6cf87b22a815cc2c4a139e Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Fri, 1 Aug 2014 14:18:28 +0530 Subject: Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+ Description: mysql_upgrade fails with below error, when there are duplicate entries(like 'root'@'LOCALHOST' and 'root'@'localhost') in mysql.user table. ERROR 1062 (23000) at line 1140: Duplicate entry 'localhost-root' for key 'PRIMARY' FATAL ERROR: Upgrade failed Analysis: As part of the bug 12917151 fix we are making all the hostnames as lower case hostnames. So, this has been done by mysql_upgrade. In case of above mentioned duplicate entries mysql_upgrade tries to change hostname to lowercase. Since there is already 'root'@'localhost' exists. it is failing with "duplicate entry" error. Fix: Since its a valid error failure. We are making the error more verbose. So, that user will delete the duplicate errors manually. Along with existing error we are printing below error as well. ERROR 1644 (45000) at line 1153: Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them --- scripts/mysql_system_tables_fix.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 23c8b7f7e5a..0578e37fb7a 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -652,6 +652,25 @@ INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now( INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; DROP TABLE tmp_proxies_priv; +-- Checking for any duplicate hostname and username combination are exists. +-- If exits we will throw error. +DROP PROCEDURE IF EXISTS mysql.count_duplicate_host_names; +DELIMITER // +CREATE PROCEDURE mysql.count_duplicate_host_names() +BEGIN + SET @duplicate_hosts=0; + SET @duplicate_hosts=(SELECT count(*) FROM mysql.user GROUP BY user, lower(host) HAVING count(*) > 1 LIMIT 1); + select @duplicate_hosts; + IF @duplicate_hosts > 1 THEN + SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them'; + END IF; +END // +DELIMITER ; +CALL mysql.count_duplicate_host_names(); +-- Get warnings (if any) +SHOW WARNINGS; +DROP PROCEDURE mysql.count_duplicate_host_names; + # Convering the host name to lower case for existing users UPDATE user SET host=LOWER( host ) WHERE LOWER( host ) <> host; -- cgit v1.2.1 From 7d904273f9535a933747ad2d975a359d401901a1 Mon Sep 17 00:00:00 2001 From: Venkata Sidagam Date: Fri, 1 Aug 2014 17:09:55 +0530 Subject: Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+ Follow-up patch. Removed unwanted code. --- scripts/mysql_system_tables_fix.sql | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 0578e37fb7a..c101fd63308 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -658,9 +658,7 @@ DROP PROCEDURE IF EXISTS mysql.count_duplicate_host_names; DELIMITER // CREATE PROCEDURE mysql.count_duplicate_host_names() BEGIN - SET @duplicate_hosts=0; SET @duplicate_hosts=(SELECT count(*) FROM mysql.user GROUP BY user, lower(host) HAVING count(*) > 1 LIMIT 1); - select @duplicate_hosts; IF @duplicate_hosts > 1 THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them'; END IF; -- cgit v1.2.1 From 9fb7de7b650fddd6bd02d9a4aaa8fe31c18a84a7 Mon Sep 17 00:00:00 2001 From: Sayantan Dutta Date: Tue, 2 Sep 2014 15:12:55 +0530 Subject: Bug #19361402 - ADD --MANUAL-LLDB OPTION TO MYSQL-TEST-RUN.PL, contributed --- scripts/mysqlaccess.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/mysqlaccess.conf (limited to 'scripts') diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100644 new mode 100755 -- cgit v1.2.1 From 8b64f825058a2439903e9420552641ca6105d9d6 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 13 Oct 2014 09:52:28 +0200 Subject: Bug#17633291: SET PROPER COMPILE OPTIONS FOR CLANG Bug#17959689: MAKE GCC AND CLANG GIVE CONSISTENT COMPILATION WARNINGS Bug#18313717: ENABLE -WERROR IN MAINTANER MODE WHEN COMPILING WITH CLANG Bug#18510941: REMOVE CMAKE WORKAROUNDS FOR OLDER VERSIONS OF OS X/XCODE Backport from mysql-5.6 to mysql-5.5 --- scripts/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5e03acb654b..05bf8530a26 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -88,16 +88,20 @@ ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS + "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") ENDFOREACH() ELSE() # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS + "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ENDIF() IF(UNIX) -- cgit v1.2.1 From bb14cc03abf6c855c61843f5c8b40cb0e11ae8de Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Fri, 17 Oct 2014 11:14:26 +0530 Subject: Bug #14486004 MYSQL_SETPERMISSION DOES NOT QUOTE USER NAMES Description: Certain operations using the client tool 'mysql\_setpermisson' which uses username of the format "xxx-yyy" results in a syntax error. Analysis: The user name variable ( $user ) was not quoted properly in the 'mysql\_setpermission' script. As a result, while granting user privileges for a user with username of the format 'xxx-yyy', results in a syntax error. Fix: The escape sequence has been applied for the user variable in the script file. Note: Test case is not added for this fix. 'mysql\_setpermission' executable resides in different directories on pb2 machines and on local boxes. Hence the test case cannot be made generic. --- scripts/mysql_setpermission.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index f23011a5ae6..48f0b09b566 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -264,13 +264,13 @@ sub addall { foreach $host (@hosts) { # user privileges: SELECT if (($todo == 2) || ($todo == 3)) { - $sth = $dbh->do("GRANT SELECT ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 4) { # user privileges: SELECT,INSERT,UPDATE,DELETE - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 5) { # user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 6) { # all privileges $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; -- cgit v1.2.1 From bd7e5aba6cffeaa3bf5d37c813b64cdd608a3fc4 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Thu, 6 Nov 2014 10:12:13 +0100 Subject: Bug #18957951 RPMBUILD DEPENDENCY SCANNER ADDS DEPENDENCY ON NON-EXISTING PERL "HOSTNAMES" When building RPMs and using the "rpmbuild" automatic scanning for Perl dependencies, it might interpret "use hostnames" in the "mysql_config.pl" script usage comment as a Perl "use" statement. And then makes the resulting RPMs depends on a non-existing module Perl "hostnames". The comment was changed to prevent this. --- scripts/mysql_install_db.pl.in | 4 ++-- scripts/mysql_install_db.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in index da097120f10..5f6bcabd518 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@ -65,8 +65,8 @@ Usage: $0 [OPTIONS] Read this file after the global files are read. --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not - work. In that case, grant table entries that normally - use hostnames will use IP addresses. + work. In that case, grant table entries that + normally use hostnames will use IP addresses. --help Display this help and exit. --ldata=path The path to the MySQL data directory. Same as --datadir. --no-defaults Don't read default options from any option file. diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 6f896965948..1b9f0e52d5c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -49,8 +49,8 @@ Usage: $0 [OPTIONS] Read this file after the global files are read. --defaults-file=name Only read default options from the given file name. --force Causes mysql_install_db to run even if DNS does not - work. In that case, grant table entries that normally - use hostnames will use IP addresses. + work. In that case, grant table entries that + normally use hostnames will use IP addresses. --help Display this help and exit. --ldata=path The path to the MySQL data directory. Same as --datadir. --no-defaults Don't read default options from any option file. -- cgit v1.2.1 From 3212aaa995b9a20d4986f563bc7ebd34d5fc1477 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 17:18:24 +0100 Subject: MDEV-6220 mysqldump will not backup database with --flush-logs parameter and log_error my.cnf parameter defined some checks were "if [ -n "$err_log" ]", others were "if [ $want_syslog -eq 0 ]", so when both are set, error log file was only partially initialized. To avoid this ambiguity we reset want_syslog when error log file is used. --- scripts/mysqld_safe.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e5e0b768440..3428fff6a59 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -586,6 +586,7 @@ then then # User explicitly asked for syslog, so warn that it isn't used log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect." + want_syslog=0 fi # Log to err_log file -- cgit v1.2.1 From a34fd50ce1c4385a7e63522d3d248fc3d417449b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 9 Feb 2015 20:53:36 +0100 Subject: MDEV-7478 log-basename unpredictable behavior in standalone mode * fix /etc/init.d/mysql to use log-basename for pid-filename * fix mysqld_safe not to force logging-to-file when log-basename is specified --- scripts/mysqld_safe.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 3428fff6a59..303e7a29a6d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -28,6 +28,7 @@ syslog_tag= user='@MYSQLD_USER@' pid_file= err_log= +err_log_base= syslog_tag_mysqld=mysqld syslog_tag_mysqld_safe=mysqld_safe @@ -208,7 +209,7 @@ parse_arguments() { --user=*) user="$val"; SET_USER=1 ;; --log-basename=*|--hostname=*|--loose-log-basename=*) pid_file="$val.pid"; - err_log="$val.err"; + err_log_base="$val"; ;; # these might have been set in a [mysqld_safe] section of my.cnf @@ -577,7 +578,16 @@ then * ) err_log="$DATADIR/$err_log" ;; esac else - err_log=$DATADIR/`@HOSTNAME@`.err + if [ -n "$err_log_base" ] + then + err_log=$err_log_base.err + case "$err_log" in + /* ) ;; + * ) err_log="$DATADIR/$err_log" ;; + esac + else + err_log=$DATADIR/`@HOSTNAME@`.err + fi fi append_arg_to_args "--log-error=$err_log" -- cgit v1.2.1
%-4s%-20s
%-2s%-20s