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.
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.
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.
Trivial cleanup
scripts/mysqld_safe.sh:
Added support for --crash-script.
Don't remove socket file (not needed as server will re-create it if needed)
Patch by Eric Bergen
storage/maria/ha_maria.h:
Removed not existing variable.
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'.
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).
(backport)
manual merge
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).
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.
Added a --nowatch (with aliases --no-watch and --no-auto-restart) option to mysqld_safe that causes it to exit after
spawning mysqld. We don't need mysqld_safe to restart mysqld after a crash, because systemd can do that just fine.
Based on code from Maarten Vanraes
scripts/mysqld_safe.sh:
Added option --nowatch (with aliases --no-watch and --no-auto-restart)
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.
sql/sql_insert.cc:
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
******
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
small cleanup
******
small cleanup
Changed test suite to use --log-basename (to get the code tested)
Added --sync-sys=1 to test suite to speed it up.
Better error messages if something goes wrong with mysql_install_db
mysql-test/Makefile.am:
Removed not existing directory
mysql-test/lib/My/ConfigFactory.pm:
Use log-basename
We had to also set 'log_error' as some test was explicitely using the old name
Added 'sync-sys=1' to speed up test suite
mysql-test/r/variables-notembedded.result:
Updated test results (variable relay_log is now set)
mysql-test/suite/binlog/t/binlog_delete_and_flush_index-master.opt:
Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_index-master.opt:
Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt:
Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
Better error message if something goes wrong
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
Updated results
mysql-test/suite/rpl/rpl_1slave_base.cnf:
Use --log-basename
scripts/mysql_install_db.sh:
More information to --help
Write url to knowledge base if something goes wrong
Fail at once if we can't create a database directory (no reason to continue and write a screenful of not related text)
scripts/mysqld_safe.sh:
Also allow one to use --data for --datadir (common shortening)
Added support for --log-basename
Fail at once if we can't create a log directory
Fixed bug where we used a pid file name without '.pid' extension
sql/log.cc:
Create a log file name trough my_once_alloc() (To get it automaticly freed at exit)
sql/mysql_priv.h:
Added new prototype
sql/mysqld.cc:
Added support for --log-basename
Better help for a lot of log-filename related variables.
sql/rpl_rli.cc:
Write information that one can use --log-basename
sql/set_var.cc:
Add log_basename as a readonly variable
The mysqld server and all clients now reads the new client-server section
Fixed that mysqldumpslow supports new slow log formats and new mysqld --slow- options
client/mysql.cc:
Read also client-server and client-mariadb sections.
client/mysql_upgrade.c:
Read also client-server and client-mariadb sections.
client/mysqladmin.cc:
Read also client-server and client-mariadb sections.
client/mysqlbinlog.cc:
Read also client-server and client-mariadb sections.
client/mysqlcheck.c:
Read also client-server and client-mariadb sections.
client/mysqldump.c:
Read also client-server and client-mariadb sections.
client/mysqlimport.c:
Read also client-server and client-mariadb sections.
client/mysqlshow.c:
Read also client-server and client-mariadb sections.
client/mysqltest.cc:
Read also client-server and client-mariadb sections.
extra/my_print_defaults.c:
Updated help text
scripts/mysql_fix_privilege_tables.sh:
Read also sections client client-server client-mariadb
scripts/mysql_install_db.pl.in:
Also allow --data=* option
Read also groups mariadb, server and client-server.
scripts/mysql_install_db.sh:
Also allow --data=* option
Read also groups mariadb, server and client-server.
Added --lose-skip-pbxt to bootstrap
scripts/mysql_secure_installation.sh:
Read also groups client-server and client-mariadb
scripts/mysqld_multi.sh:
Read also group mariadb
scripts/mysqld_safe.sh:
Read also groups mariadb server and client-server
scripts/mysqldumpslow.sh:
Fixed to support new slow log formats
Added sorting on -ae (aggregated number of retreived rows) and e (retrieved rows)
Read also group 'mariadb'
If there is many instances of same option, use last one.
Get slow log file from options log-slow-queries=filename or query-log-file=filename
Added support for future --log-basename option
sql-common/client.c:
Read also groups 'client-server' and 'client-mariadb'
tests/mysql_client_test.c:
Read also groups 'client-server' and 'client-mariadb'
tests/thread_test.c:
Read also groups 'client-server' and 'client-mariadb'
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.
- 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
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.
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.
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.
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 <plugin-dir>/whatever,
when mysqld-version=whatever, and just <plugin-dir> otherwise.
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)
(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.
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.
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:
Document that our build system explicitly overrides the @pkgfoo@ (e.g.,
pkgdatadir, pkglibdir, etc.) variables when 'make' is called.
scripts/mysqld_safe.sh:
Replace hard-coded "./share/mysql" with something like
echo @pkgdatadir@ | sed -e s/^@prefix@//.
Since the fix for bug 28544, this has been broken for mysql 5.1+,
where the package data dir is "./share" instead of "./share/mysql".
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/mysql-test-run-shell.sh:
Auto merged
netware/mysql_test_run.c:
Auto merged
sql/mysqld.cc:
Auto merged
storage/ndb/include/ndbapi/Ndb.hpp:
Auto merged
scripts/mysqld_safe.sh:
Manual merge.
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.
debian/po/ca.po:
Change URLs.
debian/po/cs.po:
Change URLs.
debian/po/da.po:
Change URLs.
debian/po/gl.po:
Change URLs.
debian/po/ja.po:
Change URLs.
debian/po/pt_BR.po:
Change URLs.
debian/po/sv.po:
Change URLs.
debian/po/tr.po:
Change URLs.
mysql-test/lib/mtr_report.pl:
Change URLs.
mysql-test/mysql-test-run-shell.sh:
Change URLs.
ndb/include/ndbapi/Ndb.hpp:
Change URLs.
netware/mysql_test_run.c:
Change URLs.
scripts/mysqld_safe.sh:
Change URLs.
sql/mysqld.cc:
Change URLs.