Commit graph

4536 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
ecd8f44844 Extra comment to mysql_install_db
Explain why it makes sense to not consider builddir == srcdir directly,
for cases when we do out-of-source builds.
2019-07-01 13:55:34 +03:00
Daniel Black
d890c45b62 mysql_install_db: assume builddir is dirname0
The assumption in the original commit for --builddir (648d3cedbc),
was to assume that without a --builddir, and when --srcdir
is specified, that the builddir is the same as the srcdir.

The problem is that this assumption does not hold for out-of-source
builds and we can figure out the builddir by looking for where
mysql_install_db script is.

As mysql_install_db is in the builddir, we use dirname0 as the builddir after
checking that my_print_defaults is also located from dirname0, otherwise
default to old behavior.
2019-07-01 13:52:28 +03:00
Vladislav Vaintroub
9e0ed0fabd MDEV-19860 - do not produce huge strings wtih comp_sql anymore.
Limit lines to ~16K
2019-06-25 23:53:42 +02:00
Ian Gilfillan
65368255ff MDEV-6521: Update server HELP contents 2019-06-25 12:33:56 +03:00
Rasmus Johansson
24503d5711 MDEV-17592 Create MariaDB named commands/symlinks 2019-06-17 12:26:26 +02:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Anel Husakovic
366bf10475 Fix echo message 2019-05-16 12:55:29 +03:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Oleksandr Byelkin
c51f85f882 Merge branch '10.2' into 10.3 2019-05-12 17:20:23 +02:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Vladislav Vaintroub
a3a48d4561 MDEV-19403 Remove mysql_secure_installation.pl 2019-05-07 18:14:14 +00:00
Oleksandr Byelkin
8cbb14ef5d Merge branch '10.1' into 10.2 2019-05-04 17:04:55 +02:00
Sergei Golubchik
3db6de33b2 MDEV-17640 UMASK_DIR configuration for mysql_install_db is not applied to mysql database
create mysql and test databases with SQL, not mkdir.
2019-04-24 16:06:54 +02:00
Sergei Golubchik
2a6f00ed6a use the correct SQL SECURITY type for OpenGIS stored procedures 2019-04-24 16:06:54 +02:00
Sergei Golubchik
23a7693a68 MDEV-18275 Live upgrade from 5.5 does not work: InnoDB stat tables are used before creation
let mysql_upgrade to work even when innodb_index_stats or
innodb_table_stats are missing.

(mysql_upgrade knows to ignore "unknown table" errors)
2019-03-20 19:18:21 +01:00
Marko Mäkelä
514b305dfb Merge 10.3 into 10.4
The MDEV-17262 commit 26432e49d3
was skipped. In Galera 4, the implementation would seem to require
changes to the streaming replication.

In the tests archive.rnd_pos main.profiling, disable_ps_protocol
for SHOW STATUS and SHOW PROFILE commands until MDEV-18974
has been fixed.
2019-03-20 10:41:32 +02:00
Sergei Golubchik
b64fde8f38 Merge branch '10.2' into 10.3 2019-03-17 13:06:41 +01:00
Sergei Golubchik
0508d327ae Merge branch '10.1' into 10.2 2019-03-15 21:00:41 +01:00
Ian Gilfillan
7ad355dde7 MDEV-18934: Document missing mysqldumpslow sort options 2019-03-15 13:58:39 +04:00
Marko Mäkelä
58f3ff7175 Merge 10.3 into 10.4 2019-03-11 18:27:58 +02:00
Marko Mäkelä
814205f306 Merge 10.2 into 10.3 2019-03-11 17:49:36 +02:00
Marko Mäkelä
3ea49d35bd Merge 10.1 into 10.2 2019-03-11 11:45:33 +02:00
Jan Lindström
9fb84a166a remove WSREP_SST_OPT_SUFFIX_VALUE, checking [mysqld] is covered in the parse_cnf --mysqld case also in wsrep_sst_xtrabackup-v2 2019-03-09 08:41:35 +02:00
Daniel Black
85a18526bc wsrep_sst: remove WSREP_SST_OPT_SUFFIX_VALUE, checking [mysqld] is covered in the parse_cnf --mysqld case 2019-03-09 08:41:35 +02:00
Jan Lindström
0957d25781 MDEV-18830: Port SST fixes from 10.4 to 10.1
modified:   mysql-test/suite/galera/disabled.def
modified:   mysql-test/suite/galera/r/galera_many_rows.result
modified:   mysql-test/suite/galera/t/galera_kill_nochanges.test
new file:   mysql-test/suite/galera/t/galera_many_rows.cnf
modified:   mysql-test/suite/galera/t/galera_many_rows.test
modified:   mysql-test/suite/galera/t/galera_var_dirty_reads.test
modified:   scripts/wsrep_sst_mariabackup.sh
2019-03-09 08:41:35 +02:00
Sergei Golubchik
33b9f80595 mysql_install_db: make sure the variable's value is visible
move the assignment out of a function, so that it wouldn't
happen in a subshell
2019-02-21 16:54:31 +01:00
Sergei Golubchik
65ffea3924 MDEV-18297 clarify mysql_install_db help text 2019-02-21 15:04:03 +01:00
Robert Bindar
90ad4dbd17 MDEV-7597 Expiration of user passwords
This patch adds support for expiring user passwords.
The following statements are extended:
  CREATE USER user@localhost PASSWORD EXPIRE [option]
  ALTER USER user@localhost PASSWORD EXPIRE [option]
If no option is specified, the password is expired with immediate
effect. If option is DEFAULT, global policy applies according to
the default_password_lifetime system var (if 0, password never
expires, if N, password expires every N days). If option is NEVER,
the password never expires and if option is INTERVAL N DAY, the
password expires every N days.
The feature also supports the disconnect_on_expired_password system
var and the --connect-expired-password client option.

Closes #1166
2019-02-21 15:04:03 +01:00
Sergei Golubchik
83de75d66d try harder to link unix_socket plugin statically
fix unix_socket tests to work if unix_socket is a built-in
2019-02-21 15:04:03 +01:00
Oleksandr Byelkin
93ac7ae70f Merge branch '10.3' into 10.4 2019-02-21 14:40:52 +01:00
Oleksandr Byelkin
00906719fe Merge branch '10.2' into bb-10.3-merge 2019-02-19 17:26:44 +01:00
Oleksandr Byelkin
91d506cf2d Merge branch '10.1' into 10.2 2019-02-19 16:47:45 +01:00
Oleksandr Byelkin
431da59f1c 1. centos has symlinks /bin->usr/bin and /sbin -> usr/sbin,
but even if this script called as /bin/mysql_install_db
it is still standard install and scripts are in /usr/share/
(but not in the /share/)
2. fix of bindir path
2019-02-19 16:09:46 +01:00
Robert Bindar
6c8ce999f8 MDEV-13095 Implement User Account locking
Add server support for user account locking.
This patch extends the ALTER/CREATE USER statements for
denying a user's subsequent login attempts:
  ALTER USER
    user [, user2] ACCOUNT [LOCK | UNLOCK]
  CREATE USER
    user [, user2] ACCOUNT [LOCK | UNLOCK]
The SHOW CREATE USER statement was updated to display the
locking state of an user.

Closes #1006
2019-02-14 17:30:22 +01:00
Sergei Golubchik
d89cdfc229 bugfix: mysql_fix_privilege_tables table_schema=database()
fix mysql_fix_privilege_tables to look for the `user` table in the
correct schema when deciding whether to convert it to `global_priv` table

make related tests a bit more verbose
2019-02-14 17:30:22 +01:00
Sergei Golubchik
ffa4677c09 MDEV-12834 mysql_secure_installation should ask about unix_socket authentication
Optionally, restore the default root authentication, that is
mysql_native_password USING 'invalid' OR unix_socket
2019-02-12 19:14:37 +01:00
Sergei Golubchik
4e4df7b46d MDEV-12834 mysql_secure_installation should ask about unix_socket authentication
recognize new unix_socket protected accounts, and don't
scare the user into setting the password for them
2019-02-12 19:14:37 +01:00
Sergei Golubchik
b9f3f06857 MDEV-12484 Enable unix socket authentication by default
Change the default authentication for root@localhost to

  IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket

which provides secure passwordless login, while still allowing
SET PASSWORD to work as expected.

Also create a second all-privilege account for the user that owns
datadir (and thus has full access to the data anyway).

Compile unix_socket plugin statically into the server.
2019-02-12 19:14:37 +01:00
Sergei Golubchik
f07b76fcfd cleanup: remove reduntant variable 2019-02-12 19:14:37 +01:00
Julius Goryavsky
5b82751111 MDEV-18426: Most of the mtr tests in the galera_3nodes suite fail
Most of the mtr tests in the galera_3nodes suite fail
for a variety of reasons with a variety of errors.

This patch fixes several substantial flaws
in the galera_3nodes suite tests and in the mtr framework
service files, adapting the tests from galera_3nodes
for the current version of MariaDB.

This patch also synchronizes some galera_3nodes-related
files with the latest changes made for MDEV-17835 (v2 patch)
and for MDEV-18379 in other branches (10.2 and 10.3).

Closes #1161
2019-02-12 09:38:13 +02:00
mkaruza
accc7f6029 MDEV-18178 Galera test failure on galera_sst_rsync2
* Donor node will now provide binlog-index argument to wsrep_sst_rsync script if binlog is used.
* Write correct path and binlog file names into joiner binlog-index file
2019-02-08 11:18:18 +01:00
mkaruza
26dcf102e3 Extend mariabackup archive timestamp in SST script
During parallel execution mariabackup script can fail when trying to create archive because of non unique name.  Extending archive timestamp with nanosecond.
2019-02-08 11:15:15 +01:00
Oleksandr Byelkin
65c5ef9b49 dirty merge 2019-02-07 13:59:31 +01:00
Sergei Golubchik
9c9b4590b6 Fix the bug introduced in MDEV-17658
if auth_root_socket is set, root user should be using unix_socket

Followup for 4abb8216a0
2019-02-04 15:54:10 +01:00
Sergei Golubchik
3ab445819e MDEV-18119 upgrading from 10.3 to 10.4 can result in the password for a user to be wiped ou 2019-02-04 15:54:10 +01:00
Marko Mäkelä
a249e57b68 Merge 10.1 into 10.2
Temporarily disable a test for
commit 2175bfce3e
because fixing it in 10.2 requires updating libmariadb.
2019-02-03 17:22:05 +02:00
Marko Mäkelä
213ece2f2e Merge 10.1 into 10.1
This is joint work with Oleksandr Byelkin.
2019-02-02 13:00:15 +02:00
Julius Goryavsky
dfc9bff5a9 MDEV-18379: IPv6 compatibility changes/Unification of check for IPv6
This patch contains the port of the MDEV-18379 patch
for 10.2 branch, but also includes a number of changes
made within MDEV-17835, which are necessary for the
normal operation of tests that use IPv6:

1) Currently, the three-node mtr suite for Galera (galera_3nodes)
uses a separate IPv6 availability check using the "have_ipv6.inc"
file. This check duplicates a more accurate check at suite.pm
level, which can be used by including the file "check_ipv6.inc".
This patch removes this discrepancy between suites.

2) Fixed numerous bugs in the SST scripts and in the mtr test
files (galera_3nodes mtr suite) that prevented the use of Galera
with IPv6 addresses.

3) Fixed flaws in the galera_3nodes mtr suite control scripts,
because of which they could not work with mariabackup.

4) Fixed flaws in the rsync and mysqldump tests (for galera_3nodes
mtr tests suite). These tests were not performed successfully
without these fixes.

5) GAL-501 test in the galera_3nodes suite does not contain the
option "--bind-address=::" that is needed for the test to work
correctly with IPv6 (at least on some systems), since without
it the server will not wait for connections on the IPv6
interface.

https://jira.mariadb.org/browse/MDEV-18379
and partially https://jira.mariadb.org/browse/MDEV-17835
2019-02-02 11:40:32 +02:00
Marko Mäkelä
081fd8bfa2 Merge 10.1 into 10.2 2019-02-02 11:40:02 +02:00
Oleksandr Byelkin
a3df9bcadc Merge branch '5.5' into 10.0 2019-01-28 10:36:12 +01:00
Julius Goryavsky
4aea6b3e3f MDEV-18379: Unification of check for IPv6
This patch contains the port of the MDEV-18379 patch
for 10.1 branch, but also includes a number of changes
made within MDEV-17835, which are necessary for the
normal operation of tests that use IPv6:

1) Fixed flaws in the galera_3nodes mtr suite control scripts,
because of which they could not work with mariabackup.

2) Fixed numerous bugs in the SST scripts and in the mtr test
files (galera_3nodes mtr suite) that prevented the use of Galera
with IPv6 addresses.

3) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes
mtr tests suite). These tests were not performed successfully
without these fixes.

4) Currently, the three-node mtr suite for Galera (galera_3nodes)
uses a separate IPv6 availability check using the "have_ipv6.inc"
file. This check duplicates a more accurate check at suite.pm
level, which can be used by including the file "check_ipv6.inc".
This patch removes this discrepancy between suites.

5) GAL-501 test in the galera_3nodes suite does not contain the
option "--bind-address=::" which is needed for the test to work
correctly with IPv6 (at least on some systems), since without
it the server will not wait for connections on the IPv6 interface.

https://jira.mariadb.org/browse/MDEV-18379
and partially https://jira.mariadb.org/browse/MDEV-17835
2019-01-26 01:15:44 +01:00
Marko Mäkelä
a3a89470fd Merge 10.3 into 10.4 2019-01-25 08:08:32 +02:00
Geoff Montee
f4ca2445c3 MDEV-18372: Minor MDEV-17973-related merge issue to 10.3 2019-01-24 17:18:26 -05:00
Marko Mäkelä
78829a5780 Merge 10.3 into 10.4 2019-01-24 22:42:35 +02:00
Marko Mäkelä
947b6b849d Merge 10.2 into 10.3 2019-01-24 16:14:12 +02:00
Marko Mäkelä
9a7281a703 Merge 10.1 into 10.2 2019-01-23 15:09:06 +02:00
Brave Galera Crew
36a2a185fe Galera4 2019-01-23 15:30:00 +04:00
Jan Lindström
55be043c13
Merge pull request #1120 from tempesta-tech/sysprg/MDEV-17835v2
MDEV-17835: Remove wsrep-sst-method=xtrabackup
2019-01-23 12:07:36 +02:00
Julius Goryavsky
0e89e90f42 MDEV-17835: Remove wsrep-sst-method=xtrabackup
The second line of changes related to replacing xtrabackup with
mariabackup:

1) All unnecessary references to xtrabackup are removed from
the documentation, from some comments, from the control files
that are used to prepare the packages.

2) Made corrections of the tests from the galera_3nodes suite
that mentioned xtrabackup or the old (associated with xtrabackup)
version of innobackupex.

3) Fixed flaws in the galera_3nodes mtr suite control scripts,
because of which they could not work with mariabackup.

4) Fixed numerous bugs in the SST scripts and in the mtr test
files (galera_3nodes mtr suite) that prevented the use of Galera
with IPv6 addresses.

5) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes
mtr tests suite). These tests were not performed successfully without
these fixes.

https://jira.mariadb.org/browse/MDEV-17835
2019-01-22 13:28:03 +01:00
Sergei Golubchik
9c5be7d131 MDEV-14580: mysql_install_db elements based on dirname of mysql_install_db
Avoid introducing new dependencies or new syntax.
That is, don't use $(...) and don't assume dirname is present.

And remove unsighty /foo/bar/../xyz from the path. Use dirname
instead of ../
2019-01-21 17:30:07 +01:00
Daniel Black
50e593386f MDEV-14580: mysql_install_db elements based on dirname of mysql_install_db
Closes #1086
2019-01-21 17:30:07 +01:00
Geoff Montee
2084cd5422 MDEV-17973: Don't overwrite xtrabackup-v2/mariabackup SST logs by default 2019-01-21 05:42:00 -05:00
Alexander Kuleshov
78f62e9079 remove duplicated paragraph from mysql_install_db.sh
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
2019-01-16 23:55:59 +04:00
Marko Mäkelä
e2b585c1c5 Merge 10.3 into 10.4 2019-01-08 18:22:43 +02:00
Marko Mäkelä
38f1c9df32 Merge 10.2 into 10.3 2019-01-08 17:37:44 +02:00
Marko Mäkelä
734510a44d Merge 10.3 into 10.4 2019-01-06 17:43:02 +02:00
Jan Lindström
3d8011b375
Merge pull request #929 from angeloudy/fix-broken-thing
Make mariabackup.sh compatible on FreeBSD
2019-01-04 14:47:56 +02:00
Tao ZHOU
cb85803c45
Use absolute path for mariabackup binary 2019-01-02 15:40:55 +11:00
Jan Lindström
b26736cdb1
Merge pull request #1029 from tempesta-tech/sysprg/MDEV-17835
DEV-17835: Remove wsrep-sst-method=xtrabackup
2018-12-18 14:05:23 +02:00
Marko Mäkelä
b5763ecd01 Merge 10.3 into 10.4 2018-12-18 11:33:53 +02:00
Jan Lindström
36b7f8f4b0
Merge pull request #1030 from tempesta-tech/sysprg/MDEV-17848
MDEV-17848: Galera test failure on galera_sst_xtrabackup-v2[_data_dir]
2018-12-17 18:37:56 +02:00
Julius Goryavsky
cadb6ac770 DEV-17835: Remove wsrep-sst-method=xtrabackup
The use of the xtrabackup and xtrabackup-v2 methods for SST
has been declared obsolete since version 10.2, now it cannot
be used because of the different redo log format. Accordingly,
we need to remove the xtrabackup-related scripts and dynamically
replace the call to xtrabackup[-v2] to the mariabackup (with a
corresponding warning in the log) when the server performs SST.

https://jira.mariadb.org/browse/MDEV-17835
2018-12-17 11:14:54 +01:00
Marko Mäkelä
6dbc50a376 Merge 10.3 into 10.4 2018-12-13 22:05:34 +02:00
Marko Mäkelä
f6e16bdc62 Merge 10.2 into 10.3 2018-12-13 21:58:35 +02:00
Marko Mäkelä
2e5aea4bab Merge 10.1 into 10.2 2018-12-13 15:47:38 +02:00
Marko Mäkelä
621041b676 Merge 10.0 into 10.1
Also, apply the MDEV-17957 changes to encrypted page checksums,
and remove error message output from the checksum function,
because these messages would be useless noise when mariabackup
is retrying reads of corrupted-looking pages, and not that
useful during normal server operation either.

The error messages in fil_space_verify_crypt_checksum()
should be refactored separately.
2018-12-13 13:37:21 +02:00
Sergei Golubchik
b58f28725b Merge branch '5.5' into 10.0 2018-12-12 20:19:06 +01:00
Julius Goryavsky
d48ac8b414 MDEV-17848: Galera test failure on galera_sst_xtrabackup-v2[_data_dir]
The mariabackup SST script was incorrectly processes
innodb_data_home_dir parameter if it is specified in
the configuration file for one of the cluster nodes.
Therefore, a corresponding revision of the mariabackup
SST script was made, which provides reading of the
corresponding parameter from the configuration file
or from the command line.

https://jira.mariadb.org/browse/MDEV-17848
2018-12-12 13:44:58 +01:00
Sergei Golubchik
4abb8216a0 MDEV-17658 change the structure of mysql.user table
Implement User_table_json.
Fix scripts to use mysql.global_priv.
Fix tests.
2018-12-12 00:31:44 +01:00
Tao ZHOU
216d5f7899
use ps -p instead of ps --pid
make it compatible on FreeBSD.
If the parent process does not exist, there's no need to kill it.
2018-11-29 12:36:57 +11:00
Alexander Barkov
4447a02cf1 MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP 2018-11-26 08:10:47 +04:00
Marko Mäkelä
dde2ca4aa1 Merge 10.3 into 10.4 2018-11-19 20:22:33 +02:00
fran
c362ea3ffd Added Master_Host to the Replication information
Closes #3
2018-11-16 13:26:21 +01:00
angeloudy
0e794c6a69 Make mariabackup.sh compatible on FreeBSD 2018-11-15 13:51:09 +11:00
Jan Lindström
781f1a765b MDEV-17379: galera_new_cluster throws error in 10.3.10
Use exit instead of return.
2018-11-09 08:41:05 +02:00
Marko Mäkelä
074c684099 Merge 10.3 into 10.4 2018-11-06 16:24:16 +02:00
Marko Mäkelä
df563e0c03 Merge 10.2 into 10.3
main.derived_cond_pushdown: Move all 10.3 tests to the end,
trim trailing white space, and add an "End of 10.3 tests" marker.
Add --sorted_result to tests where the ordering is not deterministic.

main.win_percentile: Add --sorted_result to tests where the
ordering is no longer deterministic.
2018-11-06 09:40:39 +02:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Sergei Golubchik
44f6f44593 Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
Sergei Golubchik
37ab7e4596 Merge branch '5.5' into 10.0 2018-10-27 20:46:38 +02:00
Sergei Golubchik
d851dd619f MDEV-13912 mysql_upgrade: case (in)sensitivity for stored procedures
mysql_upgrade used to convert all columns of mysql.db to
utf8_general_ci and then back to utf8_bin. In two separate ALTER's.

This failed if UNIQUE indexes in mysql.db contained entries
that differ only in the letter case.
2018-10-19 20:18:41 +02:00
Marko Mäkelä
444c380ceb Merge 10.3 into 10.4 2018-10-05 08:09:49 +03:00
Sergei Golubchik
57e0da50bb Merge branch '10.2' into 10.3 2018-09-28 16:37:06 +02:00
Sergei Golubchik
5ae8fce50b Merge branch '10.1' into 10.2 2018-09-24 11:46:08 +02:00
Marko Mäkelä
171fbbb968 Merge 10.3 into 10.4 2018-09-14 15:23:34 +03:00
Oleksandr Byelkin
28f08d3753 Merge branch '10.1' into 10.2 2018-09-14 08:47:22 +02:00
Daniel Black
b96d36344e MDEV-17173: correct parsing of 12.13.14.15:4444/xtrabackup_sst leaving LSN/SST_VER blank
Correcting commit e78e308e81
$ . scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst ; set | grep WSREP_SST
WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst
WSREP_SST_OPT_ADDR_PORT=4444
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BINLOG_INDEX=
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=12.13.14.15
WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15
WSREP_SST_OPT_LSN=
WSREP_SST_OPT_MODULE=xtrabackup_sst
WSREP_SST_OPT_PATH=xtrabackup_sst
WSREP_SST_OPT_PORT=4444
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_SUFFIX_VALUE=
WSREP_SST_OPT_USER=

. scripts/wsrep_sst_common.sh --address 12.13.14.15:4444/xtrabackup_sst/1234/5676 ; set | grep WSREP_SST
WSREP_SST_OPT_ADDR=12.13.14.15:4444/xtrabackup_sst/1234/5676
WSREP_SST_OPT_ADDR_PORT=4444
WSREP_SST_OPT_AUTH=
WSREP_SST_OPT_BINLOG=
WSREP_SST_OPT_BINLOG_INDEX=
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=12.13.14.15
WSREP_SST_OPT_HOST_UNESCAPED=12.13.14.15
WSREP_SST_OPT_LSN=1234
WSREP_SST_OPT_MODULE=xtrabackup_sst
WSREP_SST_OPT_PATH=xtrabackup_sst/1234/5676
WSREP_SST_OPT_PORT=4444
WSREP_SST_OPT_PSWD=
WSREP_SST_OPT_SST_VER=5676
WSREP_SST_OPT_SUFFIX_DEFAULT=
WSREP_SST_OPT_SUFFIX_VALUE=
WSREP_SST_OPT_USER=
2018-09-13 10:00:51 +10:00
Marko Mäkelä
1bf3e8ab43 Merge 10.3 into 10.4 2018-09-11 21:31:03 +03:00
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