Commit graph

4536 commits

Author SHA1 Message Date
Jan Lindström
8dda6d797a
Merge pull request #850 from HeMan/10.3
Return code from starting MariaDB.
2018-09-11 12:05:47 +03:00
Sergei Golubchik
db947b7599 Merge branch '10.0-galera' into 10.1 2018-09-07 15:25:27 +02:00
Oleksandr Byelkin
31081593aa Merge branch '11.0' into 10.1 2018-09-06 22:45:19 +02:00
Marko Mäkelä
2f4c391958 Merge 10.2 into 10.3 2018-09-06 22:35:45 +03:00
Jan Lindström
653038ccad
Merge pull request #855 from tempesta-tech/sysprg/10.1-MDEV-10756
MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
2018-09-06 14:10:29 +03:00
Jan Lindström
b44b9f71bd MDEV-15436: If log_bin and log_bin_index is different SST with rsync fails.
Problem was that in SST log_bin_index name and directory was not
handled and passed to rsync SST script.

wsrep_sst_common.sh
	Read binlog index dirname and filename if --binlog-index
	parameter is provided. Read binlog filenames from that file
	from donor and write transfered binlog filenames to that
	file in joiner.

mysqld.cc, mysqld.h
	Moved opt_binlog_index_name from static to global and added
	it to extern.

wsrep_sst.cc

generate_binlog_index_opt_val
	New function to generate binlog index name if opt_binlog_index_name is
	given on configuration.

sst_prepare_other
	Add binlog index configuration to SST command.

wsrep_sst.h
	Add new SST parameter --binlog-index

Add test case.
2018-09-05 10:34:36 +03:00
Daniel Black
eda88e60fb galera_new_cluster.sh: unused variables 2018-09-03 09:53:05 +10:00
Marko Mäkelä
206528f722 Merge 10.1 into 10.2 2018-08-31 15:10:02 +03:00
Jan Lindström
104089e182 MDEV-15512 - Fix sh parse error when [sst] config value has spaces.
Merged https://github.com/MariaDB/server/pull/617 authored by
Colin Mollenhour.
2018-08-29 19:30:03 +03:00
Jan Lindström
f4454a35fc
Merge pull request #539 from grooverdan/10.1-wsrep_sst_rsync_read_MYSQL_BASE_VERSION_config
MDEV-14851: galera_recovery to read correct configuration file sections
2018-08-28 13:48:43 +03:00
Marko Mäkelä
7830fb7f45 Merge 10.2 into 10.3 2018-08-28 12:22:56 +03:00
Julius Goryavsky
c11fb374b5 MDEV-10756: wsrep_sst_xtrabackup-v2 does not support innodb_data_home_dir
Current versions of xtrabackup-v2 and mariabackup support the option
--innodb-data-home-dir, but this parameter is not passed to them from
the SST script, since the SST script does not receive this information
from mysqld. The transfer of this information to the SST is already
fixed by the MDEV-10754 patch, but we need to process it in the SST
script. Also, we should take into account that on the joiner side
the corresponding information is not read yet from the configuration
file (at the mysqld side) during the start of SST, so the script must
itself read it.

https://jira.mariadb.org/browse/MDEV-10756
2018-08-27 16:24:29 +02:00
Anel Husakovic
4ba6327f95 Fix typo in --srcdir option in echo message status of mysql_install_db 2018-08-25 17:51:15 +03:00
benrubson
4c652fc62e
Use stunnel during rsync SST if available
(cherry picked from commit 1adc382c2f)
2018-08-24 13:35:44 +02:00
Jimmy Hedman
ff5a482d9c Return code from starting MariaDB.
- When bootstraping the galera cluster it's good to get correct return
  values from the (failed) execution.
2018-08-24 10:46:50 +02:00
Marko Mäkelä
b0ef1b388b After-merge fix: Revert MDEV-15511
My conflict resolution for the script did not work out after all,
and apparently I was testing a wrong version. Revert MDEV-15511
from MariaDB 10.2 for now.
2018-08-21 16:52:59 +03:00
Marko Mäkelä
9258097fa3 Merge 10.1 into 10.2 2018-08-21 15:20:34 +03:00
Julius Goryavsky
4ff7f14fef Fixes of the base patch for compatibility with the 10.1 branch 2018-08-17 15:54:55 +02:00
Vladislav Vaintroub
ead9a34a3e MDEV-15851 Stop creating mysql.host table
Changed bootstrap scripts, adjusted result files.
2018-08-16 18:12:13 +01:00
Marko Mäkelä
734db318ac Merge 10.3 into 10.4 2018-08-16 10:08:30 +03:00
Michael Widenius
d6d63f4844 MDEV-16421 Make system tables crash safe
Make all system tables in mysql directory of type
engine=Aria

Privilege tables are using transactional=1
Statistical tables are using transactional=0, to allow them
to be quickly updated with low overhead.
Help tables are also using transactional=0 as these are only
updated at init time.

Other changes:
- Aria store engine is now a required engine
- Update comment for Aria tables to reflect their new usage
- Fixed that _ma_reset_trn_for_table() removes unlocked table
  from transaction table list. This was needed to allow one
  to lock and unlock system tables separately from other
  tables, for example when reading a procedure from mysql.proc
- Don't give a warning when using transactional=1 for engines
  that is using transactions. This is both logical and also
  to avoid warnings/errors when doing an alter of a privilege
  table to InnoDB.
- Don't abort on warnings from ALTER TABLE for changes that
  would be accepted by CREATE TABLE.
- New created Aria transactional tables are marked as not movable
  (as they include create_rename_lsn).
- bootstrap.test was changed to kill orignal server, as one
  can't anymore have two servers started at same time on same
  data directory and data files.
- Disable maria.small_blocksize as one can't anymore change
  aria block size after system tables are created.
- Speed up creation of help tables by using lock tables.
- wsrep_sst_resync now also copies Aria redo logs.
2018-08-14 12:18:38 +03:00
Monty
0e0f1092b8 Fixed some source comments and help texts 2018-08-14 11:22:05 +03:00
Julius Goryavsky
36832711c1 Reverting changes made to support the mtr under the root 2018-08-13 10:40:47 +02:00
Sergei Golubchik
0aa9b03393 Merge branch '10.2' into 10.3 2018-08-12 12:02:23 +02:00
Julius Goryavsky
7e8ed15b95 Fixes after review and correction of the problems caused by the fact that during the SST innodb plugin is not yet initialized, as well as problems with running tests from the root user (not directly related to the MDEV-10754). 2018-08-09 02:24:12 +00:00
Julius Goryavsky
6d5b71e02a Merge branch '10.1' of https://github.com/MariaDB/server into sysprg/10.1-MDEV-10754 2018-08-08 15:47:57 +02:00
Sergei Golubchik
eabf5230a2 MDEV-16906 No groups to be reported (check your GNRs) - mysqld_multi does not see instances
make mysqld_multi to use same rules for my.cnf directories
that all other tools are using (see my_default.c).
2018-08-07 21:11:15 +02:00
Jan Lindström
b9f0112248
Merge pull request #609 from benrubson/stunnel
MDEV-15511 - Use stunnel during rsync SST if available
2018-08-05 09:27:13 +03:00
Marko Mäkelä
05459706f2 Merge 10.2 into 10.3 2018-08-03 15:57:23 +03:00
Vasil Dimov
3f0cd66a2b Also include InnoDB undo tablespaces in rsync sst
If --innodb-undo-tablespaces is used, then InnoDB stores undo in a
separate file(s) which whould also be replicated.

This fixes
Issue#337 This filter will cause sst failed at applying undo...
https://github.com/codership/mysql-wsrep/issues/337
2018-08-03 12:31:57 +03:00
Vasil Dimov
62e290923e Put one filter per line in wsrep_sst_rsync.sh
This way it is more readable and easy to change, also if a new entry is
added or one removed, the diff will be easier to read.
2018-08-03 12:31:25 +03:00
Marko Mäkelä
de469a2f29 MDEV-14637: Fix hang due to persistent statistics
Similar to the tables SYS_FOREIGN and SYS_FOREIGN_COLS,
the tables mysql.innodb_table_stats and mysql.innodb_index_stats
are updated by the InnoDB internal SQL parser, which fails to
enforce the size limits of the data. Due to this, it is possible
for InnoDB to hang when there are persistent statistics defined on
partitioned tables where the total length of table name,
partition name and subpartition name exceeds the incorrectly
defined limit VARCHAR(64). That column should have been defined
as VARCHAR(199).

btr_node_ptr_max_size(): Interpret the VARCHAR(64) as VARCHAR(199),
to prevent a hang in the case that the upgrade script has not been
run.

dict_table_schema_check(): Ignore difference in the length of the
table_name column.

ha_innobase::max_supported_key_length(): For innodb_page_size=4k,
return a larger value so that the table mysql.innodb_index_stats
can be created. This could allow "impossible" tables to be created,
such that it is not possible to insert anything into a secondary
index when both the secondary key and the primary key are long,
but this is the easiest and most consistent way. The Oracle fix
would only ignore the maximum length violation for the two
statistics tables.

os_file_get_status_posix(), os_file_get_status_win32(): Handle
ENAMETOOLONG as well.

This patch is based on the following change in MySQL 5.7.23.
Not all changes were applied, and our variant allows persistent
statistics to work without hangs even if the table definitions
were not upgraded.

From fdbdce701ab8145ae234c9d401109dff4e4106cb Mon Sep 17 00:00:00 2001
From: Aditya A <aditya.a@oracle.com>
Date: Thu, 17 May 2018 16:11:43 +0530
Subject: [PATCH] Bug #26390736 THE FIELD TABLE_NAME (VARCHAR(64)) FROM
           MYSQL.INNODB_TABLE_STATS CAN OVERFLOW.

    In mysql.innodb_index_stats and mysql.innodb_table_stats
    tables the table name column didn't take into consideration
    partition names which can be more than varchar(64).
2018-08-03 08:33:38 +03:00
Jan Lindström
c5a8583b31 Merge tag 'mariadb-10.0.36' into 10.0-galera 2018-08-02 11:44:02 +03:00
Marko Mäkelä
ef3070e997 Merge 10.1 into 10.2 2018-08-02 08:19:57 +03:00
Michael Widenius
0c745c743c Don't give warnings from perror or resolveip with safemalloc
- Added my_end(0) before exit
- Fixed typo in mysql_install_db
2018-07-29 10:56:11 +03:00
Julius Goryavsky
46d5e1f2fd MDEV-10754 wsrep_sst_rsync does not support innodb_data_home_dir
If innodb_data_home_dir path specified in the configuration file
then rsync IST/SST will fail because the wsrep_sst_rsync.sh script
does not read this parameter from the configuration file and then
tries to find the data files in the default directory.

To fix this error, we need to add reading of the innodb_data_home_dir
configuration parameter to the rsync-related SST script.
2018-07-26 15:44:28 +02:00
Oleksandr Byelkin
cb5952b506 Merge branch '10.0' into bb-10.1-merge-sanja 2018-07-25 22:24:40 +02:00
Oleksandr Byelkin
304440b014 Merge branch '5.5' into bb-10.0-merge-sanja 2018-07-23 11:55:18 +02:00
Oleksandr Byelkin
0896d7ebc3 Merge branch '10.0' into bb-10.1-merge 2018-07-19 12:55:54 +02:00
Sergei Golubchik
5c744bb535 MDEV-14882 mysql_upgrade performs unnecessary conversions back and forth
avoid round-robin conversions, if the column is MODIFY-ed,
it should always be modified to its final definition, not to some
intermediate state.

also avoid other unconditional changes, like
  ALTER TABLE event DROP PRIMARY KEY;
  ALTER TABLE event ADD PRIMARY KEY(db, name);
2018-07-19 11:35:39 +02:00
Sergei Golubchik
33eccb5776 MDEV-11790 WITHOUT_SERVER installs mysqld_safe_helper
Don't install server files if WITHOUT_SERVER is specified.
"Server files" are defined as files going into the MariaDB-Server RPM,
that is files in the components Server, ManPagesServer, Server_Scripts,
IniFiles, SuportFiles, and Readme.
2018-07-19 11:35:38 +02:00
Jan Lindström
71e0ba4ae6
Merge pull request #645 from grooverdan/10.0-wsrep_sst_common_bashism
MDEV-15549 - wsrep_sst_common: fix per shellcheck
2018-07-19 07:04:40 +03:00
Jan Lindström
312de43f40
Merge pull request #786 from codership/10.1-MDEV-14612
MDEV-14612 wsrep_sst_mariabackup unnecessarily converts address to host name
2018-07-18 10:25:35 +03:00
Oleksandr Byelkin
e5c26fdfab Merge branch '5.5' into bb-10.0-merge 2018-07-17 16:56:21 +02:00
Daniel Black
8c45eb3ea5 MDEV-15050 scripts: mysql_install_db.{sh|pl}, mysqld_multi - mysqld is in @sbindir@
Closes #551
2018-07-16 18:36:28 +02:00
Alexey Botchkov
25410d448d MDEV-15473 Isolate/sandbox PAM modules, so that they can't crash the server.
mysql_install_db.sh script fixed.
2018-07-14 23:06:49 +04:00
Sergei Golubchik
36e59752e7 Merge branch '10.2' into 10.3 2018-06-30 16:39:20 +02:00
Michael Widenius
faef2e6a44 Added more help text in case mysql_install_db fails. 2018-06-27 13:41:19 +03:00
Sergei Golubchik
b942aa34c1 Merge branch '10.1' into 10.2 2018-06-21 23:47:39 +02:00
Sergei Golubchik
635c5e3281 mysql_install_db: clarify the after-install message
don't tell users to set the root password if they're using unix_socket
2018-06-21 10:15:27 +02:00
Sergei Golubchik
1db1340c0c MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
post-merge fixes
2018-06-21 10:15:27 +02:00
Daniel Black
53db5edbcf MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
$ cmake -DPLUGIN_AUTH_SOCKET=STATIC ../mariadb-server-10.2/

$ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-static --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-static' ...
OK

$ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
+----------------------------------------------------------+
| CREATE USER for dan@localhost                            |
+----------------------------------------------------------+
| CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
+----------------------------------------------------------+

$ cmake -DPLUGIN_AUTH_SOCKET=NO ../mariadb-server-10.2/
$ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-none --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-none' ...
ERROR: 1126  Can't open shared library '.../plugin/auth_socket/auth_socket.so' (errno: 2, cannot open shared object file: No such file or directory)
2018-05-01 11:38:56 0 [ERROR] Aborting

$ cmake -DPLUGIN_AUTH_SOCKET=DYNAMIC ../mariadb-server-10.2/
$ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-dyn --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-dyn' ...
OK
$ ./sql/mysqld  --datadir=/tmp/mysqldatadir-auth-dyn  --lc-messages-dir=${PWD}/sql/share --plugin-dir=./plugin/auth_socket/
$ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
+----------------------------------------------------------+
| CREATE USER for dan@localhost                            |
+----------------------------------------------------------+
| CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
+----------------------------------------------------------+

$ sudo make install
$ sudo chmod a+rwx /usr/local/mysql/data
$ cd /usr/local/mysql/
$ scripts/mysql_install_db  --auth-root-socket-user=dan --auth-root-authentication-method=socket
Installing MariaDB/MySQL system tables in './data' ...
OK
..
$ bin/mysqld_safe
$ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
+----------------------------------------------------------+
| CREATE USER for dan@localhost                            |
+----------------------------------------------------------+
| CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
+----------------------------------------------------------+

Merges #767
2018-06-21 10:15:27 +02:00
mkaruza
7a7a61998c MDEV-15442 xtrabackup-v2 SST donor stuck in DONOR/DESYNCED state when joiner is killed
SST transfer scripts rsync and maribackup now monitor parent process and will cleanup if process dies
2018-06-20 13:23:38 +02:00
mkaruza
e5c6580178 MDEV-15442 xtrabackup-v2 SST donor stuck in DONOR/DESYNCED state when joiner is killed
Monitor mysqld process and if it is terminated during sst stream kill xtrabackup-v2 script and children
2018-06-19 16:09:31 +02:00
Sergei Golubchik
7fdb7d4058 more sst test failures
* xtrabackup no longer support --compact
* wsrep_sst_mysqldump wasn't always using --default-file
* wsrep_sst.cc overquoted --default-file for wsrep_sst_mysqldump

also remove redundant lines config and test lines, compiler warnings,
and mark big tests as big.
2018-06-15 22:32:07 +02:00
Sergei Golubchik
cf648afd5b fix galera sst tests
note that ${A#foo} is $A if there's no prefix foo. That's why
galera nodes tried to connect to 127.0.0.1:127.0.0.1 if there was
no port in the address

Followup for 2b35db5ac4
2018-06-15 14:28:08 +03:00
Sergei Golubchik
c22ab56f0d fix galera sst tests
note that ${A#foo} is $A if there's no prefix foo. That's why
galera nodes tried to connect to 127.0.0.1:127.0.0.1 if there was
no port in the address

Followup for 2b35db5ac4
2018-06-14 18:06:52 +02:00
Vicențiu Ciorbaru
6e55236c0a Merge branch '10.0-galera' into 10.1 2018-06-12 19:39:37 +03:00
sjaakola
15c6d6a94a MDEV-14612 wsrep_sst_mariabackup unnecessarily converts address to host name
SST script for mariabackup (wsrep_sst_mariabackup.sh) does reverse DNS to convert
the joiner's IP address to domain name, and this is not always a wanted feature.

It is not understood why this remote host DNS conversion is in the script,
in the first place, but conversion was originally added by commit:

commit 3d8aacba86
Author: Nirbhay Choubey <nirbhay.choubey@gmail.com>
Date:   Wed Feb 22 15:58:45 2017 -0500

In this commit, REMOTEHOST variable is removed and replaced by REMOTEIP. All
references to joiner is therefore by IP address only.
2018-06-07 17:12:38 +03:00
Daniel Black
88a263eabb MDEV-16318: mysqld_safe - partial revert on 64094e1
Revert part of 64094e1 because mysqld_safe isn't just used for
Debian. As such references to specific packaging files like
/etc/mysql/debian.cnf shouldn't have passed a review.

There's also no history of why 64094e1 was needed based on
the history of debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch

Other distos have survived without mysqld_safe handling signals.
2018-06-05 13:40:34 +03:00
Daniel Black
c10bed17dd mysqld_safe: use sh not bash
c902d5a4de changed this to bash.
This isn't approprate as mysqld_safe is used by FreeBSD where
there is no bash by default.

The original reason to use bash seems related to MDEV-3279 which
was a dash bug fixed in 2009 - https://git.kernel.org/pub/scm/utils/dash/dash.git/commit/?id=3800d4934391b144fd261a7957aea72ced7d47ea

Working around 9 year old fixed bugs shouldn't be done here.
2018-06-05 13:39:20 +03:00
Kristien Nielsen
c902d5a4de Apply debian/patches/61_replace_dash_with_bash_mbug675185.dpatch
We have carried along this patch as a patch inside our sources
since 2012 (commit cfd4fcb0bc).

The validity of this has thus been vetted in production for years
and the review done now did not find otherwise.

A race in dash causes mysqld_safe to occasionally loop infinitely.
Fix by using bash instead.

https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/675185

As this is the last patch, we can also clean away usage of dpatch.
2018-05-28 11:32:21 +03:00
Christian Hammers
64094e12c0 Apply debian/patches/38_scripts__mysqld_safe.sh__signals.dpatch
We have carried along this patch as a patch inside our sources
since 2012 (commit cfd4fcb0bc).

This same patch has been used also in MySQL packaging at Oracle
and in downstream Debian.org packages for both MySQL and MariaDB.

The validity of this has thus been vetted in production for years
and the review done now did not find otherwise.

Code contributed to Oracle with
http://forge.mysql.com/wiki/Sun_Contributor_Agreement

Reported as http://bugs.mysql.com/bug.php?id=31361
2018-05-28 11:32:21 +03:00
Jan Lindström
215d652c66 MDEV-15351: wsrep_sst_xtrabackup is broken in 10.1.31
Remove the setup_ports function call. This is related to
https://github.com/MariaDB/server/pull/717

Thanks to Daniel Black and Bart S.
2018-05-14 10:36:55 +03:00
Daniel Black
82f26dafcb MDEV-13968: wsrep_log_error not defined until later in wsrep_sst_common
Fix for 990c4318a7

dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' --port 1111  2>&1  | more
....
+ readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_HOST=128.0.0.5
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_ADDR_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver
+ shift
+ shift
+ [ 2 -gt 0 ]
+ readonly WSREP_SST_OPT_PORT=1111
+ shift
+ shift
+ [ 0 -gt 0 ]
readonly WSREP_SST_OPT_BYPASS
+ readonly WSREP_SST_OPT_BYPASS
readonly WSREP_SST_OPT_BINLOG
+ readonly WSREP_SST_OPT_BINLOG

if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
  if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
    if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
      echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
      exit 2
    fi
  else
    readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
  fi
fi
+ [ -n 3333 ]
+ [ -n 1111 ]
+ [ 1111 != 3333 ]
+ echo WSREP_SST: [ERROR] port in --port=1111 differs from port in --address=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
WSREP_SST: [ERROR] port in --port=1111 differs from port in --address=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ exit 2

dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'  2>&1  | more
...
+ [ 2 -gt 0 ]
+ readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_HOST=128.0.0.5
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_ADDR_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver
+ shift
+ shift
+ [ 0 -gt 0 ]
readonly WSREP_SST_OPT_BYPASS
+ readonly WSREP_SST_OPT_BYPASS
readonly WSREP_SST_OPT_BINLOG
+ readonly WSREP_SST_OPT_BINLOG

if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
  if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
    if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
      echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
      exit 2
    fi
  else
    readonly WSREP_SST_OPT_PORT="$WSREP_SST_OPT_ADDR_PORT"
  fi
fi
+ [ -n 3333 ]
+ [ -n  ]
+ readonly WSREP_SST_OPT_PORT=3333
2018-05-14 10:36:55 +03:00
Sergei Golubchik
fe3c4a4182 MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"
followup for 990c4318a7

fix broken script (set -u)
2018-05-14 10:36:55 +03:00
Sergei Golubchik
e6b31df6df MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable" 2018-05-14 10:36:55 +03:00
Daniel Black
24ab82e675 MDEV-15541: wsrep_sst_common - WSREP_SST_OPT_PORT set twice (--address and --port) 2018-05-14 10:36:55 +03:00
Daniel Black
2b35db5ac4 MDEV-15496: wsrep_sst_common - parse IPv6 correct
Fix to e78e308e81, IPv6 got split at :

Also got rid of awk (yuck!) to parse port (commit: b4fbb4183b)

Tested with dash to avoid bashisms:

$ dash -vx './wsrep_sst_common.sh' --address '128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1  | more
+ readonly WSREP_SST_OPT_ADDR=128.0.0.5:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_HOST=128.0.0.5
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=128.0.0.5
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver

$ dash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1  | more
+ readonly WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ addr_no_bracket=2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
+ readonly WSREP_SST_OPT_HOST=[2001:db8::1]
+ remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver

And bash as well:

$ bash -vx './wsrep_sst_common.sh' --address '127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more
+ readonly WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ WSREP_SST_OPT_ADDR=127.0.0.3:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ case "${WSREP_SST_OPT_ADDR}" in
+ readonly WSREP_SST_OPT_HOST=127.0.0.3
+ WSREP_SST_OPT_HOST=127.0.0.3
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3
+ WSREP_SST_OPT_HOST_UNESCAPED=127.0.0.3
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_PORT=3333
+ WSREP_SST_OPT_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver
+ WSREP_SST_OPT_SST_VER=sst_ver

$ bash -vx './wsrep_sst_common.sh' --address '[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2' 2>&1 | more
+ readonly 'WSREP_SST_OPT_ADDR=[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
+ WSREP_SST_OPT_ADDR='[2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
+ case "${WSREP_SST_OPT_ADDR}" in
+ addr_no_bracket='2001:db8::1]:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
+ readonly WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
+ WSREP_SST_OPT_HOST_UNESCAPED=2001:db8::1
+ readonly 'WSREP_SST_OPT_HOST=[2001:db8::1]'
+ WSREP_SST_OPT_HOST='[2001:db8::1]'
+ remain=:3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=3333/module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_PORT=3333
+ WSREP_SST_OPT_PORT=3333
+ remain=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_MODULE=module
+ WSREP_SST_OPT_MODULE=module
+ readonly WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
+ remain=lsn_version/sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_LSN=lsn_version
+ WSREP_SST_OPT_LSN=lsn_version
+ remain=sst_ver/some_future_option1/some_future_option2
+ readonly WSREP_SST_OPT_SST_VER=sst_ver
+ WSREP_SST_OPT_SST_VER=sst_ver
2018-05-14 10:36:55 +03:00
Sergei Golubchik
c9717dc019 Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
Sergei Golubchik
9b1824dcd2 Merge branch '10.1' into 10.2 2018-05-10 13:01:42 +02:00
Jan Lindström
b2fc197b56 MDEV-15351: wsrep_sst_xtrabackup is broken in 10.1.31
Remove the setup_ports function call. This is related to
https://github.com/MariaDB/server/pull/717

Thanks to Daniel Black and Bart S.
2018-05-09 09:16:20 +03:00
Jan Lindström
648cf7176c Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galera 2018-05-07 13:49:14 +03:00
Daniel Black
87b0434e0f MDEV-12645: mysql_install_db --no-test (postfix
mysql_test_db.sql is in the srcdir
2018-05-01 11:35:13 +04:00
Sergey Vojtovich
9a84980668 MDEV-12645 - mysql_install_db: no install test db option
Added --skip-test-db option to mysql_install_db. If specified, no test
database created and relevant grants issued.

Removed --skip-auth-anonymous-user option of mysql_install_db. Now it is
covered by --skip-test-db.

Dropped some Debian patches that did the same.

Removed unused make_win_bin_dist.1, make_win_bin_dist and
mysql_install_db.pl.in.
2018-04-30 19:34:08 +04:00
Jan Lindström
231c02f7b9 MariaDB adjustments. 2018-04-24 13:58:42 +03:00
Jan Lindström
a5001a2ad7 Merge tag 'mariadb-5.5.60' into 5.5-galera 2018-04-24 13:34:57 +03:00
Jan Lindström
7b11518198
Merge pull request #557 from grooverdan/10.0-galera-wsrep_sst_mysqldump-safety
MDEV-15023 - wsrep_sst_mysqldump: safer test of version != 5
2018-04-06 07:31:44 +03:00
Sergei Golubchik
b1818dccf7 Merge branch '10.2' into 10.3 2018-03-28 17:31:57 +02:00
Sergei Golubchik
c764bc0a78 Merge branch '10.1' into 10.2 2018-03-25 13:02:52 +02:00
Sergei Golubchik
d3681c18f9 followup for 89b0d5cb6e, backport 8c422bf48d 2018-03-23 17:40:09 +01:00
Sergei Golubchik
8f1014e9a0 MDEV-15409 make sure every sst script is tested in buildbot
fix galera.galera_sst_mysqldump test to work:
* must connect to 127.0.0.1, where mysqld is listening
* disable wsrep_sync_wait in wsrep_sst_mysqldump, otherwise
  sst can deadlock
* allow 127.0.0.1 for bind_address and wsrep_sst_receive_address.
  (it's useful in tests, or when two nodes are on the same box,
  or when nodes are on different boxes, but the connection is
  tunelled, or whatever. Don't judge user's setup). MDEV-14070
* don't wait for client connections to die when doing
  mysqldump sst. they'll die in a due time, and if needed mysql
  will wait on locks until they do. MDEV-14069

Also don't mark it big, to make sure it's sufficiently tested
2018-03-23 00:55:20 +01:00
Sergei Golubchik
a15ab358fc wsrep_sst scripts: support traditional netcat 2018-03-23 00:55:19 +01:00
Sergei Golubchik
89b0d5cb6e MDEV-13968 sst fails with "WSREP_SST_OPT_PORT: readonly variable"
Backport from 10.2: 4c2c057d40 and f7090df712
2018-03-23 00:55:19 +01:00
Jan Lindström
85ddd9e8ce Revert pull request #640 from grooverdan/10.3-MDEV-8743-wsrep_sst_common-close-fds 2018-03-17 12:56:23 +02:00
Daniel Black
04ed70fa55 MDEV-8743: wsrep_sst_common close FDs > 2
To prevent accidential overwriting of files due to mysqld file
descriptors being open we ensure where that only FDs 1, 2 and 3
are available to SST scripts. Assumed is mysqld has thse still
mapped to stdin (unused), stdout and stderr.
2018-03-08 18:55:01 +11:00
Daniel Black
6aa22eaf62 wsrep_sst_common: fix per shellcheck
shellcheck -s sh wsrep_sst_common.sh

In wsrep_sst_common.sh line 258:
        [ -n $3 ] && reval=$3
             ^-- SC2070: -n doesn't work with unquoted arguments. Quote or use [[ ]].
             ^-- SC2086: Double quote to prevent globbing and word splitting.
2018-03-07 14:36:40 +11:00
Teemu Ollakka
7cec685758 Bump wsrep patch version to 25.23 2018-02-25 21:01:34 +02:00
Alexander Barkov
583eb96c24 MDEV-11952 Oracle-style packages: stage#5
- CREATE PACKAGE [BODY] statements are now
  entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'.
- CREATE PACKAGE BODY now supports IF NOT EXISTS
- DROP PACKAGE BODY now supports IF EXISTS
- CREATE OR REPLACE PACKAGE [BODY] is now supported
- CREATE PACKAGE [BODY] now support the DEFINER clause:

    CREATE DEFINER user@host PACKAGE pkg ... END;
    CREATE DEFINER user@host PACKAGE BODY pkg ... END;

- CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.:

    CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END;

- Package routines are now created from the package CREATE PACKAGE BODY
  statement and don't produce individual records in mysql.proc.

- CREATE PACKAGE BODY now supports package-wide variables.
  Package variables can be read and set inside package routines.
  Package variables are stored in a separate sp_rcontext,
  which is cached in THD on the first packate routine call.

- CREATE PACKAGE BODY now supports the initialization section.

- All public routines (i.e. declared in CREATE PACKAGE)
  must have implementations in CREATE PACKAGE BODY

- Only public package routines are available outside of the package

- {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE
  privileges

- "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported

- SHOW CREATE PACKAGE [BODY] is now supported

- SHOW PACKAGE [BODY] STATUS is now supported

- CREATE and DROP for PACKAGE [BODY] now works for non-current databases

- mysqldump now supports packages

- "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines

- "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section)

- A new package body level MDL was added

- Recursive calls for package procedures are now possible

- Routine forward declarations in CREATE PACKATE BODY are now supported.

- Package body variables now work as SP OUT parameters

- Package body variables now work as SELECT INTO targets

- Package body variables now support ROW, %ROWTYPE, %TYPE
2018-02-25 21:08:19 +04:00
Sergei Golubchik
2732fcc608 Merge branch 'bb-10.2-ext' into 10.3 2018-02-23 08:43:34 +01:00
Sergei Golubchik
b8af22af15 Merge branch '10.2' into bb-10.2-ext 2018-02-22 19:29:52 +01:00
Sergei Golubchik
2daa005800 Merge branch '10.1' into 10.2 2018-02-22 08:39:24 +01:00
Daniel Black
4e6dab94d0 MDEV-10.1.31 does not join an existing cluster with SST xtrabackup-v2
Analysis:- The problem  is the change in the implementation of wait_for_listen
in wsrep_sst_xtrabackup-v2.sh. The new script uses lsof which will always
exit with an error code if it can't find all the items, and because the
script has the -e option set in the hashbang line (#!/bin/bash -ue), the
script will abort right after running lsof if lsof can't find even a single
item among all the items listed in its arguments. This will happen even if
socat is running and listening, because it can't find nc. The loop in
wait_for_listen will therefore always quit after one iteration without
writing the "ready" line to signal the parent.

Solution:- We will or the lsof with true.

Patch Credit :Daniel Black and David Wang
2018-02-21 19:48:18 +05:30
Marko Mäkelä
b006d2ead4 Merge bb-10.2-ext into 10.3 2018-02-15 10:22:03 +02:00
Sergei Golubchik
f7621f17bd rename mysql.user and mysql.db column
Truncate_versioning_priv->Delete_history_priv

because the command and the privilege were renamed
2018-02-12 23:43:48 +01:00
benrubson
1adc382c2f Use stunnel during rsync SST if available 2018-02-12 22:08:57 +01:00
Jerome Brauge
d943d7f712 MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
Standard compatible behavior for UPDATE: all assignments in SET
are executed "simultaneously", not left-to-right. And `SET a=b,b=a`
will swap the values.
2018-02-12 13:14:23 +01:00
Sergei Golubchik
355ee6877b MDEV-13946 Server RPMs have dependency on "which"
cleanup. use "command -v" instead of "which"
simplify some checks.
2018-02-12 12:46:34 +01:00
Alexander Barkov
3cad31f2a7 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2018-02-08 19:06:25 +04:00
Monty
6ba06cf763 On upgrade Truncate_versioning_privilege was not correct set
Fixed that Truncate_versioning_privilege works as any other privilege
during upgrade:

- If the privilege field does not exists, add it to the user and db tables.
  If the user had super_privilege then the user will also get the new
  Truncate_versioning_privilege.

This is done to ensure that if one has GRANT ALL PRIVILEGE before, one
will continue to have it after running mysql_upgrade.

This also fixes a bug where the Truncate_versioning_privilege
2018-02-07 02:39:40 +02:00
Sergei Golubchik
b4fbb4183b remove bash-ish from SST scripts
replace with awk (yuck!), avoiding gensub (which wasn't recognized)
2018-02-06 14:52:01 +01:00
Sergei Golubchik
4771ae4b22 Merge branch 'github/10.1' into 10.2 2018-02-06 14:50:50 +01:00
Daniel Black
a0a9958098
Merge branch '10.1' into 10.1-wsrep_sst_rsync_read_MYSQL_BASE_VERSION_config 2018-02-04 22:20:52 +11:00
Sergei Golubchik
c383418cbf Merge branch 'github/10.0-galera' into 10.1 2018-02-03 08:09:06 +01:00
Sergei Golubchik
d4df7bc9b1 Merge branch 'github/10.0' into 10.1 2018-02-02 10:09:44 +01:00
Jan Lindström
c7e5feb259 Merge tag 'mariadb-10.0.34' into 10.0-galera
Conflicts:
	storage/innobase/lock/lock0lock.cc
	storage/xtradb/lock/lock0lock.cc
	storage/xtradb/lock/lock0wait.cc
	support-files/mysql.server.sh
2018-02-01 14:09:48 +02:00
Michal Schorm
fb24eb87a8 MDEV-12301: galera_recovery use @sbindir@ macro for mysqld 2018-01-30 21:28:16 +01:00
Vicențiu Ciorbaru
d833bb65d5 Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
Jan Lindström
72542ffd77
Merge pull request #550 from grooverdan/10.1-wsrep_sst_mysqldump-no-max-version
MDEV-15045 - wsrep_sst_mysqldump: enforce a minimum version only
2018-01-24 10:31:00 +02:00
Daniel Black
9ee372736f mysql_install_db: correct hosting/source/maillist information 2018-01-23 15:03:30 +04:00
Daniel Black
c98906e4fe mysql_install_db: correct --skip-grant-tables help 2018-01-23 15:03:30 +04:00
Jan Lindström
ff979674e6 Merge tag 'mariadb-5.5.59' into 5.5-galera 2018-01-19 19:22:00 +02:00
Daniel Black
be83785d73 MDEV-13789: FreeBSD wsrep_sst_xtrabackup-v2 - find compatibilty +lsof
Based off #451 by angeloudy <angeloudy@yahoo.com> and
Tao Zhou <taozhou@ip-179.ish.com.au>
2018-01-18 22:06:17 +11:00
Daniel Black
c73b4b1698 wsrep_sst_mysqldump: enforce a minimum version only 2018-01-17 20:16:59 +11:00
Daniel Black
42ccfd8211 wsrep_sst_mysqldump: safer test of version != 5 2018-01-16 22:45:48 +11:00
Daniel Black
c4b7074e72 wsrep_sst_xtrabackup*: use mysqld defaults arguments
It was assumed in
https://bugs.launchpad.net/codership-mysql/+bug/1378355 that xtrabackup
didn't have the groups-defaults-suffix because it wasn't listed in the
help output.

Also --defaults-group was always just an additional group despite the
misleading description implying it was a replacement.

So actually we can use the default* mysqld arguements to xtrabackup as
the standard mysqld configuration parser was used.
2018-01-16 14:44:39 +11:00
Daniel Black
a2a038152e wsrep_sst_xtrabackup*: use wsrep_sst_common parsed vars 2018-01-14 23:31:14 +11:00
Daniel Black
51ea696c8e wsrep_sst_common: keep WSREP_SST_OPT_HOST_UNESCAPED for IPv4
change wsrep_sst_mysqldump.sh to use WSREP_SST_OPT_HOST_UNESCAPED
directly.
2018-01-14 23:31:14 +11:00
Daniel Black
722df90534 wsrep_sst_xtrabackup*: read all sections of config not nust mysqld
--mysqld parsed to parse_cnf aka my_print_defaults will parse all
sections which the server read and not just mysqld.
2018-01-14 23:31:13 +11:00
Daniel Black
cc8abb21e3 wsrep_sst_xtrabackup*: du -s removed lessens output
and only displays the summary. As this is the only bit
that is used there will be less du,kernel,awk CPU usage.
2018-01-14 23:31:13 +11:00
Daniel Black
e78e308e81 wsrep_sst_common: parse --address and split WSREP_SST_OPT_PATH
Use the string functionality of sh to split the address:

IPv6 test:
. scripts/wsrep_sst_common.sh --address [ipv6]:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2
$ set | grep WSREP_SST
WSREP_SST_OPT_ADDR='[ipv6]:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2'
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_CONF='  '
WSREP_SST_OPT_DATA=
WSREP_SST_OPT_DEFAULT=
WSREP_SST_OPT_EXTRA_DEFAULT=
WSREP_SST_OPT_HOST='[ipv6]'
WSREP_SST_OPT_HOST_UNESCAPED=ipv6
WSREP_SST_OPT_LSN=lsn_version
WSREP_SST_OPT_MODULE=module
WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
WSREP_SST_OPT_PORT=port
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=sst_ver
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_USER=

IPv4 test:
. scripts/wsrep_sst_common.sh --address ipv4:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2
$ set | grep WSREP_SST
WSREP_SST_OPT_ADDR=ipv4:port/module/lsn_version/sst_ver/some_future_option1/some_future_option2
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BYPASS=0
WSREP_SST_OPT_CONF='  '
WSREP_SST_OPT_DATA=
WSREP_SST_OPT_DEFAULT=
WSREP_SST_OPT_EXTRA_DEFAULT=
WSREP_SST_OPT_HOST=ipv4
WSREP_SST_OPT_LSN=lsn_version
WSREP_SST_OPT_MODULE=module
WSREP_SST_OPT_PATH=module/lsn_version/sst_ver/some_future_option1/some_future_option2
WSREP_SST_OPT_PORT=port
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=sst_ver
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_USER=
2018-01-14 23:31:13 +11:00
Daniel Black
95e5fe6732 wsrep_sst_common: parse_cnf - use awk rather than grep/cut/tail excessiveness
Test cases:

f($var) = awk -v var="${var}"  \
     'BEGIN { OFS=FS="="}
     { gsub(/_/,"-",$1); if ( $1=="--"var ) lastval=substr($0,length($1)+2) }
     END { print lastval }'

Missing input is blank:

$ echo '--var_aa=something' | f(var-b-not-ther)
(blank as expected)

All RHS of = is unmunged:

$ echo '--var_aa=password==_-$' | f(var-aa)
password==_-$

Mixed - and _ in var name:
$ echo '--var_aa-bb_cc=1' | f(var-aa-bb-cc)
1

No value returns blank line:
$ echo '--var_aa-bb_cc' | f(var-aa-bb-cc)
(blank line as expected)

Multiples return the last:
$  echo -e "--bb=cc\n--bb=dd" | f(bb)
dd
2018-01-14 23:31:01 +11:00
Sergei Golubchik
943c62a5d4 Backport 4bb49d84a9, correct handling on defaults[-extra]-file is SST scripts
(from 10.1 to 10.0-galera)

This conflicted signficantly with 7d550c76be
which added --defaults-group-suffix support.

Took the approach of 4bb49d84a9 and adapted the
--defaults-group-suffix handling to be consistent.

The following changes as follows:

SST scripts now use $MY_PRINT_DEFAULTS rather than the lowercase for
consistency and this include all required --default arguements.

Backport/merge by Daniel Black <daniel@linux.vnet.ibm.com>
2018-01-14 22:48:02 +11:00
Daniel Black
67f3fb1bc5 galera_recovery: misses reading default configuration groups 2018-01-13 22:29:10 +11:00
Daniel Black
7dc5183317 wsrep_sst_rsync: read correct configuration sections
4bb49d84a9 had a single option, --mysqld to obtain
the required innodb_log_group_home_dir.

83664e21e4 enumberated the groups when --mysqld
was sufficient.
2018-01-13 22:29:09 +11:00
Sergey Vojtovich
b75d767689 Fixed mysql_install_db --no-defaults
Regression after 5ea2801.
2018-01-13 13:05:09 +04:00
Daniel Black
5ea28015d5 mysql_install_db: Use --defaults-group-suffix if specified
Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
2018-01-12 12:09:06 +04:00
Aleksey Midenkov
c59c1a0736 System Versioning 1.0 pre8
Merge branch '10.3' into trunk
2018-01-10 12:36:55 +03:00
Marko Mäkelä
145ae15a33 Merge bb-10.2-ext into 10.3 2018-01-04 09:22:59 +02:00
Monty
fbab79c9b8 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts:
	cmake/make_dist.cmake.in
	mysql-test/r/func_json.result
	mysql-test/r/ps.result
	mysql-test/t/func_json.test
	mysql-test/t/ps.test
	sql/item_cmpfunc.h
2018-01-01 19:39:59 +02:00
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
Aleksey Midenkov
d5e37621cf Scripts: VTMD_TEMPLATE removed [#286] 2017-12-17 12:32:33 +03:00
Aleksey Midenkov
4624e565f3 System Versioning 1.0 pre6
Merge remote-tracking branch 'mariadb/bb-10.3-temporal-serg' into trunk
2017-12-15 18:12:18 +03:00
Eugene Kosov
765569602d System Versioning 1.0 pre4
Merge branch '10.3' into trunk
2017-12-14 17:52:08 +03:00
Sergei Golubchik
f149013393 rename versioning_* variables 2017-12-14 11:31:44 +01:00
Varun Gupta
62eaf7b657 MDEV-14573: Upgrade from previous versions is broken for procedures 2017-12-12 12:09:52 +05:30
Aleksey Midenkov
79dd77e6ae System Versioning 1.0 pre3
Merge branch '10.3' into trunk
2017-12-11 15:43:41 +03:00
Sergei Golubchik
f4270fc544 s/Delete_versioning_rows_priv/Truncate_versioning_priv/
because the statement is TRUNCATE, not DELETE
2017-12-08 16:26:16 +03:00
Varun Gupta
60c446584c MDEV-7773: Aggregate stored functions
This commit implements aggregate stored functions. The basic idea behind
the feature is:

* Implement a special instruction FETCH GROUP NEXT ROW that will pause
the execution of the stored function. When the instruction is reached,
execution of the initial query resumes "as if" the function returned.
This gives the server the opportunity to advance to the next row in the
result set.

* Stored aggregates behave like regular aggregate functions. The
implementation of thus resides in the class Item_sum_sp. Because it is
an aggregate function, for each new row in the group, the
Item_sum_sp::add() method will be called. This is when execution resumes
and the function does another iteration to "add" one extra element to
the final result.

* When the end of group is reached, val_xxx() method will be called for
the item. This case is handled by another execute step for the stored
function, only with a special flag to force a call to the return
handler. See Item_sum_sp::execute() for details.

To allow this pause and resume semantic, we must preserve the function
context across executions. This is stored in Item_sp::sp_query_arena only for
aggregate stored functions, but has no impact for regular functions.

We also enforce aggregate functions to include the "FETCH GROUP NEXT ROW"
instruction.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2017-12-04 13:22:29 +02:00
Monty
c24d1d665c Improve error messages
- mysql_install_db now prints position to error file, if log-error is used
- Warning about compatibility now mentions MySQL 5.6 and 5.7
- Give warning if --show_compatibility_56 is used
2017-12-02 12:04:54 +02:00
Marko Mäkelä
7cb3520c06 Merge bb-10.2-ext into 10.3 2017-11-30 08:16:37 +02:00
Alexander Barkov
5b697c5a23 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-11-29 12:06:48 +04: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
Aleksey Midenkov
33085349e9 IB, SQL: removed VTQ, added TRT on SQL layer [closes #305] 2017-11-15 00:22:10 +03:00
Aleksey Midenkov
a80c71dfbb Scripts: bootstrap fix [#307] 2017-11-13 19:11:04 +03:00
Aleksey Midenkov
497c6add88 System Versioning pre1.0
Merge branch '10.3' into trunk
2017-11-13 19:09:46 +03: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
Aleksey Midenkov
d8d7251019 System Versioning pre0.12
Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
2017-11-07 00:37:49 +03:00
Sachin Setiya
3cecb1bab3 Merge tag 'mariadb-10.0.33' into bb-10.0-galera 2017-11-03 12:34:05 +05:30
Marko Mäkelä
5603a5842b Merge bb-10.2-ext into 10.3 2017-11-02 12:08:37 +02:00
Marko Mäkelä
2ec7b87053 Merge 10.2 into bb-10.2-ext 2017-11-01 14:37:31 +02:00
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
Alexander Barkov
835cbbcc7b Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
TODO: enable MDEV-13049 optimization for 10.3
2017-10-30 20:47:39 +04:00
Alexander Barkov
003cb2f424 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-10-30 16:42:46 +04: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
halfspawn
75aabd03d5 MDEV-14013 : sql_mode=EMPTY_STRING_IS_NULL 2017-10-14 17:28:54 +04:00
Andrii Nikitin
494d1bf885 MDEV-14010 merge issue in wsrep_sst_xtrabackup-v2 2017-10-09 10:22:47 +02:00
Sergei Golubchik
a1a4e8eec1 Merge branch 'bb-10.2-ext' into 10.3 2017-10-05 11:48:28 +02:00
Sergei Golubchik
3e39771551 Merge branch '10.2' into bb-10.2-ext 2017-10-04 19:50:04 +02:00
Sergei Golubchik
08c493c62a Merge branch '10.1' into 10.2 2017-10-04 18:36:58 +02:00
Marko Mäkelä
2c1067166d Merge bb-10.2-ext into 10.3 2017-10-04 08:24:06 +03:00
Marko Mäkelä
1641879387 Merge 10.2 into bb-10.2-ext 2017-10-03 17:02:18 +03: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
Alexander Barkov
8ae8cd6348 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-10-02 22:35:13 +04: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
Marko Mäkelä
4a32e2395e Merge bb-10.2-ext into 10.3 2017-09-25 22:05:56 +03:00
Sergei Golubchik
1320ad5b92 Merge branch '10.2' into bb-10.2-ext 2017-09-23 20:22:30 +02: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
Marko Mäkelä
e3d44f5d62 Merge bb-10.2-ext into 10.3 2017-09-21 08:12:19 +03:00
Marko Mäkelä
fc3b1a7d2f Merge 10.2 into bb-10.2-ext 2017-09-20 17:47:49 +03:00
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
Eugene Kosov
a49239b57a SQL: truncate syntax and privilege [closes #229] 2017-09-08 10:22:24 +03:00
Marko Mäkelä
ae02407ce3 Merge bb-10.2-ext into 10.3 2017-09-07 12:30:56 +03:00
Marko Mäkelä
a82ed92a6a Merge 10.2 into bb-10.2-ext 2017-09-07 12:23:58 +03: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
Eugene Kosov
c2a70c8050 SQL, IB: option to drop historical rows on ALTER [closes #249] 2017-09-01 12:41:46 +03:00
Marko Mäkelä
4e1fa7f63d Merge bb-10.2-ext into 10.3 2017-09-01 11:33:45 +03:00
Marko Mäkelä
6749d39a95 Merge 10.2 into bb-10.2-ext 2017-09-01 08:47:55 +03: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
Sergei Golubchik
bb8e99fdc3 Merge branch 'bb-10.2-ext' into 10.3 2017-08-26 00:34:43 +02:00
Sergei Golubchik
27412877db Merge branch '10.2' into bb-10.2-ext 2017-08-25 10:25:48 +02: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
Alexander Barkov
6db1b0188c Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3 2017-08-15 07:52:48 +04: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
Alexey Botchkov
1a9e13d622 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts:
	sql/item_cmpfunc.cc
	storage/innobase/buf/buf0flu.cc
	storage/innobase/include/ut0stage.h
	storage/innobase/row/row0upd.cc
2017-08-11 10:58:23 +04: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ä
57fea53615 Merge bb-10.2-ext into 10.3 2017-07-07 12:39:43 +03:00
Alexander Barkov
8b2c7c9444 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-07-07 12:43:10 +04: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
Kristian Nielsen
1d91910b94 MDEV-12179: Per-engine mysql.gtid_slave_pos table
Merge into MariaDB 10.3.
2017-07-03 09:33:41 +02: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
Aleksey Midenkov
448374a228 SQL, IB: (0.10) VTMD tracking [closes #124]
IB: Fixes in logic when to do versioned or usual row updates. Now it is
able to do unversioned updates for versioned tables just by disabling
`TABLE_SHARE::versioned` flag.

SQL: DDL tracking for:
* RENAME TABLE, ALTER TABLE .. RENAME TO;
* DROP TABLE;
* data-modifying operations (f.ex. ALTER TABLE .. ADD/DROP COLUMN).
2017-06-19 15:21:39 +03:00
Alexander Barkov
765347384a Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-06-15 15:27:11 +04:00
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
Alexander Barkov
9bc3225642 Merge tag 'mariadb-10.2.6' into bb-10.2-ext 2017-05-26 19:32:28 +04:00
Aleksey Midenkov
1c8a2de73e Scripts: VTMD schema fix 2017-05-25 15:26:05 +03:00
kevg
45f6acd296 Scripts: VTMD table [closes #122] 2017-05-24 18:46:56 +03:00
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
Alexander Barkov
ac53b49b1b Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-05-05 16:12:54 +04: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
Kristian Nielsen
fdf2d40770 MDEV-12179: Per-engine mysql.gtid_slave_pos table
Intermediate commit.

Implement auto-creation of mysql.gtid_slave_pos* tables with needed engines,
if listed in --gtid-pos-auto-engines.

Uses an asynchronous approach to minimise locking overhead.

The list of available tables is extended with a flag. Extra entries are
added for --gtid-pos-auto-engines tables that do not exist yet, marked as
not existing but ready for auto-creation.

If record_gtid() needs a table marked for auto-creation, it sends a request
to the slave background thread to create the table, and continues to use an
existing table for the current and immediately coming transactions.

As soon as the slave background thread has made the new table available, it
will be used for all subsequent relevant transactions in record_gtid().

This asynchronous approach also avoids a lot of complex issues around trying
to do DDL in the middle of an on-going transaction.
2017-04-21 10:30:16 +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