Commit graph

1702 commits

Author SHA1 Message Date
Oleksandr Byelkin
65e8506ca9 Merge branch '10.3' into bb-10.4-release 2022-08-10 12:21:08 +02:00
fluesvamp
f2830af16c Fix typos in the codebase. 2022-08-09 18:41:09 +03:00
Oleksandr Byelkin
e509065247 Merge branch '10.3' into 10.4 2022-08-03 19:51:44 +02:00
Daniel Black
92b0a367aa MDEV-26447: mysqldump to use temporary view instead of tables.
This is particularly important for Azure where there is no
MyISAM support in their MariaDB cloud product.

Like mysqldumper does, a view can satisfy the requirement
like a table, without constraints. The views in frm files are
text form and don't have column limits.

Thanks Thomas Casteleyn for the suggestion.
2022-08-03 02:51:11 +10:00
Mike Griffin
53c4e4d054 MDEV-18702 mysqldump: add variable 'max-statement-time'
With a global non-default max-statement-time of a time interval that exceed
the query time mysqldump queries when doing a backup.

To solve both, add a max-statement-time option, defaulting to 0 (unlimited time).

Also like mariabackup, set the session wait_timeout=DEFAULT (28800). The
time/processing between mysqldump times isn't expected to get that
close ever, but let's adopt the standard of mariabackup as no-one has
challenged it has having a detrimental effect.

Reviewer and test case author Daniel Black
2022-08-02 20:31:08 +10:00
Sergei Golubchik
a70a1cf3f4 Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
Daniel Black
221ced92aa MDEV-4875 Can't restore a mysqldump if --add-drop-database meets general_log
or slow query log when the log_output=TABLE.

When this happens, we temporary disable by changing log_output until
we've created the general_log and slow_log tables again.

Move </database> in xml mode until after the transaction_registry.

General_log and slow_log tables where moved to be first to be dumped so
that the disabling of the general/slow queries is minimal.
2022-05-06 22:50:01 +10:00
Hartmut Holzgraefe
9fe3bc2aa8 MDEV-27816 Set sql_mode before DROP IF EXISTS already
Previously the correct SQL mode for a stored routine or
package was only set before doing the CREATE part, this
worked out for PROCEDUREs and FUNCTIONs, but with ORACLE
mode specific PACKAGEs the DROP also only works in ORACLE
mode.

Moving the setting of the sql_mode a few lines up to happen
right before the DROP statement is writen fixes this.
2022-05-06 22:50:01 +10:00
Sergei Golubchik
00a313ecf3 Merge branch 'bb-10.3-release' into bb-10.4-release
Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution"
was null-merged. 10.4 version of the fix is coming up separately
2021-02-12 17:44:22 +01:00
Sergei Golubchik
60ea09eae6 Merge branch '10.2' into 10.3 2021-02-01 13:49:33 +01:00
Rucha Deodhar
cbc75e9948 MDEV-20939: Race condition between mysqldump import and InnoDB persistent
statistics calculation

 Analysis: When --replace or --insert-ignore is not given, dumping of
mysql.innodb_index_stats and mysql.innodb_table_stats will result into race
condition.
Fix: Check if these options are present with --system=stats (because dumping
under --system=stats is safe). Otherwise, dump only structure, ignoring data
because innodb will recalculate data anyway.
2021-01-27 22:13:07 +05:30
Oleksandr Byelkin
c207f04ecc MDEV-21785: sequences used as default by other table not dumped in right order by mysqldump
Dump sequences first.

This atch made to keep it small and
to keep number of queries to the server the same.

Order of tables in a dump can not be changed
(except sequences first) because mysql_list_tables
uses SHOW TABLES and I used SHOW FULL TABLES.
2021-01-26 10:41:02 +01:00
Daniel Black
c58d2c941c MDEV-20939: Race condition between mysqldump import and InnoDB persistent
statistics calculation

mysqldump --system=stats and --system=timezones by default used
ordinary INSERT statements populate EITS, innodb stats, and timezone tables.

As these all have primary keys it could result in conflict.

The behavior desired with --system= is to replace the tables.
As such we assume --replace for the purposes of stats and timezone tables
there if --insert-ignore isn't specified.
2021-01-25 17:58:36 +11:00
Marko Mäkelä
533a13af06 Merge 10.3 into 10.4 2020-11-03 14:49:17 +02:00
Marko Mäkelä
c7f322c91f Merge 10.2 into 10.3 2020-11-02 15:48:47 +02:00
Daniel Black
d6ea03fa94 MDEV-23630: mysqldump logically dump system table information
Add --system={all, users, plugins, udfs, servers, stats, timezones}

This will dump system information from the server in
a logical form like:
* CREATE USER
* GRANT
* SET DEFAULT ROLE
* CREATE ROLE
* CREATE SERVER
* INSTALL PLUGIN
* CREATE FUNCTION

"stats" is the innodb statistics tables or EITS and
these are dumped as INSERT/REPLACE INTO statements
without recreating the table.

"timezones" is the collection of timezone tables
which are important to transfer to generate identical
results on restoration.

Two other options have an effect on the SQL generated by
--system=all. These are mutually exclusive of each other.
* --replace
* --insert-ignore

--replace will include "OR REPLACE" into the logical form
like:
* CREATE OR REPLACE USER ...
* DROP ROLE IF EXISTS (MySQL-8.0+)
* CREATE OR REPLACE ROLE ...
* UNINSTALL PLUGIN IF EXISTS (10.4+) ... (before INSTALL PLUGIN)
* DROP FUNCTION IF EXISTS (MySQL-5.7+)
* CREATE OR REPLACE [AGGREGATE] FUNCTION
* CREATE OR REPLACE SERVER

--insert-ignore uses the construct " IF NOT EXISTS" where
supported in the logical syntax.

'CREATE OR REPLACE USER' includes protection against
being run as the same user that is importing the mysqldump.

Includes experimental support for dumping mysql-5.7/8.0
system tables and exporting logical SQL compatible with MySQL.

Updates mysqldump man page, including this information and
(removing obsolute bug reference)

Reviewed-by: anel@mariadb.org
2020-11-01 08:04:36 +11:00
Marko Mäkelä
7b2bb67113 Merge 10.3 into 10.4 2020-10-29 13:38:38 +02:00
Anel Husakovic
81870e499f MDEV-21786 mysqldump will forget sequence definition details on --no-data dump
- Original patch was contributed by Jani Tolonen <jani.k.tolonen@gmail.com>
https://github.com/an3l/server/commits/bb-10.3-anel-MDEV-21786-dump-sequence
which distinguishes data structure (linked list) of sequences from
tables.
- Added standard sql output to prevent future changes
of sequences and disabled locks for sequences.
- Added test case for `MDEV-20070: mysqldump won't work correct on
sequences` where table column depends on sequence value.
- Restore sequence last value in the following way:
  - Find `next_not_cached_value` and use it to `setval()`
  - We just need for logical restore, so don't execute `setval()`
  - `setval()` should be showed also in case of `--no-data` option.

Reviewed-by: daniel@mariadb.org
2020-10-23 09:06:56 +02:00
Marko Mäkelä
805340936a Merge 10.3 into 10.4 2020-06-13 19:01:28 +03:00
Marko Mäkelä
d83a443250 Merge 10.2 into 10.3 2020-06-13 15:11:43 +03:00
Vicențiu Ciorbaru
8c67ffffe8 Merge branch '10.1' into 10.2 2020-06-11 22:35:30 +03:00
Ian Gilfillan
4f48856906 Client spelling mistakes 2020-06-08 11:58:44 +02:00
Marko Mäkelä
2c3c851d2c Merge 10.3 into 10.4 2020-05-05 20:33:10 +03:00
Oleksandr Byelkin
7fb73ed143 Merge branch '10.2' into 10.3 2020-05-04 16:47:11 +02:00
Oleksandr Byelkin
ca091e6372 Merge branch '10.1' into 10.2 2020-05-02 08:44:17 +02:00
Oleksandr Byelkin
23c6fb3e62 Merge branch '5.5' into 10.1 2020-04-30 17:36:41 +02:00
Marko Mäkelä
ac2604f923 Correct the name of a contributor
The name was correctly encoded in UTF-8 before
commit 0ce12f70ed.
2020-04-25 14:22:54 +03:00
Marko Mäkelä
af91266498 Merge 10.3 into 10.4
In main.index_merge_myisam we remove the test that was added in
commit a2d24def8c because
it duplicates the test case that was added in
commit 5af12e4635.
2020-04-16 12:12:26 +03:00
Marko Mäkelä
84db10f27b Merge 10.2 into 10.3 2020-04-15 09:56:03 +03:00
Marko Mäkelä
bc862c4ebe Merge 10.1 into 10.2 2020-04-01 09:19:37 +03:00
Oleksandr Byelkin
f9639c2d1a MDEV-22037: Add ability to skip content of some tables (work around for MDEV-20939)
--ignore-table-data parameter added.
2020-03-25 16:03:22 +01:00
Oleksandr Byelkin
a15234bf4b Merge branch '10.3' into 10.4 2019-12-09 15:09:41 +01:00
Faustin Lammler
2df2238cb8 Lintian complains on spelling error
The lintian check complains on spelling error:
https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
2019-12-02 12:41:13 +02:00
Marko Mäkelä
5a92ccbaea Merge 10.3 into 10.4
Disable MDEV-20576 assertions until MDEV-20595 has been fixed.
2019-09-23 17:35:29 +03:00
Marko Mäkelä
c016ea660e Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
Anel Husakovic
3793da44cf Enable the auto parameter of the flag default-character-set
Closes #739

When invoking option `--default-character-set=auto` character set
from underlying OS settings should be detected for mysqldump.
2019-09-13 02:26:16 -07:00
Monty
4733464975 Fixed that mariadb-# binaries reads their corresponding entry from my.cnf
- Added mariadb-# to load_default_groups to all mariadb-# scripts and
  mariadb-binaries.
- Added mariadbd and mariadbd-"version" to load_default_groups for the
  mysqld/mariadb server
- Added mariadb-client to load_default_groups for the mysql/mariadb client

Other things
- Ignored mysql-test/lib/My/SafeProcess/wsrep_check_version
- mysql_install_db will now automatically detect if run from srcdir
2019-07-18 15:32:22 +03:00
Marko Mäkelä
b7b0bc8f11 Merge 10.3 into 10.4
We omit the work-around commit 0b7fa5a05d
because it appears to be needed for CentOS 6 only,
which we no longer support.
2019-06-27 17:54:47 +03:00
Anel Husakovic
620f4f8af9 MDEV-17429 mysqldump uses 10.3 options with pre-10.3 servers and breaks 2019-06-24 02:40:06 -07:00
Georg Richter
d13080133f MDEV-14101 Provide an option to select TLS protocol version
Server and command line tools now support option --tls_version to specify the
TLS version between client and server. Valid values are TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3
or a combination of them. E.g.

--tls_version=TLSv1.3
--tls_version=TLSv1.2,TLSv1.3

In case there is a gap between versions, the lowest version will be used:
--tls_version=TLSv1.1,TLSv1.3 -> Only TLSv1.1 will be available.

If the used TLS library doesn't support the specified TLS version, it will use
the default configuration.

Limitations:

SSLv3 is not supported. The default configuration doesn't support TLSv1.0 anymore.
TLSv1.3 protocol currently is only supported by OpenSSL 1.1.0 (client and server) and
GnuTLS 3.6.5 (client only).

Overview of TLS implementations and protocols

Server:

+-----------+-----------------------------------------+
| Library   | Supported TLS versions                  |
+-----------+-----------------------------------------+
| WolfSSL   | TLSv1.1, TLSv1,2                        |
+-----------+-----------------------------------------+
| OpenSSL   | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3    |
+-----------+-----------------------------------------+
| LibreSSL  | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3    |
+-----------+-----------------------------------------+

Client (MariaDB Connector/C)
+-----------+-----------------------------------------+
| Library   | Supported TLS versions                  |
+-----------+-----------------------------------------+
| GnuTLS    | (TLSv1.0), TLSv1.1, TLSv1.2, TLSv1.3    |
+-----------+-----------------------------------------+
| Schannel  | (TLSv1.0), TLSv1.1, TLSv1.2             |
+-----------+-----------------------------------------+
| OpenSSL   | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3    |
+-----------+-----------------------------------------+
| LibreSSL  | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3    |
+-----------+-----------------------------------------+
2019-06-17 12:26:25 +02:00
Marko Mäkelä
2fd82471ab Merge 10.3 into 10.4 2019-06-12 08:37:27 +03:00
Marko Mäkelä
b42dbdbccd Merge 10.2 into 10.3 2019-06-11 13:00:18 +03:00
Monty
76f14be10f Ensure that tests and programs can restore variables
- --default-character-set can now be disabled in mysqldump
- --skip-resolve can be be disabled in mysqld
- mysql_client_test now resets global variables it changes
- mtr couldn't handle [mysqldump] in config files (wrong regexp used)
2019-06-03 15:06:51 +03:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02: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
Alexey Botchkov
651a43e0a0 MDEV-18782 mysqldump --all-databases causes segmentation fault.
Do not consider rows of Information_schema.files where
LOGFILE_GROUP_NAME is NULL.
2019-05-07 16:13:53 +04:00