lp:maria

Owned by Maria-captains
Get this repository:
git clone https://git.launchpad.net/maria

Import details

Import Status: Reviewed

This repository is an import of the Git repository at https://github.com/MariaDB/server.git.

The next import is scheduled to run .

Last successful import was .

Import started on juju-1e3bde-prod-lp-code-import-16 and finished taking 9 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-16 and finished taking 11 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-16 and finished taking 9 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-15 and finished taking 8 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 7 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 4 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 6 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 7 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 5 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 7 minutes — see the log

Branches

Name Last Modified Last Commit
bb-10.2-mdev-22711-hf 2021-10-25 20:29:27 UTC
MDEV-22711 Assertion `nr != 0' failed in handler::update_auto_increment.

Author: Alexey Botchkov
Author Date: 2021-10-20 10:53:01 UTC

MDEV-22711 Assertion `nr != 0' failed in handler::update_auto_increment.

DBUG_ASSERT removed as the AUTO INCREMENT can actually be 0 when the
SET insert_id= 0; was done.

bb-10.2-lib_n_compiler 2021-10-25 20:21:27 UTC
pthread_yield() is depricated now, so use sched_yield() if possible.

Author: Oleksandr "Sanja" Byelkin
Author Date: 2021-10-25 20:21:27 UTC

pthread_yield() is depricated now, so use sched_yield() if possible.

bb-10.7-serg 2021-10-25 19:37:16 UTC
libfmt fix for cmake <3.0

Author: Sergei Golubchik
Author Date: 2021-10-25 19:33:16 UTC

libfmt fix for cmake <3.0

this is CentOOOOOOS 7

bb-10.7-row_number 2021-10-25 18:40:16 UTC
MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon

Author: Rucha Deodhar
Author Date: 2021-10-18 15:00:04 UTC

MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon
ER_TRUNCATED_WRONG_VALUE

Part 1: Fix for DELETE without ORDER BY

Analysis: m_current_row_for_warning doesn't increment and assumes default
value which is then used by ROW_NUMBER.
Fix: Increment m_current_row_for_warning for each processed row.

bb-10.5-MDEV-23766 2021-10-25 16:01:50 UTC
MDEV-23766: JSON consistency checks in Json_writer

Author: Sergei Krivonos
Author Date: 2021-10-24 21:19:37 UTC

MDEV-23766: JSON consistency checks in Json_writer

10.2 2021-10-25 15:53:25 UTC
MDEV-26556 An improper locking bug(s) due to unreleased lock.

Author: Alexey Botchkov
Author Date: 2021-10-21 11:11:20 UTC

MDEV-26556 An improper locking bug(s) due to unreleased lock.

Get rid of the global big_buffer.

bb-10.2-mdev-26556-hf 2021-10-25 15:53:25 UTC
MDEV-26556 An improper locking bug(s) due to unreleased lock.

Author: Alexey Botchkov
Author Date: 2021-10-21 11:11:20 UTC

MDEV-26556 An improper locking bug(s) due to unreleased lock.

Get rid of the global big_buffer.

bb-10.2-serg 2021-10-25 15:30:03 UTC
compilation fixes for sys-devel/gcc-11.2.0:11

Author: Sergei Golubchik
Author Date: 2021-10-25 08:48:24 UTC

compilation fixes for sys-devel/gcc-11.2.0:11

bb-10.5-andrei 2021-10-25 15:25:03 UTC
MDEV-26833 Missed statement rollback in case transaction drops or create temp...

Author: Andrei Elkin
Author Date: 2021-10-25 15:25:03 UTC

MDEV-26833 Missed statement rollback in case transaction drops or create temporary table

When transaction creates or drops temporary tables and afterward its statement
faces an error its already binlog in ROW format events are involved into binlog
through the transaction's commit.

Fixed with proper analysis of whether the errored-out statement can be also rolled back
in binlog. For instance a fact of already having cached CREATE or DROP of a temporary
table not by the current statement (then by previous statements)
leads to the statement rollback decision.

preview-10.7-MDEV-4958-uuid 2021-10-25 13:28:25 UTC
MDEV-26785 Hyphens inside the value of uuid datatype

Author: Alexander Barkov
Author Date: 2021-10-25 13:28:25 UTC

MDEV-26785 Hyphens inside the value of uuid datatype

preview-10.7-MDEV-22166-convert-partition 2021-10-25 12:54:55 UTC
MDEV-26767 Server crashes when rename table and alter storage engine

Author: midenok
Author Date: 2021-10-11 12:28:00 UTC

MDEV-26767 Server crashes when rename table and alter storage engine

Wrong assertion leftover removed. m_sql_cmd can be allocated by any
ALTER subcommand and before allocation it is checked for NULL first.

bb-10.5-anel-MDEV-26875-wrong-set-default 2021-10-25 12:43:38 UTC
MDEV-26875: Wrong user in SET DEFAULT ROLE error

Author: Anel Husakovic
Author Date: 2021-10-25 12:43:30 UTC

MDEV-26875: Wrong user in SET DEFAULT ROLE error

- Caused by 7c02e8717de5, where 957cb7b7ba35 introduced the bug.

Reviewed by:

bb-10.3-midenok-MDEV-25004 2021-10-25 11:09:26 UTC
MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY

Author: midenok
Author Date: 2021-10-24 19:51:32 UTC

MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY

1. In case of system-versioned table add row_end into FTS_DOC_ID index
   in fts_create_common_tables() and innobase_create_key_defs().
   fts_n_uniq() returns 1 or 2 depending on whether the table is
   system-versioned.

   After this patch recreate of FTS_DOC_ID index is required for
   existing system-versioned tables. If you see this message in error
   log or server warnings: "InnoDB: Table db/t1 contains 2 indexes
   inside InnoDB, which is different from the number of indexes 1
   defined in the MariaDB" use this command to fix the table:

      ALTER TABLE db.t1 FORCE;

2. Fix duplicate history for secondary unique index like it was done
   in MDEV-23644 for clustered index (932ec586aad). In case of
   existing history row which conflicts with currently inseted row we
   check in row_ins_scan_sec_index_for_duplicate() whether that row
   was inserted as part of current transaction. In that case we
   indicate with DB_FOREIGN_DUPLICATE_KEY that new history row is
   needed.

3. Some parts of MDEV-21138 (7410ff436e9) reverted. Skipping of
   FTS_DOC_ID index for history rows made problems with purge
   system. Now this is fixed differently by p.2.

4. wait_all_purged.inc checks that we didn't affect non-history rows
   so they are deleted and purged correctly.

10.7 2021-10-25 10:40:00 UTC
MDEV-26890 : Crash on shutdown, with active binlog dump threads

Author: Vladislav Vaintroub
Author Date: 2021-10-25 10:40:00 UTC

MDEV-26890 : Crash on shutdown, with active binlog dump threads

The reason for the crash was a bug in MDEV-19275, after which shutdown
does not wait for binlog threads anymore.

bb-10.5-anel-MDEV-22552 2021-10-25 10:15:49 UTC
MDEV-22552: mytop packaging

Author: Anel Husakovic
Author Date: 2021-06-21 12:02:17 UTC

MDEV-22552: mytop packaging

`mytop` and `my_print_defaults` for RPM

- Add `mytop` to client package
- Add man page of `my_print_defaults` to client package
- Add dependencies for RPMs
- Remove old comment
- Remove dead link

Reviewed by: serg@mariadb.com

bb-10.7-row_number-MDEV-26844 2021-10-25 09:27:33 UTC
MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon

Author: Rucha Deodhar
Author Date: 2021-10-25 09:27:33 UTC

MDEV-26844: DELETE returns ROW_NUMBER=1 for every row upon
ER_TRUNCATED_WRONG_VALUE

Part 2: Fix for DELETE with ORDER BY

Analysis: m_current_row_for_warning doesn't increment and assumes default
value which is then used by ROW_NUMBER.
Fix: Introduced a a new variable(modify_m_current_row_for_warning) which
when true increments counter. It is set to true when object of Filesort
class is created for DELETE and false everywhere else to avoid getting
strange results for other statements example SELECT.
This also fixes UPDATE with ORDER BY

10.6 2021-10-25 07:55:04 UTC
MDEV-26674: Set innodb_use_native_aio=OFF when using io_uring on a potentiall...

Author: Marko Mäkelä
Author Date: 2021-10-25 07:55:04 UTC

MDEV-26674: Set innodb_use_native_aio=OFF when using io_uring on a potentially affected kernel

We have observed hangs of the io_uring subsystem when using a
Linux kernel newer than 5.10. Also 5.15-rc6 is affected by this.

The exact cause of the hangs has not been diagnosed yet.
As a safety measure, we will disable innodb_use_native_aio by default
when the server has been configured with io_uring and the kernel
version is between 5.11 and 5.15.

If the start-up parameter innodb_use_native_aio=ON is set, then
we will issue a warning to the server error log.

preview-10.7-MDEV-26519-json-histograms 2021-10-24 17:31:08 UTC
MDEV-26892: JSON histograms become invalid with a specific (corrupt) value ..

Author: Sergey Petrunia
Author Date: 2021-10-24 17:31:08 UTC

MDEV-26892: JSON histograms become invalid with a specific (corrupt) value ..

Handle the case where the last value in the table cannot be represented
in utf8mb4.

bb-10.2-MDEV-22522 2021-10-24 05:48:16 UTC
MDEV-22522 RPM packages have meaningless summary/description

Author: Alexey Bychko
Author Date: 2021-10-23 15:38:13 UTC

MDEV-22522 RPM packages have meaningless summary/description

added separate file for summary/descriptions to separate cmake logic
from large text data.
RPM descriptopns are mostly aligned with debian ones

bb-10.4-MDEV-11853 2021-10-22 18:01:14 UTC
MDEV-11853: semisync thread can be killed after sync binlog but before ACK in...

Author: Brandon Nesterenko
Author Date: 2021-10-21 02:13:45 UTC

MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state

Problem:
========
If a primary is shutdown during an active semi-sync connection
during the period when the primary is awaiting an ACK, the primary
hard kills the active communication thread and does not ensure the
transaction was received by a replica. This can lead to an
inconsistent replication state.

Solution:
========
During shutdown, the primary should wait for an ACK or timeout
before hard killing a thread which is awaiting a communication. We
extend the `SHUTDOWN WAIT FOR SLAVES` logic to identify and ignore
any threads waiting for a semi-sync ACK in phase 1. Then, before
stopping the ack receiver thread, the shutdown is delayed until all
waiting semi-sync connections receive an ACK or time out. The
connections are then killed in phase 2.

Reviewed By:
============
<TODO>

bb-10.3-bar-MDEV-22380 2021-10-22 15:45:20 UTC
MDEV-22380: Assertion `name.length == strlen(name.str)' failed ...

Author: Alexander Barkov
Author Date: 2021-10-22 14:41:35 UTC

MDEV-22380: Assertion `name.length == strlen(name.str)' failed ...

Also fixes:
MDEV-25399 Assertion `name.length == strlen(name.str)' failed in Item_func_sp::make_send_field

Also fixes a problem that in this scenario:

SET NAMES binary;
SELECT 'some not well-formed utf8 string';

the auto-generated column name copied the binary string value directly
to the Item name, without checking utf8 well-formedness.

After this change auto-generated column names work as follows:
- Zero bytes 0x00 are copied to the name using HEX notation
- In case of "SET NAMES binary", all bytes sequences that do not make
  well-formed utf8 characters are copied to the name using HEX notation.

bb-10.7-MDEV-24621-rebase 2021-10-22 14:32:18 UTC
MDEV-24621 In bulk insert, pre-sort and build indexes one page at a time

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-22 14:32:18 UTC

MDEV-24621 In bulk insert, pre-sort and build indexes one page at a time

When inserting a number of rows into an empty table,
InnoDB will buffer and pre-sort the records for each index, and
build the indexes one page at a time.

For each index, a buffer of innodb_sort_buffer_size will be created.

If the buffer ran out of memory then we will create temporary files
for storing the data.

At the end of the statement, we will sort and apply the buffered
records. Ideally, we would do this at the end of the transaction
or only when starting to execute a non-INSERT statement on the table.
However, it could be awkward if duplicate keys or similar errors
would be reported during the execution of a later statement.
This will be addressed in MDEV-25036.

Any columns longer than 2000 bytes will buffered in temporary files.

innodb_prepare_commit_versioned(): Apply all bulk buffered insert
operation, at the end of each statement.

ha_commit_trans(): Handle errors from innodb_prepare_commit_versioned().

row_merge_buf_write(): This function should accept blob
file handle too and it should write the field data which are
greater than 2000 bytes

row_merge_bulk_t: Data structure to maintain the data during
bulk insert operation.

trx_mod_table_time_t::start_bulk_insert(): Notify the start of
bulk insert operation and create new buffer for the given table

trx_mod_table_time_t::add_tuple(): Buffer a record.

trx_mod_table_time_t::write_bulk(): Do bulk insert operation
present in the transaction

trx_mod_table_time_t::bulk_buffer_exist(): Whether the buffer
storage exist for the bulk transaction

trx_mod_table_time_t::write_bulk(): Write all buffered insert
operation for the transaction and the table.

row_ins_clust_index_entry_low(): Insert the data into the
bulk buffer if it is already exist.

row_ins_sec_index_entry(): Insert the secondary tuple
if the bulk buffer already exist.

row_merge_bulk_buf_add(): Insert the tuple into bulk buffer
insert operation.

row_merge_buf_blob(): Write the field data whose length is
more than 2000 bytes into blob temporary file. Write the
file offset and length into the tuple field.

row_merge_copy_blob_from_file(): Copy the blob from blob file
handler based on reference of the given tuple.

row_merge_insert_index_tuples(): Handle blob for bulk insert
operation.

row_merge_bulk_t::row_merge_bulk_t(): Constructor. Initialize
the buffer and file for all the indexes expect fts index.

row_merge_bulk_t::create_tmp_file(): Create new temporary file
for the given index.

row_merge_bulk_t::write_to_tmp_file(): Write the content from
buffer to disk file for the given index.

row_merge_bulk_t::add_tuple(): Insert the tuple into the merge
buffer for the given index. If the memory ran out then InnoDB
should sort the buffer and write into file.

row_merge_bulk_t::write_to_index(): Do bulk insert operation
from merge file/merge buffer for the given index

row_merge_bulk_t::write_to_table(): Do bulk insert operation
for all the indexes.

dict_stats_update(): If a bulk insert transaction is in progress,
treat the table as empty. The index creation could hold latches
for extended amounts of time.

bb-10.7-monty 2021-10-22 13:44:51 UTC
Fixed mysqld--help.result if password-reuse-check is compiled in static

Author: Monty
Author Date: 2021-10-22 11:10:45 UTC

Fixed mysqld--help.result if password-reuse-check is compiled in static

bb-10.2-MDEV-26668-schema-mismatch 2021-10-22 13:04:02 UTC
MDEV-26668 CHECK TABLE fails to report schema mismatch

Author: Eugene
Author Date: 2021-10-11 08:19:57 UTC

MDEV-26668 CHECK TABLE fails to report schema mismatch

check_index_consistency(): always check clustered index against all
fields defined in MariaDB table. Also check for a possible FTS index
at the end.

innobase_match_index_columns(): the change is not a refactoring only.
Notice a while loop which was removed. Once it encounters a DATA_SYS
field it skips all the left fields! This is fixed now.

ha_innobase::open(): now returns an error when MariaDB and InnoDB table
definitions differ

innodb_strict_mode: affects the above check in a sandard way:
makes it an error or a warning.

MDEV-18186 test case was moved to another file because previous
if (have_debug) code in the test case makes SHOW CREATE TABLE behave
differently in release and debug modes.

bb-10.6-MDEV-26779 2021-10-22 12:46:55 UTC
MDEV-26779: work around lock_sys.wait_mutex contention by spinloop

Author: Marko Mäkelä
Author Date: 2021-10-22 12:46:55 UTC

MDEV-26779: work around lock_sys.wait_mutex contention by spinloop

This should be equivalent to pull request #1923
when CMAKE_CXX_FLAGS includes -DSPIN_MUTEX_INLINE.

All invocations of spin_mutex_lock() where we are holding other latches
are marked with comments. My hypothesis is that some of those
spin_mutex_lock() invocations should be reverted to improve performance.

10.7-selectivity 2021-10-22 11:26:43 UTC
Split cost calculations into fetch and total

Author: Monty
Author Date: 2021-10-21 16:40:58 UTC

Split cost calculations into fetch and total

This patch causes no changes in costs or result files.

Changes:
- Store row compare cost separately in Cost_estimate::comp_cost
- Store cost of fetching rows separately in OPT_RANGE
- Use range->fetch_cost instead of adjust_quick_cost(total_cost)

This was done to simplify cost calculation in sql_select.cc:
- We can use range->fetch_cost directly without having to call
  adjust_quick_cost(). adjust_quick_cost() is now removed.

Other things:
- Removed some not used functions in Cost_estimate

bb-10.2-nikita 2021-10-22 10:44:11 UTC
reformat row_ins_foreign_fill_virtual

Author: Nikita Malyavin
Author Date: 2021-10-22 10:44:11 UTC

reformat row_ins_foreign_fill_virtual

bb-10.6-MDEV-26827 2021-10-22 10:11:41 UTC
MDEV-26827: Avoid buf_pool.mutex in buf_page_write_complete()

Author: Marko Mäkelä
Author Date: 2021-10-19 20:28:26 UTC

MDEV-26827: Avoid buf_pool.mutex in buf_page_write_complete()

buf_page_write_complete(): Do not acquire buf_pool.mutex
except when writing out a compressed-only ROW_FORMAT=COMPRESSED page
or when executing LRU eviction flushing.

buf_page_t::write_complete(), buf_page_t::reset_oldest_modification():
Replaces buf_page_t::clear_oldest_modification(bool).

buf_page_t::ready_for_flush(): Relax an assertion on
oldest_modification().

buf_flush_page(): After acquiring the page U-latch, evaluate whether
the page still needs to be written out. Previously, this check was not
necessary, because buf_flush_list() and buf_page_write_complete()
would be mutually exclusive due to buf_pool.mutex.

bb-10.7-bar-uuid 2021-10-22 09:52:52 UTC
MDEV-26664 Store UUIDs in a more efficient manner

Author: Alexander Barkov
Author Date: 2021-10-19 09:17:11 UTC

MDEV-26664 Store UUIDs in a more efficient manner

UUID values

  llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn

are now stored as

  nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll

inside the record:

- the groups (segments separated by dash) are reordered right-to-left.
- the bytes inside the groups are not reordered (stored as before,
  in big-endian format).

This provides a better sorting order: the earlier UUID was generated,
the higher it appears in the ORDER BY output.

Also, this change enables a good key prefix compression,
because the constant part is now in the beginning, while
the non-constant part (the timestamp) is in the end.

bb-10.2-MDEV-14938 2021-10-22 09:30:56 UTC
MDEV-14938 make buildbot to include galera into bintars

Author: Alexey Bychko
Author Date: 2021-10-21 08:51:35 UTC

MDEV-14938 make buildbot to include galera into bintars

this commit adds cmake module to process external directory with built
galera to include galera library and binaries into server build.
it introduces new cmake variable EXT_GALERA_PATH representing relative
or absolute path to compiled galera tree.

preview-10.7-MDEV-12933-provider-plugins 2021-10-22 08:14:57 UTC
mariabackup: rename encryption_plugin -> xb_plugin

Author: Sergei Golubchik
Author Date: 2021-10-22 08:14:57 UTC

mariabackup: rename encryption_plugin -> xb_plugin

because plugin code is not only about encryption anymore
(also loads provider plugins), and xb_ prefix prevents name
clashes with the server code (that mariabackup links with).

10.2-tmp 2021-10-22 08:08:36 UTC
Fix comment

Author: Sergey Petrunia
Author Date: 2021-10-20 16:53:49 UTC

Fix comment

bb-10.2-tmp 2021-10-22 08:08:36 UTC
Fix comment

Author: Sergey Petrunia
Author Date: 2021-10-20 16:53:49 UTC

Fix comment

bb-10.3-KILL-as-TOI-galera 2021-10-22 06:41:02 UTC
MDEV-23328 Server hang due to Galera lock conflict resolution

Author: Jan Lindström
Author Date: 2021-10-21 11:49:51 UTC

MDEV-23328 Server hang due to Galera lock conflict resolution

Mutex order violation when wsrep bf thread kills a conflicting trx,
the stack is

          wsrep_thd_LOCK()
          wsrep_kill_victim()
          lock_rec_other_has_conflicting()
          lock_clust_rec_read_check_and_lock()
          row_search_mvcc()
          ha_innobase::index_read()
          ha_innobase::rnd_pos()
          handler::ha_rnd_pos()
          handler::rnd_pos_by_record()
          handler::ha_rnd_pos_by_record()
          Rows_log_event::find_row()
          Update_rows_log_event::do_exec_row()
          Rows_log_event::do_apply_event()
          Log_event::apply_event()
          wsrep_apply_events()

and mutexes are taken in the order

          lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data

When a normal KILL statement is executed, the stack is

          innobase_kill_query()
          kill_handlerton()
          plugin_foreach_with_mask()
          ha_kill_query()
          THD::awake()
          kill_one_thread()

        and mutexes are

          victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex

This patch is the plan D variant for fixing potetial mutex locking
order exercised by BF aborting and KILL command execution.

In this approach, KILL command is replicated as TOI operation.
This guarantees total isolation for the KILL command execution
in the first node: there is no concurrent replication applying
and no concurrent DDL executing. Therefore there is no risk of
BF aborting to happen in parallel with KILL command execution
either. Potential mutex deadlocks between the different mutex
access paths with KILL command execution and BF aborting cannot
therefore happen.

TOI replication is used, in this approach, purely as means
to provide isolated KILL command execution in the first node.
KILL command should not (and must not) be applied in secondary
nodes. In this patch, we make this sure by skipping KILL
execution in secondary nodes, in applying phase, where we
bail out if applier thread is trying to execute KILL command.
This is effective, but skipping the applying of KILL command
could happen much earlier as well.

This also fixed unprotected calls to wsrep_thd_abort
that will use wsrep_abort_transaction. This is fixed
by holding THD::LOCK_thd_data while we abort transaction.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>

bb-10.7-MDEV-24621-revised 2021-10-22 05:20:00 UTC
Fixup: Removed row0ins.cc changes alone

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-22 05:20:00 UTC

Fixup: Removed row0ins.cc changes alone

bb-10.2-KILL-as-TOI-galera 2021-10-22 04:02:39 UTC
MDEV-23328 Server hang due to Galera lock conflict resolution

Author: Jan Lindström
Author Date: 2021-10-21 11:49:51 UTC

MDEV-23328 Server hang due to Galera lock conflict resolution

Mutex order violation when wsrep bf thread kills a conflicting trx,
the stack is

          wsrep_thd_LOCK()
          wsrep_kill_victim()
          lock_rec_other_has_conflicting()
          lock_clust_rec_read_check_and_lock()
          row_search_mvcc()
          ha_innobase::index_read()
          ha_innobase::rnd_pos()
          handler::ha_rnd_pos()
          handler::rnd_pos_by_record()
          handler::ha_rnd_pos_by_record()
          Rows_log_event::find_row()
          Update_rows_log_event::do_exec_row()
          Rows_log_event::do_apply_event()
          Log_event::apply_event()
          wsrep_apply_events()

and mutexes are taken in the order

          lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data

When a normal KILL statement is executed, the stack is

          innobase_kill_query()
          kill_handlerton()
          plugin_foreach_with_mask()
          ha_kill_query()
          THD::awake()
          kill_one_thread()

        and mutexes are

          victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex

This patch is the plan D variant for fixing potetial mutex locking
order exercised by BF aborting and KILL command execution.

In this approach, KILL command is replicated as TOI operation.
This guarantees total isolation for the KILL command execution
in the first node: there is no concurrent replication applying
and no concurrent DDL executing. Therefore there is no risk of
BF aborting to happen in parallel with KILL command execution
either. Potential mutex deadlocks between the different mutex
access paths with KILL command execution and BF aborting cannot
therefore happen.

TOI replication is used, in this approach, purely as means
to provide isolated KILL command execution in the first node.
KILL command should not (and must not) be applied in secondary
nodes. In this patch, we make this sure by skipping KILL
execution in secondary nodes, in applying phase, where we
bail out if applier thread is trying to execute KILL command.
This is effective, but skipping the applying of KILL command
could happen much earlier as well.

This also fixed unprotected calls to wsrep_thd_abort
that will use wsrep_abort_transaction. This is fixed
by holding THD::LOCK_thd_data while we abort transaction.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>

bb-10.3-wlad 2021-10-21 16:42:29 UTC
Do not run GCC specific tests on MSVC

Author: Vladislav Vaintroub
Author Date: 2021-10-21 15:35:24 UTC

Do not run GCC specific tests on MSVC

10.5 2021-10-21 15:09:17 UTC
Merge 10.4 into 10.5

Author: Marko Mäkelä
Author Date: 2021-10-21 15:09:17 UTC

Merge 10.4 into 10.5

10.4 2021-10-21 15:06:31 UTC
Merge 10.3 into 10.4

Author: Marko Mäkelä
Author Date: 2021-10-21 15:06:31 UTC

Merge 10.3 into 10.4

10.3 2021-10-21 14:39:34 UTC
Merge 10.2 into 10.3

Author: Marko Mäkelä
Author Date: 2021-10-21 14:39:34 UTC

Merge 10.2 into 10.3

bb-10.2-MDEV-19129 2021-10-21 13:48:00 UTC
MDEV-19129: Xcode compatibility update: mysql-test-run.pl: rename $opt_vs_con...

Author: Sergei Krivonos
Author Date: 2021-10-21 12:21:44 UTC

MDEV-19129: Xcode compatibility update: mysql-test-run.pl: rename $opt_vs_config to $multiconfig to use with other cmake multiconfig generators

bb-10.5-release 2021-10-21 13:41:15 UTC
MDEV-26864 Race condition between transaction commit and undo log truncation

Author: Marko Mäkelä
Author Date: 2021-10-21 09:29:33 UTC

MDEV-26864 Race condition between transaction commit and undo log truncation

trx_commit_in_memory(): Do not release the rseg reference before
trx_undo_commit_cleanup() has been invoked and the current transaction
is truly done with the rollback segment. The purpose of the reference
count is to prevent data races with trx_purge_truncate_history().

This is based on
mysql/mysql-server@ac79aa1522f33e6eb912133a81fa2614db764c9c.

bb-10.2-MDEV-25114-galera-v2 2021-10-21 11:48:30 UTC
MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

Author: sjaakola
Author Date: 2021-09-15 06:16:44 UTC

MDEV-25114 Crash: WSREP: invalid state ROLLED_BACK (FATAL)

This patch is the plan D variant for fixing potetial mutex locking
order exercised by BF aborting and KILL command execution.

In this approach, KILL command is replicated as TOI operation.
This guarantees total isolation for the KILL command execution
in the first node: there is no concurrent replication applying
and no concurrent DDL executing. Therefore there is no risk of
BF aborting to happen in parallel with KILL command execution
either. Potential mutex deadlocks between the different mutex
access paths with KILL command execution and BF aborting cannot
therefore happen.

TOI replication is used, in this approach, purely as means
to provide isolated KILL command execution in the first node.
KILL command should not (and must not) be applied in secondary
nodes. In this patch, we make this sure by skipping KILL
execution in secondary nodes, in applying phase, where we
bail out if applier thread is trying to execute KILL command.
This is effective, but skipping the applying of KILL command
could happen much earlier as well.

This patch also fixes mutex locking order and unprotected
THD member accesses on bf aborting case. We try to hold
THD::LOCK_thd_data during bf aborting. Only case where it
is not possible is at wsrep_abort_transaction before
call wsrep_innobase_kill_one_trx where we take InnoDB
mutexes first and then THD::LOCK_thd_data.

This will also fix possible race condition during
close_connection and while wsrep is disconnecting
connections.

Added wsrep_bf_kill_debug test case

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>

force thread change and sleep on some critical points

Add more debug_sync points to wsrep_abort_transaction and
add two new test cases

(1) galera_to_error : After TOI error server does not accept new
statements
(2) galera_disconnect_debug: Disconnect victim connection while we
are debug_sync point on wsrep_abort_transaction

Fix regression on wsrep_close_connections by informing
wsrep_abort_transaction do we hold LOCK_thread_lock
or not and by introducing find_thread_by_id that
will not lock LOCK_thread_lock.

Remove unnecessary assigment

Add shutdown test with forced unireg_abort

bb-10.7-row_number-MDEV-26843 2021-10-21 11:43:13 UTC
MDEV-26843: Inconsistent behavior of ROW_NUMBER upon resignalling from

Author: Rucha Deodhar
Author Date: 2021-10-20 06:32:35 UTC

MDEV-26843: Inconsistent behavior of ROW_NUMBER upon resignalling from
function
Analysis: ROW_NUMBER should be 0 because the error produced is not related to
statement that modifies table data. It is just wrong number of arguments.
However, ROW_NUMBER is 1 because m_current_row_for_warning is not set to 0
before executing function.
Fix: Set m_current_row_for_warning to 0.

bb-10.2-MDEV-26647 2021-10-21 08:34:06 UTC
MDEV-26647 (simple_password_check) Include password validation plugin informa...

Author: Oleksandr "Sanja" Byelkin
Author Date: 2021-10-20 09:37:14 UTC

MDEV-26647 (simple_password_check) Include password validation plugin information in the error message if the SQL statement is not satisfied password policy

Make the plugin reporting cause of the error.

bb-10.2-MDEV-25114-planE-galera 2021-10-21 08:33:16 UTC
WRONG

Author: Jan Lindström
Author Date: 2021-10-21 08:33:16 UTC

WRONG

bb-10.2-thiru 2021-10-21 07:54:03 UTC
MDEV-19522 InnoDB commit fails when FTS_DOC_ID value is greater than 4294967295

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-06 13:20:56 UTC

MDEV-19522 InnoDB commit fails when FTS_DOC_ID value is greater than 4294967295

InnoDB commit fails when consecutive FTS_DOC_ID value
is greater than 4294967295.
Fix is that InnoDB should remove the delta FTS_DOC_ID
value limitations and fts should encode 8 byte value,
remove FTS_DOC_ID_MAX_STEP variable. Replaced the
fts0vlc.ic file with fts0vlc.h

fts_encode_int(): Should be able to encode 10 bytes value

fts_get_encoded_len(): Should get the length of the value
which has 10 bytes

fts_decode_vlc(): Add debug assertion to verify the maximum
length allowed is 10.

mach_read_uint64_little_endian(): Reads 64 bit stored in
little endian format

Added a unit test case which check for minimum and maximum
value to do the fts encoding

bb-10.7-MDEV-24621_revised 2021-10-21 07:49:13 UTC
Fixup:

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-21 07:49:13 UTC

Fixup:
1) Hack to apply bulk buffer insert via versioning related call
2) Removed all the changes in ha_innodb.cc
3) Removed all the changes in row0ins.cc
4) Removed all the changes in trx0trx.cc

preview-10.7-MDEV-24621-innodb-bulk-insert 2021-10-21 07:09:15 UTC
Fixup: Added UNIV_LIKELY(bulk_insert) IN bulk_insert_apply().

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-21 07:09:15 UTC

Fixup: Added UNIV_LIKELY(bulk_insert) IN bulk_insert_apply().
row_merge_bulk_t::write_to_index(): Assign nullptr when the files
are not created.

10.4-MDEV-11853 2021-10-21 02:37:45 UTC
MDEV-11853: semisync thread can be killed after sync binlog but before ACK in...

Author: Brandon Nesterenko
Author Date: 2021-10-21 02:13:45 UTC

MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state

No commit message yet, intermediary commit.

bb-10.4-nikita 2021-10-20 13:49:28 UTC
MDEV-20131 Assertion `!pk->has_virtual()' failed

Author: Nikita Malyavin
Author Date: 2021-10-07 12:04:56 UTC

MDEV-20131 Assertion `!pk->has_virtual()' failed

Assertion `!pk->has_virtual()' failed in dict_index_build_internal_clust
while creating PRIMARY key longer than possible to store in the page.

This happened because the key was wrongly deduced as Long UNIQUE supported,
however PRIMARY KEY cannot be of that type. The main reason is that
only 8 bytes are used to store the hash, see HA_HASH_FIELD_LENGTH.

This is also why HA_NOSAME flag is removed (and caused the assertion in
turn) in open_table_from_share:
      if (key_info->algorithm == HA_KEY_ALG_LONG_HASH)
      {
        key_part_end++;
        key_info->flags&= ~HA_NOSAME;
      }

To make it unique, the additional check is done by
check_duplicate_long_entries call from ha_write_row, and similar one from
ha_update_row.

PRIMARY key is already forbidden, which is checked by the first test in
main.long_unique, however is_hash_field_needed was wrongly deduced to true
in mysql_prepare_create_table in this particular case.

FIX:

* Improve the check for Key::PRIMARY type
* Simplify is_hash_field_needed deduction for a more neat reading

bb-10.3-MDEV-23182 2021-10-20 12:24:31 UTC
MDEV-23182: Server crashes in Item::fix_fields_if_needed / table_value_constr...

Author: Dmitry Shulga
Author Date: 2021-10-20 12:24:31 UTC

MDEV-23182: Server crashes in Item::fix_fields_if_needed / table_value_constr::prepare upon 2nd execution of PS

Repeating execution of a query containing the clause IN with string literals
in environment where the server variable in_predicate_conversion_threshold
is set results in server abnormal termination in case the query is run
as a Prepared Statement and conversion of charsets for string values in a query
are required.

The reason for terminating server abnormally is that instances of the class
Item_string created on transforming the IN clause into subquery were created
on runtime memory root that is deallocated on finishing execution of Prepared
statement. On the other hand, references to Items placed on deallocated memory
root still exist in objects of the class table_value_constr. Subsequent running
the same prepared statement leads to dereferencing of pointers to already
deallocated memory that could lead to undefined behaviour.

bb-10.7-row_number-MDEV-26830 2021-10-20 03:34:09 UTC
MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with

Author: Rucha Deodhar
Author Date: 2021-10-18 07:57:36 UTC

MDEV-26830: Wrong ROW_NUMBER in diagnostics upon INSERT IGNORE with
CHECK violation

Analysis: When there is constraint fail we return non-zero value for
view_check_option(). So we continue the loop which doesn't increment the
counter because it increments at the end of the loop.
Fix: Increment m_current_row_for_warning() at the beginning of loop. This
will also fix similar bugs if any, about counter not incrementing
correctly because of continue.

bb-10.4-MDEV-26363-danielblack-zero_last_password_changed 2021-10-20 01:39:04 UTC
MDEV-26363 Passwords incorrectly expiring after MySQL5.7 -> MariaDB10.3 -> 10...

Author: Daniel Black
Author Date: 2021-08-15 22:40:56 UTC

MDEV-26363 Passwords incorrectly expiring after MySQL5.7 -> MariaDB10.3 -> 10.4+ upgrades

MySQL-5.7 mysql.user tables have a last_password_changed field.

Because before MariaDB-10.4 remained oblivious to this, the act of creating
users or otherwise changing a users row left the last_password_field with 0.

Running a MariaDB-10.4 instance on this would work correctly, until mysql_upgrade
is run, when this 0 value immediately translates to password expired
state.

MySQL-5.7 relied on the password_expired enum to indicate password
expiry so we aren't going to activate password that were expired in
MySQL-5.7.

Thanks Hans Borresen for the bug report and review of the fix.

bb-10.7-row_number-MDEV-26695 2021-10-19 20:00:04 UTC
MDEV-26695: Number of an invalid row is not calculated for table value

Author: Rucha Deodhar
Author Date: 2021-10-19 20:00:04 UTC

MDEV-26695: Number of an invalid row is not calculated for table value
constructor

Analysis: counter does not increment while sending rows for table value
constructor and so row_number assumes the default value (0 in this case).
Fix: Increment the counter to avoid counter using default value.

bb-10.2-vicentiu 2021-10-19 17:59:41 UTC
Update minimum cmake version to 3.1.0

Author: Vicențiu Ciorbaru
Author Date: 2021-10-19 17:59:41 UTC

Update minimum cmake version to 3.1.0

Our cmake files actually depend on cmake 3.1.0 policies. See MDEV-26319,
and PR #1897, where policy CMP0054 NEW is needed to avoid dereferencing
strings that may be variable names.

Most of the code assumes this policy to be in place and additionally,
all our builders use cmake version >= 3.1.

bb-10.5-vicentiu 2021-10-19 16:34:52 UTC
Deb: Stop shipping mariadb-plugin-spider separately, include in server

Author: Otto Kekäläinen
Author Date: 2021-08-16 05:39:14 UTC

Deb: Stop shipping mariadb-plugin-spider separately, include in server

Instead of having a separate plugin, simply include Spider in the main
MariaDB Server package and let users manually enable on server installs
where they want to run it.

bb-10.3-vicentiu 2021-10-19 16:22:54 UTC
Fix Groonga crash on MIPS: Correctly link to libatomic

Author: Vicențiu Ciorbaru
Author Date: 2021-10-19 16:20:23 UTC

Fix Groonga crash on MIPS: Correctly link to libatomic

MIPS (and possibly other) platforms require linking against libatomic to
support 64-bit atomic integers. Groonga was failing to do so and all related
tests were failing with an atomics relocation error on MIPS.

Contributors:
James Cowgill <jcowgill@debian.org>

bb-10.5-MDEV-19129 2021-10-19 14:48:58 UTC
MDEV-19129: Xcode compatibility update: update libmariadb submodule

Author: Sergei Krivonos
Author Date: 2021-10-18 15:51:04 UTC

MDEV-19129: Xcode compatibility update: update libmariadb submodule

10.5-MDEV-23766 2021-10-19 14:12:28 UTC
MDEV-23766: moving JSON writer consistency check into Json_writer

Author: Sergei Krivonos
Author Date: 2021-10-19 13:07:35 UTC

MDEV-23766: moving JSON writer consistency check into Json_writer

bb-10.5-mdev-26158 2021-10-19 10:04:05 UTC
MDEV-26158 SIGSEGV in spider_free_mem from ha_spider::open on INSERT

Author: Nayuta Yanagisawa
Author Date: 2021-09-21 11:22:56 UTC

MDEV-26158 SIGSEGV in spider_free_mem from ha_spider::open on INSERT

The server crashes due to passing NULL to spider_free().

In some cases, this == pt_handler_share_handlers[0] at the label
error_get_share in ha_spider::open().

In such cases, to nullify pt_handler_share_handlers[0]->wide_handler
is nothing but to nullify this->wide_handler. We should not do this
before freeing this->wide_handler.

bb-10.2-wlad 2021-10-19 09:09:06 UTC
Try to fix appveyor to prevent occasional failing of mysql_client_test

Author: Vladislav Vaintroub
Author Date: 2021-10-19 09:09:06 UTC

Try to fix appveyor to prevent occasional failing of mysql_client_test

Sometimes, although not often, it would timeout after 3 minutes.

bb-10.4-MDEV-26294-instant-alter-charset 2021-10-19 07:37:16 UTC
MDEV--26294 Duplicate entries in unique index not detected when changing coll...

Author: Eugene
Author Date: 2021-10-19 07:31:09 UTC

MDEV--26294 Duplicate entries in unique index not detected when changing collation with INPLACE / NOCOPY algoritm

_bin collations are case sensitive. Transition to case insensitive collations
is not possible in general because of the possible duplicates. Thus,
it should be prohibited. Only VARCHAR is affected.

bb-10.2-mdev-24585-hf 2021-10-19 07:00:56 UTC
MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.

Author: Alexey Botchkov
Author Date: 2021-10-11 11:05:44 UTC

MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.

We should set the charset in
Item_func_json_format::fix_length_and_dec().

bb-10.2-mdev-26852 2021-10-19 05:04:42 UTC
MDEV-26852 Spider: -Werror=maybe-uninitialized raises on spd_sys_table.cc and...

Author: Nayuta Yanagisawa
Author Date: 2021-10-19 04:59:14 UTC

MDEV-26852 Spider: -Werror=maybe-uninitialized raises on spd_sys_table.cc and ha_spider.cc

The warning "maybe-uninitialized" raises on spd_sys_table.cc and
ha_spider.cc when the sever is compiled with CMAKE_CXX_FLAGS=-Og.

bb-10.2-MDEV-25284 2021-10-18 16:43:51 UTC
MDEV-25284: Assertion `info->type == READ_CACHE || info->type == WRITE_CACHE'...

Author: Brandon Nesterenko
Author Date: 2021-10-13 13:31:32 UTC

MDEV-25284: Assertion `info->type == READ_CACHE || info->type == WRITE_CACHE' failed

Problem:
========
This patch addresses two issues.

First, if a CHANGE MASTER command is issued and an error happens
while locating the replica’s relay logs, the logs can be put into an
invalid state where future updates fail and future CHANGE MASTER
calls crash the server. More specifically, right before a replica
purges the relay logs (part of the `CHANGE MASTER TO` logic), the
relay log is temporarily closed with state LOG_TO_BE_OPENED. If the
server errors in-between the temporary log closure and purge, i.e.
during the function find_log_pos, the log should be closed.
MDEV-25284 reveals the log is not properly closed.

Second, upon issuing a RESET SLAVE ALL command, a slave’s GTID
filters are not cleared (DO_DOMAIN_IDS, IGNORE_DOMIAN_IDS,
IGNORE_SERVER_IDS). MySQL had a similar bug report, Bug #18816897,
which fixed this issue to clear IGNORE_SERVER_IDS after issuing
RESET SLAVE ALL in version 5.7.

Solution:
=========

To fix the first problem, the CHANGE MASTER error handling logic was
extended to transition the relay log state to LOG_CLOSED from
LOG_TO_BE_OPENED.

To fix the second problem, the RESET SLAVE ALL logic is extended to
clear the domain_id filter and ignore_server_ids.

Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>

bb-10.7-hs 2021-10-18 15:40:01 UTC
Add #error after ifdef HAVE_HANDLERSOCKET

Author: Nayuta Yanagisawa
Author Date: 2021-10-18 15:40:01 UTC

Add #error after ifdef HAVE_HANDLERSOCKET

bb-10.2-midenok 2021-10-18 12:22:48 UTC
MDEV-24176 More test cases

Author: midenok
Author Date: 2021-10-18 12:22:48 UTC

MDEV-24176 More test cases

Test cases from duplicate bugs. LOCK TABLES case.

bb-10.2-midenok2 2021-10-17 19:43:01 UTC
MDEV-22284 Aria table key read crash because wrong index used

Author: midenok
Author Date: 2021-10-17 17:28:38 UTC

MDEV-22284 Aria table key read crash because wrong index used

When restoring lastinx last_key.keyinfo must be updated as well. The
good example is in _ma_check_index().

The point of failure is extra(HA_EXTRA_NO_KEYREAD) in
ha_maria::get_auto_increment():

  1. extra(HA_EXTRA_KEYREAD) saves lastinx;
  2. maria_rkey() changes index, so the lastinx and last_key.keyinfo;
  3. extra(HA_EXTRA_NO_KEYREAD) restores lastinx but not
     last_key.keyinfo.

So we have discrepancy between lastinx and last_key.keyinfo after 3.

bb-10.2-bar-MDEV-23408 2021-10-15 17:56:17 UTC
A clean-up patch for MDEV-23408: fixing test failure on Windows

Author: Alexander Barkov
Author Date: 2021-10-15 17:56:17 UTC

A clean-up patch for MDEV-23408: fixing test failure on Windows

Schema and table names in a veiw FRM files are:
- in upper case on Linux
- in lower case on Windows

Using the LOWER() function when displaying an FRM file fragment,
to avoid the OS-specific difference.

bb-10.3-mdev-26544_3 2021-10-15 16:50:55 UTC
MDEV-26544 Assertion `part_share->auto_inc_initialized' failed in ha_partitio...

Author: Nayuta Yanagisawa
Author Date: 2021-10-13 13:45:26 UTC

MDEV-26544 Assertion `part_share->auto_inc_initialized' failed in ha_partition::get_auto_increment on INSERT

The partition storage engine ignores return (error) values of
handler::info(). As a result, a query that should be aborted is
not aborted and then the server violates the assertion.

bb-10.2-vicentiu-mdev-17964 2021-10-15 14:38:11 UTC
MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action

Author: Vicențiu Ciorbaru
Author Date: 2021-10-13 10:13:27 UTC

MDEV-17964: Assertion `status == 0' failed in add_role_user_mapping_action

This happens upon CREATE USER and DROP ROLE.

The underlying problem is that our HASH implementation shuffles elements
around when performing an update or delete. This means that when doing a
scan through the HASH table by index, in search of elements to delete or
update one must restart the scan to make sure nothing is missed if at least
one delete / update happened.

More specifically, what happened in this case:
The hash has 131 element, DROP ROLE removes the element
[119]. Its [119]->next was element [129], so [129] is moved to [119].
Now we need to compact the hash, removing the last element [130]. It
gets one bit off its hash value and becomes element [2]. The existing
element [2] is moved to [129], and old [130] is moved to [2].

We cannot simply move [130] to [129] and make [2]->next=130, it won't
work if [2] is itself in the collision list and doesn't belong in [2].

The handle_grant_struct code assumed that it is safe to continue by only
reexamining the currently modified / deleted element index, but that is
not true.

Missing to delete an element in the hash triggered the assertion in
the test case. DROP ROLE would not clear all necessary role->role or
role->user mappings.

To fix the problem we ensure that the scan is restarted, only if an
element was deleted / updated, similar to how bubble-sort keeps sorting
until it finds no more elements to swap.

bb-10.7-vicentiu 2021-10-15 09:14:47 UTC
MDEV-26221: DYNAMIC_ARRAY use size_t for sizes

Author: Eric Herman
Author Date: 2021-09-03 04:38:54 UTC

MDEV-26221: DYNAMIC_ARRAY use size_t for sizes

https://jira.mariadb.org/browse/MDEV-26221
my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy

The DYNAMIC_STRING uses size_t for sizes, but DYNAMIC_ARRAY used uint.
This patch adjusts DYNAMIC_ARRAY to use size_t like DYNAMIC_STRING.

As the MY_DIR member number_of_files is copied from a DYNAMIC_ARRAY,
this is changed to be size_t.

As MY_TMPDIR members 'cur' and 'max' are copied from a DYNAMIC_ARRAY,
these are also changed to be size_t.

The lists of plugins and stored procedures use DYNAMIC_ARRAY,
but their APIs assume a size of 'uint'; these are unchanged.

bb-10.3-midenok 2021-10-14 10:41:22 UTC
MDEV-25552 system versioned partitioned by LIMIT tables break CHECK TABLE

Author: midenok
Author Date: 2021-10-14 10:36:45 UTC

MDEV-25552 system versioned partitioned by LIMIT tables break CHECK TABLE

Replaced HA_ADMIN_NOT_IMPLEMENTED error code by HA_ADMIN_OK. Now CHECK
TABLE does not fail by unsupported check_misplaced_rows(). Admin
message is not needed as well.

Test case is the same as for MDEV-21011 (a7cf0db3d86), the result have
been changed.

bb-10.5-MDEV-26826 2021-10-14 09:06:50 UTC
MDEV-26826 The guess in buf_page_get_gen() may not be helpful

Author: Marko Mäkelä
Author Date: 2021-10-14 09:06:50 UTC

MDEV-26826 The guess in buf_page_get_gen() may not be helpful

buf_page_get_low(), buf_page_get_gen(): Remove the parameter "guess".
We will have to access the buf_pool.page_hash anyway, in order to
acquire the page_hash_latch. So, knowing the block upfront might only
help us in case the block is behind a deep hash bucket.

We will also remove the build option WITH_INNODB_ROOT_GUESS,
any references to the preprocessor symbol BTR_CUR_ADAPT,
as well as the data fields
trx_undo_t::guess_block and btr_search_t::root_guess.

bb-10.3-bar-MDEV-23408 2021-10-14 05:11:01 UTC
MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg...

Author: Alexander Barkov
Author Date: 2021-10-13 08:57:57 UTC

MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset

There were two independent problems which lead to the crash
and to the non-relevant records returned in I_S queries:

- The code in the I_S implementation was not secure
  about values with 0x00 bytes.
  It's fixed by using check_db_name() and check_table_name()
  inside make_table_name_list(), and by adding the test for
  0x00 inside check_table_name().

- The code in Item_string::print() did not convert
  strings without introducers when restoring
  the CREATE VIEW statement from an Item tree.
  This made wrong literals inside the "query" line in the view FRM file
  in cases when the VIEW parse time
  character_set_client!=character_set_connection.
  That's fixed by adding a proper conversion.

  This change also fixed a similar problem in SHOW PROCEDURE CODE -
  the literals were displayed in wrong character set in SP instructions
  in cases when the SP parse time
  character_set_client!=character_set_connection.

bb-10.5-bar-MDEV-26742 2021-10-14 04:37:23 UTC
MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBu...

Author: Alexander Barkov
Author Date: 2021-10-14 04:37:23 UTC

MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item

bb-10.5-midenok 2021-10-13 18:12:13 UTC
MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index o...

Author: midenok
Author Date: 2021-10-12 12:37:53 UTC

MDEV-25555 Server crashes in tree_record_pos after INPLACE-recreating index on HEAP table

Drop and add same key is considered rename (look ALTER_RENAME_INDEX in
fill_alter_inplace_info()). But in this case order of keys may be
changed, because mysql_prepare_alter_table() yet does not know about
rename and treats 2 operations: drop and add.

In that case we disable inplace algorithm for non-InnoDB by
ALTER_INDEX_ORDER flag. Nothing was changed in
handler::check_if_supported_inplace_alter(). The presence of any flags
in handler_flags fails it by default.

ha_innobase::check_if_supported_inplace_alter() works differently and
inplace is not disabled (with the help of modified
INNOBASE_INPLACE_IGNORE). add_drop_v_cols fork was also tweaked as it
wrongly failed with MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN
when it seen ALTER_INDEX_ORDER.

No-op operation must be still no-op no matter of ALTER_INDEX_ORDER
presence, so we tweek its condition as well.

bb-10.2-andrei 2021-10-13 16:02:15 UTC
MDEV-26712 row events never reset thd->mem_root

Author: Andrei Elkin
Author Date: 2021-09-29 16:19:38 UTC

MDEV-26712 row events never reset thd->mem_root

but must do that at the end of the statement.
A provide template patch is elaborated also to match
to the upstream fixes of the very same bug.

bb-10.5-MDEV-26707-galera 2021-10-13 15:11:07 UTC
MDEV-26707: SR transaction rolls back locally, but not in cluster

Author: Jan Lindström
Author Date: 2021-10-13 14:57:31 UTC

MDEV-26707: SR transaction rolls back locally, but not in cluster

Record correct result file.

bb-10.6-MDEV-24062-galera 2021-10-13 14:18:20 UTC
MDEV-24062: : Galera test failure on galera_var_replicate_myisam_on

Author: Jan Lindström
Author Date: 2021-10-13 10:35:49 UTC

MDEV-24062: : Galera test failure on galera_var_replicate_myisam_on

10.6 version

bb-10.2-MDEV-26815-galera 2021-10-13 08:56:33 UTC
MDEV-26815 : galera.galera_ftwrl_drain fails with wrong errno 1146

Author: Jan Lindström
Author Date: 2021-10-13 08:56:33 UTC

MDEV-26815 : galera.galera_ftwrl_drain fails with wrong errno 1146

Add wait_conditions to stabilize

bb-10.3-danielblack-rocksdb-featureinfo 2021-10-13 02:34:08 UTC
rocksdb: feature info incorrect when invalid zstd exists

Author: Daniel Black
Author Date: 2021-10-13 02:34:01 UTC

rocksdb: feature info incorrect when invalid zstd exists

It could be possible that an invalid rocksdb version exists like
zstd < 1.1.2. So don't just report the feature enabled because
it wants to be, only if its valid.

bb-10.5-MDEV-26712-andrei 2021-10-12 17:39:31 UTC
MDEV-26712 row events never reset thd->mem_root

Author: Andrei Elkin
Author Date: 2021-10-12 17:39:31 UTC

MDEV-26712 row events never reset thd->mem_root

but must do that at the end of the statement.
A provide template patch is elaborated also to match
to the upstream fixes of the very same bug.

bb-10.7-kevgs 2021-10-12 17:00:09 UTC
fix C++20 !!! build failure: iterator concept was not fully implemented

Author: Eugene
Author Date: 2021-10-12 17:00:09 UTC

fix C++20 !!! build failure: iterator concept was not fully implemented

bb-10.3-MDEV-26712-andrei 2021-10-12 16:58:12 UTC
MDEV-26712 row events never reset thd->mem_root

Author: Andrei Elkin
Author Date: 2021-09-29 16:19:38 UTC

MDEV-26712 row events never reset thd->mem_root

but must do that at the end of the statement.
A provide template patch is elaborated also to match
to the upstream fixes of the very same bug.

bb-10.3-serg 2021-10-12 16:49:30 UTC
MDEV-18304 sql_safe_updates does not work with OR clauses

Author: Sergei Golubchik
Author Date: 2021-10-12 16:34:51 UTC

MDEV-18304 sql_safe_updates does not work with OR clauses

not every index-using plan sets bits in table->quick_keys.
QUICK_ROR_INTERSECT_SELECT, for example, doesn't.

Use the fact that select->quick is set instead.

Also allow EXPLAIN to work.

bb-10.4-MDEV-18543-instant-import-bugs 2021-10-11 11:06:55 UTC
MDEV-18543 IMPORT TABLESPACE fails after instant DROP COLUMN

Author: Eugene
Author Date: 2021-08-09 18:54:12 UTC

MDEV-18543 IMPORT TABLESPACE fails after instant DROP COLUMN

ALTER TABLE IMPORT doesn't properly handle instant alter metadata.
This patch makes IMPORT read, parse and apply instant alter metadata at the
very beginning of operation. So, cases when source table has some metadata
and destination table doesn't have it now works fine.

DISCARD already removes instant metadata so importing normal table into
instant table worked fine before this patch.

decrypt_decompress(): decrypts and decompresses page if needed

handle_instant_metadata(): this should be the first thing to read source
table. Basically, it applies instant metadata to a destination
dict_table_t object. This is the first thing to read FSP flags so
all possible checks of it were moved to this function.

PageConverter::update_index_page(): it doesn't now read instant metadata.
This logic were moved into handle_instant_metadata()

row_import::match_flags(): this is a first part row_import::match_schema().
As a separate function it's used by handle_instant_metadata().

fil_space_t::is_full_crc32_compressed(): added convenient function

ha_innobase::discard_or_import_tablespace(): do not reload table definition
to read instant metadata because handle_instant_metadata() does it better.
The reverted code was originally added in
4e7ee166a9c76eb3546356aabfd2dbc759671cd0

ANONYMOUS_VAR: this is a handy thing to use along with make_scope_exit()

full_crc32_import.test shows different results, because no
dict_table_close() and dict_table_open_on_id() happens.
Thus, SHOW CREATE TABLE shows a little bit older table definition.

bb-10.4-galera 2021-10-11 08:07:34 UTC
Make test galera_sr_kill_slave_before_apply deterministic

Author: Daniele Sciascia
Author Date: 2021-10-08 08:11:31 UTC

Make test galera_sr_kill_slave_before_apply deterministic

* Handle the (rare) case where the ongoing transaction is aborted, if
  the ongoing transaction is considered orphaned. This happens if the
  node delivers two consecutive primary views with the
* Add ignorable warning to suite.pm

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>

bb-10.4-mdev-24343 2021-10-11 06:56:56 UTC
MDEV-24343 Spider Left join failed Unknown column 't0.ID' in 'on clause'

Author: Nayuta Yanagisawa
Author Date: 2021-10-11 05:21:10 UTC

MDEV-24343 Spider Left join failed Unknown column 't0.ID' in 'on clause'

The Spider mixes the comma join with other join types, and thus
ERROR 1054 occurs.

This is well-known issue caused by the precedence of the operators,
as is explained in the following document.
https://dev.mysql.com/doc/refman/8.0/en/join.html

We can avoid the problem simply by using JOINs instead of commas.

bb-10.2-bar 2021-10-08 16:44:38 UTC
MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_sy...

Author: Alexander Barkov
Author Date: 2021-10-08 16:44:38 UTC

MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax

The crash happened because my_isalnum() does not support character
sets with mbminlen>1.

The value of "ft_boolean_syntax" is converted to utf8 in do_string_check().
So calling my_isalnum() is combination with "default_charset_info" was wrong.

Adding new parameters (size_t length, CHARSET_INFO *cs) to
ft_boolean_check_syntax_string() and passing self->charset(thd)
as the character set.

bb-10.2-psergey 2021-10-08 16:17:06 UTC
Make Explain_node::children protected

Author: Sergey Petrunia
Author Date: 2021-10-08 16:17:06 UTC

Make Explain_node::children protected

10.2-MDEV-19129 2021-10-08 14:05:52 UTC
Xcode compatibility update

Author: Sergei Krivonos
Author Date: 2021-10-06 08:31:08 UTC

Xcode compatibility update

bb-10.2-MDEV-19522 2021-10-08 11:40:21 UTC
MDEV-19522 InnoDB commit fails when FTS_DOC_ID value

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-10-06 13:20:56 UTC

MDEV-19522 InnoDB commit fails when FTS_DOC_ID value
                    is greater than 4294967295

InnoDB commit fails when consecutive FTS_DOC_ID value
is greater than 4294967295.
Fix is that InnoDB should remove the delta FTS_DOC_ID
value limitations and fts should encode 8 byte value,
remove FTS_DOC_ID_MAX_STEP variable. Renamed the
fts0vlc.ic file to fts0vlc.h

fts_encode_int(): Should be able to encode 8 bytes value

fts_get_encoded_len(): Should get the length of the value
which has 8 bytes

mach_read_uint64_little_endian(): Reads 64 bit stored in
big endian format

uint64_2_exp(): Calculate 2 to power n and return
64 bit value

bb-10.5-MDEV-26732 2021-10-07 16:58:18 UTC
MDEV-26732 Assertion `0' failed in Item::val_native

Author: Alexander Barkov
Author Date: 2021-10-07 16:58:18 UTC

MDEV-26732 Assertion `0' failed in Item::val_native

Also fixes MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion

bb-10.3-25444-10.2-nullmerge 2021-10-06 15:31:01 UTC
Merge branch '10.2' into 10.3

Author: Brandon Nesterenko
Author Date: 2021-10-06 15:31:01 UTC

Merge branch '10.2' into 10.3

bb-10.2-MDEV-25444 2021-10-06 13:50:37 UTC
MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs

Author: Brandon Nesterenko
Author Date: 2021-10-06 13:42:03 UTC

MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs

Note: This patch backports commits 10cd281 and 1755ea4 from 10.3.

10cd281:
Problem:- Some binary data is inserted into the table using
Jconnector. When binlog dump of the data is applied using mysql
client it gives syntax error.

Reason:-
After investigating it turns out to be a issue of mysql client not
able to properly handle \\0 <0 in binary>. In all binary files
where mysql client fails to insert
these 2 bytes are common (0x5c00)

Solution:-
I have changed mysql.cc to include for the possibility that binary
string can have \\0 in it

1755ea4:
Changes on top of Sachin’s patch. Specifically:
 1) Refined the parsing break condition to only change the parser’s
behavior for parsing strings in binary mode (behavior of \0 outside
of strings is unchanged).
 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
associate the purpose of the test.
 3) As the input of the test contains binary zeros (0x5c00),
different text editors can visualize this sequence differently, and
Github would not display it at all. Therefore, the input itself was
consolidated into the test and created out of hex sequences to make
it easier to understand what is happening.
 4) Extended test to validate that the rows which correspond to the
INSERTS with 0x5c00 have the correct binary zero data.

Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>

bb-10.7-MDEV-24920 2021-10-06 07:55:29 UTC
MDEV-24920: Merge "old" SQL variable to "old_mode" sql variable

Author: Rucha Deodhar
Author Date: 2021-08-13 10:19:16 UTC

MDEV-24920: Merge "old" SQL variable to "old_mode" sql variable

Analysis: There are 2 server variables- "old_mode" and "old". "old" is no
longer needed as "old_mode" has replaced it (however still used in some places
 in the code). "old_mode" and "old" has same purpose- emulate behavior from
previous MariaDB versions. So they can be merged to avoid confusion.
Fix: Deprecate "old" variable and create another mode for @@old_mode to mimic
behavior of previous "old" variable. Create specific modes for specifix task
that --old sql variable was doing earlier and use the new modes instead.

bb-10.3-25444 2021-10-05 16:54:57 UTC
MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs

Author: Brandon Nesterenko
Author Date: 2021-09-30 21:03:44 UTC

MDEV-25444: mysql --binary-mode is not able to replay some mysqlbinlog outputs

Changes on top of Sachin’s patch. Specifically:
 1) Refined the parsing break condition to only change the parser’s
behavior for parsing strings in binary mode (behavior of \0 outside
of strings is unchanged).
 2) Prefixed binary_zero_insert.test with ‘mysql_’ to more clearly
associate the purpose of the test.
 3) As the input of the test contains binary zeros (0x5c00),
different text editors can visualize this sequence differently, and
Github would not display it at all. Therefore, the input itself was
consolidated into the test and created out of hex sequences to make
it easier to understand what is happening.
 4) Extended test to validate that the rows which correspond to the
INSERTS with 0x5c00 have the correct binary zero data.

Reviewed By:
===========
Andrei Elkin <andrei.elkin@mariadb.com>

bb-10.3-hf-2 2021-10-05 08:56:11 UTC
MDEV-26768 Spider table crashes the server after the mysql_list_fields() clie...

Author: Alexey Botchkov
Author Date: 2021-10-05 08:56:11 UTC

MDEV-26768 Spider table crashes the server after the mysql_list_fields() client's call and produces weird result for SHOW FIELDS.

Suppress errors in ha_spider::info() called from mysqld_show_fields()

1100 of 1141 results
This repository contains Public information 
Everyone can see this information.

Subscribers