maria:bb-11.2-MDEV-31477-json_key_value

Last commit made on 2023-06-20
Get this branch:
git clone -b bb-11.2-MDEV-31477-json_key_value https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.2-MDEV-31477-json_key_value
Repository:
lp:maria

Recent commits

ac5342c... by Rucha Deodhar <email address hidden>

MDEV-31477: The JSON_KEY_VALUE function should print an error message
if json_doc is passed as a variable

Analysis:
JSON_KEY_VALUE() uses Json_path_extractor::extract() to reach to path and
extract values. One error it only returns true, but no error.
Fix:
report error when there is error in scanning json document.

d1eb58e... by Rucha Deodhar <email address hidden>

MDEV-30145: JSON_TABLE: allow to retrieve the key when iterating on JSON
objects

Idea behind implementation:
We get the json object specified by the json path. Then, transform it into
key-value pairs by going over the json. Get each key-value pair
one-by-one and return the result.

28d9b9b... by Anel Husakovic <email address hidden>

MDEV-28343: sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE when schema contains temporary tables

- MDEV-28342 raised the error in case temporary table shadows base table
- Now we are allowed to shadow base tables with temporary tables and
`sys.create_synonym_db()` can easily check for existance of temporary table and
ignore view creation, since it is not supported to create view from
temporary table.

Reviewed-by: <email address hidden>,
             <email address hidden>

79ff655... by Monty <email address hidden>

MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info

Reviewed-by: <email address hidden>

b17883e... by Anel Husakovic <email address hidden>

MDEV-12459 Patch sysschema

This commit updates sysschema to work with the new behaviour of show
tables and information_schema.tables table showing temporary tables for
current connection.

Co-authored-by: Monty <email address hidden>
Reviewer: <email address hidden>

0f75a52... by Anel Husakovic <email address hidden>

MDEV-12459 Get temporary tables visible to the IS.tables for current connection

Additionally fixes the bugs uncovered in:
  - `MDEV-28332: Alter on temporary table causes ER_TABLE_EXISTS_ERROR note`
    Since there is no `warning` issued by shadowing of base table, this MDEV
    is irrelevant. Keeping for review purposes and for future development
    in case shadowing is going to be implemented
  - `MDEV-28334: SHOW TABLE STATUS shows all temporary tables ignoring database and conditions`
  - `MDEV-28453: SHOW commands are inconsistent for temporary tables`

Reviewed by: <email address hidden>,
             <email address hidden>

2f99d13... by Anel Husakovic <email address hidden>

Cosmetic fixes

Reviewer: <email address hidden>

79f9e94... by Yuchen Pei

MDEV-26137 Improve import tablespace workflow.

Allow ALTER TABLE ... IMPORT TABLESPACE without creating the table
followed by discarding the tablespace.

That is, assuming we want to import table t1 to t2, instead of

CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 DISCARD TABLESPACE;
FLUSH TABLES t1 FOR EXPORT;
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;

We can simply do

FLUSH TABLES t1 FOR EXPORT;
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;

We achieve this by creating a "stub" table in the second scenario
while opening the table, where t2 does not exist but needs to import
from t1. The "stub" table is similar to a table that is created but
then instructed to discard its tablespace.

We include tests with various row formats, encryption, with indexes
and auto-increment.

Signed-off-by: Yuchen Pei <email address hidden>

bdee0de... by Zhibo Zhang <email address hidden>

MDEV-30188: Ensure all binlog* variables are visible as system variables
Turn the remaining three `binlog*` options binlog_do_db, binlog_ignore_db,
binlog_rows_event_max_size into global variables so that they can be
visible from the SQL user level. This is for audit / secure
configuration check purposes.

Create new MTR tests to make sure that the newly created global
variables can be visible from the command line interface.

Behavior before the code change:

    MariaDB [(none)]> SHOW GLOBAL VARIABLES WHERE
        -> Variable_name LIKE 'binlog_do_db' OR
        -> Variable_name LIKE 'binlog_ignore_db' OR
        -> Variable_name LIKE 'binlog_row_event_max_size';
    Empty set (0.001 sec)

Behavior after the code change:

    MariaDB [(none)]> SHOW GLOBAL VARIABLES WHERE
        -> Variable_name LIKE 'binlog_do_db' OR
        -> Variable_name LIKE 'binlog_ignore_db' OR
        -> Variable_name LIKE 'binlog_row_event_max_size';
    +---------------------------+-------+
    | Variable_name | Value |
    +---------------------------+-------+
    | binlog_do_db | |
    | binlog_ignore_db | |
    | binlog_row_event_max_size | 8192 |
    +---------------------------+-------+
    3 rows in set (0.001 sec)

Note:

For `binlog_do_db` and `binlog_ignore_db`, we add a new class
`Sys_var_binlog_filter` to handle the dynamically-composable command line
options for `binlog_do_db` and `binlog_ignore_db`. Below
is the motivation:

When the users start the server with the option
    --binlog-do-db="database1" --binlog-do-db="database2"
The expected behavior is that the system should allow replication for
both `database1` and `database2`, which is the logic of the original
code.

However, when turning the variables into system variables, the
functionality does not exist any more, since system variables will only
handle the last occurrence of the option, and in this case, the system
will only be able to handle `database2`.

Copyright:

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the BSD-new
license. I am contributing on behalf of my employer Amazon Web Services, Inc.

907bc68... by Sergei Golubchik

Merge branch '11.1' into 11.2