View Bazaar branches
Get this repository:
git clone https://git.launchpad.net/maria

MariaDB has 18 active reviews.

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-13 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 2 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 2 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-12 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-17 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-15 and finished taking 3 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-15 and finished taking 2 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-14 and finished taking 2 minutes — see the log
Import started on juju-1e3bde-prod-lp-code-import-13 and finished taking 3 minutes — see the log

Branches

Name Last Modified Last Commit
10.5 2021-12-01 11:43:43 UTC
MDEV-12353 fixup: Correct a comment

Author: Marko Mäkelä
Author Date: 2021-12-01 11:43:43 UTC

MDEV-12353 fixup: Correct a comment

Several EXTENDED type records have already been implemented.

bb-10.4-galera 2021-12-01 11:33:12 UTC
cs()->bf_abort instrumentation

Author: Jan Lindström
Author Date: 2021-12-01 11:33:12 UTC

cs()->bf_abort instrumentation

10.6 2021-12-01 08:07:06 UTC
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-12-01 08:07:06 UTC

MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

- Replaced the pointer parameter of validate_for_recovery() with uint32_t

bb-10.6-MDEV-27014 2021-12-01 08:07:06 UTC
MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-12-01 08:07:06 UTC

MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

- Replaced the pointer parameter of validate_for_recovery() with uint32_t

bb-10.2-MDEV-27148-mysqltest-reject 2021-12-01 07:11:28 UTC
MDEV-27148: mysqltest writes .reject file to the same location as

Author: Vlad Lesin
Author Date: 2021-12-01 07:11:28 UTC

MDEV-27148: mysqltest writes .reject file to the same location as
.result file

The code which writes .reject file to the location of .result file is
removed.

10.4 2021-12-01 06:27:08 UTC
Fix bad galera tests

Author: Jan Lindström
Author Date: 2021-11-27 07:56:56 UTC

Fix bad galera tests

* galera_kill_applier : we should make sure that node has
  correct number of wsrep appliers
* galera_bad_wsrep_new_cluster: This test restarts both nodes,
so it is bad on mtr. Make sure it is run alone
* galera_update_limit : Make sure we have PK when needed
galera_as_slave_replay : bf abort was not consistent
* galera_unicode_pk : Add wait_conditions so that all nodes
are part of cluster and DDL and INSERT has replicated before
any further operations are done.
* galera_bf_abort_at_after_statement : Add wait_conditions
to make sure all nodes are part of cluster and that DDL
and INSERT has replicated. Make sure we reset DEBUG_SYNC.

bb-10.6-MDEV-20605-cur-pos-fix 2021-12-01 04:39:35 UTC
MDEV-20605 With optimistic and aggressive modes of parallel replication,

Author: Vlad Lesin
Author Date: 2021-11-30 15:22:39 UTC

MDEV-20605 With optimistic and aggressive modes of parallel replication,
some replicated statements have no effect

sel_restore_position_for_mysql() moves forward persistent cursor
position after btr_pcur_restore_position() call if cursor relative position
is BTR_PCUR_ON and the cursor points to the record with NOT the same field
values as in a stored record(and some other not important for this case
conditions).

It was done because btr_pcur_restore_position() sets
page_cur_mode_t mode to PAGE_CUR_LE for cursor->rel_pos == BTR_PCUR_ON
before opening cursor. So we are searching for the record less or equal
to stored one. And if the found record is not equal to stored one, then
it is less and we need to move cursor forward.

But there can be a situation when the stored record was purged, but the
new one with the same key but different value was inserted while
row_search_mvcc() was suspended. In this case, when the thread is
awaken, it will invoke sel_restore_position_for_mysql(), which, in turns,
invoke btr_pcur_restore_position(), which will return false because found
record don't match stored record, and
sel_restore_position_for_mysql() will move forward cursor position.

The above can lead to the case when awaken row_search_mvcc() do not see
records inserted by other transactions while it slept. The mtr test case
shows the example how it can be.

The fix is to add output argument to btr_pcur_restore_position(), which
is set to "true" if restored record do not match the stored one, but their
unique fields are the same, and sel_restore_position_for_mysql() don't move
cursor forward in this case.

Delete-marked records are correctly processed in row_search_mvcc().
Non-unique secondary indexes are "uniquified" by adding the PK, the
index->n_uniq should then be index->n_fields. So there is no need in
additional checks in the fix.

bb-10.8-MDEV-27036 2021-12-01 01:13:45 UTC
MDEV-27036: re-enable my_json_writer-t unit test

Author: Sergei Krivonos
Author Date: 2021-12-01 01:11:14 UTC

MDEV-27036: re-enable my_json_writer-t unit test

bb-10.8-MDEV-11675 2021-11-30 18:25:31 UTC
MDEV-11675; post-merge incremental patch 1

Author: sachin
Author Date: 2021-01-29 11:59:14 UTC

MDEV-11675; post-merge incremental patch 1

fixes the slave parallel execution, including Start ALTER retry and concurrency
with temporary table operations by another worker threads;
refines two asserts;
cleans up in few parts (mostly pertaining to rgi); and
adds an extra print block to a number of test results.;

bb-10.8-MDEV-22224 2021-11-30 16:31:26 UTC
Patch1

Author: Rucha Deodhar
Author Date: 2021-11-22 17:29:30 UTC

Patch1

bb-10.8-mdev-26858 2021-11-30 14:20:20 UTC
remove protected by others

Author: Nayuta Yanagisawa
Author Date: 2021-11-30 14:20:20 UTC

remove protected by others

bb-10.8-mdev-27106 2021-11-30 10:10:37 UTC
MDEV-27106 Spider: specify connection to data node by engine-defined attributes

Author: Nayuta Yanagisawa
Author Date: 2021-11-25 08:03:02 UTC

MDEV-27106 Spider: specify connection to data node by engine-defined attributes

We introduce engine-defined attributes to specify remote data nodes.

The engine attributes do not cover all the existing DSN parameters
because most of them need not be specified at the table level.
We introduce the following three attributes: REMOTE_SERVER,
REMOTE_DATABASE, REMOTE_TABLE.

One cannot specify both DSN parameter, in COMMENT or CONNECT, and
engine-defined attribute that are for the same SPIDER_SHARE attribute.
For example, if both COMMENT='table "t1"' and REMOTE_TABLE="t2" are
specified in a single CREATE TABLE or ALTER TABLE statement, Spider
returns an error.

10.2 2021-11-30 00:30:52 UTC
MDEV-27088: lf unit tests - cycles insufficient

Author: Martin Beck
Author Date: 2021-11-24 07:46:46 UTC

MDEV-27088: lf unit tests - cycles insufficient

Per bug report, cycles was woefully insufficient to
detect any implementation error.

bb-10.8-wlad-MDEV-26713 2021-11-29 23:46:20 UTC
MDEV-26713 set console codepage to what user set in --default-character-set

Author: Vladislav Vaintroub
Author Date: 2021-11-29 18:47:36 UTC

MDEV-26713 set console codepage to what user set in --default-character-set

If someone on whatever reasons uses --default-character-set=cp850,this will
avoid incorrect display, and inserting incorrect data.

That fix is currently Windows-only, and serves people who used combination
of chcp achieve WYSIWYG effect (although, this would mostly likely used
with utf8 in the past)

Now, --default-character-set would be a replacement for that.

Fix fs_character_set() detection of current codepage.
GetACP() is always correct and system default locale is often , but not
always - it does not take into account activeCodePage in application
manifest, and the fact that not all users use system default settings.

bb-10.7-midenok-MDEV-25292 2021-11-29 22:46:33 UTC
MDEV-25292 Atomic CREATE OR REPLACE TABLE

Author: midenok
Author Date: 2021-11-29 22:46:27 UTC

MDEV-25292 Atomic CREATE OR REPLACE TABLE

Atomic replace algorithm

  Two DDL chains are used for CREATE OR REPLACE:
  ddl_log_state_create (C) and ddl_log_state_rm (D).

  1. (C) Write DDL_LOG_CREATE_TABLE_ACTION of TMP table (drops TMP table);
  2. Create new table as TMP;
  3. Do everything with TMP (like insert data);
  4. (D) Write DDL_LOG_RENAME_TABLE_ACTION from ORIG to TMP (replays TMP -> ORIG);
  5. (D) Write DDL_LOG_DROP_ACTION of ORIG;
  6. (C) close chain;
  7. (D) replay chain

Temporary table for CREATE OR REPLACE

  Before dropping "old" table, CREATE OR REPLACE creates "tmp" table.
  ddl_log_state_create holds the drop of the "tmp" table. When
  everything is OK (data is inserted, "tmp" is ready) ddl_log_state_rm
  is written to replace "old" with "tmp". Until ddl_log_state_create
  is closed ddl_log_state_rm is not executed.

  After the binlogging is done ddl_log_state_create is closed. At that
  point ddl_log_state_rm is executed and "tmp" is replaced with
  "old". That is: final rename is done by the DDL log.

  With that important role of DDL log for CREATE OR REPLACE operation
  replay of ddl_log_state_rm must fail at the first hit error and
  print the error message if possible. F.ex. foreign key error is
  discovered at this phase: InnoDB rejects to drop the "old" table and
  returns corresponding foreign key error code.

Additional notes

  - CREATE TABLE without REPLACE is not affected by this commit.

  - Engines having HTON_EXPENSIVE_RENAME flag set are not affected by
    this commit.

  - CREATE TABLE .. SELECT XID usage is fixed and now there is no need
    to log DROP TABLE via DDL_CREATE_TABLE_PHASE_LOG (see comments in
    do_postlock()). XID is now correctly updated so it disables
    DDL_LOG_DROP_TABLE_ACTION. Note that binary log is flushed at the
    final stage when the table is ready. So if we have XID in the
    binary log we don't need to drop the table.

  - Three variations of CREATE OR REPLACE handled:

    1. CREATE OR REPLACE TABLE t1 (..);
    2. CREATE OR REPLACE TABLE t1 LIKE t2;
    3. CREATE OR REPLACE TABLE t1 SELECT ..;

  - Test case uses 5 combinations for engines (aria, aria_notrans,
    myisam, ib, expensive_rename) and 2 combinations for binlog types
    (row, stmt). Combinations help to check differences between the
    results. Error failures are tested for the above three variations.

  - Triggers mechanism is unaffected by this change. This is tested in
    create_replace.test.

  - LOCK TABLES is affected. Lock restoration must be done after "rm"
    chain is replayed.

Rename and drop via DDL log

  We replay ddl_log_state_rm to drop the old table and rename the
  temporary table. In that case we must throw the correct error
  message if ddl_log_revert() fails (f.ex. on FK error).

  If table is deleted earlier and not via DDL log and the crash
  happened, your create chain is not closed. Linked drop chain is not
  executed and the new table is not installed. But the old table is
  already deleted.

ddl_log.cc changes

  Now we can place action before DDL_LOG_DROP_INIT_ACTION and it will
  be replayed after DDL_LOG_DROP_TABLE_ACTION.

  report_error parameter for ddl_log_revert() allows to fail at first
  error and print the error message if
  possible. ddl_log_execute_action() now can print error message.

  Since we now can handle errors from ddl_log_execute_action() (in
  case of non-recovery execution) unconditional setting "error= TRUE"
  is wrong (it was wrong anyway because it was overwritten at the end
  of the function).

On XID usage

  Like with all other atomic DDL operations XID is used to avoid
  inconsistency between master and slave in the case of a crash after
  binary log is written and before ddl_log_state_create is closed. On
  recovery XIDs are taken from binary log and corresponding DDL log
  events get disabled. That is done by
  ddl_log_close_binlogged_events().

On linking two chains together

  Chains are executed in the ascending order of entry_pos of execute
  entries. But entry_pos assignment order is undefined: it may assign
  bigger number for the first chain and then smaller number for the
  second chain. So the execution order in that case will be reverse:
  second chain will be executed first.

  To avoid that we link one chain to another. While the master chain
  is active the slave chain is not executed. That is: only one chain
  can be executed in two linked chains.

  The interface ddl_log_link_chains() was done in "MDEV-22166
  ddl_log_write_execute_entry() extension".

Refactoring: moved select_field_count into Alter_info.

  As atomic CREATER OR REPLACE .. SELECT now uses temporary table
  there is a need to have both C_ALTER_TABLE and select_field_count in
  one call. Semantically creation mode and field count are two
  different things. Making creation mode negative constants and field
  count positive variable into one parameter seems to be a lazy hack
  for not making the second parameter.

  select_field_count does not make sense without
  alter_info->create_list, so the natural way is to hold it in
  Alter_info too.

More on CREATE OR REPLACE .. SELECT

  We use create_and_open_tmp_table() like in ALTER TABLE to create
  temporary TABLE object (tmp_table is (NON_)TRANSACTIONAL_TMP_TABLE).

  After we created such TABLE object we use create_info->tmp_table()
  instead of table->s->tmp_table when we need to check for
  parser-requested tmp-table.

  External locking is required for temporary table created by
  create_and_open_tmp_table(). F.ex. that disables logging for Aria
  transactional tables and wihout that (when no mysql_lock_tables() is
  done) it cannot work correctly.

  For external locking we require Aria table to work in
  non-transactional mode. That is usually done by
  ha_enable_transaction(false). But we cannot disable transaction
  completely because: 1. binlog rollback removes pending row events
  (binlog_remove_pending_rows_event()). The row events are added
  during CREATE .. SELECT data insertion phase. 2. replication slave
  highly depends on transaction and cannot work without it.

  So we put temporary Aria table into non-transactional mode with
  "thd->transaction->on hack". See comment for on_save variable.

  Note that Aria table has internal_table mode. But we cannot use it
  because:

  if (!internal_table)
  {
    mysql_mutex_lock(&THR_LOCK_myisam);
    old_info= test_if_reopen(name_buff);
  }

  For internal_table test_if_reopen() is not called and we get a new
  MARIA_SHARE for each file handler. In that case duplicate errors are
  missed because insert and lookup in CREATE .. SELECT is done via two
  different handlers (see create_lookup_handler()).

  For temporary table before dropping TABLE_SHARE by
  drop_temporary_table() we must do ha_reset(). ha_reset() releases
  storage share. Without that the share is kept and the second CREATE
  OR REPLACE .. SELECT fails with:

    HA_ERR_TABLE_EXIST (156): MyISAM table '#sql-create-b5377-4-t2' is
    in use (most likely by a MERGE table). Try FLUSH TABLES.

    HA_EXTRA_PREPARE_FOR_DROP also removes MYISAM_SHARE, but that is
    not needed as ha_reset() does the job.

  ha_reset() is usually done by
  mark_tmp_table_as_free_for_reuse(). But we don't need that mechanism
  for our temporary table.

Atomic_info in HA_CREATE_INFO

  Many functions in CREATE TABLE pass the same parameters. These
  parameters are part of table creation info and should be in
  HA_CREATE_INFO (or whatever). Passing parameters via single
  structure is much easier for adding new data and
  refactoring.

preview-10.8-MDEV-26519-json-histograms 2021-11-29 17:33:59 UTC
MDEV-27062: Make histogram_type=JSON_HB the new default

Author: Sergey Petrunia
Author Date: 2021-11-29 13:11:18 UTC

MDEV-27062: Make histogram_type=JSON_HB the new default

bb-10.2-serg 2021-11-29 17:31:59 UTC
fix srpm builds after fe065f8d90b0

Author: Sergei Golubchik
Author Date: 2021-11-29 16:02:31 UTC

fix srpm builds after fe065f8d90b0

bb-10.2-release 2021-11-29 17:31:59 UTC
fix srpm builds after fe065f8d90b0

Author: Sergei Golubchik
Author Date: 2021-11-29 16:02:31 UTC

fix srpm builds after fe065f8d90b0

bb-10.6-MDEV-27022-sort-flush-list 2021-11-29 17:07:17 UTC
MDEV-27022 slightly optimize crash recovery in InnoDB

Author: Eugene
Author Date: 2021-11-11 09:22:20 UTC

MDEV-27022 slightly optimize crash recovery in InnoDB

recv_sys_t::apply(): don't write to dist and fsync() the last batch.
Insead, sort it by oldest_modification for MariaDB server and some
mariabackup operations.

log_sort_flush_list(): a thread-safe function which sorts buf_pool::flush_list

bb-10.5-MDEV-27022-sort-flush-list 2021-11-29 16:57:23 UTC
MDEV-27022 slightly optimize crash recovery in InnoDB

Author: Eugene
Author Date: 2021-11-11 09:22:20 UTC

MDEV-27022 slightly optimize crash recovery in InnoDB

recv_sys_t::apply(): don't write to dist and fsync() the last batch.
Insead, sort it by oldest_modification for MariaDB server and some
mariabackup operations.

log_sort_flush_list(): a thread-safe function which sorts buf_pool::flush_list

bb-10.6-spetrunia 2021-11-29 13:25:27 UTC
Make the Optimizer Trace of reqular query and PS EXECUTE be identical

Author: Sergey Petrunia
Author Date: 2021-11-19 09:17:14 UTC

Make the Optimizer Trace of reqular query and PS EXECUTE be identical

Print this piece when we've just made the choice to convert to semi-join.
Also, print it when we've already made that choice before:

  transformation": {
     "select_id": 2,
     "from": "IN (SELECT)",
     "to": "semijoin",
     "chosen": true
   }

bb-10.4-spetrunia 2021-11-29 13:19:10 UTC
Make the Optimizer Trace of reqular query and PS EXECUTE be identical

Author: Sergey Petrunia
Author Date: 2021-11-19 09:17:14 UTC

Make the Optimizer Trace of reqular query and PS EXECUTE be identical

Print this piece when we've just made the choice to convert to semi-join.
Also, print it when we've already made that choice before:

  transformation": {
     "select_id": 2,
     "from": "IN (SELECT)",
     "to": "semijoin",
     "chosen": true
   }

bb-10.5-MDEV-27139-file-offset-type 2021-11-29 12:55:16 UTC
MDEV-27139 32-bit systems fail to use big innodb-log-file-size

Author: Eugene
Author Date: 2021-11-29 12:55:16 UTC

MDEV-27139 32-bit systems fail to use big innodb-log-file-size

log_write_buf(): use os_offset_t to allow to write to files
which a bigger that 4G

mapped_file_t::map(): cleanup

10.8 2021-11-29 09:58:15 UTC
Merge 10.7 into 10.8

Author: Marko Mäkelä
Author Date: 2021-11-29 09:58:15 UTC

Merge 10.7 into 10.8

10.7 2021-11-29 09:42:07 UTC
Merge 10.6 into 10.7

Author: Marko Mäkelä
Author Date: 2021-11-29 09:42:07 UTC

Merge 10.6 into 10.7

10.3 2021-11-29 08:34:33 UTC
MDEV-27134: Sporadic failure of DROP DATABASE test

Author: Marko Mäkelä
Author Date: 2021-11-29 08:34:33 UTC

MDEV-27134: Sporadic failure of DROP DATABASE test

Let us create and drop a separate database for getting rid of the
default database in the MDEV-22781 test.

bb-10.7-MDEV-4989 2021-11-29 00:06:08 UTC
MDEV-4989

Author: Brandon Nesterenko
Author Date: 2021-11-29 00:04:32 UTC

MDEV-4989

Changed --gtid-strict-mode to be independent of --offset
and --start-datetime.

Fixed stop-position condition to always stop when all
stop-position GTIDs have been hit (previously if
start and stop were in different domains, the start
would go indefinitely)

preview-10.8-MDEV-27009-uca-1400 2021-11-28 12:55:15 UTC
MDEV-27009 Add UCA-14.0.0 collations

Author: Alexander Barkov
Author Date: 2021-11-28 12:55:15 UTC

MDEV-27009 Add UCA-14.0.0 collations

A working prototype implementation for utf8mb4_unicode_1400_ci.

TODO:
- Reserve a permanent ID instead of 456
- Add tests
- Add collations for utf8, ucs2, utf16, utf32.

st-10.6-wlad 2021-11-28 10:56:43 UTC
Fix MSVC warning C4819 when system codepage is set to UTF-8.

Author: Vladislav Vaintroub
Author Date: 2021-11-28 10:03:02 UTC

Fix MSVC warning C4819 when system codepage is set to UTF-8.

The warning message says the file contains a character which can not be
represented in current codepage (not exactly accurate)

preview-10.8-MDEV-10654-inout 2021-11-28 10:13:12 UTC
A clean-up for MDEV-10654 add support IN, OUT, INOUT parameter qualifiers for...

Author: Alexander Barkov
Author Date: 2021-11-26 02:56:04 UTC

A clean-up for MDEV-10654 add support IN, OUT, INOUT parameter qualifiers for stored functions

Changes:

1. Enabling IN/OUT/INOUT mode for sql_mode=DEFAULT,
   adding tests for sql_mode=DEFAULT based by mostly
   translating compat/oracle.sp-inout.test to SQL/PSM
   with minor changes (e.g. testing trigger OLD.column and
   NEW.column as IN/OUT parameters).

2. Removing duplicate grammar:
   sp_pdparam and sp_fdparam implemented exactly the same syntax after
   - the first patch for MDEV-10654 (for sql_mode=ORACLE)
   - the change #1 from this patch (for sql_mode=DEFAULT)
   Removing separate rules and adding a single "sp_param" rule instead,
   which now covers both PRDEDURE and FUNCTION parameters
   (and CURSOR parameters as well!).

3. Adding a helper rule sp_param_name_and_mode, which is a combination
   of the parameter name and the IN/OUT/INOUT mode. It allows to simplify
   the grammer a bit.

4. The first patch unintentionally allowed IN/OUT/INOUT mode
  to be specified in CURSOR parameters.
  This is good for the IN keyword - it is allowed in PL/SQL CURSORs.
  This is not good the the OUT/INOUT keywords - they should not be allowed.
  Adding a additional symantic post-check.

bb-10.2-MDEV-27109 2021-11-28 04:42:20 UTC
MDEV-27109 mysql_config mariadb_config lists non existant -lmariadb

Author: Alexey Bychko
Author Date: 2021-11-27 05:30:51 UTC

MDEV-27109 mysql_config mariadb_config lists non existant -lmariadb

server part of MDEV-27109.
added dependency devel->shared and conflict with previous versions

bb-10.2-igor 2021-11-26 21:02:39 UTC
MDEV-26553 NOT IN subquery construct crashing 10.1 and up

Author: Igor Babaev
Author Date: 2021-11-25 07:19:22 UTC

MDEV-26553 NOT IN subquery construct crashing 10.1 and up

This bug was introduced by commit be00e279c6061134a33a8099fd69d4304735d02e
The commit was applied for the task MDEV-6480 that allowed to remove top
level disjuncts from WHERE conditions if the range optimizer evaluated them
as always equal to FALSE/NULL.
If such disjuncts are removed the WHERE condition may become an AND formula
and if this formula contains multiple equalities the field JOIN::item_equal
must be updated to refer to these equalities. The above mentioned commit
forgot to do this and it could cause crashes for some queries.

Approved by Oleksandr Byelkin <sanja@mariadb.com>

preview-10.7-MDEV-26519-json-histograms 2021-11-26 17:03:08 UTC
MDEV-26886: Estimation for filtered rows less precise with JSON histogram

Author: Sergey Petrunia
Author Date: 2021-11-26 17:03:08 UTC

MDEV-26886: Estimation for filtered rows less precise with JSON histogram

- Make Histogram_json_hb::range_selectivity handle singleton buckets
  specially when computing selectivity of the max. endpoint bound.
  (for min. endpoint, we already do that).

- Also, fixed comments for Histogram_json_hb::find_bucket

bb-10.8-MDEV-26938 2021-11-26 14:28:59 UTC
squash! 421739c6dab0aa8a77930bf1bf98cbafaeca7425

Author: Marko Mäkelä
Author Date: 2021-11-26 14:28:59 UTC

squash! 421739c6dab0aa8a77930bf1bf98cbafaeca7425

dict_index_t::is_btree(): Check whether the index is a regular
B-tree index (not SPATIAL, FULLTEXT, or the ibuf.index,
or a corrupted index.

btr_cur_search_to_nth_level_func(): Only attempt to use
the adaptive hash index if index->is_btree().
This function may also be invoked on ibuf.index, and
cmp_dtuple_rec_with_match_bytes() will no longer work on ibuf.index
because it assumes that the index and record fields exactly match.
The ibuf.index is a special variadic index tree.

bb-10.6-MDEV-27111 2021-11-26 13:17:07 UTC
MDEV-27111 atomic.rename_table test case fails

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-11-23 14:26:28 UTC

MDEV-27111 atomic.rename_table test case fails

 InnoDB fails to identify the deferred tablespace after recovery.
Problem is that InnoDB fails to rename the tablespace present
in deferred tablespace. Fix is that InnoDB should try to rename the
deferred tablespace when tablespace is not found.

bb-10.5-danielblack-MDEV-24788-mysqld--help-cannot-lock-aria-control 2021-11-26 05:29:37 UTC
MDEV-24788: mariadbd --help Can't lock aria control file

Author: Daniel Black
Author Date: 2021-05-19 04:56:09 UTC

MDEV-24788: mariadbd --help Can't lock aria control file

... '/var/lib/mysql/aria_log_control' for exclusive use, error: 11

As such don't lock under aria_readonly (which is set by opt_help in the handler
initialization.

Fixes: 8eba777c2bbad7721c818936a3a0ced3b2fcd59c

bb-10.3-mdev26249 2021-11-25 09:20:29 UTC
MDEV-26249: Crash in Explain_node::print_explain_for_children with slow query...

Author: Sergey Petrunia
Author Date: 2021-11-23 14:55:08 UTC

MDEV-26249: Crash in Explain_node::print_explain_for_children with slow query log

The problem was caused by this:
- The select in derived table uses two-phase optimization (due to a
  possible LATERAL DERIVED).
- The primary select has "Impossible where" and so it short-cuts its
  optimization.
- The optimization for the SELECT in the derived table is never finished,
  and EXPLAIN data structure has a dangling pointer to select #2.

Fixed with this: if the select has "Impossible where", do not add links
to derived table subselects into the EXPLAIN data structure. We are not
going to execute those anyway.

bb-10.8-MDEV-5816 2021-11-25 08:11:11 UTC
MDEV-5816: Stored programs: validation of stored program statements

Author: Dmitry Shulga
Author Date: 2021-11-24 12:41:14 UTC

MDEV-5816: Stored programs: validation of stored program statements

This is the prerequisite patch to move the sp_instr class and classes derived
from it into the files sp_instr.cc/sp_instr.h

bb-10.8-mdev-5271 2021-11-25 04:32:29 UTC
MDEV-5271 Support engine-defined attributes per partition

Author: Nayuta Yanagisawa
Author Date: 2021-11-05 07:39:28 UTC

MDEV-5271 Support engine-defined attributes per partition

Make it possible to specify engine-defined attributes on partitions
as well as tables.

If an engine-defined attribute is only specified at the table level,
it applies to all the partitions in the table.
This is a backward-compatible behavior.

If the same attribute is specified both at the table level and the
partition level, the per-partition one takes precedence.
So, we can consider per-table attributes as default values.

One cannot specify engine-defined attributes on subpartitions.

Implementation details:

* We store per-partition attributes in the partition_element class
  because we already have the part_comment field, which is for
  per-partition comments.

* In the case of ALTER TABLE statements, the partition_elements in
  table->part_info is set up by mysql_unpack_partition().
  So, we parse per-partition attributes after the call of the function.

bb-10.6-robert 2021-11-24 15:52:51 UTC
Fix build failure on mac due to invalid access on private member from rw_lock

Author: Robert Bindar
Author Date: 2021-11-24 15:51:34 UTC

Fix build failure on mac due to invalid access on private member from rw_lock

bb-10.8-robert 2021-11-24 14:39:38 UTC
Remove DYNAMIC_ARRAY get_index_dynamic()

Author: Eric Herman
Author Date: 2021-11-05 18:03:38 UTC

Remove DYNAMIC_ARRAY get_index_dynamic()

The DYNAMIC_ARRAY copies values in and copies values out. Without a
comparitor function, get_index_dynamic() does not make sense.

This function is not used. If we have a need for a function like it
in the future, I propose we write a new one with unit tests showing
how it is used and demostrating that it behaves as expected.

bb-10.2-robert 2021-11-24 10:57:44 UTC
MDEV-26558 Fix a deadlock due to cyclic dependence

Author: ryancaicse
Author Date: 2021-11-10 10:35:17 UTC

MDEV-26558 Fix a deadlock due to cyclic dependence

Fix a potential deadlock bug between locks ctrl_mutex and entry->mutex

bb-bar-10.8 2021-11-24 09:45:35 UTC
MDEV-27042 UCA: Resetting contractions to ignorable does not work well

Author: Alexander Barkov
Author Date: 2021-11-14 03:09:08 UTC

MDEV-27042 UCA: Resetting contractions to ignorable does not work well

The weight scanner routine scanner_next() did not properly handle the cases
when a contraction produces no weights (is ignorable).

Adding a helper routine my_uca_scanner_set_weight() and using
it in all cases:

- A single ASCII character
- A contraction starting with an ASCII character
- A multi-byte character
- A contraction starting with a multi-byte character

Also adding two other helper routines:

- my_uca_scanner_next_expansion_weight()
- my_uca_scanner_set_weight_outside_maxchar()

to avoid using scanner->wbeg directly inside scanner_next().
This reduces the probability of similar future bugs.

bb-10.7-MDEV-22522 2021-11-23 10:37:20 UTC
MDEV-22522 RPM packages have meaningless summary/description

Author: Alexey Bychko
Author Date: 2021-11-22 12:34:47 UTC

MDEV-22522 RPM packages have meaningless summary/description

this patch moves cpack summury and description for optional packages
to the appropriate CMakeLists.txt files
this patch is based on 10.2 one with additions for 10.5+

bb-10.7-serg 2021-11-23 10:08:35 UTC
cmake: detect lz4 version, require >= 1.6

Author: Sergei Golubchik
Author Date: 2021-11-04 15:17:35 UTC

cmake: detect lz4 version, require >= 1.6

bb-10.5-MDEV-22522 2021-11-23 07:56:48 UTC
MDEV-22522 RPM packages have meaningless summary/description

Author: Alexey Bychko
Author Date: 2021-11-22 12:34:47 UTC

MDEV-22522 RPM packages have meaningless summary/description

this patch moves cpack summury and description for optional packages
to the appropriate CMakeLists.txt files
this patch is based on 10.2 one with additions for 10.5+

bb-10.2-MDEV-22522 2021-11-23 04:29:24 UTC
MDEV-22522 RPM packages have meaningless summary/description

Author: Alexey Bychko
Author Date: 2021-11-22 12:34:47 UTC

MDEV-22522 RPM packages have meaningless summary/description

this patch moves cpack summury and description for optional packages
to the appropriate CMakeLists.txt files

bb-10.2-MDEV-26915-galera 2021-11-23 02:10:47 UTC
MDEV-26915: SST scripts do not take log_bin_index setting into account

Author: Julius Goryavsky
Author Date: 2021-11-16 06:32:14 UTC

MDEV-26915: SST scripts do not take log_bin_index setting into account

Currently, SST scripts assume that the filename specified in
the --log-bin-index argument either does not contain an extension
or uses the standard ".index" extension. Similar assumptions are
used for the log_bin_index parameter read from the configuration
file. This commit adds support for arbitrary extensions for the
index file paths.

bb-10.3-MDEV-26915-galera 2021-11-23 01:41:00 UTC
MDEV-26915: SST scripts do not take log_bin_index setting into account

Author: Julius Goryavsky
Author Date: 2021-11-16 06:32:14 UTC

MDEV-26915: SST scripts do not take log_bin_index setting into account

Currently, SST scripts assume that the filename specified in
the --log-bin-index argument either does not contain an extension
or uses the standard ".index" extension. Similar assumptions are
used for the log_bin_index parameter read from the configuration
file. This commit adds support for arbitrary extensions for the
index file paths.

bb-10.3-MDEV-26064-galera 2021-11-23 01:18:26 UTC
MDEV-26064: mariabackup SST fails when starting with --innodb-force-recovery

Author: Julius Goryavsky
Author Date: 2021-11-16 04:21:18 UTC

MDEV-26064: mariabackup SST fails when starting with --innodb-force-recovery

If the server is started with the --innodb-force-recovery argument
on the command line, then during SST this argument can be passed to
mariabackup only at the --prepare stage, and accordingly it must be
removed from the --mysqld-args list (and it is not should be passed
to mariabackup otherwise).

This commit fixes a flaw in the SST scripts and add a test that
checks the ability to run the joiner node in a configuration that
uses --innodb-force-recovery=1.

bb-10.5-danielblack-MDEV-26891-delay-insert-virt-crash-pr1943 2021-11-22 23:13:43 UTC
MDEV-26891 Server crashes upon INSERT DELAYED with virtual columns (test)

Author: Elena Stepanova
Author Date: 2021-11-22 21:55:29 UTC

MDEV-26891 Server crashes upon INSERT DELAYED with virtual columns (test)

bb-10.5-nikita 2021-11-22 21:36:02 UTC
exclude Columnstore.xml from conffiles

Author: Nikita Malyavin
Author Date: 2021-11-20 00:28:16 UTC

exclude Columnstore.xml from conffiles

bb-10.8-C++-14 2021-11-22 11:21:49 UTC
use c++14 standard

Author: Sergei Krivonos
Author Date: 2021-11-18 01:04:20 UTC

use c++14 standard

bb-10.3-mdev26337 2021-11-22 07:55:38 UTC
MDEV-26337: subquery with groupby and ROLLUP returns incorrect results on LEF...

Author: Sergey Petrunia
Author Date: 2021-11-22 07:55:38 UTC

MDEV-26337: subquery with groupby and ROLLUP returns incorrect results on LEFT JOIN on INDEXED values

Make const_expression_in_where() ignore the equalities injected by
LATERAL DERIVED optimization, unless these equalities are used for
ref access.

This follows what make_join_select()/make_cond_for_table() does:
these functions will discard such equalities too.

bb-10.2-mdev-22742-hf 2021-11-22 05:58:46 UTC
MDEV-22742 UBSAN: Many overflow issues in strings/decimal.c - runtime error: ...

Author: Alexey Botchkov
Author Date: 2021-11-22 05:58:46 UTC

MDEV-22742 UBSAN: Many overflow issues in strings/decimal.c - runtime error: signed integer overflow: x * y cannot be represented in type 'long long int' (on optimized builds).

Avoid integer overflow, do the check before the calculation.

bb-10.8-wlad 2021-11-21 15:54:09 UTC
MDEV-25785 Add support for OpenSSL 3.0

Author: Vladislav Vaintroub
Author Date: 2021-11-08 17:48:19 UTC

MDEV-25785 Add support for OpenSSL 3.0

Summary of changes

- MD_CTX_SIZE is increased

- EVP_CIPHER_CTX_buf_noconst(ctx) does not work anymore, points
  to nobody knows where. The assumption made previously was that
  (since the function does not seem to be documented)
  was that it points to the last partial source block.
  Add own partial block buffer for NOPAD encryption instead

- SECLEVEL in CipherString in openssl.cnf
  had been downgraded to 0, from 1, to make TLSv1.0 and TLSv1.1 possible
   (according to https://github.com/openssl/openssl/blob/openssl-3.0.0/NEWS.md
   even though the manual for SSL_CTX_get_security_level claims that it
   should not be necessary)

- Workaround Ssl_cipher_list issue, it now returns TLSv1.3 ciphers,
  in addition to what was set in --ssl-cipher

- ctx_buf buffer now must be aligned to 16 bytes with openssl(
  previously with WolfSSL only), ot crashes will happen

- updated aes-t , to be better debuggable
  using function, rather than a huge multiline macro
  added test that does "nopad" encryption piece-wise, to test
  replacement of EVP_CIPHER_CTX_buf_noconst

bb-10.2-bar 2021-11-20 17:49:25 UTC
MDEV-27098 Subquery using the ALL keyword on TIME columns produces a wrong re...

Author: Alexander Barkov
Author Date: 2021-11-20 17:49:25 UTC

MDEV-27098 Subquery using the ALL keyword on TIME columns produces a wrong result

bb-10.8-C++-14-TODO-3121 2021-11-20 16:25:48 UTC
Improve LibFMT detection

Author: Sergei Krivonos
Author Date: 2021-11-17 07:41:13 UTC

Improve LibFMT detection

Signed-off-by: Sergei Krivonos <sergei.krivonos@mariadb.com>

bb-10.6-MDEV-26827 2021-11-20 12:41:04 UTC
Merge

Author: Marko Mäkelä
Author Date: 2021-11-20 12:41:04 UTC

Merge

bb-10.8-midenok 2021-11-19 15:32:28 UTC
MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit ty...

Author: midenok
Author Date: 2021-11-19 15:06:48 UTC

MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'

32-bit variable must be expanded to 64-bit before shift left.

bb-10.7-midenok2 2021-11-19 15:06:48 UTC
MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit ty...

Author: midenok
Author Date: 2021-11-19 15:06:48 UTC

MDEV-27048 UBSAN: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int'

32-bit variable must be expanded to 64-bit before shift left.

bb-10.7-release 2021-11-19 14:39:04 UTC
MDEV-23766: fix by assert (Windows)

Author: Sergei Krivonos
Author Date: 2021-11-09 18:06:22 UTC

MDEV-23766: fix by assert (Windows)

bb-10.7-MDEV-23766 2021-11-19 14:39:04 UTC
MDEV-23766: fix by assert (Windows)

Author: Sergei Krivonos
Author Date: 2021-11-09 18:06:22 UTC

MDEV-23766: fix by assert (Windows)

bb-10.8-TODO-3121 2021-11-19 12:40:01 UTC
Improve LibFMT detection

Author: Sergei Krivonos
Author Date: 2021-11-17 07:41:13 UTC

Improve LibFMT detection

Signed-off-by: Sergei Krivonos <sergei.krivonos@mariadb.com>

st-10.8-wlad 2021-11-19 08:46:57 UTC
Revert "MDEV-26713 Windows - improve utf8 support for command line tools"

Author: Vladislav Vaintroub
Author Date: 2021-11-19 08:46:57 UTC

Revert "MDEV-26713 Windows - improve utf8 support for command line tools"

This reverts commit several commits pushed by mistake.

bb-10.7-TODO-3121 2021-11-18 02:32:02 UTC
Improve LibFMT detection

Author: Sergei Krivonos
Author Date: 2021-11-17 07:41:13 UTC

Improve LibFMT detection

Signed-off-by: Sergei Krivonos <sergei.krivonos@mariadb.com>

bb-10.2-wlad 2021-11-17 23:55:09 UTC
MDEV-27075 mysql_upgrade_service.exe - using uninitialized memory 'defaults_f...

Author: Vladislav Vaintroub
Author Date: 2021-11-17 23:51:17 UTC

MDEV-27075 mysql_upgrade_service.exe - using uninitialized memory 'defaults_file'

Remove section that was trying to rename default-character-set to character-set-server

This seems to be an old workaround for some upgrade warning, which did not
work for some time already, because the ini filename was not initialized.

bb-10.7-MDEV-20119 2021-11-17 20:36:01 UTC
MDEV-20119: Implement the --do-domain-ids, --ignore-domain-ids, and --ignore-...

Author: Brandon Nesterenko
Author Date: 2021-09-14 18:58:04 UTC

MDEV-20119: Implement the --do-domain-ids, --ignore-domain-ids, and --ignore-server-ids options for mysqlbinlog

New Feature:
============
Extend mariadb-binlog command-line tool to use GTIDs for filtering
event groups by using domain id and server id as a blacklist or
whitelist. This patch additionally adds the option
--do-server-ids as an alias for --server-id for consistency.

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

bb-10.2-MDEV-14938 2021-11-17 05:52:38 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
galera binaries to include galera library and binaries into server
bintar.
it introduces new cmake variable EXT_GALERA_PATH representing relative
or absolute path to galera which can be either just files in directory,
compiled tree or unpacked tarball.
if EXT_GALERA_PATH is used, bintar name will include glibc version, for
example mariadb-10.2.42-linux-glibc_224-x86_64.tar.gz

bb-10.2-MDEV-26064-galera 2021-11-16 04:21:18 UTC
MDEV-26064: mariabackup SST fails when starting with --innodb-force-recovery

Author: Julius Goryavsky
Author Date: 2021-11-16 04:21:18 UTC

MDEV-26064: mariabackup SST fails when starting with --innodb-force-recovery

If the server is started with the --innodb-force-recovery argument
on the command line, then during SST this argument can be passed to
mariabackup only at the --prepare stage, and accordingly it must be
removed from the --mysqld-args list (and it is not should be passed
to mariabackup otherwise).

This commit fixes a flaw in the SST scripts and add a test that
checks the ability to run the joiner node in a configuration that
uses --innodb-force-recovery=1.

bb-10.3-DBAAS-7828 2021-11-15 23:33:45 UTC
DBAAS-7828: Primary/replica: configuration change of autocommit=0 can not be ...

Author: Brandon Nesterenko
Author Date: 2021-11-15 23:33:45 UTC

DBAAS-7828: Primary/replica: configuration change of autocommit=0 can not be applied

Problem:
========
When the mysql.gtid_slave_pos table uses the InnoDB engine, and
mysqld starts, it reads the table and begins a transaction. After
reading the value, it should end the transaction and release all
associated locks. The bug reported in DBAAS-7828 shows that when
autocommit is off, the locks are not released, resulting in
indefinite hangs on future attempts to change gtid_slave_pos. In
particular, the transaction was not properly finalized because
thd->server_status was not updated to reflect the end of the
transaction.

Solution:
========
This patch updates the code to properly commit the transaction after
reading gtid_slave_pos during mysqld start-up.

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

bb-10.4-MDEV-23766 2021-11-14 07:51:07 UTC
MDEV-27036: allow Json_writer_[array|object] from Json_writer

Author: Sergei Krivonos
Author Date: 2021-11-14 04:11:12 UTC

MDEV-27036: allow Json_writer_[array|object] from Json_writer

bb-10.5-midenok 2021-11-13 15:57:21 UTC
MDEV-25292 Refactoring: moved select_field_count into Alter_info.

Author: midenok
Author Date: 2021-11-13 15:57:21 UTC

MDEV-25292 Refactoring: moved select_field_count into Alter_info.

There is a need in MDEV-25292 to have both C_ALTER_TABLE and
select_field_count in one call. Semantically creation mode and field
count is 2 different things. Making creation mode negative constants
and field count positive variable into one parameter was a lazy hack
for not making the second parameter.

select_field_count does not make sense without
alter_info->select_field_count, so the natural way is to hold it in
Alter_info too.

bb-10.4-MDEV-16462 2021-11-12 01:36:10 UTC
MDEV-16462: add assert to detect duplicated JSON keys

Author: Sergei Krivonos
Author Date: 2021-11-12 01:36:10 UTC

MDEV-16462: add assert to detect duplicated JSON keys

bb-10.5-serg 2021-11-11 18:19:55 UTC
require system pcre2 in rpms

Author: Sergei Golubchik
Author Date: 2021-11-05 14:12:14 UTC

require system pcre2 in rpms

now when SLES12.3 is gone, we can enforce it

10.7-MDEV-26991-merge 2021-11-11 15:33:27 UTC
MDEV-26991: CURRENT_TEST: main.mysql_binary_zero_insert 'grep' is not recogni...

Author: Brandon Nesterenko
Author Date: 2021-11-11 13:19:19 UTC

MDEV-26991: CURRENT_TEST: main.mysql_binary_zero_insert 'grep' is not recognized as an internal or external command, operable program or batch file.

Removed grep from mysqldump command stream and instead,
extend the search_file pattern to search for rows containing
binary zeros instead of any occurance of '00' in the input

10.7-selectivity 2021-11-11 10:59:13 UTC
Another fixup, to be combined with the previous commits

Author: Monty
Author Date: 2021-11-09 12:45:53 UTC

Another fixup, to be combined with the previous commits

Fixed a lot of inconsistencies in optimizer cost calculation. The main
objective was get cost calculation as similar (and accurate) as
possible to make different plans more comparable.

- Replaced constant 2.0 with new define TABLE_SCAN_SETUP_COST.
- Added RECORD_COPY_COST, the cost of finding the next row and copying
  it to record for table scans.
- Added INDEX_COPY_COST, the cost of finding the next key and copying it
  to record for index scans.
- Added INDEX_NEXT_FIND_COST, the cost of finding the next index entry and
  checking it against filter.
- Some scan cost estimates did not take into account
  TIME_FOR_COMPARE. Now all scan costs takes this into
  account. (main.show_explain)
- Fixed that we don't calculate TIME_FOR_COMPARE twice for some plans,
  like in optimize_straight_join() and greedy_search()
- JOIN_TAB::scan_time() did not take into account index only scans,
  which produced a wrong cost when index scan was used. Fixed by
  adding support for covering keys. Cached also the calculated values
  to avoid future calls during optimization phase.
- Fixed that most index cost calculation are done the same way and
  more close to 'range' calculations. The effects of this change are:
  - Cost of index scan is now lower than before, which causes some
   tests result to change. (innodb.innodb, main.show_explain)
  - Fixed the EQ_REF takes into account clustered and covered keys.
  - Ensured that index_scan_cost() ==
    range(scan_of_all_rows_in_table_using_one_range) +
    MULTI_RANGE_READ_INFO_CONST. One effect of this is that if there is
    choice of doing a full index scan and a range-index scan over almost
    the whole table then index scan will be preferred (no range-read
    setup cost).
  - Rowid filter setup cost and filter compare cost now takes into account
    fetching and checking the rowid (INDEX_NEXT_FIND_COST).
   (main.partition_pruning heap.heap_btree main.log_state)
- Introduced ha_scan_time() that takes into account the CPU cost of
  finding the next row and copying the row from the engine to
  'record'. This causes costs of table scan to slightly increase and
  some test to changed their plan from ALL to RANGE or ALL to ref.
  (innodb.innodb_mysql, main.select_pkeycache)
- Introduced ha_scan_and_compare_time() to is like ha_scan_time() but also
  adds the cost of checking the where clause (TIME_FOR_COMPARE).
- Cost of index scan was too low before compared to anything else.
  - Introduced ha_keyread_time(rows) that takes into account finding the
    next row and copying the key value to 'record' (INDEX_COPY_COST).
  - Introduced ha_key_scan_time() for calculating an index scan over all
     rows.
  - Added IDX_LOOKUP_COST to keyread_time() as a startup cost.
  - Added index_only_fetch_cost() as a convenience function to
    OPT_RANGE.
  - keyread_time() cost is slightly reduced to prefer shorter keys.
  - All of the above caused some index_merge combinations to be
    rejected because of cost (main.index_intersect)
- Added checking of the WHERE clause of the accepted rows to ROR costs in
  get_best_ror_intersect()
- Fixed bug in get_best_ror_intersect() where 'min_cost' was not updated,
  and the cost we compared with was not the one that was used.
- Removed '- 0.001' from 'join->best_read' and optimize_straight_join()
  to ensure that the 'Last_query_cost' status variable contains the same
  value as the one that was calculated by the optimizer.
- Extend get_range_limit_read_cost() to take into considering
  cost_for_index_read() if there where no quick keys. This will reduce
  the computed cost for ORDER BY with LIMIT in some cases.
  (main.innodb_ext_key)
- Added INDEX_NEXT_FIND_COST to Range_rowid_filter_cost_info::lookup_cost
  to account of the time to find and check the next key value against the
  container
- Changed 'JOIN_TAB:::scan_time() to take into consideration clustered and
  covered keys. The values are now cached and we only have to call this
  function once. Other calls are changed to use the cached values.
  Function renamed to JOIN_TAB::estimate_scan_time().

Other things:
- Added some 'if (thd->trace_started())' to speed up code
- Removed not used function Cost_estimate::is_zero()
- Simplified testing of HA_POS_ERROR in get_best_ror_intersect().
  (No cost changes)

bb-10.6-MDEV-23805 2021-11-11 09:42:30 UTC
MDEV-23805 Make Online DDL to Instant DDL when table is empty

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-11-11 07:26:33 UTC

MDEV-23805 Make Online DDL to Instant DDL when table is empty

- In ha_innobase::prepare_inplace_alter_table(), InnoDB should
check whether the table is empty. If the table is empty then
server should avoid downgrading the MDL after prepare phase.
It is more like instant alter, does change only in dicationary
and metadata.

- Changed few debug test case to make non-empty DDL table

selectivity-10.7-rbz 2021-11-10 13:04:47 UTC
Another fixup, to be combined with the previous commits

Author: Monty
Author Date: 2021-11-09 12:45:53 UTC

Another fixup, to be combined with the previous commits

Fixed a lot of inconsistencies in optimizer cost calculation. The main
objective was get cost calculation as similar (and accurate) as
possible to make different plans more comparable.

- Replaced constant 2.0 with new define TABLE_SCAN_SETUP_COST.
- Added RECORD_COPY_COST, the cost of finding the next row and copying
  it to record for table scans.
- Added INDEX_COPY_COST, the cost of finding the next key and copying it
  to record for index scans.
- Added INDEX_NEXT_FIND_COST, the cost of finding the next index entry and
  checking it against filter.
- Some scan cost estimates did not take into account
  TIME_FOR_COMPARE. Now all scan costs takes this into
  account. (main.show_explain)
- Fixed that we don't calculate TIME_FOR_COMPARE twice for some plans,
  like in optimize_straight_join() and greedy_search()
- JOIN_TAB::scan_time() did not take into account index only scans,
  which produced a wrong cost when index scan was used. Fixed by
  adding support for covering keys. Cached also the calculated values
  to avoid future calls during optimization phase.
- Fixed that most index cost calculation are done the same way and
  more close to 'range' calculations. The effects of this change are:
  - Cost of index scan is now lower than before, which causes some
   tests result to change. (innodb.innodb, main.show_explain)
  - Fixed the EQ_REF takes into account clustered and covered keys.
  - Ensured that index_scan_cost() ==
    range(scan_of_all_rows_in_table_using_one_range) +
    MULTI_RANGE_READ_INFO_CONST. One effect of this is that if there is
    choice of doing a full index scan and a range-index scan over almost
    the whole table then index scan will be preferred (no range-read
    setup cost).
  - Rowid filter setup cost and filter compare cost now takes into account
    fetching and checking the rowid (INDEX_NEXT_FIND_COST).
   (main.partition_pruning heap.heap_btree main.log_state)
- Introduced ha_scan_time() that takes into account the CPU cost of
  finding the next row and copying the row from the engine to
  'record'. This causes costs of table scan to slightly increase and
  some test to changed their plan from ALL to RANGE or ALL to ref.
  (innodb.innodb_mysql, main.select_pkeycache)
- Introduced ha_scan_and_compare_time() to is like ha_scan_time() but also
  adds the cost of checking the where clause (TIME_FOR_COMPARE).
- Cost of index scan was too low before compared to anything else.
  - Introduced ha_keyread_time(rows) that takes into account finding the
    next row and copying the key value to 'record' (INDEX_COPY_COST).
  - Introduced ha_key_scan_time() for calculating an index scan over all
     rows.
  - Added IDX_LOOKUP_COST to keyread_time() as a startup cost.
  - Added index_only_fetch_cost() as a convenience function to
    OPT_RANGE.
  - keyread_time() cost is slightly reduced to prefer shorter keys.
  - All of the above caused some index_merge combinations to be
    rejected because of cost (main.index_intersect)
- Added checking of the WHERE clause of the accepted rows to ROR costs in
  get_best_ror_intersect()
- Fixed bug in get_best_ror_intersect() where 'min_cost' was not updated,
  and the cost we compared with was not the one that was used.
- Removed '- 0.001' from 'join->best_read' and optimize_straight_join()
  to ensure that the 'Last_query_cost' status variable contains the same
  value as the one that was calculated by the optimizer.
- Extend get_range_limit_read_cost() to take into considering
  cost_for_index_read() if there where no quick keys. This will reduce
  the computed cost for ORDER BY with LIMIT in some cases.
  (main.innodb_ext_key)
- Added INDEX_NEXT_FIND_COST to Range_rowid_filter_cost_info::lookup_cost
  to account of the time to find and check the next key value against the
  container
- Changed 'JOIN_TAB:::scan_time() to take into consideration clustered and
  covered keys. The values are now cached and we only have to call this
  function once. Other calls are changed to use the cached values.
  Function renamed to JOIN_TAB::estimate_scan_time().

Other things:
- Added some 'if (thd->trace_started())' to speed up code
- Removed not used function Cost_estimate::is_zero()
- Simplified testing of HA_POS_ERROR in get_best_ror_intersect().
  (No cost changes)

10.7-MDEV-20119-v2 2021-11-09 15:58:03 UTC
Stash holder

Author: Brandon Nesterenko
Author Date: 2021-11-09 15:58:03 UTC

Stash holder

bb-10.7-MDEV-23805 2021-11-09 10:58:12 UTC
MDEV-23805 Make Online DDL to Instant DDL when table is empty

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-11-09 10:56:29 UTC

MDEV-23805 Make Online DDL to Instant DDL when table is empty

 In ha_innobase::prepare_inplace_alter_table(), InnoDB should
check whether the table is empty. If the table is empty then
server should avoid downgrading the MDL after prepare phase.
It is more like instant alter, does change only in dicationary
and metadata.

 Changed few debug test case to make non-empty DDL table

bb-10.3-danielblack-MDEV-27008-aarch-atomics 2021-11-09 07:35:00 UTC
MDEV-27008: aarch64: use compiler flag outline-atomics if available

Author: Tzachi Zidenberg
Author Date: 2020-07-05 12:21:43 UTC

MDEV-27008: aarch64: use compiler flag outline-atomics if available

outline-atomics compilation flag changes behaviour of builtin_atomics,
by adding runtime detection of LSE atomics. If these are supported, they
will be used. This gains LSE atomics use without hurting compatibility
with older aarch64 machines.

Backport of f843e215f3f640de377d8fd60e85bb372fb138fd to fix f502ccbcb5dfce29067434885a23db8d1bd5f134

bb-10.6-release 2021-11-08 18:42:18 UTC
Merge branch '10.6' into bb-10.6-release

Author: Oleksandr "Sanja" Byelkin
Author Date: 2021-11-08 18:42:18 UTC

Merge branch '10.6' into bb-10.6-release

bb-10.3-release 2021-11-08 18:37:16 UTC
Merge branch '10.3' into bb-10.3-release

Author: Oleksandr "Sanja" Byelkin
Author Date: 2021-11-08 18:37:16 UTC

Merge branch '10.3' into bb-10.3-release

bb-10.2-MDEV-21866 2021-11-08 12:16:14 UTC
MDEV-21866: Assertion `!result' failed in convert_const_to_int upon 2nd execu...

Author: Dmitry Shulga
Author Date: 2021-11-08 08:22:06 UTC

MDEV-21866: Assertion `!result' failed in convert_const_to_int upon 2nd execution of PS

Consider the following use case:
MariaDB [test]> CREATE TABLE t1 (field1 BIGINT DEFAULT -1);
MariaDB [test]> CREATE VIEW v1 AS SELECT DISTINCT field1 FROM t1;

Repeated execution of the following query as a Prepared Statement

MariaDB [test]> PREPARE stmt FROM 'SELECT * FROM v1 WHERE field1 <=> NULL';
MariaDB [test]> EXECUTE stmt;

results in a crash for a server built with DEBUG.

MariaDB [test]> EXECUTE stmt;
ERROR 2013 (HY000): Lost connection to MySQL server during query

Assertion failed: (!result), function convert_const_to_int, file item_cmpfunc.cc, line 476.
Abort trap: 6 (core dumped)

The crash inside the function convert_const_to_int() happens by the reason
that the value -1 is stored in an instance of the class Field_longlong
on restoring its original value in the statement
  result= field->store(orig_field_val, TRUE);
that leads to assigning the value 1 to the variable 'result' with subsequent
crash in the DBUG_ASSERT statement following it
  DBUG_ASSERT(!result);

The main matter here is why this assertion failure happens on the second
execution of the prepared statement and doens't on the first one.
On first handling of the statement
  'EXECUTE stmt;'
a temporary table is created for serving the query involving the view 'v1'.
The table is created by the function create_tmp_table() in the following
calls trace: (trace #1)
  JOIN::prepare (at sql_select.cc:725)
    st_select_lex::handle_derived
      LEX::handle_list_of_derived
        TABLE_LIST::handle_derived
          mysql_handle_single_derived
            mysql_derived_prepare
              select_union::create_result_table
                create_tmp_table

Note, that the data member TABLE::status of a TABLE instance returned by the
function create_tmp_table() has the value 0.

Later the function setup_table_map() is called on the TABLE instance just
created for the sake of the temporary table (calls trace #2 is below):
  JOIN::prepare (at sql_select.cc:737)
    setup_tables_and_check_access
      setup_tables
        setup_table_map
where the data member TABLE::status is set to the value STATUS_NO_RECORD.

After that when execution of the method JOIN::prepare reaches calling of
the function setup_without_group() the following calls trace is invoked
  JOIN::prepare
    setup_without_group
      setup_conds
        Item_func::fix_fields
          Item_func_equal::fix_length_and_dec
            Item_bool_rowready_func2::fix_length_and_dec
              Item_func::setup_args_and_comparator
                Item_func::convert_const_compared_to_int_field
                  convert_const_to_int

There is the following code snippet in the function convert_const_to_int()
at the line item_cmpfunc.cc:448
    bool save_field_value= (field_item->const_item() ||
                            !(field->table->status & STATUS_NO_RECORD));
Since field->table->status has bits STATUS_NO_RECORD set the variable
save_field_value is false and therefore neither the method
Field_longlong::val_int() nor the method Field_longlong::store is called
on the Field instance that has the numeric value -1.
That is the reason why first execution of the Prepared Statement for the query
  'SELECT * FROM v1 WHERE field1 <=> NULL'
is successful.

On second running of the statement 'EXECUTE stmt' a new temporary tables
is also created by running the calls trace #1 but the trace #2 is not executed
by the reason that data member SELECT_LEX::first_cond_optimization has been set
to false on first execution of the prepared statemet (in the method
JOIN::optimize_inner()). As a consequence, the data member TABLE::status for
a temporary table just created doesn't have the flags STATUS_NO_RECORD set and
therefore on re-execution of the prepared statement the methods
Field_longlong::val_int() and Field_longlong::store() are called for the field
having the value -1 and the DBUG_ASSERT(!result) is fired.

To fix the issue the data member TABLE::status has to be assigned the value
STATUS_NO_RECORD in every place where the macros empty_record() is called
to emptify a record for just instantiated TABLE object created on behalf
the new temporary table.

bb-10.7-MDEV-26238 2021-11-08 11:21:33 UTC
MDEV-26238: Remove inconsistent behaviour of --default-* options

Author: Rucha Deodhar
Author Date: 2021-09-01 13:39:01 UTC

MDEV-26238: Remove inconsistent behaviour of --default-* options
in my_print_defaults

Analysis: --defaults* option is recognized anywhere in the commandline
instead of only at the beginning because handle_options() recognizes
options in any order.
Fix: use get_defaults_options() which recognizes --defaults* options only at
the beginning. After this is done, we only want to recognize other options
given in any order which can be done using handle_options(). So only skip
--defaults* options and pass rest of them to handle_options().
Also, removed -e, -g and -c because only my_print_defaults supports them.

bb-10.8-MDEV-19308 2021-11-04 16:38:40 UTC
MDEV-19308: bloom filter

Author: Sergei Krivonos
Author Date: 2021-11-04 15:32:05 UTC

MDEV-19308: bloom filter

bb-10.8-MDEV-26971 2021-11-04 10:07:44 UTC
MENT-1626: JSON file interface to wsrep node state.

Author: Alexey Yurchenko
Author Date: 2021-09-05 14:07:05 UTC

MENT-1626: JSON file interface to wsrep node state.

Integration with status reporter in wsrep-lib.

Status reporter reports changes in wsrep state and logged errors/
warnings to a json file which then can be read and interpreted by
an external monitoring tool.

Rationale: until the server is fully initialized it is unaccessible
by client and the only source of information is an error log which
is not machine-friendly. Since wsrep node can spend a very long time
in initialization phase (state transfer), it may be a very long time
that automatic tools can't easily monitor its liveness and progression.

New variable: wsrep_status_file specifies the output file name.
If not set, no file is created and no reporting is done.

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

bb-10.3-serg 2021-11-03 14:34:28 UTC
MDEV-26755 innodb.undo_truncate: ilink::assert_linked(): Assertion `prev != 0...

Author: Sergei Golubchik
Author Date: 2021-11-03 14:34:28 UTC

MDEV-26755 innodb.undo_truncate: ilink::assert_linked(): Assertion `prev != 0 && next != 0' failed

close_connections() in mysqld.cc sends a signal to all threads.
But InnoDB is too busy purging, doesn't react immediately.
close_connections() waits 20 seconds, which isn't enough in this
particular case, and then unlinks all threads from
the list and forcibly closes their vio connection.

InnoDB background threads have no vio connection to close, but
they're unlinked all the same. So when later they finally notice
the shutdown request and try to unlink themselves, they fail to
assert that they're still linked.

10.7-wlad 2021-11-03 14:12:59 UTC
appveyor - do not use cygwin's broken bison

Author: Vladislav Vaintroub
Author Date: 2021-11-03 13:35:13 UTC

appveyor - do not use cygwin's broken bison

bb-10.4-MDEV-18477 2021-11-03 12:06:55 UTC
MDEV-18477: add generic_hash_fnv1a

Author: Sergei Krivonos
Author Date: 2021-11-03 12:06:55 UTC

MDEV-18477: add generic_hash_fnv1a

bb-10.8-MDEV-18477 2021-11-03 11:30:08 UTC
MDEV-18477: add generic_hash_fnv1a

Author: Sergei Krivonos
Author Date: 2021-11-03 12:06:55 UTC

MDEV-18477: add generic_hash_fnv1a

bb-10.3-mdev-20770-hf 2021-11-02 12:21:11 UTC
MDEV-20770 Server crashes in JOIN::transform_in_predicates_into_in_subq upon ...

Author: Alexey Botchkov
Author Date: 2021-11-02 12:21:11 UTC

MDEV-20770 Server crashes in JOIN::transform_in_predicates_into_in_subq upon 2nd execution of PS/SP comparing GEOMETRY with other types.

The Item_in_subselect::in_strategy keeps the value and as the error
happens the condition isn't modified. That leads to wrong ::fix_fields
execution on second PS run. Also the select->table_list is merged
but not restored if an error happens, which causes hanging loops on
the third PS execution.

bb-10.4-MDEV-26953 2021-11-02 12:02:56 UTC
MDEV-26953 Assertion `!str || str != Ptr || !is_alloced()' failed in String::...

Author: Alexander Barkov
Author Date: 2021-11-02 12:02:56 UTC

MDEV-26953 Assertion `!str || str != Ptr || !is_alloced()' failed in String::copy upon SELECT with sjis

Item::save_str_in_field() passes &Item::str_value as a parameter
to val_str().

Item_func::make_empty_result() also fills and returns str_value.

As a result, in the reported scenario in
Item_func::val_str_from_val_str_ascii()
both "str" and "res" pointed to Item::str_value,
which made the DBUG_ASSERT inside String::copy()
(preventing copying to itself) crash:

  if ((null_value= str->copy(res->ptr(), res->length(),
                             &my_charset_latin1, collation.collation,
                             &errors)))

Fix:
- Adding a String* parameter to make_empty_result()
- Passing the val_str() parameter to make_empty_string().

bb-10.2-MDEV-26668-schema-mismatch 2021-11-02 10:47:23 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.3-midenok 2021-11-02 08:49:47 UTC
MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit...

Author: midenok
Author Date: 2021-11-02 01:52:04 UTC

MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields

versioning_fields flag indicates that any columns were specified WITH
SYSTEM VERSIONING. In that case we imply WITH SYSTEM VERSIONING for
the whole table and WITHOUT SYSTEM VERSIONING for the other columns.

bb-10.3-midenok-MDEV-25004 2021-11-02 08:13:21 UTC
MDEV-25004 FTS tests for System Versioning

Author: midenok
Author Date: 2021-11-02 08:13:21 UTC

MDEV-25004 FTS tests for System Versioning

MTR combination 'vers' for debug build sets sysvers_force and
sysvers_hide. sysvers_force makes every created table
system-versioned, sysvers_hide hides WITH SYSTEM VERSIONING for SHOW
CREATE.

To use 'vers' combination one must include maybe_versioning.inc into
his test.

Removed innodb-fts-stopword.test as it duplicates stopword.test

10.4-MDEV-11853 2021-11-01 15:51:30 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:
============

bb-10.7-MDEV-26497 2021-11-01 08:19:57 UTC
MDEV-26947 UNIQUE column checks fail in InnoDB resulting in table corruption

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2021-11-01 08:19:57 UTC

MDEV-26947 UNIQUE column checks fail in InnoDB resulting in table corruption

InnoDB fails to rollback the bulk insert buffered operation when
trx_mark_sql_stat_end() encounters the DB_DUPLICATE_KEY error.
In this case, check table fails with secondary index row count
mismatch. InnoDB gives the error "ER_ERROR_DURING_COMMIT"
while encountering the DB_DUPLICATE_KEY in trx_mark_sql_stat_end()

bb-10.4-MDEV-19129 2021-10-30 15:31:55 UTC
MDEV-19129: Xcode compatibility update: deprecated vfork -> fork

Author: Sergei Krivonos
Author Date: 2021-10-29 18:01:28 UTC

MDEV-19129: Xcode compatibility update: deprecated vfork -> fork

1100 of 1169 results

Other repositories

Name Last Modified
lp:maria 1 hour ago
lp:~maria-captains/maria/+git/connector-c 2018-01-08
12 of 2 results
You can't create new repositories for MariaDB.