Commit graph

192567 commits

Author SHA1 Message Date
Vladislav Vaintroub
78bd7d86a4 MDEV-25953 Tpool - prevent potential deadlock in simulated AIO
Do not execute user callback just after pwrite. Instead, submit user
function as task into thread pool. This way, the IO thread would not hog
aiocb, which is a limited (in Innodb) resource
2021-06-17 20:39:47 +02:00
Thirunarayanan Balathandayuthapani
cd1a195b22 MDEV-25947 innodb_fts.misc_debug fails in buildbot
- Make innodb_fts.misc_debug test case more stable.
2021-06-17 17:22:30 +05:30
Daniel Black
48938c57c7 MDEV-25894: support AIX as a platform in mtr
Add fixed for tests mysqld--help,aix.rdiff and sysvars_server_notembedded,aix.rdiff

AIX couldn't compile in embedded mode so leaving sysvars_server_embedded
for later (if required).
2021-06-16 15:44:18 +10:00
Sergei Golubchik
35b57c37bb MDEV-25617 10.5.10 upgrade: "scriptlet / line 6 : [: is-active : binary operator expected" 2021-06-16 12:26:43 +07:00
Marko Mäkelä
c307dc6efd Remove a unused variable
In commit 1c35a3f6fd a useless
computation that used the variable was removed.
2021-06-16 07:50:04 +03:00
Julius Goryavsky
2edb8e12e1 MDEV-25880 part 2: Improving reliability of the SST scripts
Additional improvements aimed at improving operational
reliability of the SST scripts:

1) Script need to give rsync and stunnel a short time to
   terminate after "kill -9" before the first PID check
   using ps utility;
2) The temporary file used to create the binlog index could
   sometimes remain in the data directory if tar failed and
   then may be reused without being cleaned up (the next
   time when SST was run) - now it's fixed;
3) The temporary file used to build the binlog index is now
   created using mktemp and, if this variable is present in
   the configuration file, in tmpdir;
4) Checking the secret tag in SST via rsync is made faster
   and does not require creating a temporary file, which
   could remain in the data directory in case of failure;
5) Added "-F" option to grep to check the tag when using
   mariabackup/xtrabackup-v2 - to avoid possible collisions
   in case of special characters in the tag value (unlikely
   scenario, but the new check is more reliable).
2021-06-15 14:27:22 +02:00
Julius Goryavsky
18d5be5b54 MDEV-25880: rsync may be mistakenly killed when overlapping SST
This commit fixes a bug was originally discovered during the
galera_nbo_sst_slave mtr test for 10.6 branch. However it is
relevant for all versions and can lead to intermittent SST
crashes via rsync on very fast server restarts - when a new
SST process (for example, after starting a new server instance)
overlaps the old SST process started by the previous, already
terminated server. This overlap can result in the new rsync
being killed instead of the old rsync, or the pid file from
the new rsync being killed, which then lead to problems.
2021-06-15 14:27:22 +02:00
Eugene Kosov
1c35a3f6fd fix clang build
a new warning -Wunused-but-set-variable was introduced recently to clang
2021-06-15 13:10:16 +03:00
Thirunarayanan Balathandayuthapani
7d591cf850 MDEV-24713 Assertion `dict_table_is_comp(index->table)' failed in row_merge_buf_add()
- During online alter conversion from compact to redundant,
virtual column field length already set during
innobase_get_computed_value(). Skip the char(n) check for
virtual column in row_merge_buf_add()
2021-06-15 13:15:32 +05:30
Thirunarayanan Balathandayuthapani
7229107e3e MDEV-25872 InnoDB: Assertion failure in row_merge_read_clustered_index upon ALTER on table with indexed virtual columns
- InnoDB fails to check DB_COMPUTE_VALUE_FAILED error in
row_merge_read_clustered_index() and wrongly asserts that
the buffer shouldn't be ran out of memory. Alter table
should give warning when the column value is being
truncated.
2021-06-15 13:15:32 +05:30
Thirunarayanan Balathandayuthapani
8c7d8b716c MDEV-14180 Automatically disable key rotation checks for file_key_managment plugin
Problem:
=======
- InnoDB iterates the fil_system space list to encrypt the
tablespace in case of key rotation. But it is not
necessary for any encryption plugin which doesn't do
key version rotation.

Solution:
=========
- Introduce a new variable called srv_encrypt_rotate to
indicate whether encryption plugin does key rotation

fil_space_crypt_t::key_get_latest_version(): Enable the
srv_encrypt_rotate only once if current key version is
higher than innodb_encyrption_rotate_key_age

fil_crypt_must_default_encrypt(): Default encryption tables
should be added to default_encryp_tables list if
innodb_encyrption_rotate_key_age is zero and encryption
plugin doesn't do key version rotation

fil_space_create(): Add the newly created space to
default_encrypt_tables list if
fil_crypt_must_default_encrypt() returns true

Removed the nondeterministic select from
innodb-key-rotation-disable test. By default,
InnoDB adds the tablespace to the rotation list and
background crypt thread does encryption of tablespace.
So these select doesn't give reliable results.
2021-06-15 13:15:32 +05:30
Thirunarayanan Balathandayuthapani
7d2c338c48 MDEV-14180 preparation: Rename key_rotation_list
- Rename the rotation list to default_encrypt_tables in
fil_system_t. Because rotation list naming could be
misleading when it comes to key version rotation

- Rename is_in_rotation_list to is_in_default_encrypt
in fil_space_t

- Rename keyrotate_next function to default_encrypt_next

fil_system_t::default_encrypt_next(): Find the next
suitable default encrypt table if beginning of
default_encrypt_tables list has been scheduled
to be deleted
2021-06-15 13:15:32 +05:30
Daniel Black
be243ed9e3 cmake OpenBSD copyright notice correction
Brad Smith made this OpenBSD file based of the
FreeBSD cmake directives in commit ab58904367
by the Monty Program Ab.

As such the Oracle Copyright header isn't really applicable.
2021-06-15 12:42:10 +10:00
Jordy Zomer
ec4df51414 eventscheduler mismatch of my_{malloc,free}, delete
Fix malloc/delete mismatch. This causes a double free in the cleanup.

closes #1845
2021-06-15 12:35:57 +10:00
Vladislav Vaintroub
2e33f574b3 update libmariadb 2021-06-14 23:45:31 +02:00
Sergei Golubchik
c9f9e38bb5 fix mysqlest crash on ./mtr --sp innodb_fts.innodb-fts-stopword 2021-06-12 12:38:53 +02:00
Sergei Golubchik
887f46a618 fix mysqltest crash report output
* read_command_buf is a pointer now, sizeof() no longer reflects its
  length, read_command_buflen is.
* my_safe_print_str() prints multiple screens of '\0' bytes after the
  query end and up to read_command_buflen. Use fprintf() instead.
* when setting connection->name to "-closed_connection-" update
  connection->name_len to match.
2021-06-12 12:38:53 +02:00
Daniel Black
8a2b4d531d MDEV-20162: fix connect-abstract test case
The check-testcase record uses a mysqltest connection
to the database to do the recording. With the server configured
as an abstract socket, the mysqltest client cannot connect and
fails.

We work around this by starting the server as normal and then
restart with an abstract socket and test this.

This didn't affect Windows as it just did a tcp connection.
So this did affect all unix socket based systems except Linux
as this was the only one that supported abstract sockets.
2021-06-11 14:30:42 +10:00
Brad Smith
4352c77c5a Link with libexecinfo on OpenBSD for stacktrace functionality. 2021-06-11 10:31:26 +10:00
Otto Kekäläinen
152c83d49c MDEV-20392: Skip ABI check if 'diff' is not found
Not all environments have 'diff' installed. Most notably CentOS 8
does not have diff out-of-the-box. Thus users running 'cmake .' and
'make' would fail to build MariaDB, and they would think the error
was in ABI incompatibilities due to the error message emitted by CMake
when in reality simply 'diff' was missing.

This fixes it and makes the developer experience better by simply
skipping the diffing if 'diff' is not found.

Closes #1846
2021-06-10 12:47:01 +02:00
Vladislav Vaintroub
e85df7feac MDEV-19702 Refactor Bitmap<N> to be based on ulonglong, not on uint32
Removed Field_map, since it was used only in a single function.

Fixed is_indexed_agg_distinct(), since it relied on initialization of
Bitmap in constructor.

Fixes MDEV-25888 in 10.4
2021-06-10 11:43:28 +02:00
Marko Mäkelä
396864c6b3 Remove orphan type name trx_sig_t
This was missed in commit 1d0f70c2f8.
2021-06-10 11:17:40 +03:00
Elena Stepanova
0b9a59bbc4 MDEV-25884 Tests use environment $USER variable without quotes
These are only 10.4+ tests. 10.2+ tests are pushed into 10.2
and will be merged into 10.4+ independently
2021-06-10 00:39:04 +03:00
Elena Stepanova
7a1eff0a9d MDEV-25884 Tests use environment $USER variable without quotes 2021-06-10 00:26:56 +03:00
Sergei Golubchik
f13b80af39 MDEV-23933 main.failed_auth_unixsocket fails on arm
the idea of main.failed_auth_unixsocket was to have existing
user account (root) authenticate with unix_socket, then login with
non-existent user name, Non-existent user name forces the server
to perform the authentication in the name of some random existing
user. But it must still fail at the end, as the user name is wrong.

In 10.4 a second predefined user was added, mariadb.sys, so root
is not the only user in mysql.global_priv and unix_socket auth
must be forced for all existing user accounts, because we cannot
know what user account the server will randomly pick for non-existing
user auth.
2021-06-09 18:36:44 +02:00
Sergei Golubchik
bafec28e43 rpm packaging: account for fedora > 31
RocksDB failed to package on fedora 32 and 33 with

*** ERROR: ambiguous python shebang in /usr/bin/myrocks_hotbackup: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
2021-06-09 18:36:43 +02:00
Sergei Golubchik
7e9bc7bf4e mdl_dbug_print_locks(): make it useful in gdb too 2021-06-09 18:36:43 +02:00
Thirunarayanan Balathandayuthapani
2c6d5c92c7 MDEV-25642 InnoDB rename table copy DDL fails while dropping the table
When doing a ALTER TABLE ... RENAME, MariaDB doesn't rename
original table to #sql-backup, which it does in other cases,
but insteads drops the original table directly. However
this optimization doesn't work in case of InnoDB table
with a foreign key constraint.

During copy algorithm, InnoDB fails to rename the foreign key
constraint(MDEV-25855). With this optimisation, InnoDB also
fails to drop the original table because the table has
FOREIGN Key constraint exist in INNODB_SYS_FOREIGN table.
This leads to orphan .ibd file in InnoDB dictionary.
so disabling this optimization when FK is involved.

Reviewer: monty@mariadb.org
2021-06-09 20:19:21 +05:30
Vladislav Vaintroub
b81803f065 MDEV-22221: MariaDB with WolfSSL doesn't support AES-GCM cipher for SSL
Enable AES-GCM for SSL (only).

AES-GCM for encryption plugins remains disabled (aes-t fails, on some bug
in GCM or CTR padding)
2021-06-09 15:44:55 +02:00
Vladislav Vaintroub
dbe3161b6d Remove WolfSSL workaround for old version.
We're already on 4.4.6
2021-06-09 15:44:55 +02:00
Sergei Petrunia
c872125a66 MDEV-25630: Crash with window function in left expr of IN subquery
* Make Item_in_optimizer::fix_fields inherit the with_window_func
  attribute of the subquery's left expression (the subquery itself
  cannot have window functions that are aggregated in this select)

* Make Item_cache_wrapper::Item_cache_wrapper() inherit
  with_window_func attribute of the item it is caching.
2021-06-09 15:52:13 +03:00
Marko Mäkelä
b25d2a4578 Merge 10.4 into 10.5 2021-06-09 14:29:58 +03:00
Marko Mäkelä
c7ee039d36 Merge 10.3 to 10.4 2021-06-09 14:28:57 +03:00
Marko Mäkelä
75a65d3201 MDEV-25886 CHECK TABLE crash with DB_MISSING_HISTORY if innodb_read_only
Occasionally, the test innodb.alter_copy would fail in MariaDB 10.6.1,
reporting DB_MISSING_HISTORY during CHECK TABLE. It started to occur during
the development of MDEV-25180, which introduced purge_sys.stop_SYS().
If we delay purge more during DDL operations, then the test would
almost always fail. The reason is that during startup we will restore
a purge view, and CHECK TABLE would still use REPEATABLE READ
even though innodb_read_only is set and other isolation levels
than READ UNCOMMITTED are not guaranteed to work.

ha_innobase::check(): Use READ UNCOMMITTED isolation level if
innodb_read_only is set or innodb_force_recovery exceeds 3.

dict_set_corrupted(): Do not update the persistent data dictionary
if innodb_force_recovery exceeds 3.
2021-06-09 14:23:20 +03:00
Marko Mäkelä
f4425d3a3d Merge 10.4 into 10.5 2021-06-08 16:03:53 +03:00
Marko Mäkelä
b8d38c5e39 dict_index_build_internal_clust(): Catch MDEV-20131 on CREATE TABLE 2021-06-08 15:03:50 +03:00
Marko Mäkelä
72b2489621 Merge 10.3 into 10.4 2021-06-08 15:02:40 +03:00
Marko Mäkelä
6e9642beb2 Merge 10.2 into 10.3 2021-06-08 14:33:07 +03:00
Marko Mäkelä
dfa2d0bc13 MDEV-25869 Change buffer entries are lost on InnoDB restart
buf_read_ibuf_merge_pages(): If space->size is 0, invoke
fil_space_get_size() to determine the size of the tablespace
by reading the header page. Only after that proceed to delete
any entries that are beyond the end of the tablespace.
Otherwise, we could be deleting valid entries that actually
need to be applied.

This fixes a regression that had been introduced in
commit b80df9eba2 (MDEV-21069),
which aimed to avoid crashes during DROP TABLE of corrupted tables.
2021-06-08 13:21:33 +03:00
Igor Babaev
bb28bffc3e Ported the test case for MDEV-25682 from 10.2
No fix for this bug is needed starting from version 10.4.
2021-06-07 19:51:57 -07:00
Igor Babaev
8149e4d0a1 MDEV-25682 Explain shows an execution plan different from actually executed
If a select query contained an ORDER BY clause that followed a LIMIT clause
or an ORDER BY clause or ORDER BY with LIMIT the EXPLAIN output for the
query showed an execution plan different from that was actually executed.

Approved by Roman Nozdrin <roman.nozdrin@mariadb.com>
2021-06-07 15:08:18 -07:00
Monty
bf5c050fd2 MDEV-25866 Upgrade from pre-10.5.10 to 10.5.10 causes CHECK errors on encrypted Aria tables
Hard to do a test case, but tested by hand and verified that mysql_upgrade
will update the encrypted MariaDB tables.
2021-06-07 20:51:32 +03:00
Monty
eed419b487 Fixed a DBUG_ASSERT when running zerofill() on aria tables
This happended when an aria table was already used by the system before
running zerofill, which could happen with Aria system tables.

Fixed by using a proper page type when reading pages in zerofill
2021-06-07 20:51:32 +03:00
Marko Mäkelä
310dff5d84 MDEV-25783: Change buffer records are lost under heavy load
ibuf_read_merge_pages(): Disable some code that was added in MDEV-20394
in order to avoid a server hang if the change buffer is corrupted,
presumably due to the race condition in recovery that was later fixed in
MDEV-24449. The code will still be available in debug builds when
the command line option --debug=d,ibuf_merge_corruption is specified.

Due to MDEV-19514, the impact of this code is much worse starting
with the 10.5 series. In older versions, the code was only enabled
during a shutdown with innodb_fast_shutdown=0, but in 10.5 it was
active during the normal operation of the server.
2021-06-07 19:07:45 +03:00
Monty
f456e716fe Make maria.repair more resiliant for different failures
This is because on different compilation and server configurations the
memory usage is different and the query can get killed in different places
with different error messages as a result.

Reviewer: None (trival change)
2021-06-07 12:11:35 +03:00
Otto Kekäläinen
3c922d6def Revert "CONNECT: move jar files to /usr/share and include them in DEBs"
This partially reverts commit d7321893d8.

The *.jar files are not being built and all Debian builds are failing
as dh_install stops on missing files. To build them we would need to also
add new Java build dependencies.

In a stable release (10.2->10.5) we shouldn't add new files and certainly
not any new build dependencies, so reverting commit.

Also, the files are located in a different path, and already included
in the mariadb-test-data package:

  /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/JavaWrappers.jar
  /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/JdbcMariaDB.jar
  /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/Mongo2.jar
  /usr/share/mysql/mysql-test/plugin/connect/connect/std_data/Mongo3.jar

This change needs to be redesigned and applies only on 10.6 or newer.
2021-06-06 11:49:36 +02:00
Vladislav Vaintroub
9f9a925c39 MDEV-23815 Windows : mysql_upgrade_wizard fails, if service name has spaces
The fix is to quote service name parameter, when it is passed to
mysql_upgrade_service subprocess.
2021-06-06 08:48:12 +02:00
Otto Kekäläinen
d4a6e3a698 Deb: Misc cleanup and autobake-deb.sh and Salsa-CI fixes
* Clean up autobake-deb.sh

  - No need to define any TokuDB rules, there is no such package
  - No need to define RocksDB arch, it already has "Architecture:" line
  - No need to dh-systemd backwards compat stanza, neither Debian Jessie
    nor Ubuntu Xenial has any new MariaDB 10.5 releases anymore
  - Minor spelling fixes

* Ensure dch runs non-interactively so builds pass with new dch version

  A recent version of dch (available in Ubuntu Hirsute and Debian Bullseye)
  had a change in behaviour that it started prompting if the DEBEMAIL or
  EMAIL variable as unset, asking for confirmation. We can't have anything
  interactive in our build scripts, so prevent this prompt by giving
  --controlmaint to the command, so it always uses the name and email from
  the debian/control file and does not prompt anything.

  The command-line argument has been around for a long time, so it is safe
  to use on all Debian/Ubuntu builds we have.

  See https://manpages.debian.org/jessie/devscripts/dch.1.en.html

  Since MariaDB 10.5 is the oldest release we still release for Ubuntu Hisute
  and Debian Bullseye, merge this on 10.5 and from there merge up to latest.
  No need to consider 10.2, 10.3 and 10.4 as those will not be released for
  Ubuntu Bullseye or Ubuntu Hirsute.

* Minor Salsa-CI cleanup

  - Fix spelling (synced from downstream Debian)

* Many minor spelling fixes (synced from downstream Debian)
2021-06-05 19:25:16 -07:00
Vladislav Vaintroub
cebc435592 MDEV-25859 - HeidiSQL 11.3 2021-06-05 16:57:46 +02:00
Vladislav Vaintroub
b1b4d67bcd MDEV-21373 DBUG compilation - bad synchronization in ha_heap::external_lock()
ha_heap::external_lock contains some consistency checks for the table,#
in a debug compilation.

This code suffers from lack of synchronization, in a rare case
where mysql_lock_tables() fail, and unlock is forced, even if lock was
not previously taken.

To workaround, require EXTRA_DEBUG compile definition in order to activate
the consistency checks.The code still might be useful in some cases - but
the audience are developers looking for errors in single-threaded scenarios,
rather than multiuser stress-tests.
2021-06-04 15:02:48 +02:00