Commit 833f353e authored by unknown's avatar unknown

Changed safe_mysqld -> mysqld_safe

Added some alias to SHOW commands
Prepare for dynamic changing of MySQL variables


man/Makefile.am:
  Changed safe_mysqld -> mysqld_safe
man/isamchk.1:
  Changed safe_mysqld -> mysqld_safe
man/isamlog.1:
  Changed safe_mysqld -> mysqld_safe
man/mysql.1:
  Changed safe_mysqld -> mysqld_safe
man/mysql_zap.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqlaccess.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqladmin.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqld.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqld_multi.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqld_safe.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqldump.1:
  Changed safe_mysqld -> mysqld_safe
man/mysqlshow.1:
  Changed safe_mysqld -> mysqld_safe
man/perror.1:
  Changed safe_mysqld -> mysqld_safe
man/replace.1:
  Changed safe_mysqld -> mysqld_safe
man/which.2:
  Changed safe_mysqld -> mysqld_safe
myisam/mi_search.c:
  Fixed bug when using packed keys.
scripts/Makefile.am:
  Changed safe_mysqld -> mysqld_safe
scripts/make_binary_distribution.sh:
  Changed safe_mysqld -> mysqld_safe
scripts/mysql_install_db.sh:
  Changed safe_mysqld -> mysqld_safe
scripts/mysqld_multi.sh:
  Changed safe_mysqld -> mysqld_safe
scripts/mysqld_safe-watch.sh:
  Changed safe_mysqld -> mysqld_safe
scripts/mysqld_safe.sh:
  Changed safe_mysqld -> mysqld_safe
sql/lex.h:
  Addex SHOW INDEXES as an alias for SHOW INDEX
sql/sql_class.cc:
  Prepare for dynamic changing of MySQL variables
sql/sql_lex.h:
  Prepare for dynamic changing of MySQL variables
sql/sql_yacc.yy:
  Some changes to SHOW commands.
support-files/binary-configure.sh:
  Changed safe_mysqld -> mysqld_safe
support-files/mysql-max.spec.sh:
  Changed safe_mysqld -> mysqld_safe
support-files/mysql-multi.server.sh:
  Changed safe_mysqld -> mysqld_safe
support-files/mysql.server.sh:
  Changed safe_mysqld -> mysqld_safe
support-files/mysql.spec.sh:
  Changed safe_mysqld -> mysqld_safe
parent f246b619
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \ man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \ mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
perror.1 replace.1 safe_mysqld.1 perror.1 replace.1 mysqld_safe.1
EXTRA_DIST = $(man_MANS) EXTRA_DIST = $(man_MANS)
......
...@@ -125,7 +125,7 @@ mysqlshow (1), ...@@ -125,7 +125,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -83,7 +83,7 @@ mysqlshow (1), ...@@ -83,7 +83,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
......
...@@ -111,7 +111,7 @@ executable ...@@ -111,7 +111,7 @@ executable
.I /depot/bin/mysqld .I /depot/bin/mysqld
executable executable
.TP .TP
.I /depot/bin/safe_mysqld .I /depot/bin/mysqld_safe
executable shell script for starting mysqld safely executable shell script for starting mysqld safely
.TP .TP
.I /site/var/mysql/data .I /site/var/mysql/data
...@@ -135,7 +135,7 @@ mysqlshow (1), ...@@ -135,7 +135,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -28,7 +28,7 @@ isn't given, ask user for confirmation for each process to kill. If signal isn't ...@@ -28,7 +28,7 @@ isn't given, ask user for confirmation for each process to kill. If signal isn't
.BR -t .BR -t
is given the processes is only shown on stdout. is given the processes is only shown on stdout.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), safe_mysqld (1), which1 (1), zap (1), isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
.\" end of man page .\" end of man page
\ No newline at end of file
...@@ -106,7 +106,7 @@ mysqlshow (1), ...@@ -106,7 +106,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -189,7 +189,7 @@ mysqlshow (1), ...@@ -189,7 +189,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -137,7 +137,7 @@ Don't check the rows in the table if there isn't any delete blocks. ...@@ -137,7 +137,7 @@ Don't check the rows in the table if there isn't any delete blocks.
Before a table is automaticly repaired, mysqld will add a note about this in the error log. If you want to be able to recover from most things without user intervention, you should use the options BACKUP,FORCE. This will force a repair of a table even if some rows would be deleted, but it will keep the old data file as a backup so that you can later examine what happened. Before a table is automaticly repaired, mysqld will add a note about this in the error log. If you want to be able to recover from most things without user intervention, you should use the options BACKUP,FORCE. This will force a repair of a table even if some rows would be deleted, but it will keep the old data file as a backup so that you can later examine what happened.
.TP .TP
.BR \-\-pid\-file=\fP\fIpath \fP .BR \-\-pid\-file=\fP\fIpath \fP
Path to pid file used by safe_mysqld. Path to pid file used by mysqld_safe.
.TP .TP
.BR \-P | \-\-port=... .BR \-P | \-\-port=...
Port number to listen for TCP/IP connections. Port number to listen for TCP/IP connections.
...@@ -215,7 +215,7 @@ mysqlshow (1), ...@@ -215,7 +215,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -36,7 +36,7 @@ Log file. Full path to and the name for the log file. NOTE: If the file exists, ...@@ -36,7 +36,7 @@ Log file. Full path to and the name for the log file. NOTE: If the file exists,
mysqladmin binary to be used for a server shutdown. mysqladmin binary to be used for a server shutdown.
.TP .TP
.BR --mysqld=... .BR --mysqld=...
mysqld binary to be used. Note that you can give safe_mysqld to this option also. The options are passed to mysqld. Just make sure you have mysqld in your environment variable PATH or fix safe_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 environment variable PATH or fix mysqld_safe.
.TP .TP
.BR --no-log .BR --no-log
Print to stdout instead of the log file. By default the log file is turned on. Print to stdout instead of the log file. By default the log file is turned on.
...@@ -70,7 +70,7 @@ mysqlshow (1), ...@@ -70,7 +70,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
......
.TH SAFE_MYSQLD 1 "19 December 2000" .TH SAFE_MYSQLD 1 "19 December 2000"
.SH NAME .SH NAME
.BR safe_mysqld .BR mysqld_safe
is the recommended way to start a mysqld daemon on Unix. safe_mysqld adds some safety features such as restarting the server when an error occurs and logging run-time information to a log file. is the recommended way to start a mysqld daemon on Unix. mysqld_safe adds some safety features such as restarting the server when an error occurs and logging run-time information to a log file.
.SH SYNOPSIS .SH SYNOPSIS
.B safe_mysqld .B mysqld_safe
.RB [ \-\-basedir=\fP\fIpath\fP ] .RB [ \-\-basedir=\fP\fIpath\fP ]
.RB [ \-\-core\-file\-size=# ] .RB [ \-\-core\-file\-size=# ]
.RB [ \-\-defaults\-extra\-file=\fP\fIpath\fP ] .RB [ \-\-defaults\-extra\-file=\fP\fIpath\fP ]
...@@ -58,7 +58,7 @@ Set the timezone (the TZ) variable to the value of this parameter. ...@@ -58,7 +58,7 @@ Set the timezone (the TZ) variable to the value of this parameter.
.TP .TP
.BR \-\-user=# .BR \-\-user=#
.SH NOTE .SH NOTE
Note that all options on the command line to safe_mysqld are passed to mysqld. If you wants to use any options in safe_mysqld that mysqld doesn't support, you must specify these in the option file. Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamchk (1),
isamlog (1), isamlog (1),
...@@ -71,7 +71,7 @@ mysqlshow (1), ...@@ -71,7 +71,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -258,7 +258,7 @@ mysqlshow (1), ...@@ -258,7 +258,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -78,7 +78,7 @@ mysqlshow (1), ...@@ -78,7 +78,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -43,7 +43,7 @@ mysqlshow (1), ...@@ -43,7 +43,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -52,7 +52,7 @@ mysqlshow (1), ...@@ -52,7 +52,7 @@ mysqlshow (1),
msql2mysql (1), msql2mysql (1),
perror (1), perror (1),
replace (1), replace (1),
safe_mysqld (1), mysqld_safe (1),
which1 (1), which1 (1),
zap (1), zap (1),
.SH AUTHOR .SH AUTHOR
......
...@@ -48,7 +48,7 @@ Ignore option ...@@ -48,7 +48,7 @@ Ignore option
.BR --read-alias; .BR --read-alias;
don\'t read stdin. don\'t read stdin.
.SH "SEE ALSO" .SH "SEE ALSO"
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), safe_mysqld (1), which1 (1), zap (1), isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
.SH AUTHOR .SH AUTHOR
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com) Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
.\" end of man page .\" end of man page
\ No newline at end of file
...@@ -265,9 +265,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -265,9 +265,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags. SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags.
flag is the value returned by _mi_key_cmp and as treated as final */ flag is the value returned by _mi_key_cmp and as treated as final */
int flag=0, my_flag=-1; int flag=0, my_flag=-1;
uint nod_flag, length, len, matched, cmplen, kseg_len, key_len_left; uint nod_flag, length, len, matched, cmplen, kseg_len;
uint prefix_len,suffix_len; uint prefix_len,suffix_len;
int key_len_skip, seg_len_pack; int key_len_skip, seg_len_pack, key_len_left;
uchar *end, *kseg, *vseg; uchar *end, *kseg, *vseg;
uchar *sort_order=keyinfo->seg->charset->sort_order; uchar *sort_order=keyinfo->seg->charset->sort_order;
uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2; uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
...@@ -294,7 +294,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -294,7 +294,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uint lenght_pack; uint lenght_pack;
get_key_pack_length(kseg_len,lenght_pack,kseg); get_key_pack_length(kseg_len,lenght_pack,kseg);
key_len_skip=lenght_pack+kseg_len; key_len_skip=lenght_pack+kseg_len;
key_len_left=key_len-key_len_skip; key_len_left=(int) key_len- (int) key_len_skip;
cmplen=(key_len_left>=0) ? kseg_len : key_len-lenght_pack; cmplen=(key_len_left>=0) ? kseg_len : key_len-lenght_pack;
} }
......
...@@ -44,7 +44,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ ...@@ -44,7 +44,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
mysqlhotcopy.sh \ mysqlhotcopy.sh \
mysqldumpslow.sh \ mysqldumpslow.sh \
mysqld_multi.sh \ mysqld_multi.sh \
safe_mysqld.sh mysqld_safe.sh
EXTRA_DIST = $(EXTRA_SCRIPTS) \ EXTRA_DIST = $(EXTRA_SCRIPTS) \
mysqlaccess.conf \ mysqlaccess.conf \
......
...@@ -117,7 +117,7 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ ...@@ -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 \@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 < $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 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/configure
......
...@@ -333,7 +333,7 @@ then ...@@ -333,7 +333,7 @@ then
if test "$IN_RPM" -eq 0 if test "$IN_RPM" -eq 0
then then
echo "You can start the MySQL daemon with:" echo "You can start the MySQL daemon with:"
echo "cd @prefix@ ; $bindir/safe_mysqld &" echo "cd @prefix@ ; $bindir/mysqld_safe &"
echo echo
echo "You can test the MySQL daemon 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 "cd sql-bench ; run-all-tests"
......
...@@ -457,12 +457,12 @@ sub example ...@@ -457,12 +457,12 @@ sub example
# directory, that you have (just change the socket, -S=...) # directory, that you have (just change the socket, -S=...)
# See more detailed information from chapter: # See more detailed information from chapter:
# '6 The MySQL Access Privilege System' from the MySQL manual. # '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 # 2.pid-file is very important, if you are using mysqld_safe to start mysqld
# (e.g. --mysqld=safe_mysqld) Every mysqld should have it's own pid-file. # (e.g. --mysqld=mysqld_safe) Every mysqld should have it's own pid-file.
# The advantage using safe_mysqld instead of mysqld directly here is, that # The advantage using mysqld_safe instead of mysqld directly here is, that
# safe_mysqld 'guards' every mysqld process and will restart it, if mysqld # mysqld_safe 'guards' every mysqld process and will restart it, if mysqld
# process fails due to signal kill -9, or similar. (Like segmentation fault, # 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 # 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 # you may have to CD to a certain directory, before you start the
# mysqld_multi. If you have problems starting, please see the script. # mysqld_multi. If you have problems starting, please see the script.
...@@ -497,7 +497,7 @@ sub example ...@@ -497,7 +497,7 @@ sub example
# give you extra performance in a threaded system! # give you extra performance in a threaded system!
# #
[mysqld_multi] [mysqld_multi]
mysqld = @bindir@/safe_mysqld mysqld = @bindir@/mysqld_safe
mysqladmin = @bindir@/mysqladmin mysqladmin = @bindir@/mysqladmin
user = multi_admin user = multi_admin
password = multipass password = multipass
...@@ -591,9 +591,9 @@ Options: ...@@ -591,9 +591,9 @@ Options:
Using: $opt_log Using: $opt_log
--mysqladmin=... mysqladmin binary to be used for a server shutdown. --mysqladmin=... mysqladmin binary to be used for a server shutdown.
Using: $mysqladmin 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 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 Using: $mysqld
--no-log Print to stdout instead of the log file. By default the log --no-log Print to stdout instead of the log file. By default the log
file is turned on. file is turned on.
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# binary installation that has other paths than you are using. # 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 # mysql.server works by first doing a cd to the base directory and from there
# executing safe_mysqld # executing mysqld_safe
# Check if we are starting this relative (for the binary release) # 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 \ if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# binary installation that has other paths than you are using. # 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 # mysql.server works by first doing a cd to the base directory and from there
# executing safe_mysqld # executing mysqld_safe
trap '' 1 2 3 15 # we shouldn't let anyone kill us trap '' 1 2 3 15 # we shouldn't let anyone kill us
...@@ -38,12 +38,12 @@ parse_arguments() { ...@@ -38,12 +38,12 @@ parse_arguments() {
--pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;;
--user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;; --user=*) user=`echo "$arg" | sed -e "s;--user=;;"` ;;
# these two might have been set in a [safe_mysqld] section of my.cnf # these two might have been set in a [mysqld_safe] section of my.cnf
# they get passed via environment variables to safe_mysqld # they get passed via environment variables to mysqld_safe
--socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;; --socket=*) MYSQL_UNIX_PORT=`echo "$arg" | sed -e "s;--socket=;;"` ;;
--port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;; --port=*) MYSQL_TCP_PORT=`echo "$arg" | sed -e "s;--port=;;"` ;;
# safe_mysqld-specific options - must be set in my.cnf ([safe_mysqld])! # mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
--ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;; --ledir=*) ledir=`echo "$arg" | sed -e "s;--ledir=;;"` ;;
--err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;; --err-log=*) err_log=`echo "$arg" | sed -e "s;--err-log=;;"` ;;
# QQ The --open-files should be removed # QQ The --open-files should be removed
...@@ -114,7 +114,7 @@ fi ...@@ -114,7 +114,7 @@ fi
pid_file= pid_file=
err_log= err_log=
# Get first arguments from the my.cnf file, groups [mysqld] and [safe_mysqld] # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments # and then merge with the command line arguments
if test -x ./bin/my_print_defaults if test -x ./bin/my_print_defaults
then then
...@@ -130,7 +130,7 @@ else ...@@ -130,7 +130,7 @@ else
fi fi
args= args=
parse_arguments `$print_defaults $defaults mysqld server safe_mysqld` parse_arguments `$print_defaults $defaults mysqld server mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@" parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test ! -x $ledir/$MYSQLD if test ! -x $ledir/$MYSQLD
...@@ -138,7 +138,7 @@ then ...@@ -138,7 +138,7 @@ 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 "Please do a cd to the mysql installation directory and restart"
echo "this script from there as follows:" echo "this script from there as follows:"
echo "./bin/safe_mysqld". echo "./bin/mysqld_safe".
exit 1 exit 1
fi fi
......
...@@ -170,6 +170,7 @@ static SYMBOL symbols[] = { ...@@ -170,6 +170,7 @@ static SYMBOL symbols[] = {
{ "IGNORE", SYM(IGNORE_SYM),0,0}, { "IGNORE", SYM(IGNORE_SYM),0,0},
{ "IN", SYM(IN_SYM),0,0}, { "IN", SYM(IN_SYM),0,0},
{ "INDEX", SYM(INDEX),0,0}, { "INDEX", SYM(INDEX),0,0},
{ "INDEXES", SYM(INDEXES),0,0},
{ "INFILE", SYM(INFILE),0,0}, { "INFILE", SYM(INFILE),0,0},
{ "INNER", SYM(INNER_SYM),0,0}, { "INNER", SYM(INNER_SYM),0,0},
{ "INNOBASE", SYM(INNOBASE_SYM),0,0}, { "INNOBASE", SYM(INNOBASE_SYM),0,0},
......
...@@ -49,6 +49,8 @@ template class List<Alter_drop>; ...@@ -49,6 +49,8 @@ template class List<Alter_drop>;
template class List_iterator<Alter_drop>; template class List_iterator<Alter_drop>;
template class List<Alter_column>; template class List<Alter_column>;
template class List_iterator<Alter_column>; template class List_iterator<Alter_column>;
template class List<Set_option>;
template class List_iterator<Set_option>;
#endif #endif
/**************************************************************************** /****************************************************************************
......
...@@ -120,6 +120,18 @@ typedef struct st_select_lex { ...@@ -120,6 +120,18 @@ typedef struct st_select_lex {
} SELECT_LEX; } SELECT_LEX;
class Set_option :public Sql_alloc {
public:
const char *name;
Item *item;
uint name_length;
bool type; /* 1 if global */
Set_option(bool par_type, const char *par_name, uint length,
Item *par_item)
:name(par_name), item(par_item), name_length(length), type(par_type) {}
};
/* The state of the lex parsing. This is saved in the THD struct */ /* The state of the lex parsing. This is saved in the THD struct */
typedef struct st_lex { typedef struct st_lex {
...@@ -143,6 +155,7 @@ typedef struct st_lex { ...@@ -143,6 +155,7 @@ typedef struct st_lex {
List<create_field> create_list; List<create_field> create_list;
List<Item> *insert_list,field_list,value_list; List<Item> *insert_list,field_list,value_list;
List<List_item> many_values; List<List_item> many_values;
List<Set_option> option_list;
SQL_LIST proc_list, auxilliary_table_list; SQL_LIST proc_list, auxilliary_table_list;
TYPELIB *interval; TYPELIB *interval;
create_field *last_field; create_field *last_field;
...@@ -167,7 +180,7 @@ typedef struct st_lex { ...@@ -167,7 +180,7 @@ typedef struct st_lex {
uint grant,grant_tot_col,which_columns; uint grant,grant_tot_col,which_columns;
thr_lock_type lock_option; thr_lock_type lock_option;
bool drop_primary,drop_if_exists,local_file; bool drop_primary,drop_if_exists,local_file;
bool in_comment,ignore_space,verbose,simple_alter; bool in_comment,ignore_space,verbose,simple_alter, option_type;
} LEX; } LEX;
......
...@@ -197,6 +197,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); ...@@ -197,6 +197,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token IDENT %token IDENT
%token IGNORE_SYM %token IGNORE_SYM
%token INDEX %token INDEX
%token INDEXES
%token INFILE %token INFILE
%token INNER_SYM %token INNER_SYM
%token INNOBASE_SYM %token INNOBASE_SYM
...@@ -1047,6 +1048,7 @@ key_or_index: ...@@ -1047,6 +1048,7 @@ key_or_index:
keys_or_index: keys_or_index:
KEYS {} KEYS {}
| INDEX {} | INDEX {}
| INDEXES {}
opt_unique_or_fulltext: opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; } /* empty */ { $$= Key::MULTIPLE; }
...@@ -2392,7 +2394,7 @@ show_param: ...@@ -2392,7 +2394,7 @@ show_param:
lex->select->db= $3; lex->select->db= $3;
lex->select->options=0; lex->select->options=0;
} }
| opt_full COLUMNS FROM table_ident opt_db wild | opt_full COLUMNS from_or_in table_ident opt_db wild
{ {
Lex->sql_command= SQLCOM_SHOW_FIELDS; Lex->sql_command= SQLCOM_SHOW_FIELDS;
if ($5) if ($5)
...@@ -2452,7 +2454,7 @@ show_param: ...@@ -2452,7 +2454,7 @@ show_param:
opt_db: opt_db:
/* empty */ { $$= 0; } /* empty */ { $$= 0; }
| FROM ident { $$= $2.str; } | from_or_in ident { $$= $2.str; }
wild: wild:
/* empty */ /* empty */
...@@ -2462,6 +2464,10 @@ opt_full: ...@@ -2462,6 +2464,10 @@ opt_full:
/* empty */ { Lex->verbose=0; } /* empty */ { Lex->verbose=0; }
| FULL { Lex->verbose=1; } | FULL { Lex->verbose=1; }
from_or_in:
FROM
| IN_SYM
binlog_in: binlog_in:
/* empty */ { Lex->mi.log_file_name = 0; } /* empty */ { Lex->mi.log_file_name = 0; }
| IN_SYM TEXT_STRING { Lex->mi.log_file_name = $2.str; } | IN_SYM TEXT_STRING { Lex->mi.log_file_name = $2.str; }
...@@ -2818,6 +2824,7 @@ keyword: ...@@ -2818,6 +2824,7 @@ keyword:
| HOSTS_SYM {} | HOSTS_SYM {}
| HOUR_SYM {} | HOUR_SYM {}
| IDENTIFIED_SYM {} | IDENTIFIED_SYM {}
| INDEXES {}
| ISOLATION {} | ISOLATION {}
| ISAM_SYM {} | ISAM_SYM {}
| INNOBASE_SYM {} | INNOBASE_SYM {}
...@@ -2901,6 +2908,8 @@ set: ...@@ -2901,6 +2908,8 @@ set:
lex->select->select_limit=lex->thd->default_select_limit; lex->select->select_limit=lex->thd->default_select_limit;
lex->gemini_spin_retries=lex->thd->gemini_spin_retries; lex->gemini_spin_retries=lex->thd->gemini_spin_retries;
lex->tx_isolation=lex->thd->tx_isolation; lex->tx_isolation=lex->thd->tx_isolation;
lex->option_type=0;
lex->option_list.empty()
} }
option_value_list option_value_list
...@@ -2910,6 +2919,8 @@ opt_option: ...@@ -2910,6 +2919,8 @@ opt_option:
option_value_list: option_value_list:
option_value option_value
| GLOBAL_SYM { Lex->option_type=1; } option_value
| LOCAL_SYM { Lex->option_type=0; } option_value
| option_value_list ',' option_value | option_value_list ',' option_value
option_value: option_value:
...@@ -3017,6 +3028,28 @@ option_value: ...@@ -3017,6 +3028,28 @@ option_value:
slave_skip_counter = $3; slave_skip_counter = $3;
pthread_mutex_unlock(&LOCK_slave); pthread_mutex_unlock(&LOCK_slave);
} }
| ident equal DEFAULT
{
LEX *lex=Lex;
lex->option_list.push_back(new Set_option(lex->option_type,
$1.str,$1.length,
(Item*) 0));
}
| ident equal expr
{
THD *thd=current_thd;
Item *item= $3;
if (item->fix_fields(current_thd,0))
{
send_error(&thd->net, ER_SET_CONSTANTS_ONLY);
YYABORT;
}
thd->lex.option_list.
push_back(new Set_option(thd->lex.option_type,
$1.str,$1.length,
item));
}
text_or_password: text_or_password:
TEXT_STRING { $$=$1.str;} TEXT_STRING { $$=$1.str;}
......
...@@ -20,5 +20,5 @@ then ...@@ -20,5 +20,5 @@ then
echo "Starting the mysqld server. You can test that it is up and running" echo "Starting the mysqld server. You can test that it is up and running"
echo "with the command:" echo "with the command:"
echo "./bin/mysqladmin version" echo "./bin/mysqladmin version"
./bin/safe_mysqld & ./bin/mysqld_safe &
fi fi
...@@ -208,7 +208,7 @@ chmod -R og-rw $mysql_datadir/mysql ...@@ -208,7 +208,7 @@ chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally. # Restart in the same way that mysqld will be started normally.
/etc/rc.d/init.d/mysql start /etc/rc.d/init.d/mysql start
# Allow safe_mysqld to start mysqld and print a message before we exit # Allow mysqld_safe to start mysqld and print a message before we exit
sleep 2 sleep 2
%preun %preun
...@@ -244,7 +244,7 @@ fi ...@@ -244,7 +244,7 @@ fi
%attr(755, root, root) /usr/bin/perror %attr(755, root, root) /usr/bin/perror
%attr(755, root, root) /usr/bin/replace %attr(755, root, root) /usr/bin/replace
%attr(755, root, root) /usr/bin/resolveip %attr(755, root, root) /usr/bin/resolveip
%attr(755, root, root) /usr/bin/safe_mysqld %attr(755, root, root) /usr/bin/mysqld_safe
%attr(755, root, root) /usr/bin/mysqld_multi %attr(755, root, root) /usr/bin/mysqld_multi
%attr(755, root, root) /usr/bin/my_print_defaults %attr(755, root, root) /usr/bin/my_print_defaults
......
...@@ -133,14 +133,14 @@ case "$mode" in ...@@ -133,14 +133,14 @@ case "$mode" in
'start') 'start')
# Start daemon # Start daemon
if test -x $bindir/safe_mysqld if test -x $bindir/mysqld_safe
then then
# We only need to specify datadir and pid-file here and we # We only need to specify datadir and pid-file here and we
# get all other instance-specific config from $datadir/my.cnf. # get all other instance-specific config from $datadir/my.cnf.
# We have to explicitly pass --defaults-extra-file because it # We have to explicitly pass --defaults-extra-file because it
# reads the config files before the command line options. # reads the config files before the command line options.
# Also it must be first because of the way safe_mysqld works. # Also it must be first because of the way mysqld_safe works.
$bindir/safe_mysqld --defaults-extra-file=$datadir/my.cnf \ $bindir/mysqld_safe --defaults-extra-file=$datadir/my.cnf \
--datadir=$datadir --pid-file=$pid_file & --datadir=$datadir --pid-file=$pid_file &
# Make lock for RedHat / SuSE # Make lock for RedHat / SuSE
if test -d /var/lock/subsys if test -d /var/lock/subsys
...@@ -148,7 +148,7 @@ case "$mode" in ...@@ -148,7 +148,7 @@ case "$mode" in
touch /var/lock/subsys/mysql touch /var/lock/subsys/mysql
fi fi
else else
echo "Can't execute $bindir/safe_mysqld" echo "Can't execute $bindir/mysqld_safe"
fi fi
;; ;;
......
...@@ -100,18 +100,18 @@ case "$mode" in ...@@ -100,18 +100,18 @@ case "$mode" in
'start') 'start')
# Start daemon # Start daemon
if test -x $bindir/safe_mysqld if test -x $bindir/mysqld_safe
then then
# Give extra arguments to mysqld with the my.cnf file. This script may # Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade. # be overwritten at next upgrade.
$bindir/safe_mysqld --datadir=$datadir --pid-file=$pid_file & $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file &
# Make lock for RedHat / SuSE # Make lock for RedHat / SuSE
if test -w /var/lock/subsys if test -w /var/lock/subsys
then then
touch /var/lock/subsys/mysql touch /var/lock/subsys/mysql
fi fi
else else
echo "Can't execute $bindir/safe_mysqld" echo "Can't execute $bindir/mysqld_safe"
fi fi
;; ;;
......
...@@ -296,7 +296,7 @@ chmod -R og-rw $mysql_datadir/mysql ...@@ -296,7 +296,7 @@ chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally. # Restart in the same way that mysqld will be started normally.
/etc/rc.d/init.d/mysql start /etc/rc.d/init.d/mysql start
# Allow safe_mysqld to start mysqld and print a message before we exit # Allow mysqld_safe to start mysqld and print a message before we exit
sleep 2 sleep 2
%post Max %post Max
...@@ -342,7 +342,7 @@ fi ...@@ -342,7 +342,7 @@ fi
%attr(755, root, root) /usr/bin/perror %attr(755, root, root) /usr/bin/perror
%attr(755, root, root) /usr/bin/replace %attr(755, root, root) /usr/bin/replace
%attr(755, root, root) /usr/bin/resolveip %attr(755, root, root) /usr/bin/resolveip
%attr(755, root, root) /usr/bin/safe_mysqld %attr(755, root, root) /usr/bin/mysqld_safe
%attr(755, root, root) /usr/bin/mysqld_multi %attr(755, root, root) /usr/bin/mysqld_multi
%attr(755, root, root) /usr/bin/my_print_defaults %attr(755, root, root) /usr/bin/my_print_defaults
...@@ -379,7 +379,7 @@ fi ...@@ -379,7 +379,7 @@ fi
%attr(644, root, man) %doc /usr/man/man1/mysqlshow.1* %attr(644, root, man) %doc /usr/man/man1/mysqlshow.1*
%attr(644, root, man) %doc /usr/man/man1/perror.1* %attr(644, root, man) %doc /usr/man/man1/perror.1*
%attr(644, root, man) %doc /usr/man/man1/replace.1* %attr(644, root, man) %doc /usr/man/man1/replace.1*
%attr(644, root, man) %doc /usr/man/man1/safe_mysqld.1* %attr(644, root, man) %doc /usr/man/man1/mysqld_safe.1*
%post shared %post shared
/sbin/ldconfig /sbin/ldconfig
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment