Commit graph

195337 commits

Author SHA1 Message Date
Sergei Golubchik
a450d58ad0 fix a copy-paste error
LEX_CSTRING table_name= { table->s->db.str, table->s->table_name.length };

and misc cleanups
2022-02-03 15:28:12 +01:00
Andrei
e53199e76b MDEV-27721 rpl.rpl_relay_max_extension test is not FreeBSD-compatible
Fixed the test to execute only on linux as it depends on unportable sed.
2022-02-02 20:02:20 +02:00
Andrei
e4d7886cc5 MDEV-11675. rpl_start_alter_ftwrl.test is refined
The test could fail sporadically because of not anticipated
race on slave between CREATE and ALTER queries.

Fixed to synchronize slave and master wrt CREATE.
2022-02-02 17:17:27 +02:00
Marko Mäkelä
12f29a4bc0 MDEV-11675 fixup: GCC -Og -Wmaybe-uninitialized
save_restore_context_apply_event(): Because compilers cannot infer
that ev->apply_event(rgi) will not affect ev->get_type_code(),
let us test that condition only once and allow the compiler to
emit a tail call.

Also, replace a goto with an early return for error handling.
2022-02-02 11:30:16 +02:00
Vladislav Vaintroub
2b95c36b4b fix clang-cl warnings 2022-02-02 01:35:40 +01:00
Oleksandr Byelkin
83cdcf5bf2 new CC 3.3 2022-02-01 21:28:25 +01:00
Oleksandr Byelkin
cf63eecef4 Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
Andrei
2b55411673 MDEV-27687 Assertion `!thd->rgi_fake || ...
The added by MDEV-11675 assert is incorrected assuming
a replayed from binlog transaction can't contain invoke
a FD event's apply method.

In fact it can do that through BINLOG event.
The test case like

  BEGIN;
    INSERT INTO t1 VALUES(10);
    BINLOG '
    SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';

is provided (by yet to merged atm) MDEV-27536 fixes.

The assert is removed.
2022-02-01 17:12:05 +02:00
Thirunarayanan Balathandayuthapani
8d742fe4ac MDEV-26326 mariabackup skip valid ibd file
- Store the deferred tablespace name while loading the tablespace
for backup process.

- Mariabackup stores the list of space ids which has page0 INIT_PAGE
records. backup_first_page_op() and first_page_init() was introduced
to track the page0 INIT_PAGE records.

- backup_file_op() and log_file_op() was changed to handle
FILE_MODIFY redo log records. It is used to identify the
deferred tablespace space id.

- Whenever file operation redo log was processed by backup,
backup_file_op() should check whether the space name exist
in deferred tablespace. If it is then it needs to store the
space id, name when FILE_MODIFY, FILE_RENAME redo log processed
and it should delete the tablespace name from defer list in other
cases.

- backup_fix_ddl() should check whether deferred tablespace has
any page0 init records. If it is then consider the tablespace
as newly created tablespace. If not then backup should try
to reload the tablespace with SRV_BACKUP_NO_DEFER mode to
avoid the deferring of tablespace.
2022-02-01 19:50:08 +05:30
Andrei
fe2d90cca9 MDEV-11675. Convert the new session var to bool type and test changes
The new @@binlog_alter_two_phase is converted to `my_bool` type.
2022-01-31 22:57:39 +02:00
Vladislav Vaintroub
62ba2f230a MDEV-27535 remove debug output 2022-01-31 21:50:57 +01:00
Vladislav Vaintroub
8c457dad48 MDEV-27546 MSI should fail if INSTALLDIR is a non-empty existing directory
Make installer fail if INSTALLDIR exists.
In UI mode, show a popup and disable "Next" button until install root is
corrected
2022-01-31 20:10:08 +01:00
Vladislav Vaintroub
12cea09713 MDEV-27535 Service does not start after MSI install into restricted directory
This happens for example if one installs into home directory of a user
C:\Users\<username>\mariadb

The reason is that the service user "NT SERVICE\<service_name>" does
not have read and execute permissions for service executable mysqld.exe
in this directory.
Moreover, it would not have read permissions for server.dll loaded by the
exe, or to plugin directory, where plugins may reside.

The fix is to give service users read and execute permissions to bin, share, and
lib\plugin subdirectories.

The permission setting is doneby  mysql_install_db.exe, but also in MSI.
It is important to do that in MSI, as we want permissions to survive
the MSI upgrade.
2022-01-31 20:10:08 +01:00
Alexander Barkov
2a0962f39b MDEV-27696 Json table columns accept redundant COLLATE syntax 2022-01-31 21:18:43 +04:00
Brandon Nesterenko
a64991df9d MDEV-4989: Support for GTID in mysqlbinlog
This patch fixes two issues:

First, it fixes test failure due to GTID List events
having inconsistent ordering of domain ids. In
particular, this patch ensures that a GTID list log
event will have its GTIDs ordered by domain id
(ascending) followed by sequence number (ascending).

Second, it fixes an assert which could use an
unintialized variable.

Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>
2022-01-31 09:30:23 -07:00
Sergei Golubchik
fb40a2fabf pass MYSQL_MAINTAINER_MODE down to srpm builds
fixes errors on rpm-*-debug builder
2022-01-31 11:45:30 +01:00
Sergei Golubchik
0943386fb3 fix main.mysqld--help-aria failures
when it's run directly after main.mysql_json_mysql_upgrade

because mysqld--help-aria starts a second mysqld that reads the plugin
table, so it has to be flushed and closed at that time.
2022-01-31 11:41:12 +01:00
Oleksandr Byelkin
c04a203a10 Rocksdb result fix after merge 2022-01-31 08:37:33 +01:00
Sergei Golubchik
2d4a0f6079 pass MYSQL_MAINTAINER_MODE down to srpm builds
fixes errors on rpm-*-debug builder
2022-01-30 22:52:59 +01:00
Oleksandr Byelkin
2d85188627 Fix galera result after merge 2022-01-30 18:14:27 +01:00
Sergei Golubchik
66bc8bf09e fix query cache in embedded, enable MARIADB_CLIENT_EXTENDED_METADATA
this fixes plugins.qc_info in --embed

followup for 430d60d1fc MDEV-24487
2022-01-30 18:09:55 +01:00
Oleksandr Byelkin
ca41fdba22 fix MDEV-27217 (4d5ae2b325)
Add error from later versions to avoid chaging HA_ERR_*
accross versions and in already released versions.
2022-01-30 17:52:15 +01:00
Sergei Golubchik
77b3777bab update columnstore to 6.2.3-1 2022-01-30 16:37:12 +01:00
Sergei Golubchik
9667ec1f53 fix query cache in embedded
this fixes main.partition_cache and main.cache_innodb in --embed

followup for 430d60d1fc MDEV-24487
2022-01-30 13:56:22 +01:00
Sergei Golubchik
bc10f58a58 MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
pass the pointer to thd->killed down to the json library,
check it while scanning,
use thd->check_killed() to generate the proper error message
2022-01-30 12:07:31 +01:00
Sergei Golubchik
bae9fb5904 MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
preallocate the string in json_nice()
to avoid reallocs on every 1-character append()
2022-01-30 12:07:16 +01:00
Sergei Golubchik
3add51b769 cleanup: move the common code into the function 2022-01-30 12:07:16 +01:00
Sergei Golubchik
3cc278e960 enable main.mysqldump-system test
that was permanently disabled in a merge mistake. also
* use auth_test_plugin to test dumping of plugins and user auth,
  as the original test intended
* s/USER/foobar/ to make a username searchable
2022-01-30 12:07:16 +01:00
Oleksandr Byelkin
a576a1cea5 Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
Sergei Golubchik
646e2f423b update columnstore to 5.6.4-1 2022-01-29 16:28:31 +01:00
Oleksandr Byelkin
41a163ac5c Merge branch '10.2' into 10.3 2022-01-29 15:41:05 +01:00
Sergei Golubchik
e2b50213cf main.events_embedded test failures in buildbot
revert 68b3fa8865
2022-01-29 13:56:18 +01:00
Sergei Golubchik
8afcda9309 ASAN/valgrind errors in connect.misc test
accessing freed memory.
Before XMLCOL::WriteColumn() Tdbp->Clist gets assigned
a nodelist in

      Clist = RowNode->SelectNodes(g, Colname, Clist);

which is RowNode->Doc->Xop->nodesetval.

In XMLCOL::WriteColumn()

        ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);

calls LIBXMLDOC::GetNodeList() again, which frees the previous
XPath object Xop and replaces it with a new one.

In this case RowNode->Doc == ColNode->Doc, so Clist->Listp
points to a freed memory now.
2022-01-29 13:42:38 +01:00
Sergei Golubchik
5e5feb84b6 MDEV-11241 Certain combining marks cause MariaDB to crash when doing Full-Text searches
fix it for Aria too
2022-01-28 21:36:33 +01:00
Alexander Barkov
059a8fd87e MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref 2022-01-28 22:32:56 +04:00
Marko Mäkelä
c478a5533e MDEV-27667 Fix MDEV-26720 on 64-bit Microsoft Windows
The correct macro to detect the AMD64 ISA is _M_X64, not M_IX64.

This is the 10.6 version of
commit fb8fea3490 (10.5).
2022-01-28 16:42:37 +02:00
Monty
a1f630ccfe Fixed result for embedded server
- Revert wrongly record embedded result files. These were either
  recorded with normal server (not embedded) or an embedded server
  with not default compile option. This can be seen that the committed
  result file had replication variables which should never happen.

- Reverted back change of include/is_embedded.inc. One cannot check for
  $MYSQL_EMBEDDED as this only tells if there exists an embedded
  server, not if the current server we are testing is the embedded
  server. This could easily be verified by doing
  'mtr sys_vars.sysvars_server_embedded'. This would fail with a wrong
  result instead of being marked as skipped as --embedded was not
  used.
2022-01-28 16:31:53 +02:00
Monty
7045ec27a6 Fixed wrong function call in embedded server
This happens when compiled with HAVE_EMBEDDED_PRIVILEGE_CONTROL.
There is a lot of other problems with the above option that should
be fixed at some point
2022-01-28 16:31:03 +02:00
Marko Mäkelä
fb8fea3490 MDEV-27667 Fix MDEV-26720 on 64-bit Microsoft Windows
The correct macro to detect the AMD64 ISA is _M_X64, not M_IX64.

Thanks to Vladislav Vaintroub for pointing this out.
2022-01-28 15:55:39 +02:00
Oleksandr Byelkin
880d543554 Merge branch 'merge-perfschema-5.7' into 10.5 2022-01-28 11:57:52 +01:00
Marko Mäkelä
f0f5ce58c7 MDEV-27402 'asm goto' is not supported on Apple Xcode 9.4.1
Even though Apple Xcode is based on and similar to Clang,
it does not support the asm goto construct which was added
in commit 668a5f3d12 (MDEV-26720)
to work around a compiler deficiency that results in suboptimal
code being generated for IA-32 and AMD64.

We will disable this manual optimization if __APPLE_CC__ is defined.

Similar constructs are also used in sync/srw_lock.cc, but that code
is not used on Apple, because we have not implemented a Linux futex
compatible interface on Apple macOS.

Thanks to Valerii Kravchuk for reporting and testing this.
2022-01-28 08:31:57 +02:00
Monty
24c51be6fe Fixed compilation error if HAVE_CRYPT is not defined 2022-01-27 21:44:45 +02:00
Sachin
0c5d1342ae MDEV-11675 Lag Free Alter On Slave
This commit implements two phase binloggable ALTER.
When a new

      @@session.binlog_alter_two_phase = YES

ALTER query gets logged in two parts, the START ALTER and the COMMIT
or ROLLBACK ALTER. START Alter is written in binlog as soon as
necessary locks have been acquired for the table. The timing is
such that any concurrent DML:s that update the same table are either
committed, thus logged into binary log having done work on the old
version of the table, or will be queued for execution on its new
version.

The "COMPLETE" COMMIT or ROLLBACK ALTER are written at the very point
of a normal "single-piece" ALTER that is after the most of
the query work is done. When its result is positive COMMIT ALTER is
written, otherwise ROLLBACK ALTER is written with specific error
happened after START ALTER phase.
Replication of two-phase binloggable ALTER is
cross-version safe. Specifically the OLD slave merely does not
recognized the start alter part, still being able to process and
memorize its gtid.

Two phase logged ALTER is read from binlog by mysqlbinlog to produce
BINLOG 'string', where 'string' contains base64 encoded
Query_log_event containing either the start part of ALTER, or a
completion part. The Query details can be displayed with `-v` flag,
similarly to ROW format events.  Notice, mysqlbinlog output containing
parts of two-phase binloggable ALTER is processable correctly only by
binlog_alter_two_phase server.

@@log_warnings > 2 can reveal details of binlogging and slave side
processing of the ALTER parts.

The current commit also carries fixes to the following list of
reported bugs:
MDEV-27511, MDEV-27471, MDEV-27349, MDEV-27628, MDEV-27528.

Thanks to all people involved into early discussion of the feature
including Kristian Nielsen, those who helped to design, implement and
test: Sergei Golubchik, Andrei Elkin who took the burden of the
implemenation completion, Sujatha Sivakumar, Brandon
Nesterenko, Alice Sherepa, Ramesh Sivaraman, Jan Lindstrom.
2022-01-27 21:25:07 +02:00
Monty
a85d942be9 Fixed result file for rocksdb.i_s_deadlock
This failed because of MDEV-18918 which removed DEFAULT's
2022-01-27 19:15:02 +02:00
Marko Mäkelä
48b974b267 MDEV-27026 innodb_fts.concurrent_insert failed
Most of this was likely already fixed by MDEV-27017.
On one implementation of the AMD64 ISA, the test
innodb_fts.concurrent_insert would still occasionally hang,
with both dict_sys_t::evict_table_LRU() and
dict_index_set_merge_threshold() waiting in dict_sys_t::lock()
several threads waiting in dict_sys_t::freeze(),
no thread holding exclusive dict_sys.latch and also no thread
in the stack traces apparently holding any dict_sys.latch,
even though dict_sys.latch_readers == 1.

To prevent this scenario, we will remove the dict_sys.latch
acquisition from dict_index_set_merge_threshold(). It is actually
not needed, because dict_sys.sys_indexes will not change after
InnoDB startup. The SYS_INDEXES leaf page will be sufficiently
protected by the page latch.

There potentially is a bug in the srw_lock implementation,
which will have to be investigated further.
2022-01-27 18:14:37 +02:00
Monty
2f5d6ef039 Fixed random failure main/truncate_notembedded
Backport from 10.6
2022-01-27 17:00:52 +02:00
Monty
20a91b8fc5 MDEV-27477 Remaining SUSE patches for 10.2+
Adds reload and --datadir functionality to mysqld_multi
Increased version to 3.0

Source:
https://github.com/openSUSE/mysql-packaging/blob/master/patches/mysql-patches/mariadb-10.0.15-mysqld_multi-features.patch

Author: Michal Hrusecky <Michal.Hrusecky@opensuse.org>
Reviewer: monty@mariadb.org
2022-01-27 16:37:58 +02:00
Marko Mäkelä
c64e507fad MDEV-27621 Backup fails with FATAL ERROR: Was only able to copy log
In commit 685d958e38 (MDEV-14425)
a bug was introduced to mariadb-backup --backup for the case when
the log is wrapping around to log_sys.START_OFFSET (12288).

This could also cause a "Missing FILE_CHECKPOINT" error during
mariadb-backup --prepare, in case the log copying resumed after
the server had produced a multiple of innodb_log_file_size-12288
bytes of more log so that the last mini-transaction would end
exactly at the end of the log file.

xtrabackup_copy_logfile(): If the log wraps around, read everything
to the end of the log file, and then the rest from log_sys.START_OFFSET.
2022-01-27 16:17:40 +02:00
Monty
008c02c987 MDEV-27477 Remaining SUSE patches for 10.2+
This patch fixes the logrotate config file for mariadb.
Read more at https://www.novell.com/support/kb/doc.php?id=7005219

Source:
https://github.com/openSUSE/mysql-packaging/blob/master/patches/mysql-patches/mariadb-10.0.15-logrotate-su.patch
2022-01-27 16:12:16 +02:00
Monty
37886a29e5 Updated comment in systemd.cmake
Suggested by serg@mariadb.org
2022-01-27 16:07:02 +02:00