maria:bb-10.4-andrei

Last commit made on 2023-11-09
Get this branch:
git clone -b bb-10.4-andrei https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.4-andrei
Repository:
lp:maria

Recent commits

d6872f9... by Andrei <email address hidden>

MDEV-32365: post-fixes to rpl_semi_sync_slave_reply_fail

62d8065... by Alexander Barkov

MDEV-29110 mariabackup has wrong or missing plugin-dir default?

Problem:

The file backup-my.cnf from the backup directory was loaded by
"mariabackup --prepare" only in case of the explicit --target-dir given.
It was not loaded from the default directory ./xtrabackup_backupfiles/
in case if the explicit --target-dir was missing.

In other words, it worked as follows:

1. When started as "mariabackup --prepare --target-dir=DIR", mariabackup:
  a. loads defaults from "DIR/backup-my.cnf"
  b. processes data files in the specified directory DIR

2. When started as "mariabackup --prepare", mariabackup:
  a. does not load defaults from "./xtrabackup_backupfiles/backup-my.cnf"
  b. processes data files in the default directory "./xtrabackup_backupfiles/"

This patch fixes the second scenario, so it works as follows:

2. When started as "mariabackup --prepare", mariabackup:
  a. loads defaults from "./xtrabackup_backupfiles/backup-my.cnf"
  b. processes data files in the default directory "./xtrabackup_backupfiles/"

This change fixes (among others) the problem with the
"Can't open shared library '/file_key_management.so'" error
reported when "mariabackup --prepare" is used without --target-dir
in combinaton with the encryption plugin.

2b6d241... by Alexander Barkov

MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE

The crash happened with an indexed virtual column whose
value is evaluated using a function that has a different meaning
in sql_mode='' vs sql_mode=ORACLE:

- DECODE()
- LTRIM()
- RTRIM()
- LPAD()
- RPAD()
- REPLACE()
- SUBSTR()

For example:

CREATE TABLE t1 (
  b VARCHAR(1),
  g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL,
  KEY g(g)
);

So far we had replacement XXX_ORACLE() functions for all mentioned function,
e.g. SUBSTR_ORACLE() for SUBSTR(). So it was possible to correctly re-parse
SUBSTR_ORACLE() even in sql_mode=''.

But it was not possible to re-parse the MariaDB version of SUBSTR()
after switching to sql_mode=ORACLE. It was erroneously mis-interpreted
as SUBSTR_ORACLE().

As a result, this combination worked fine:

SET sql_mode=ORACLE;
CREATE TABLE t1 ... g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL, ...;
INSERT ...
FLUSH TABLES;
SET sql_mode='';
INSERT ...

But the other way around it crashed:

SET sql_mode='';
CREATE TABLE t1 ... g CHAR(1) GENERATED ALWAYS AS (SUBSTR(b,0,0)) VIRTUAL, ...;
INSERT ...
FLUSH TABLES;
SET sql_mode=ORACLE;
INSERT ...

At CREATE time, SUBSTR was instantiated as Item_func_substr and printed
in the FRM file as substr(). At re-open time with sql_mode=ORACLE, "substr()"
was erroneously instantiated as Item_func_substr_oracle.

Fix:

The fix proposes a symmetric solution. It provides a way to re-parse reliably
all sql_mode dependent functions to their original CREATE TABLE time meaning,
no matter what the open-time sql_mode is.

We take advantage of the same idea we previously used to resolve sql_mode
dependent data types.

Now all sql_mode dependent functions are printed by SHOW using a schema
qualifier when the current sql_mode differs from the function sql_mode:

SET sql_mode='';
CREATE TABLE t1 ... SUBSTR(a,b,c) ..;
SET sql_mode=ORACLE;
SHOW CREATE TABLE t1; -> mariadb_schema.substr(a,b,c)

SET sql_mode=ORACLE;
CREATE TABLE t2 ... SUBSTR(a,b,c) ..;
SET sql_mode='';
SHOW CREATE TABLE t1; -> oracle_schema.substr(a,b,c)

Old replacement names like substr_oracle() are still understood for
backward compatibility and used in FRM files (for downgrade compatibility),
but they are not printed by SHOW any more.

228b7e4... by Marko Mäkelä

MDEV-13626 Merge InnoDB test cases from MySQL 5.7

This imports and adapts a number of MySQL 5.7 test cases that are
applicable to MariaDB.

Some tests for old bug fixes are not that relevant because the code
has been refactored since then (especially starting with
MariaDB Server 10.6), and the tests would not reproduce the
original bug if the fix was reverted.

In the test innodb_fts.opt, there are many duplicate MATCH ranks, which
would make the results nondeterministic. The test was stabilized by
changing some LIMIT clauses or by adding sorted_result in those cases
where the purpose of a test was to show that no sorting took place
in the server.

In the test innodb_fts.phrase, MySQL 5.7 would generate FTS_DOC_ID that
are 1 larger than in MariaDB. In innodb_fts.index_table the difference is 2.
This is because in MariaDB, fts_get_next_doc_id() post-increments
cache->next_doc_id, while MySQL 5.7 pre-increments it.

Reviewed by: Thirunarayanan Balathandayuthapani

2447172... by Monty <email address hidden>

Ensure that process "State" is properly cleaned after query execution

In some cases "SHOW PROCESSLIST" could show "Reset for next command"
as State, even if the previous query had finished properly.

Fixed by clearing State after end of command and also setting the State
for the "Connect" command.

Other things:
- Changed usage of 'thd->set_command(COM_SLEEP)' to
  'thd->mark_connection_idle()'.
- Changed thread_state_info() to return "" instead of NULL. This is
  just a safety measurement and in line with the logic of the
  rest of the function.

01623ac... by Marko Mäkelä

Fix clang -Wtypedef-redefinition

f77a386... by Marko Mäkelä

MDEV-11816 fixup: Remove an orphan test file

fa81afd... by Alexey Botchkov

MDEV-27595 Backport SQL service, introduced by MDEV-19275.

Post-review fixes.

910a0dd... by Alexey Botchkov

MDEV-27295 Backport SQL service, introduced by MDEV-19275.

necessary functions added to the SQL SERVICE.

b080cff... by Alexey Botchkov

MDEV-27295 Backport SQL service, introduced by MDEV-19275.

ifdef fixed.