Commit graph

4207 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
985d2d393c Merge remote-tracking branch 'origin/10.1' into 10.2 2017-12-22 12:23:39 +02:00
Sachin Setiya
2a4faa8ab6 MDEV-13478 Full SST sync fails because of the error in the cleaning part
Problem:
 The command was:
    find $paths -mindepth 1 -regex $cpat -prune -o -exec rm -rf {} \+
 Which was supposed to work as
    * skipping $paths directories themselves (-mindepth 1)
    * see if the dir/file name matches $cpat (-regex)
    * if yes - don't dive into the directory, skip it (-prune)
    * otherwise (-o)
    * remove it and everything inside (-exec)
 Now -exec ... \+ works like this:
    every new found path is appended to the end of the command line.
    when accumulated command line length reaches `getconf ARG_MAX` (~2Gb)
    it's executed, and find continues, appending to a new command line.

 What happens here, find appends some directory to the command line,
 then dives into it, and starts appending files from that directory.
 At some point command line overflows, rm -rf gets executed and removes
 the whole directory. Now find tries to continue scanning the directory
 that was already removed.

Fix: don't dive into directories that will be recursively removed
anyway, use -prune for them. Basically, we should be pruning both paths
that have matched $cpat and paths that have not matched it. This is
achived by pruning unconditionally, before the regex is tested:
    find $paths -mindepth 1 -prune -regex $cpat -o -exec rm -rf {} \+

Patch Credit:- Serg
2017-12-20 18:51:30 +01:00
Vicențiu Ciorbaru
e3d89652e5 Merge branch '10.0' into 10.1 2017-12-20 13:30:05 +02:00
Vicențiu Ciorbaru
042f763268 Merge remote-tracking branch '5.5' into 10.0 2017-12-20 12:51:57 +02:00
Sachin Setiya
9007ca6873 MDEV-13478 Full SST sync fails because of the error in the cleaning part
Problem:
 The command was:
    find $paths -mindepth 1 -regex $cpat -prune -o -exec rm -rf {} \+
 Which was supposed to work as
    * skipping $paths directories themselves (-mindepth 1)
    * see if the dir/file name matches $cpat (-regex)
    * if yes - don't dive into the directory, skip it (-prune)
    * otherwise (-o)
    * remove it and everything inside (-exec)
 Now -exec ... \+ works like this:
    every new found path is appended to the end of the command line.
    when accumulated command line length reaches `getconf ARG_MAX` (~2Gb)
    it's executed, and find continues, appending to a new command line.

 What happens here, find appends some directory to the command line,
 then dives into it, and starts appending files from that directory.
 At some point command line overflows, rm -rf gets executed and removes
 the whole directory. Now find tries to continue scanning the directory
 that was already removed.

Fix: don't dive into directories that will be recursively removed
anyway, use -prune for them. Basically, we should be pruning both paths
that have matched $cpat and paths that have not matched it. This is
achived by pruning unconditionally, before the regex is tested:
    find $paths -mindepth 1 -prune -regex $cpat -o -exec rm -rf {} \+

Patch Credit:- Serg
2017-12-20 00:06:02 +05:30
Sergei Golubchik
beabe6b216 MDEV-13969 sst mysqldump and xtrabackup-v2 handle WSREP_SST_OPT_CONF incorrectly
$WSREP_SST_OPT_CONF already includes --defaults-extra-file= prefix.
2017-12-18 16:41:40 +01:00
Martynas Bendorius
1c2f59f7fb MDEV-13969 sst mysqldump and xtrabackup-v2 handle WSREP_SST_OPT_CONF incorrectly
wrep_sst_common: Setting "-c ''" for my_print_defaults just takes no values from config at all. $MY_PRINT_DEFAULTS is already set at the top of the script to have --defaults-file and --defaults-extra-file. If WSREP_SST_OPT_CONF if set to "--defaults-file=/etc/my.cnf --defaults-extra-file=/etc/my.extra.cnf", then "my_print_defaults -c "" --defaults-file=/etc/my.cnf" succeeds, but if WSREP_SST_OPT_CONF is empty - no default values are taken at all.
wsrep_sst_xtrabackup-v2: innobackupex does not support --defaults-extra-file, so ${WSREP_SST_OPT_CONF} cannot be used as an argument, it has been changed to ${WSREP_SST_OPT_DEFAULT}. Removed --defaults-file= from INNOMOVE line, because WSREP_SST_OPT_CONF already includes it (INNOBACKUP was fine, INNOMOVE - not).
2017-12-18 16:41:40 +01:00
Sergei Golubchik
8c422bf48d MDEV-14256 MariaDB 10.2.10 can't SST with xtrabackup-v2
another followup for 4c2c057d40.

there are six possible cases:
--port can be set or not.
--address can be set, not set, or set but without a port number

The correct behavior is:
1 both --port and --address have a port number
  - use it if it's the same, otherwise an error
2 only --port has the number (--address isn't set)
  - use the value from --port
3 only --port has the number (--address is set, but has no port)
  - use the value from --port
4 --port is unset, --address has the port number
  - use the value from --address
5 --port is unset, --address has no port number
  - use the value from --address, that is, port is empty string
6 --port is unset, --address is unset
  - port is unset (an error somewhere later)

case 5 wasn't handled correctly
2017-11-21 20:03:57 +01:00
Sergei Golubchik
7f1900705b Merge branch '10.1' into 10.2 2017-11-21 19:47:46 +01:00
Sergei Golubchik
36f8474403 MDEV-14337 mysqld_safe may suppress error messages with --log-output=file
don't close stdout/stderr, redirect them to /dev/null instead.
otherwise redirections like >&2 fail with "invalid file descriptor"
2017-11-10 12:48:52 +01:00
Sergei Golubchik
2a4e4335c4 Merge branch 'github/10.0-galera' into 10.1 2017-11-10 01:38:03 +01:00
Sachin Setiya
3cecb1bab3 Merge tag 'mariadb-10.0.33' into bb-10.0-galera 2017-11-03 12:34:05 +05:30
Monty
6b7918d524 Fixed that --malloc-lib works properly
- Expand paths also for jemalloc
- Test also if tcmalloc or jemalloc is in /usr/lib64
- Take into account that .so has a version
- Remove automatic adding of flavors ( _minial, _debug). Better to
  have user specify these directly
- Changed documentation link to MariaDB
- Don't give extra error if mysqld_safe_helper doesn't exist
2017-11-01 12:21:46 +02:00
Sergei Golubchik
f7090df712 MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"
followup for 4c2c057d40

fix broken script (set -u)
2017-10-25 01:03:19 +02:00
Sergei Golubchik
e0a1c745ec Merge branch '10.1' into 10.2 2017-10-24 14:53:18 +02:00
Sergei Golubchik
9d2e2d7533 Merge branch '10.0' into 10.1 2017-10-22 13:03:41 +02:00
Alexey Yurchenko
86d31ce9f1 MW-384 protect access to wsrep_ready variable with mutex 2017-10-19 09:34:09 +03:00
Jan Lindström
8da6b4ef52 Merge tag 'mariadb-5.5.58' into 5.5-galera 2017-10-19 09:06:17 +03:00
Sergei Golubchik
e6df6031f6 MDEV-13969 sst mysqldump and xtrabackup-v2 handle WSREP_SST_OPT_CONF incorrectly
$WSREP_SST_OPT_CONF already includes --defaults-extra-file= prefix.
2017-10-18 22:15:27 +02:00
Sergei Golubchik
4c2c057d40 MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable" 2017-10-18 22:15:26 +02:00
Sergei Golubchik
a75884e701 MDEV-13836 mariadb_config & mysql_config output differ
Use mariadb_config, for C/C config variables
2017-10-18 22:15:26 +02:00
Sergei Golubchik
da4503e956 Merge branch '5.5' into 10.0 2017-10-18 15:14:39 +02:00
Sergei Golubchik
93144b9e92 MDEV-13440 mysql_install_db fails with hard-coded langdir
always search in compile-time specified paths
INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User
can set them to arbitrary values, it's not enough to search only
in their usual values of bin, sbin and libexec, share and share/mysql.
2017-10-17 07:37:39 +02:00
Sergei Golubchik
52516706c8 cleanup mysql_install_db
1. detect resolveip location, don' assume it's in $basedir/bin
2. don't guess $scriptdir to (incorrectly) construct the $0 path
3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir
   automatically. This allows to use identical path lists in
   find_in_dirs and in cannot_find_file.
4. move search path lists to CMakeLists.txt to avoid specifying the
   same path list twice (in find_in_dirs and in cannot_find_file).
2017-10-17 07:37:39 +02:00
Andrii Nikitin
494d1bf885 MDEV-14010 merge issue in wsrep_sst_xtrabackup-v2 2017-10-09 10:22:47 +02:00
Sergei Golubchik
08c493c62a Merge branch '10.1' into 10.2 2017-10-04 18:36:58 +02:00
Vincent Milum Jr
98e09ee4b6 MDEV-13909 Fix wsrep_sst_rsync fails on debian
Fix for the following error messages during SST:
/usr/local/mysql/bin/wsrep_sst_rsync: 258: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
/usr/local/mysql/bin/wsrep_sst_rsync: 263: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
/usr/local/mysql/bin/wsrep_sst_rsync: 268: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
2017-10-02 13:21:00 -07:00
sachin
bcda03b4fa MDEV-13950 mysqld_safe could not start Galera node after upgrade ...
This is regression caused by patch of mdev-10767.

1st problem :- mktmp is invoked without '-t' or specifing tmp directory.
2nd problem :- Since eval_log_error redirect stderr to stdout  '2>' will
return nothing. and hence $wr_logfile will be empty.

Patch Credit:- Andrii Nikitin
2017-10-02 14:07:22 +05:30
Martynas Bendorius
36ef89c999 wrep_sst_common: Setting "-c ''" for my_print_defaults just takes no values from config at all. $MY_PRINT_DEFAULTS is already set at the top of the script to have --defaults-file and --defaults-extra-file. If WSREP_SST_OPT_CONF if set to "--defaults-file=/etc/my.cnf --defaults-extra-file=/etc/my.extra.cnf", then "my_print_defaults -c "" --defaults-file=/etc/my.cnf" succeeds, but if WSREP_SST_OPT_CONF is empty - no default values are taken at all.
wsrep_sst_xtrabackup-v2: innobackupex does not support --defaults-extra-file, so ${WSREP_SST_OPT_CONF} cannot be used as an argument, it has been changed to ${WSREP_SST_OPT_DEFAULT}. Removed --defaults-file= from INNOMOVE line, because WSREP_SST_OPT_CONF already includes it (INNOBACKUP was fine, INNOMOVE - not).
2017-10-01 15:50:25 +02:00
Vladislav Vaintroub
7354dc6773 MDEV-13384 - misc Windows warnings fixed 2017-09-28 17:20:46 +00:00
Sergei Golubchik
f1ce69f3a9 Merge branch '10.1' into 10.2
But without f4f48e06215..f8a800bec81 - fixes for MDEV-12672
and related issues. 10.2 specific fix follows...
2017-09-22 02:27:00 +02:00
sachin
bb7a70c955 MDEV-10767 /tmp/wsrep_recovery.${RANDOM} file created in unallowed SELinux context
Problem:- To create file in /tmp dir mysqld require permission initrc_tmp_t.
And mysqld does not have his permission.

Solution:- Instead of giving mysqld permission of initrc_tmp_t , we redirected
log to file in /tmp dir through shell. I also removed a earlier workarround
in mysqld_safe.sh , which create tmp log file in datadir.
2017-09-21 12:37:40 +05:30
Vincent Milum Jr
7f2fab0106 Fixes Galera on FreeBSD
Corrects the following error with rsync sst on FreeBSD:
WSREP_SST: [ERROR] rsync daemon port '4444' has been taken

The FreeBSD version of grep doesn't play nicely with the -w parameter mixed with [[:space:]] and ends up matching nothing. This causes the script to loop and attempt to spawn more than one instance of rsync, which fails with the initial instance already having the port open. Because of this, the entire script fails and no sst occurs resulting in the error message listed above appearing in the log file.
2017-09-13 10:48:10 -07:00
Julien Del-Piccolo
720928782f Fix bash expansion issue in wsrep_sst_rsync (#443)
* Fix bash expansion issue in wsrep_sst_rsync. https://github.com/docker-library/mariadb/issues/126

* Fix permissions
2017-09-03 11:33:27 +04:00
Marko Mäkelä
a36c369bda Merge 10.1 into 10.2
For running the Galera tests, the variable my_disable_leak_check
was set to true in order to avoid assertions due to memory leaks
at shutdown.

Some adjustments due to MDEV-13625 (merge InnoDB tests from MySQL 5.6)
were performed. The most notable behaviour changes from 10.0 and 10.1
are the following:

* innodb.innodb-table-online: adjustments for the DROP COLUMN
behaviour change (MDEV-11114, MDEV-13613)

* innodb.innodb-index-online-fk: the removal of a (1,NULL) record
from the result; originally removed in MySQL 5.7 in the
Oracle Bug #16244691 fix
377774689b

* innodb.create-index-debug: disabled due to MDEV-13680
(the MySQL Bug #77497 fix was not merged from 5.6 to 5.7.10)

* innodb.innodb-alter-autoinc: MariaDB 10.2 behaves like MySQL 5.6/5.7,
while MariaDB 10.0 and 10.1 assign different values when
auto_increment_increment or auto_increment_offset are used.
Also MySQL 5.6/5.7 exhibit different behaviour between
LGORITHM=INPLACE and ALGORITHM=COPY, so something needs to be tested
and fixed in both MariaDB 10.0 and 10.2.

* innodb.innodb-wl5980-alter: disabled because it would trigger an
InnoDB assertion failure (MDEV-13668 may need additional effort in 10.2)
2017-08-31 09:30:40 +03:00
Jan Lindström
c23efc7d50 Merge remote-tracking branch 'origin/10.0-galera' into 10.1 2017-08-21 13:35:00 +03:00
Sergei Golubchik
cb1e76e4de Merge branch '10.1' into 10.2 2017-08-17 11:38:34 +02:00
Alexey Yurchenko
83664e21e4 MW-366 Improved support for IPv6 networks - made mysqld and SST scripts to recognize []-escaped IPv6 addresses - pulled in latest Percona and MariaDB updates to SST scripts - instruct netcat and socat in wsrep_sst_xtrabackup-v2 to listen on IPv6 socket via sockopt parameter in the [sst] section of my.cnf
In summary, wsrep_node_address and wsrep_sst_receive_address can now
be set to IPv6 addresses escaped by []. Rsync SST works out ouf the
box thanks to rsync daemon listening on both IPv4 and IPv6 sockets by
default. For xtrabackup SST onver IPv6 one needs to set sockopt in
the [sst] section of joiner's configuration file to ",pf=ip6" if
using socat as a streamer or to "-6" if using netcat.
2017-08-11 15:00:18 +03:00
Jan Lindström
86f9b77147 MDEV-13037: wsrep_sst_mysqldump checking wrong version of mysql client
This happens because on line 59 of /usr/bin/wsrep_sst_mysqldump
we have a check :
   "if ! $MYSQL_CLIENT --version | grep 'Distrib 10.1' >/dev/null"
but the client is 10.2 so it doesnt match the grep expression.

Fixed check to be:
      "if ! $MYSQL_CLIENT --version | grep 'Distrib 10.' >/dev/null"
so that every 10. version is accepted.
2017-08-09 12:47:12 +03:00
Jan Lindström
56b03e308f Merge tag 'mariadb-10.0.32' into 10.0-galera 2017-08-09 08:56:11 +03:00
Sergei Golubchik
8e8d42ddf0 Merge branch '10.0' into 10.1 2017-08-08 10:18:43 +02:00
Alexey Botchkov
56959e7b2c MDEV-11963 RPM Lint: script-without-shebang /usr/bin/wsrep_sst_common.
Don't set the +x on /bin/wsrep_sst_common when installing.
2017-08-01 09:46:27 +04:00
Vicențiu Ciorbaru
786ad0a158 Merge remote-tracking branch 'origin/5.5' into 10.0 2017-07-25 00:41:54 +03:00
Sergei Golubchik
7e507f262a MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 chars
InnoDB fix will come in MDEV-13360.
Here I just fix upgrades from old unfixed InnoDBs - bad data
makes the following copying ALTER TABLE to fail.
2017-07-20 20:13:28 +02:00
Jan Lindström
a481de30bb Merge tag 'mariadb-5.5.57' into 5.5-galera 2017-07-20 08:56:09 +03:00
Sergei Golubchik
9a5fe1f4ea Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-07-18 14:59:10 +02:00
Marko Mäkelä
8c71c6aa8b MDEV-12548 Initial implementation of Mariabackup for MariaDB 10.2
InnoDB I/O and buffer pool interfaces and the redo log format
have been changed between MariaDB 10.1 and 10.2, and the backup
code has to be adjusted accordingly.

The code has been simplified, and many memory leaks have been fixed.
Instead of the file name xtrabackup_logfile, the file name ib_logfile0
is being used for the copy of the redo log. Unnecessary InnoDB startup and
shutdown and some unnecessary threads have been removed.

Some help was provided by Vladislav Vaintroub.

Parameters have been cleaned up and aligned with those of MariaDB 10.2.

The --dbug option has been added, so that in debug builds,
--dbug=d,ib_log can be specified to enable diagnostic messages
for processing redo log entries.

By default, innodb_doublewrite=OFF, so that --prepare works faster.
If more crash-safety for --prepare is needed, double buffering
can be enabled.

The parameter innodb_log_checksums=OFF can be used to ignore redo log
checksums in --backup.

Some messages have been cleaned up.
Unless --export is specified, Mariabackup will not deal with undo log.
The InnoDB mini-transaction redo log is not only about user-level
transactions; it is actually about mini-transactions. To avoid confusion,
call it the redo log, not transaction log.

We disable any undo log processing in --prepare.

Because MariaDB 10.2 supports indexed virtual columns, the
undo log processing would need to be able to evaluate virtual column
expressions. To reduce the amount of code dependencies, we will not
process any undo log in prepare.

This means that the --export option must be disabled for now.

This also means that the following options are redundant
and have been removed:
	xtrabackup --apply-log-only
	innobackupex --redo-only

In addition to disabling any undo log processing, we will disable any
further changes to data pages during --prepare, including the change
buffer merge. This means that restoring incremental backups should
reliably work even when change buffering is being used on the server.
Because of this, preparing a backup will not generate any further
redo log, and the redo log file can be safely deleted. (If the
--export option is enabled in the future, it must generate redo log
when processing undo logs and buffered changes.)

In --prepare, we cannot easily know if a partial backup was used,
especially when restoring a series of incremental backups. So, we
simply warn about any missing files, and ignore the redo log for them.

FIXME: Enable the --export option.

FIXME: Improve the handling of the MLOG_INDEX_LOAD record, and write
a test that initiates a backup while an ALGORITHM=INPLACE operation
is creating indexes or rebuilding a table. An error should be detected
when preparing the backup.

FIXME: In --incremental --prepare, xtrabackup_apply_delta() should
ensure that if FSP_SIZE is modified, the file size will be adjusted
accordingly.
2017-07-05 11:43:28 +03:00
Sachin Setiya
e8a2a75121 MDEV-11036 Add link wsrep_sst_rsync_wan -> wsrep_sst_rsync
Currently galera has capability of using delta transfer algorithm (rsync)
for SST. But for using delta transfer we have change/copy wsrep_sst_rsync
wsrep_sst_rsync_wan. This patch creates a symbolic link of
wsrep_sst_rsync_wan to wsrep_sst_rsync.
2017-06-20 14:29:25 +05:30
Marko Mäkelä
2d8fdfbde5 Merge 10.1 into 10.2
Replace have_innodb_zip.inc with innodb_page_size_small.inc.
2017-06-08 12:45:08 +03:00
Daniel Black
d8515829ec MDEV-13032: fix galera_new_cluster to be POSIX
Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2017-06-08 12:43:39 +10:00
Sachin Setiya
92209ac6f6 Merge tag 'mariadb-10.0.31' into 10.0-galera
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-05-30 15:28:52 +05:30
Tor Didriksen
f4ce18b0a6 Bug #25436469: BUILDS ARE NOT REPRODUCIBLE
Backport to 5.5

Current MySQL builds, even on Pushbuild, are not reproducible; they return
different results depending on which directory they are built from (and
Pushbuild uses several different directories). This is because absolute paths
leak into debug information, and even worse, __FILE__. The latter moves code
around enough that we've actually seen sysbench changes on the order of 4% in
some tests.

CMake seemingly insists on using absolute paths, but we can insert our own
layer between CMake and GCC to relativize all paths. Also give the right flags
to get debug information reproducible and turn off build stamping. This makes
the mysqld build 100% bit-for-bit reproducible between runs on my machine,
even when run from different directories.
2017-05-16 08:39:43 +02:00
Sergei Golubchik
c91ecf9e9b Merge branch '10.1' into 10.2
Revert commit db0917f68f, because the fix for MDEV-12696
is coming from 5.5 and 10.1 in this merge.
2017-05-09 13:24:52 +02:00
=Ian Gilfillan
44eca0f512 galera_new_cluster man page and sh typo 2017-05-09 11:24:22 +02:00
Marko Mäkelä
14c6f00a9f Merge 10.1 into 10.2
Also, include fixes by Vladislav Vaintroub to the
aws_key_management plugin. The AWS C++ SDK specifically depends on
OPENSSL_LIBRARIES, not generic SSL_LIBRARIES (such as YaSSL).
2017-05-06 14:36:46 +03:00
Jakub Dorňák
a9a38fcd7a wsrep_new_cluster: Add -h and --help options
From: https://github.com/devexp-db/mariadb/blob/f27/mariadb-galera-new-cluster-help.patch
2017-04-30 14:47:34 +10:00
Sergei Golubchik
e74f2e2b86 Merge branch '10.0' 10.1 2017-04-28 20:19:32 +02:00
Nirbhay Choubey
3d8aacba86 SST script for mariabackup.
Execute mariabackup in innobackupex mode to avoid "unknown argument" error.
2017-04-27 19:12:41 +02:00
Sergei Golubchik
2c3f578789 don't generate wsrep_sst_common in-place
rename the source to wsrep_sst_common.sh
2017-04-27 19:12:37 +02:00
Sachin Setiya
97e0c260dc Fix Galera tests failures on 10.1 and 10.2
When we build server out of git directory , we did not copy
wsrep_sst_common into build-dir. This causes galera/wsrep tests
to fail
2017-04-25 15:28:29 +05:30
Sachin Setiya
a9ad84e4d4 Fix Galera tests failures on 10.1 and 10.2
When we build server out of git directory , we did not copy
wsrep_sst_common into build-dir. This causes galera/wsrep tests
to fail
2017-04-25 15:25:10 +05:30
Sergei Golubchik
8d75a7533e Merge branch '5.5' into 10.0 2017-04-21 18:34:06 +02:00
Sachin Setiya
5ca8121292 Merge tag 'mariadb-5.5.55' into bb-5.5-sachin-merge
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
2017-04-18 12:01:56 +05:30
Shishir Jaiswal
788fb5bf67 Bug#25043674 - MYSQLACCESS SCRIPT LOADS AND EXECUTES CODE
FROM THE CURRENT DIRECTORY

DESCRIPTION
===========
When 'mysqlaccess' tool is run, it reads (and executes) the
content of its configuration file 'mysqlaccess.conf' from
the current directory. This is not a recommended behaviour
as someone with ill intentions can insert malicious
instructions into this file which could be executed
whenever this tool is run.

ANALYSIS
========
The configuration file is presently looked for, in the
following folders (in given order):
1. Current directory
2. SYSCONFDIR       //This gets expanded
3. /etc/

Owing to the reasons mentioned above, we should not permit
the file to be in the current directory. Since the other
two folders are assumed to be accessible only to authorized
people, the config file is safe to be read from there.

FIX
===
Modified the script so that it looks for the config file
now in the following two folders (in the given order):
1. SYSCONFDIR
2. /etc/

If it's absent from above locations but present in current
directory, an error is thrown asking the user to move the
file to one of the above locations and retry.

NOTE
====
The location paths and their precedence are not documented
for this tool. It needs to be noted as part of the
associated documentation.
2017-04-17 12:04:14 +05:30
Sergei Golubchik
663068c6ee Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-04-11 10:18:04 -04:00
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
Terje Rosten
5d4cfb30e5 BUG#25719975 SHEBANG HARD CODED AS /USR/BIN/PERL IN SCRIPTS, BREAKS ON FREEBSD
Use cmake variable to adjust shebang to platform.
2017-03-28 13:22:32 +02:00
Terje Rosten
ec2a6b6035 BUG#25364806 MYSQLD_SAFE FAILING TO START IF DATADIR GIVEN IS NOT ABSOLUTE PATH
mysqld_safe is working on real files, however passing these file paths
as is to mysqld as options gives different meaning when paths are
relative.

mysqld_safe uses current working directory as basedir for relative paths,
while mysqld uses $datadir as basedir.
2017-03-09 11:40:10 +01:00
Sergey Vojtovich
fa137476ff MDEV-11941 - Lintian complains about executable bits
Revoked executable bit from files that are not supposed to be executed directly.
Removed interpreted from files that are not supposed to be executed directly.
Added interpreter to files that are supposed to be executed directly.
2017-03-07 22:28:33 +04:00
Vicențiu Ciorbaru
fdfdea40f1 MDEV-11170: MariaDB 10.2 cannot start on MySQL 5.7 datadir:
Fatal error: mysql.user table is damaged or in unsupported 3.20 format

The problem stems from MySQL 5.7.6. According to MySQL documentation:
In MySQL 5.7.6, the Password column was removed and all credentials are
stored in the authentication_string column.

If opening a MySQL 5.7.6 (and up) datadir with MariaDB 10.2, the user table
appears corrupted. In order to fix this, the server must be started with
--skip-grant-tables and then a subsequent mysql_upgrade command must be
issued.

This patch updates the mysql_upgrade command to also add the removed
Password column. The password column is necessary, otherwise
the mysql_upgrade script fails due to the Event_scheduler not being able
to start, as it can't find Event_priv in the table where it ought to be.
MySQL's version has column position 28 (0 index) vs our datadir version
expects position 29.
2017-02-14 07:46:58 +02:00
Terje Rosten
b7f33d22d8 Bug#25144379 MYSQLD PROCESS DOES NOT INCLUDE FULL PATH WHEN STARTING MYSQL SERVER
Fix of Bug#25088048 caused paths to be relative, not absolute, this
proved to be problematic.

Fix is to still ignore current working directory, however switch to
using full path of basedir, which is set to parent directory of bin/
directory where mysqld_safe is located.

References to legacy tool mysql_print_defaults are removed, only
my_print_defaults is used these days.

This will also fix:
  Bug#11745176 (11192) MYSQLD_SAFE ONLY EVALUATES --DEFAULTS-FILE OPTION WHEN IT IS THE FIRST OP
  Bug#23013510 (80866) MYSQLD_SAFE SHOULD NOT SEARCH $MY_BASEDIR_VERSION/VAR AS DATADIR
  Bug#25244898 (84173) MYSQLD_SAFE --NO-DEFAULTS & SILENTLY DOES NOT WORK ANY MORE
  Bug#25261472 (84219) INITSCRIPT ERRORS WHEN LAUCHING MYSQLD_SAFE IN NON DEFAULT BASEDIR
  Bug#25319392 (84263) MYSQL.SERVER (MYSQL SERVER STARTUP SCRIPT) CAN NOT WORK,AND EXPORT SOME ERROR.
  Bug#25319457         MYSQLD_SAFE MIGHT FAIL IF $DATADIR HAS TRAILING /
  Bug#25341981         MYSQLD_SAFE ASSUMES INCORRECT BASEDIR WHEN EXECUTED WITH ABSOLUTE PATH
  Bug#25356221 (84427) MYSQLD_SAFE FAILS TO START WHEN USING A FIFO FOR LOG-ERROR (REGRESSION)
  Bug#25365194 (84447) MYSQLD_SAFE DOESN'T CHECK EXISTENCE OF GIVEN BASEDIR PARAMETER
  Bug#25377815         ERRORS WHILE STARTING MYSQLD_SAFE WITH SYM LINK ENABLED
2017-02-13 14:56:28 +01:00
Sergei Golubchik
2195bb4e41 Merge branch '10.1' into 10.2 2017-02-10 17:01:45 +01:00
iangilfillan
ee3febae04 Minor typo 2017-01-26 13:51:03 +02:00
Kristian Nielsen
736afe8680 mysql_install_db enhancements to facilitate Debian bug#848616 fix
In Debian, the default install is made more secure by omitting the anonymous
user and by making the root account authenticate by unix socket
authentication instead of the default password-less root. However, Debian
hard-codes this change in mysql_install_db, which breaks that program for
other users.

This commit instead implements new general options for mysql_install_db that
can be used by anyone to similarly perform a more secure install:

  --skip-auth-anonymous-user: omits the anonymous user.

  --auth-root-authentication-method=normal: Keeps the existing behaviour
    with a password-less root account. Currently on by default.

  --auth-root-socket-user=USER
  --auth-root-authentication-method=socket: creates the MariaDB root user
    with the name USER (defaults to 'root') and using unix socket
    authentication. This way, only that user has MariaDB root access
    after install.

The idea with --auth-root-authentication-method=normal is that
applications that need this behaviour can give that option explicitly.
Then eventually we could make --auth-root-authentication-method=socket
the default, giving a more secure default installation.

Note that it is perfectly possible to do a secure install with
--auth-root-authentication-method=normal. For example, installing a
private server just for local access by a single OS-level user, by
using --skip-networking and putting the connection socket in a
location without public access. So it is important to preserve this
API for backwards compatibility.
2017-01-17 17:13:14 +01:00
Vicențiu Ciorbaru
1e192e901c Post merge review fixes
* Remove duplicate lines from tests
* Use thd instead of current_thd
* Remove extra wsrep_binlog_format_names
* Correctly merge union patch from 5.5 wrt duplicate rows.
* Correctly merge SELinux changes into 10.1
2017-01-17 04:16:38 +02:00
Nirbhay Choubey
ec9a48112b Fix bad merge 2017-01-15 22:32:22 -05:00
Vicențiu Ciorbaru
5ac71d4464 Merge remote-tracking branch '10.0-galera' into 10.1 2017-01-16 04:53:57 +02:00
Vicențiu Ciorbaru
8e15768731 Merge branch '10.0' into 10.1 2017-01-16 03:18:14 +02:00
Nirbhay Choubey
ee8b5c305a Merge tag 'mariadb-10.0.29' into 10.0-galera 2017-01-13 13:53:59 -05:00
Vicențiu Ciorbaru
1c5ca7c183 Merge branch '5.5' into 10.0 2017-01-12 03:37:13 +02:00
Sergei Golubchik
6ad3dd6054 mysqld_safe: don't close stdout if set -x 2017-01-10 14:19:11 +01:00
Vicențiu Ciorbaru
ecdb39a9f5 Fix problems from 5.5 merge
* Update mysqld_safe script to remove duplicated parameter --crash-script
* Make --core-file-size accept underscores as well as dashes correctly.
* Add mysqld_safe_helper to Debian and Ubuntu files.
* Update innodb minor version to 35
2017-01-10 12:33:08 +02:00
vicentiu
e9aed131ea Merge remote-tracking branch 'origin/5.5' into 10.0 2017-01-06 17:09:59 +02:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Nirbhay Choubey
901f7ebcf3 Merge tag 'mariadb-5.5.54' into 5.5-galera 2016-12-27 21:39:05 -05:00
Sergei Golubchik
8fcdd6b0ec Numerous issues in mysqld_safe 2016-12-22 12:25:10 +01:00
Shishir Jaiswal
e00810b934 Bug#11751149 - TRYING TO START MYSQL WHILE ANOTHER INSTANCE
IS STARTING: CONFUSING ERROR

DESCRIPTION
===========
When mysql server processes transactions but has not yet
committed and shuts down abnormally (due to crash, external
killing etc.), a recovery is due from Storage engine side
which takes place the next time mysql server (either
through mysqld or mysqld_safe) is run.

While the 1st server is in mid of recovery, if another
instance of mysqld_safe is made to run, it may result into
2nd instance killing the 1st one after a moment.

ANALYSIS
========
In the "while true" loop, we've a check (which is done
after the server stops) for the existence of pid file to
enquire if it was a normal shutdown or not. If the file is
absent, it means that the graceful exit of server had
removed this file.

However if the file is present, the scripts makes a plain
assumption that this file is leftover of the "current"
server. It misses to consider that it could be a valid pid
file belonging to another running mysql server.

We need to add more checks in the latter case. The script
should extract the PID from this existing file and check if
its running or not. If yes, it means an older instance of
mysql server is running and hence the script should abort.

FIX
===
Checking the status of process (alive or not) by adding a
@CHECK_PID@ in such a case. Aborting if its alive. Detailed
logic is as follows:

- The mysqld_safe script would quit at start only as soon
as it finds that there is an active PID i.e. a mysql server
is already running.
- The PID file creation takes place after InnoDb recovery,
which means in rare case (when PID file isn't created yet)
it may happen that more than 1 server can come up but even
in that case others will have to wait till the 1st server
has released the acquired InnoDb lock. In this case all
these servers will either TIMEOUT waiting for InnoDb lock
or after this they would find that the 1st server is
already running (by reading $pid_file) and would abort.
- Our core fix is that we now check the status of mysql
server process (alive or not) after the server stops
running within the loop of "run -> shutdown/kill/abort ->
run ... ", so that only the script who owns the mysql
server would be able to bring it down if required.

NOTE
====
Removed the deletion of pid file and socket file from entry
of the loop, as it may result in 2nd instance deleting
these files created by 1st instance in RACE condition.
Compensated this by deleting these files at end of the loop

Reverted the changes made in patch to Bug#16776528. So
after this patch is pushed, the concept of mysqld_safe.pid
would go altogether. This was required as the script was
deleting other instance's mysqld_safe.pid allowing multiple
mysqld_safe instances to run in parallel. This patch would
fix Bug#16776528 as well as the resources would be guarded
anyway by InnoDb lock + our planned 5.7 patch.
2016-12-22 14:56:02 +05:30
Terje Rosten
1079066b22 Bug#13344753 MYSQL_SECURE_INSTALLATION SCRIPT DOES NOT CHECK USER INPUT
Loop until valid answer is given. Variants of y,yes and
n,no and blank (meaning default) are considered valid.
2016-12-19 12:01:45 +01:00
Sergei Golubchik
2f20d297f8 Merge branch '10.0' into 10.1 2016-12-11 09:53:42 +01:00
Sergei Golubchik
3e8155c637 Merge branch '5.5' into 10.0 2016-12-09 16:33:48 +01:00
Sergei Golubchik
5142cd55f4 MDEV-11052 mariadb-service-convert does not work after upgrading to 10.1.18
mysqld_safe: don't close stdout and stderr if --dry-run
2016-12-06 09:45:50 +01:00
Sergei Golubchik
0a4b508173 MDEV-11242 MariaDB Server releases contains promotion of MariaDB Corporation 2016-12-03 22:02:00 +01:00
Nirbhay Choubey
44ccb8f29e MDEV-10432: Post-fix after merging PR#205 2016-11-21 15:38:33 -05:00
Bernard Spil
cf1b0c1ace Implement native/base process checks for FreeBSD
- Make rsync process checks OS-dependent
  - Use (BSD) netstat on FreeBSD (not lsof)
2016-11-21 15:38:33 -05:00
Bernard Spil
f16ead51fb POSIX-ify wsrep scripts
- Replace #!/bin/bash with #!/bin/sh
  - Split username:password using POSIX compat %% and ##
  - Don't use array for FILTERS
  - Replace == tests with POSIX-compat =
2016-11-21 15:38:33 -05:00
Terje Rosten
cdd57aa719 Bug#25088048 ADDITIONAL ISSUES IN MYSQLD_SAFE
Don't read --ledir option from config file.
Ignore current working for finding location of mysqld
Remove use of chown/chmod in scripts.
Be helpful only when basedir is /var/log or /var/lib.
Removed unused systemd files for SLES.
Set explicit basedir in scripts.
2016-11-16 14:01:12 +01:00
Francisco Biete
db95beb365 MDEV-9903 - 10.2 : Check and run rsync daemon only in the needed IP
See https://github.com/MariaDB/server/pull/235
I submit this code under the BSD-new license.
2016-11-07 11:53:58 -05:00
Nirbhay Choubey
5db2195a35 Merge tag 'mariadb-10.0.28' into 10.0-galera 2016-10-28 15:50:13 -04:00
Nirbhay Choubey
308c666b60 Merge remote-tracking branch 'origin/5.5' into 5.5-galera 2016-10-14 10:57:07 -04:00
Terje Rosten
1f93f4381b Bug#24483092 UNSAFE USE OF VARIOUS SHELL UTILITIES
- Remove use of touch and chmod.
 - Restrict usage of chown to cases where target directory is /var/log.
 - Due to limited feature set in /bin/sh on Solaris, /bin/bash will be
   used on this platform.
 - Give error if directory for UNIX socket file is missing.
 - Privileged user should not log to files owned by different user
   (mysqld will log as before).
2016-10-06 13:26:16 +02:00
Sergei Golubchik
2ede40e67e Merge branch '10.0' into 10.1 2016-09-29 12:59:51 +02:00
Sergei Golubchik
a3f11f7549 Merge branch '5.5' into 10.0 2016-09-29 12:31:46 +02:00
Sergei Golubchik
7497ebf8a4 mysqld_safe: close stdout and stderr
when they're not needed anymore. Helps when
daemonizing it from mysql.init
2016-09-29 10:16:24 +02:00
Nirbhay Choubey
e1c6f28f0d Merge branch '10.0-galera' into 10.1 2016-09-28 13:20:02 -04:00
Hartmut Holzgraefe
c9ded859a6 MDEV-10853 netcat help output in error log when running xtrabackup SST 2016-09-28 12:53:43 -04:00
Alexey Botchkov
d30809a3cd MDEV-10832 Out of tree build: mysql_install_db to see all .sql files.
One line in mysql_install_db.sh was left unfixed.
2016-09-26 09:40:47 +04:00
Daniel Black
5d001d13c2 MDEV-10832 - Out of tree build: mysql_install_db to see all .sql files (#237)
* Out of tree build: mysql_install_db to see all .sql files

Since MDEV-7875 (da0991c6), not all sql source files are in the source
directory, maria_add_gis_sp_bootstrap.sql is in the build directory.

This corrects mysql_install_db{.sh} to be aware of the differing
locations.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>

* Out of tree build: scripts/mysql_install_db.pl.in

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
2016-09-23 11:28:38 +04:00
Hartmut Holzgraefe
04f92dde67 MDEV-10853 netcat help output in error log when running xtrabackup SST 2016-09-22 17:26:18 -04:00
Seamus Lee
e387bfafbb MDEV-10830 - Fix undefined database test error when running mysql_install_db (#234)
* Fix undefined database test error when running mysql_install_db

When using mariaDb in docker mode it can fail as it calls mysql_install_db but as we are going through a slightly different install process the test database has not been created, therefore we should fall back to the mysql database as per https://mariadb.com/kb/en/mariadb/mariadb-10112-mysql_install_db-aborts-on-unkown-file-test/

* Also fix mysql_install_db.pl.in
2016-09-22 13:14:40 +04:00
Sergei Golubchik
59d51f0c12 Merge branch '10.2' into bb-10.2-connector-c-integ-subm 2016-09-21 12:54:56 +02:00
Sergei Golubchik
fb8bc59f01 mysqld_safe: don't use "$DATADIR/my.cnf"
finally removed, after being deprecated since 2005
2016-09-19 20:13:49 +02:00
Sergei Golubchik
06b7fce9f2 Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
Terje Rosten
7603ac53c8 Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Post push fix: Solaris 10 /bin/sh don't understand $().
2016-08-26 11:25:40 +02:00
Nirbhay Choubey
90266e8a0e Merge branch '10.0-galera' into bb-10.1-serg 2016-08-25 15:39:39 -04:00
Sergei Golubchik
6b1863b830 Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
Nirbhay Choubey
b506d9527b Merge branch '5.5-galera' into 10.0-galera 2016-08-24 19:41:11 -04:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
sjaakola
58386ca04d refs codership/mysql-wsrep#239
Synced xtrabackup SST scripts from PXC source tree as of PXC 5.6.27-25.13
- PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cn
- PXC#460: wsrep_sst_auth don't work in Percona-XtraDB-Cluster-56-5.6.25-25.
- PXC-416: Fix SST related issues.
- PXC-389: Merge remote-tracking branch 'wsrep/5.6' into 5.6-wsrep-pxc389
- Bug #1431101: SST does not clobber backup-my.cnf
2016-08-21 16:16:58 -04:00
Terje Rosten
8b1f4d84ca Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Argument to malloc-lib must be included in restricted list of
directories, symlink guards added, and mysqld and mysqld-version
options restricted to command line only. Don't redirect errors to
stderr.
2016-08-18 12:19:15 +02:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Nirbhay Choubey
38a0def805 Merge tag 'mariadb-5.5.51' into 5.5-galera 2016-08-10 10:34:54 -04:00
Nirbhay Choubey
44e3046d3b MDEV-10487: Galera SST using rsync does not filter out lost+found
In rsync based SST method, during third phase of data transfer,
'lost+found' should be filtered out while recursively transferring
files from various directories under data directory.
2016-08-03 22:15:57 -04:00
Nirbhay Choubey
b522c71e4b MDEV-10396: MariaDB does not restart after upgrade on debian 8
During wsrep position recovery, galera_recovery.sh script
redirected mysqld's error log to a temporary file in order
to find the start position. This, however, will not work
if --log-error is configured for the server.

Fixed by using --log-error in command line instead of
redirection.

[Patch contributed by Philippe MARASSE]
2016-07-27 17:38:38 -04:00
Elena Stepanova
5cf49cdf92 MDEV-10248 Cannot Remove Test Tables
While dropping the test database, use IF EXISTS to avoid bogus errors
2016-07-15 23:51:30 +03:00
Sergei Golubchik
64583629ad MDEV-9588 Mariadb client-only build creates a useless mysqld_safe file 2016-07-13 08:55:26 +02:00
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Sergei Golubchik
3361aee591 Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
Martin Stefany
64c115b835 Use hostname instead of IP in donor's socat
Using IP address in donor's socat with TLS/SSL and certificate
which doesn't contain IP address in CN or SubjectAltName causes
transfer to fail with message:

socat[5799] E certificate is valid but its commonName does not
match hostname.

This patch tries to reverse resolve IP address to hostname and
use it for transfer. If reverse resolution fails, IP address is
still used as fall-back, so proper A/AAAA and PTR records are
important, but not mandatory.

Certain certificates cannot contain IP addresses, e.g. FreeIPA's
Dogtag doesn't allow it, so in my case I would need to use self-
signed certificates instead, use verify=0 with socat or don't use
TLS/SSL at all. Issue is mentioned in MDEV-9403.
2016-06-27 21:50:34 -04:00
Nirbhay Choubey
aa9c8f2a0d MDEV-10233: Support bootstraping a Galera cluster with mysqld_multi
Added a new --wsrep-new-cluster option to enable mysqld_multi
script to start mysqld with the same option.

[Patch contributed by Hartmut]
2016-06-27 18:24:07 -04:00
Nirbhay Choubey
7ef5257a64 MDEV-10230: --wsrep_on option no longer passed through by mysqld_safe
Append mysqld_safe's wsrep-on option to the list of options
used to start mysqld.
[Patch contributed by Hartmut]
2016-06-27 18:22:35 -04:00
Nirbhay Choubey
a6816995ee MDEV-10004: Galera's pc.recovery process fails in 10.1 with systemd
Galera recovery process works in two phases. In the first
phase, mysqld is started as non-daemon with --wsrep-recover
to recover and fetch the last logged global transaction ID.
This ID is then used in second phase as the start position
(--wsrep-start-position=XX) to start mysqld as daemon.

As this process was implemented in mysqld_safe script, the
recovery did not work when server was started using systemd.

Fixed by introducing a shell script (wsrep_recovery.sh) that
mimics the first phase of the recovery process.
2016-06-27 18:03:24 -04:00
Alexey Botchkov
e337fd13b2 MDEV-10119 mysql_install_db creates GIS procedures with invalid definer.
Servers sets default DEFINER to empty if run with the
        --scip-grant-tables option.
        So specify the DEFINER explicitly
2016-06-27 22:12:21 +04:00
Nirbhay Choubey
14d62505d9 Merge tag 'mariadb-10.0.26' into 10.0-galera 2016-06-24 12:01:22 -04:00
Nirbhay Choubey
ecdb2b6e86 Merge tag 'mariadb-5.5.50' into 5.5-galera 2016-06-23 12:54:38 -04:00
Sergei Golubchik
a69f4c783d Merge branch 'bb-10.0-serg' into 10.0 2016-06-21 15:55:37 +02:00
Sergei Golubchik
c081c978a2 Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
Alexey Botchkov
b21e7af20e MDEV-9969 mysql_install_db error processing ignore_db_dirs.
Changes to the mysql_install_db scripts so they don't repeat
        arguments twice.
2016-06-16 13:41:45 +04:00
Sergei Golubchik
ae29ea2d86 Merge branch 'mysql/5.5' into 5.5 2016-06-14 13:55:28 +02:00
Otto Kekäläinen
effbe7dd7b General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
Nirbhay Choubey
0a1c2a2051 Merge branch '10.0-galera' into 10.1 2016-05-05 09:15:04 -04:00
Sergei Golubchik
87e3e67f43 Merge branch '10.0' into 10.1 2016-05-04 15:23:26 +02:00
Monty
c788a13c64 Drop old not used mysql.ndb_binlog_index if exists 2016-05-01 19:10:51 +03:00
Monty
ad4239cc3d Fixed assert if user table was mailformed.
Added mysql_to_mariadb.sql script, to change mysql.user tables from
MySQL 5.7 to MariaDB.
After this script is run, one can get the other tables fixed by running
mysql_upgrade
2016-05-01 18:52:13 +03:00
Nirbhay Choubey
c0238be6cf Merge branch '5.5-galera' into 10.0-galera 2016-04-29 16:59:25 -04:00
Nirbhay Choubey
8a1efa1bdd Merge branch '10.0' into 10.0-galera 2016-04-29 16:50:58 -04:00
Nirbhay Choubey
51a32ebeb3 MDEV-9884: Existing /var/lib/mysql/.sst directory (with contents) causes SST to fail with xtrabackup-v2
[Fix taken from https://github.com/percona/percona-xtradb-
cluster/commit/b3ee75949ed82b88f355ca2e26431350cc1c89ac]

During SST, the receiver node creates .sst directory under
datadir to process/prepare the received data and removes it
at the end of the process. In case of error, this directory,
however, was not removed, which later caused subsequent SSTs
to fail. Fixed by removing this directory at the beginning
of SST if it existed.
2016-04-27 12:29:25 -04:00
Sergei Golubchik
7b58fd5ef0 tests -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
This fixes:
MDEV-7693 MariaDB - mysql-test - SUITE:funcs_1 - funcs_1.is_tables_mysql is failing on TABLE_COLLATION /DATABASE_COLLATION
MDEV-8487 mysql-test - main.information_schema 'xtradb' fails
MDEV-8486 mysql-test - main.bootstrap fails
2016-04-24 18:15:20 +02:00
Michael Widenius
031e3442f8 Removed file-key-management from mysql_install_db as someone may have
deciced to use it even before bootstrap.
2016-04-07 19:58:28 +03:00
Sergei Petrunia
89b744eb6c Fix the buildbot: file-key-management is provided by a plugin, so should be loose. 2016-04-06 18:08:16 +03:00
Monty
cdd4043117 Cleanups:
- Removed some QQ markers
- Removed some rows not compatible with valgrind 3.9.0
- Made mysql_install_db.sh more silent by default. --verbose now gives more information
- Added assert that auto-increment doesn't generate 0 (safety)
- Removed thd->set_time() in some places as it's set in init_for_queries()
- Fixed some --big tests in tokudb
- Fixed a bug in mysql_client_test.cc where sql_mode was not properly reset
2016-04-05 18:00:04 +03:00
Sergei Golubchik
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
Sergei Golubchik
3b0c7ac1f9 Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
iangilfillan
6befd84202 Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
Otto Kekäläinen
1777fd5f55 Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
Shishir Jaiswal
32d6db3bfa Bug#19920049 - MYSQLD_MULTI MISLEADING WHEN MY_PRINT_DEFAULTS
IS NOT FOUND

DESCRIPTION
===========
If script mysqld_multi and utility my_print_defaults are in
the same folder (not included in $PATH) and the former is
made to run, it complaints that the mysqld binary is absent
eventhough the binary exists.

ANALYSIS
========
We've a subroutine my_which() mimicking the behaviour of
POSIX "which" command. Its current behaviour is to check
for a given argument as follows:
- Step 1: Assume the argument to be a command having full
fledged absolute path. If it exists "as-is", return the
argument (which will be pathname), else proceed to Step 2.
- Step 2: Assume the argument to be a plain command with no
aboslute path. Try locating it in all of the paths
(mentioned in $PATH) one by one. If found return the
pathname. If found nowhere, return NULL.

Currently when my_which(my_print_defaults) is called, it
returns from Step 1 (since utlity exists in current
folder) and doesn't proceed to Step 2. This is wrong since
the returned value is same as the argument i.e.
'my_print_default' which defies the purpose of this
subroutine whose job is to return a pathname either in Step
1 or Step 2.

Later when the utility is executed in subroutine
defaults_for_group(), it evaluates to NULL and returns the
same. This is because the plain command 'my_print_defaults
{options} ...' would execute properly only if
my_print_defaults exists in one of the paths (in $PATH). In
such a case, in the course of the flow it looks onto the
variable $mysqld_found which comes out to be NULL and
hence ethe error.

In this case, call to my_which should fail resulting in
script being aborted and thus avoiding this mess.

FIX
===
This utility my_print_defaults should be tested only in
Step 2 since it does not have an absolute path. Thus added
a condition in Step 1 so that is gets executed iff not
called for my_print_defaults thus bypassing it to proceed
to Step 2 where the check is made for various paths (in
$PATH)
2016-03-01 13:05:14 +05:30
Nirbhay Choubey
66832b6195 MDEV-9598: Donor's rsync SST script hangs if FTWRL fails
During SST, since wsrep_sst_rsync waits for mysqld to create
"tables_flushed" file after it has successfully executed FTWRL,
it would wait forever if FTWRL fails.
Fixed by introducing a mechanism to report failure to the script.
2016-02-26 10:49:19 -05:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Nirbhay Choubey
cceec7858f Merge branch '10.0-galera' into bb-10.1-serg 2016-02-24 01:21:40 -05:00
Krunal Bauskar
f67d6fccac - PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cnf
If any given variable the xtrabackup-v2 sst script looks for is specified
  multiple times in cnf file then it tend to pick both of them causing
  some of the follow-up command to fail.

  Avoid this programatic mistake by honoring only the last variable assigned
  setting as done by mysqld too.

  Check https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1362830
2016-02-23 21:46:53 -05:00
Krunal Bauskar
0cf66e49db - PXC#460: wsrep_sst_auth don't work in Percona-XtraDB-Cluster-56-5.6.25-25.12.1.el7
Semantics:
---------

* Generally end-user will create a separate user with needed
privileges for
    performing DONOR action.
* This user credentials are specified using wsrep_sst_auth.

* Along with this user there could be other user(s) created on the
server
    that sysadmin may use for normal or other operations
* Credentials for these user(s) can be specified in same
cluster/server
    cnf file as part of [client] section

When cluster act as DONOR and if wsrep_sst_auth is provided then it
should
strictly use it for performing SST based action.

What if end-user has same credentials for performing both SST action
and
normal admin work ?
* Then end-user can simply specify these credentials as part of
[client]
    section in cnf file and skip providing wsrep_sst_auth.

Issue:
-----

MySQL client user/password parsing preference order is as follows:
* command line (through --user/--password)
* cnf file
* MYSQL_PWD enviornment variable.

Recent change tried passing sst user password through MYSQL_PWD
(and user though --user command line param as before).

On the system where-in admin had another user for performing non-SST
actions,
credentials for such user were present in cnf file under [client]
section.

Due to mysql client preference order, SST user name was used (as it
was
passed through command line) but password of other user (meant for
non-SST)
action was being used as it was passed through cnf file.

Password passed through MYSQL_PWD was completely ignored causing
user-name/password mismatch.

Solution:
---------

* If user has specified credentials for SST then pass them through
command
    line so that they are used in priority.

(There could be security concern on passing things through command
line but
   when I tried passing user-name and password through command line to
mysql
   client and then did ps I saw this
   ./bin/mysql --user=sstuser --password=x xxxxxxxx -S /tmp/n1.sock
so seems like password is not shown)
2016-02-23 21:44:32 -05:00
Vladislav Vaintroub
ff25158d7f MDEV-9529 - do not install sql script to BINDIR 2016-02-22 12:42:56 +01:00
Monty
b2f8d7b410 Merge branch '10.1' into 10.2
Conflicts:
	VERSION
	cmake/plugin.cmake
	config.h.cmake
	configure.cmake
	plugin/server_audit/server_audit.c
	sql/sql_yacc.yy
2016-02-06 18:14:54 +02:00
Alexey Botchkov
da0991c6da MDEV-7875 Duplicate maria_add_gis_sp script in the sources.
Now both are generated by the cmake from the
        scripts/maria_add_gis_sp.sql.in
2016-01-25 11:32:19 +04:00
Alexander Barkov
2ba7ed77aa Merge remote-tracking branch 'origin/10.1' into 10.2 2015-12-29 19:37:11 +04:00
Sergey Vojtovich
63f0669fd6 MDEV-9297 - mysql_install_db launches mysqld 3x
Perform database installation in one mysqld run. This makes mysql_install_db
3x faster.
2015-12-29 18:09:54 +04:00
Sergey Vojtovich
c597ed0111 MDEV-9209 - [PATCH] scripts: Do not prepend the prefix to absolute paths
Allow absolute paths for INSTALL_*DIR.
2015-12-22 19:13:51 +04:00
Sergei Golubchik
d8e127f9f4 Merge branch '10.1' into bb-10.1-serg 2015-12-22 15:19:51 +01:00
Sergei Golubchik
7697bf0bd7 Merge branch 'github/10.0-galera' into 10.1
Note: some tests fail, just as they failed before the merge!
2015-12-22 10:32:33 +01:00
Sergei Golubchik
a2bcee626d Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
Nirbhay Choubey
ab9a488dec MDEV-9141 : [PATCH] Add CA validation to wsrep_sst_xtrabackup-v2.sh
- Add CA validation to wsrep_sst_xtrabackup-v2.sh.
- Also added a few {} around tpem for consistency.
- Abort if encryption is requested but socat is not ssl-enabled.

Patch contributed by : Klaas Demter
2015-12-20 19:24:03 -05:00
Nirbhay Choubey
dad555a09c Merge tag 'mariadb-10.0.23' into 10.0-galera 2015-12-19 14:24:38 -05:00
Sergei Golubchik
1623995158 Merge branch '5.5' into 10.0 2015-12-13 00:10:40 +01:00
Nirbhay Choubey
ca07ee85ea Merge tag 'mariadb-5.5.47' into 5.5-galera 2015-12-10 13:00:08 -05:00
Sergei Golubchik
e05883bf30 MDEV-7341 mysqld_multi doesn't recognize include directive (not following includes) 2015-12-07 15:20:23 +01:00
Sergey Vojtovich
253be36c0f MDEV-7376 - Removal of the tool "mysql_zap" 2015-11-26 11:34:18 +04:00
Sergey Vojtovich
0b5e975cf8 MDEV-8654 - Remove mysqlbug
mysqlbug has been obsolete since MySQL 5.5, and has been removed in MySQL 5.7.
It's also of no use for reporting MariaDB bugs. The script and the associated
man page removed from MariaDB.
2015-11-26 11:34:18 +04:00
Nirbhay Choubey
370a2cbe96 Fix syntax error in wsrep_sst_common.sh. 2015-11-20 19:49:16 -05:00
Nirbhay Choubey
0d8eb20cb0 Remove duplicate code. 2015-11-20 12:31:22 -05:00
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01:00
Sergei Golubchik
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00
Nirbhay Choubey
c78fc8b1ea MTR: rsync process is left running if pid file is removed
MTR drops the datadir in the event of a test failure. In case mysqld
is running as a Galera node and a failure occurs while the SST is in
progress, the rsync pid file gets removed as part of the cleanup and
wsrep_sst_rsync, which relies on this file, fails to kill the rsync.
Fixed by using the cached $RSYNC_REAL_PID to kill rsync daemon.
2015-11-16 12:35:06 -05:00
Sergei Petrunia
9f862ce026 MDEV#7383: engine-independent-stats column_stats has limited values for max/min values
Patch from Daniel Black:
- Change the charset of mysql.column_stats.{min_value, max_value} from
  utf8_bin varchar to varbinary
- Adjust the code that saves/reads the data accordingly.
- Also provide upgrade statement in mysql_system_tables_fix.sql
2015-11-09 17:58:35 +03:00
Nirbhay Choubey
f9e320c82d MDEV-9026: Revert patch for MDEV-6069
Post-fix:
Reverting the patch for MDEV-6069 brought some ALTERs with
ENGINE=MYISAM back into the mysql_system_tables_fix.sql
script. As a result, running mysql_upgrade with global
enforce_storage_engine=INNODB (or any other non-MyISAM
engine, for that matter) would fail.

Fixed by locally unsetting enforce_storage_engine in the
upgrade script.
2015-11-04 15:00:34 -05:00
Nirbhay Choubey
95289e5b66 Revert "MDEV-6069: Remove old logic for 3.23-to-higher upgrades from upgrade SQL scripts"
This reverts commit 5e6f12366a.
2015-11-03 11:55:30 -05:00
Nirbhay Choubey
d68b083672 Revert "MDEV-6069: Remove old logic for 3.23-to-higher upgrades from upgrade SQL scripts"
This reverts commit f8381d9382.
2015-11-03 11:54:37 -05:00
Nirbhay Choubey
a574407444 MDEV-9007: Bootstrap does not work in CentOS start script
Some modifications in galera_new_cluster :

* Do not use absolute path for systemctl
* Fix parameter substitution syntax
2015-11-02 23:37:04 -05:00
Daniel Black
a2c3549404 MDEV-427: systemd - use galera_new_cluster instead of bootstrap
Use galera_new_cluster instead. systemctl start mariadb@bootstrap
will generate error message, use_galera_new_cluster.conf is the name
of the file that will generate this error.

Output:

Job for mariadb@bootstrap.service failed. See "systemctl status
mariadb@bootstrap.service" and "journalctl -xe" for details.

● mariadb@bootstrap.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb@.service; disabled;
vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/mariadb@bootstrap.service.d
           └─use_galera_new_cluster.conf
   Active: failed (Result: exit-code) since Thu 2015-10-15 19:27:52
CEST; 5s ago
  Process: 24334 ExecStart=/usr/bin/false (code=exited,
status=1/FAILURE)
  Process: 24330 ExecStart=/usr/bin/echo Please use galera_new_cluster
to start the mariadb service with --wsrep-new-cluster (code=exited,
status=0/SUCCESS)
 Main PID: 24334 (code=exited, status=1/FAILURE)

Oct 15 19:27:52 spaceman systemd[1]: Starting MariaDB database server...
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service: main
process exited, code=exited, status=1/FAILURE
Oct 15 19:27:52 spaceman systemd[1]: Failed to start MariaDB database
server.
Oct 15 19:27:52 spaceman systemd[1]: Unit mariadb@bootstrap.service
entered failed state.
Oct 15 19:27:52 spaceman systemd[1]: mariadb@bootstrap.service failed.
2015-11-02 23:37:03 -05:00
Nirbhay Choubey
4d15112962 Merge tag 'mariadb-10.0.22' into 10.0-galera 2015-10-31 18:07:02 -04:00
Sergey Vojtovich
e4f9d20d7c MDEV-8498 - mysql_secure_installation can't find "mysql" in basedir
mysql_secure_installation used incorrect path while looking up for "mysql"
client tool: $basedir/$basedir/bin instead of $basedir/bin.

This patch adapts "my_print_defaults" lookup algorithm for "mysql" client tool.
2015-10-26 16:11:13 +04:00
Michael Widenius
18f7dfed17 Allow mysql_upgrade to enable event after table is corrected
new features:
set event_scheduler=ON|OFF will now try to init event scheduler
if it's not enabled
set event_scheduler=default will try to enable it based on
the value of the event_scheduler when mysqld was started
2015-10-21 16:31:11 +03:00
Daniel Black
079cc48e06 MDEV-426: systemd mariadb-sevice-convert - abs paths
Systemd config files need absolute paths.

LimitCore was ment to be LimitCORE

Oct 14 07:28:04 spaceman systemd[1]: [/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf:7] Unknown lvalue 'LimitCore' in section 'Service'
Oct 14 07:28:04 spaceman systemd[1]: [/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf:9] Executable path is not absolute, ignoring: sync
Oct 14 07:28:04 spaceman systemd[1]: [/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf:10] Executable path is not absolute, ignoring: sysctl -q -w vm.drop_caches=3
2015-10-14 12:45:58 +02:00
Daniel Black
82fb035ecc MDEV-426: mariadb-service-convert to use MYSQLD_OPTS
During the review process OPTIONS was converted to MYSQLD_OPTS.
In the script mariadb-service convert, the ExecStart of the system
also uses this setting.
2015-10-14 12:45:58 +02:00
Sergey Vojtovich
6346d1de2f MDEV-427/MDEV-5713 Add systemd script with notify functionality
After review/QA fixes.
2015-10-12 17:51:49 +02:00
Daniel Black
20c2ae39db MDEV-427/MDEV-5713 Add systemd script with notify functionality 2015-10-12 17:51:49 +02:00
Sergei Golubchik
dfb74dea30 Merge branch '10.0' into 10.1 2015-10-12 00:37:58 +02:00
Monty
7c1e2fe35c Better error message if failed 2015-10-08 10:17:07 +03:00
Jan Lindström
173e486950 MDEV-8576: Bootstrap should ignore --enforce-storage-engine option
Allow enforce-storage-engine="" option and use that on mysql_install_db
when doing bootstrap.
2015-09-16 13:14:19 +03:00
Alexey Yurchenko
0ccbbffb78 Slight cleanup improvement on a previous commit. 2015-09-09 22:30:51 -04:00
Philip Stoev
bc796c29b3 Refs codership/mysql-wsrep#143 . Account for the case where the SST password is empty 2015-09-09 22:30:50 -04:00
Alexey Yurchenko
86ee30cea9 Refs codership/mysql-wsrep#141: this commit
1. Passes wsrep_sst_auth_value to SST scripts via WSREP_SST_OPT_AUTH envronmental variable, so it never appears on the command line
  2. In mysqldump and xtrabackup* SST scripts which rely on MySQL authentication, instead of passing password on the command line, SST script sets MYSQL_PWD environment variable, so that password also never appears on the mysqldump/innobackupex command line.
2015-09-09 22:29:03 -04:00