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-98ee42-prod-launchpad-codeimport-0 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 1 hour 10 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 20 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 8 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 15 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-1 and finished taking 7 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 13 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-5 and finished taking 6 minutes — see the log
Import started on juju-98ee42-prod-launchpad-codeimport-4 and finished taking 9 minutes — see the log

Branches

Name Last Modified Last Commit
bb-11.3-mdev-22534 2023-09-12 01:57:07 UTC
MDEV-22534 Fix self-referencing Item_direct_view_ref

Author: Yuchen Pei
Author Date: 2023-09-12 01:57:07 UTC

MDEV-22534 Fix self-referencing Item_direct_view_ref

The loop is created in substitute_for_best_equal_field().

It calls Item_ref::transform (for the Item_direct_view_ref object)
which calls:

  Item *new_item= (*ref)->transform(thd, transformer, arg); // TRANSFORM-CALL

where transformer is Item::replace_equal_field().

Consider *vr1->ref==field, where vr1 is an Item_direct_view_ref, and
field is an Item_field that erroneously participates in a multiple
equality. If field->replace_equal_field() returns vr2, another
Item_direct_view_ref, with vr2->ref == vr1->ref. vr1->transform()
will, after the call on field->transform() that returns vr2 for
replacement, update its ref to point to vr2, so now *vr1->ref==vr2,
and since vr2->ref==vr1->ref, this gives us *vr2->ref == vr2, a self
reference.

This can be generalised to nested Item_direct_view_refs too, if
field->transform() returns an Item_direct_view_ref that has the same
ref field as the ref field of any Item_direct_view_ref in the chain.

On to the fix. If we maintain the rule that

  Objects inside Item_direct_view_ref do not participate in multiple
  equalities.

then the TRANSFORM-CALL will have new_item == *ref. That is, the
transform will be a no-op and no loop will be created.

The participation of multiple equalities is set during call to
Item::propagate_equal_fields(). This commit fixes
Item_ref::propagate_equal_fields() so that the rule is not violated
when a (non-Item_direct_view_ref) Item_ref points to an
Item_direct_view_ref:

Item_ref->Item_ref->...->Item_direct_view_ref->Item_direct_view_ref->...->Item_field

More specifically, we now delegate to the dereferenced
item (i.e. *ref) in such calls, rather than directly to the underlying
Item_field. By doing this, the call to propagate_equal_fields() on
toplevel Item_direct_view_ref will make it participate in the multiple
equality, instead of any of its downstream items.

bb-11.3-mdev-27277 2023-09-11 14:44:09 UTC
MDEV-27277 Add a warning when max_sort_length is reached

Author: Oleg Smirnov
Author Date: 2023-09-04 06:15:06 UTC

MDEV-27277 Add a warning when max_sort_length is reached

During a query execution some sorting and grouping operations
on strings may be involved. System variable max_sort_length defines
the maximum number of bytes to use when comparing strings during
sorting/grouping. Thus, the comparable parts of strings may be less
than their actual size, so the results of the query may be not
sorted/grouped properly.
To indicate that some comparisons were done on a truncated lengths,
a new warning has been introduced with this commit.

bb-10.4-lenas 2023-09-11 14:03:39 UTC
Added a new option for MTR:

Author: Lena Startseva
Author Date: 2023-09-11 14:03:39 UTC

Added a new option for MTR:
  ps-protocol-switch=# Set type of "--ps-protocol":
                          0 - prepare statement with "SELECT" query is executed
                              twice and result of 2nd execution is compared
                              with verification file (use by default)
                          1 - all prepare statements are executed only one
                              time

bb-11.2-mdev-22534 2023-09-11 08:59:28 UTC
MDEV-22534 Fix self-referencing Item_direct_view_ref

Author: Yuchen Pei
Author Date: 2023-08-22 02:28:55 UTC

MDEV-22534 Fix self-referencing Item_direct_view_ref

When the Item_ref points to another Item_ref, delegate the
propagate_equal_fields to the latter.

This fixes the inconsitency in equal_field of the underlying
Item_field, when an Item_ref points to a Item_direct_view_ref, as the
latter has its own propagate_equal_fields() that may "move" the
equal_field of the Item_field to itself.

bb-10.4-mdev-22534-demo-exists2in-loop 2023-09-11 07:24:03 UTC
MDEV-22534 [DEMO] Swapping the order in Item_cond_and causes infinite item_re...

Author: Yuchen Pei
Author Date: 2023-09-11 00:45:05 UTC

MDEV-22534 [DEMO] Swapping the order in Item_cond_and causes infinite item_ref loop

bb-10.6-MDEV-31983 2023-09-11 03:48:03 UTC
MDEV-31983 jointable materialization subquery optimization ignoring errors, ...

Author: Rex Johnston
Author Date: 2023-09-10 23:51:45 UTC

MDEV-31983 jointable materialization subquery optimization ignoring errors, then failing ASSERT.

Add in thread error check after get_quick_record_count() checking for
errors in constructing SEL_TREE.

bb-11.2-mdev-22534-demo-exists2in-loop 2023-09-11 00:45:05 UTC
MDEV-22534 [DEMO] Swapping the order in Item_cond_and causes infinite item_re...

Author: Yuchen Pei
Author Date: 2023-09-11 00:45:05 UTC

MDEV-22534 [DEMO] Swapping the order in Item_cond_and causes infinite item_ref loop

bb-10.5-MDEV-16641-test-unmask-mysql_client_test_tests 2023-09-08 23:28:56 UTC
MDEV-16641: renable mysql_client_test* tests

Author: Daniel Black
Author Date: 2023-09-08 23:28:56 UTC

MDEV-16641: renable mysql_client_test* tests

bb-11.2-mdev-22534-unpatched-equal-fields 2023-09-08 06:39:22 UTC
MDEV-22534 [DEMO] Unpatching propagate_equal_fields to reprod self-referencin...

Author: Yuchen Pei
Author Date: 2023-09-08 06:39:22 UTC

MDEV-22534 [DEMO] Unpatching propagate_equal_fields to reprod self-referencing item_ref

bb-10.4-MDEV-32130 2023-09-08 05:48:47 UTC
MDEV-16641: renable mysql_client_test* tests

Author: Daniel Black
Author Date: 2023-09-08 05:48:43 UTC

MDEV-16641: renable mysql_client_test* tests

See if buildbot still fails on these.

bb-11.2-mdev-22534-item-ref-propagate 2023-09-08 05:20:01 UTC
MDEV-22534 Decorrelate IN subquery

Author: Yuchen Pei
Author Date: 2023-09-08 05:20:01 UTC

MDEV-22534 Decorrelate IN subquery

Transform

in (select inner_col' from inner_table where inner_col = outer_col)

to

, outer_col in (select inner_col', inner_col from inner_table)

Achieved by implementing Item_in_subselect::exists2in_processor(),
accompanied with comprehensive test coverage. Factored out common code
between the two transformations.

Also avoid inconsistent Item_ref::propagate_equal_fields

When the Item_ref points to another Item_ref, delegate the
propagate_equal_fields to the latter.

This fixes the inconsitency in equal_field of the underlying
Item_field, when an Item_ref points to a Item_direct_view_ref, as the
latter has its own propagate_equal_fields() that may "move" the
equal_field of the Item_field to itself. It will prevent infinite
recursions like in MDEV-3881, when the Item_ref::transform() called
with the replace_equal_field transformer depends on the correct
Item_field of the underlying field.

Also include a workaround for MDEV-31269: skip exists2in
transformations if we are in a ps execution and at least one of the
chosen equalities contains an item of type ITEM_REF on either side.

Caveat:

- Cannot recognise bad item mismatch in equalities that causes
  materialization to not materialize down the road

bb-10.5-10.5.22-MDEV-24035-assertion 2023-09-07 15:01:09 UTC
MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing di...

Author: Vlad Lesin
Author Date: 2023-09-07 14:47:40 UTC

MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure

This commit is for custom build.

The transaction, which holds implicit record lock, must also hold IX
table lock.

bb-11.3-bar-MDEV-31431 2023-09-07 07:49:54 UTC
A followup for MDEV-31431 support sql standard <explicit table> expressions

Author: Alexander Barkov
Author Date: 2023-09-07 03:33:26 UTC

A followup for MDEV-31431 support sql standard <explicit table> expressions

Make `ANALYZE TABLE t1` parse the `TABLE t1` part through
the `explicit_table` table rule.

Still in progress: some statements crash with prepared statements.

bb-11.3-georg 2023-09-07 06:21:29 UTC
MDEV-31994:

Author: Georg Richter
Author Date: 2023-09-07 06:21:29 UTC

MDEV-31994:

Added additional verification option for secure connections by checking the
client certificate fingerprint. The fingerprint option implies REQUIRE X509
and REQUIRE SSL.

The fingerprint has to be passed as SHA224, SHA256, SHA384 or SHA512
hexadecimal hash.

Example:
CREATE USER tlsuser@localhost REQUIRE
FINGERPRINT X'82E26FC8E2B1ACE188EE27DD1FCB98A78B1F1390B10F3788497561D1';

bb-11.3-mini-MDEV-31431 2023-09-05 23:08:51 UTC
MDEV-31431 support sql standard <explicit table> expressions

Author: Rex Johnston
Author Date: 2023-09-05 22:55:23 UTC

MDEV-31431 support sql standard <explicit table> expressions

Support SQL 2016 syntax <explicit table> ::= TABLE <table or query name>
Simplified version banning "analyze table _tablename_"
from being interpreted as "analyze (table _tablename_)"

bb-11.2-mdev-22534-item-ref-propagate-review-fixes 2023-09-05 11:32:51 UTC
SergeiP Fixup for:

Author: Sergey Petrunia
Author Date: 2023-09-05 11:32:51 UTC

SergeiP Fixup for:

commit 3eeab3c4508d26fa850d68434bbc00853ac8c380
Author: Yuchen Pei <ycp@mariadb.com>
Date: Tue Aug 22 12:28:55 2023 +1000

(more details pending)

bb-10.6-MDEV-32096-pkgtest 2023-09-05 10:03:36 UTC
MDEV-32096 Parallel replication lags because innobase_kill_query() may fail t...

Author: Marko Mäkelä
Author Date: 2023-09-05 10:03:36 UTC

MDEV-32096 Parallel replication lags because innobase_kill_query() may fail to interrupt a lock wait

lock_sys_t::cancel(trx_t*): Remove, and merge to its only caller
innobase_kill_query().

innobase_kill_query(): Before reading trx->lock.wait_lock,
do acquire lock_sys.wait_mutex, like we did before
commit e71e6133535da8d5eab86e504f0b116a03680780 (MDEV-24671).
In this way, we should not miss a recently started lock wait
by the killee transaction.

lock_wait(): Invoke trx_is_interrupted() before entering the wait,
in case innobase_kill_query() was invoked some time earlier and
some longer-running operation did not check for interrupts.
Avoid some redundant loads of trx->lock.wait_lock; cache the value
in the local variable wait_lock.

trx_t::error_state: Correctly document the data member.

trx_lock_t::was_chosen_as_deadlock_victim: Clarify that other threads
may set the field (or flags in it) while holding lock_sys.wait_mutex.

Thanks to Johannes Baumgarten for reporting the problem and testing
the fix, as well as to Kristian Nielsen for suggesting the fix.

bb-10.6-MDEV-32080 2023-09-04 21:03:12 UTC
MDEV-32080 Blank table alias weirdness

Author: Rex Johnston
Author Date: 2023-09-04 19:28:00 UTC

MDEV-32080 Blank table alias weirdness

Simple check to make sure table aliases have length != 0

bb-10.6-MDEV-32067 2023-09-01 08:44:35 UTC
WIP MDEV-32067 InnoDB linear read ahead had better be logical

Author: Marko Mäkelä
Author Date: 2023-09-01 08:44:35 UTC

WIP MDEV-32067 InnoDB linear read ahead had better be logical

The linear read-ahead (enabled by nonzero innodb_read_ahead_threshold)
only works if index leaf pages or undo log pages have been allocated
on adjacent page numbers. That is not always the case. We will introduce
a logical read-ahead for accessing leaf-level B-tree pages. It is
enabled by default by setting innodb_read_ahead_threshold>0.

buf_page_get_low(): Do not invoke buf_page_t::set_accessed(),
buf_page_make_young_if_needed(), or buf_read_ahead_linear().
We will invoke them in those callers of buf_page_get_gen() or
buf_page_get() where it makes sense: the access is not
one-time-on-startup and the page and not going to be freed soon.

btr_copy_blob_prefix(), btr_pcur_move_to_next_page(),
trx_undo_get_prev_rec_from_prev_page(),
trx_undo_get_first_rec(): Invoke buf_read_ahead_linear().

We will not invoke linear read-ahead in functions that would
essentially allocate or free pages, because allocated pages
should be reinitialized by buf_page_create(), eliminating the
need to read anything from the file system. Likewise, freeing
pages should not involve accessing any sibling pages, except
for freeing singly-linked lists of BLOB pages.

buf_read_ahead_logical(): A new function, currently invoked in
btr_cur_t::search_leaf() and when opening the leftmost leaf page
in btr_cur_t::open_leaf().

We will not invoke buf_read_ahead_logical() in
btr_cur_t::pessimistic_search_leaf() or in a pessimistic operation
of btr_cur_t::open_leaf(), because it is assumed that pessimistic
operations should be preceded by optimistic operations, which should
already have invoked read-ahead.

TODO: In btr_cur_t::search_leaf(), instead of reading ahead up all
leaf pages from the key onwards (up to children[16] pages), try to
limit the read-ahead to the range of interest, by referring to the
end_key that is passed to handler::read_range_first().

bb-10.4-midenok-MDEV-31042 2023-08-30 14:01:52 UTC
Review

Author: midenok
Author Date: 2023-08-30 13:52:52 UTC

Review

Needless MDEV-31042_3 as it tests only --list-files
FIXME: converge MDEV-31042_1 and MDEV-31042_2

bb-11.2-mdev-28856-static-fallback 2023-08-30 00:26:04 UTC
MDEV-28856 [demo] static table options vs dynamic spider attributes

Author: Yuchen Pei
Author Date: 2023-08-30 00:26:04 UTC

MDEV-28856 [demo] static table options vs dynamic spider attributes

bb-11.3-vicentiu 2023-08-29 09:46:55 UTC
MDEV-31303 Key not used when IN clause has both signed and usigned values

Author: Alexander Barkov
Author Date: 2023-08-29 07:51:01 UTC

MDEV-31303 Key not used when IN clause has both signed and usigned values

Summary:

This patch enables possible index optimization when
the WHERE clause has an IN condition of the form:

signed_or_unsigned_column IN (signed_or_unsigned_constant,
                              signed_or_unsigned_constant
                              [,signed_or_unsigned_constant]*)

when the IN list constants are of different signess, e.g.:
  WHERE signed_column IN (signed_constant, unsigned_constant ...)
  WHERE unsigned_column IN (signed_constant, unsigned_constant ...)

Details:

In a condition like:
   WHERE unsigned_predicant IN (1, LONGLONG_MAX + 1)

comparison handlers for individual (predicant,value) pairs are
calculated as follows:

* unsigned_predicant and 1 produce &type_handler_newdecimal
* unsigned_predicant and (LONGLONG_MAX + 1) produce &type_handler_slonglong

The old code decided that it could not use bisection because
the two pairs had different comparison handlers.
As a result, bisection was not allowed, and, in case of
an indexed integer column predicant the index on the column was not used.

The new code catches special cases like:
    signed_predicant IN (signed_constant, unsigned_constant)
    unsigned_predicant IN (signed_constant, unsigned_constant)

It enables bisection using in_longlong, which supports a mixture
of predicant and values of different signess.
In case when the predicant is an indexed column this change
automatically enables index range optimization.

Thanks to Vicențiu Ciorbaru for proposing the idea and for preparing MTR tests.

bb-10.5-MDEV-31177 2023-08-28 18:16:09 UTC
MDEV-31177: Review Round 2

Author: Brandon Nesterenko
Author Date: 2023-08-28 18:15:56 UTC

MDEV-31177: Review Round 2

Test change:
- Switched save variables from MTR to user

bb-11.2-ycp-mdev-28856-sysvar-option-same 2023-08-28 05:34:06 UTC
MDEV-28856 [demo] We cannot determine if any options have been specified

Author: Yuchen Pei
Author Date: 2023-08-28 05:34:06 UTC

MDEV-28856 [demo] We cannot determine if any options have been specified

...because of how options associated with sysvars work. They are added
to option_list when the sysvar value is non-default.

This makes it impossible to determine whether the an option comes from
a SET statement (session level), or specified for the table (table
level). Given we are delaying deprecating the comment parsing to after
MDEV-28856, the only solution is to let comment parsing override
option values.

Consider this case:

set session spider_read_only_mode = 1;
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv",TABLE "t2"';

The correct thing to do is to use the table level value 0 specified in
the comment. However, during the create table query, there no way to
tell whether option_struct->read_only (== 1) is set with a

`SET SESSION spider_read_only_mode = 1`

or as a create table option

SPIDER_READ_ONLY=1

And the only way to guarantee this works is to let comment parsing
override table options.

bb-10.9-MDEV-32008 2023-08-25 08:36:57 UTC
MDEV-32008 auto_increment value on table increments by one after restart

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2023-08-25 07:42:49 UTC

MDEV-32008 auto_increment value on table increments by one after restart

- Update the current auto increment value rather than
next auto increment value.

bb-11.2-MDEV-31431 2023-08-24 03:40:02 UTC
MDEV-31431 support sql standard <explicit table> expressions

Author: Rex Johnston
Author Date: 2023-08-24 03:29:15 UTC

MDEV-31431 support sql standard <explicit table> expressions

Initial support for sql standard <explicit table> expressions
The <explicit table>
    TABLE <table or query name>
    is equivalent to the <query specification>
    SELECT * FROM <table or query name>
Deal with the conflict caused by ANALYZE TABLE t1; being both
a request for table statistics and analyzing an SQL statement.

bb-10.6-MDEV-31496 2023-08-23 14:11:54 UTC
MDEV-31496: Make optimizer handle UCASE(varchar_col)=...

Author: Sergey Petrunia
Author Date: 2023-06-19 14:53:16 UTC

MDEV-31496: Make optimizer handle UCASE(varchar_col)=...

(Review input addressed)
(added handling of UPDATE/DELETE and partitioning w/o index)
If the properties of the used collation allow, do the following
equivalent rewrites:

1. UPPER(key_col)=expr -> key_col=expr
   expr=UPPER(key_col) -> expr=key_col
   (also rewrite both sides of the equality at the same time)

2. UPPER(key_col) IN (constant-list) -> key_col IN (constant-list)

- Mark utf8mb{3,4}_general_ci as collations that allow this.
- Add optimizer_switch='sargable_casefold=ON' to control this.
  (OFF by default in this patch)
- Cover the rewrite in Optimizer Trace, rewrite name is
  "sargable_casefold_removal".

bb-11.1-mdev-27201 2023-08-23 10:16:59 UTC
MDEV-27201 Refactoring and cleanup

Author: Oleg Smirnov
Author Date: 2023-08-23 05:40:32 UTC

MDEV-27201 Refactoring and cleanup

Extract function mark_column_if_needed() from find_field_in_table_ref().
Fix Windows build errors

bb-10.6-spetrunia-tmp1 2023-08-23 09:40:17 UTC
MDEV-31975: UCASE(varchar_col)=... not handled for partition tables

Author: Sergey Petrunia
Author Date: 2023-08-23 09:40:17 UTC

MDEV-31975: UCASE(varchar_col)=... not handled for partition tables

Enable sargable casefolding rewrite when the column is a part of
partitioning expression.

bb-11.2-mdev-28856 2023-08-23 02:43:55 UTC
MDEV-28856 [demo] static_key_cardinality is always -1

Author: Yuchen Pei
Author Date: 2023-08-23 02:43:34 UTC

MDEV-28856 [demo] static_key_cardinality is always -1

All tests pass still

bb-11.2-mdev-31117 2023-08-23 02:04:42 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-11.1-mdev-31117 2023-08-23 02:02:04 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-11.0-mdev-31117 2023-08-23 01:59:03 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-10.11-mdev-31117 2023-08-23 01:50:28 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-10.10-mdev-31117 2023-08-23 01:48:49 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-10.10-mdev-31117-merge 2023-08-23 01:48:14 UTC
[after merge change] MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-08-23 01:48:14 UTC

[after merge change] MDEV-31117 Fix spider connection info parsing

bb-10.6-mdev-31117 2023-08-23 01:37:05 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-10.5-mdev-31117-merge 2023-08-23 01:34:51 UTC
[after merge changes] MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-08-23 01:34:51 UTC

[after merge changes] MDEV-31117 Fix spider connection info parsing

bb-10.5-mdev-31117 2023-08-23 01:28:49 UTC
MDEV-31117 Fix spider connection info parsing

Author: Yuchen Pei
Author Date: 2023-07-05 07:55:30 UTC

MDEV-31117 Fix spider connection info parsing

Spider connection string is a comma-separated parameter definitions,
where each definition is of the form "<param_title> <param_value>",
where <param_value> is quote delimited on both ends, with backslashes
acting as an escaping prefix.

Despite the simple syntax, the existing spider connection string
parser was poorly-written, complex, hard to reason and error-prone,
causing issues like the one described in MDEV-31117. For example it
treated param title the same way as param value when assigning, and
have nonsensical fields like delim_title_len and delim_title.

Thus as part of the bugfix, we clean up the spider comment connection
string parsing, including:

- Factoring out some code from the parsing function
- Simplify the struct `st_spider_param_string_parse`
- And any necessary changes caused by the above changes

bb-11.1-mdev-31902 2023-08-22 05:55:35 UTC
MDEV-31902 [demo] minimal change to trigger spider in ci

Author: Yuchen Pei
Author Date: 2023-08-22 05:55:35 UTC

MDEV-31902 [demo] minimal change to trigger spider in ci

bb-11.2-mdev-22534-item-ref-propagate-unsquashed 2023-08-22 03:07:57 UTC
MDEV-22534 [demo] Assert const in Item*ref::propagate_equal_fields()

Author: Yuchen Pei
Author Date: 2023-08-22 03:00:37 UTC

MDEV-22534 [demo] Assert const in Item*ref::propagate_equal_fields()

All tests prefixed with main.subselect pass:

mtr --suite main --do-test=subselect

pending CI for regressions.

bb-10.9-anel-repl-slave_report-v2 2023-08-21 10:16:35 UTC
MDEV-21322: show replica hosts update result with GTID states

Author: Anel Husakovic
Author Date: 2023-01-19 13:51:17 UTC

MDEV-21322: show replica hosts update result with GTID states

+ We are trying to extend the command `SHOW REPLICA HOSTS` that is
executed on master, with columns `GTID_state_sent` and `GTID_state_ack`.
In order to achieve that we have to extend `thd->slave_info` struct with
2 new entries. This struct needs to be populated and must be accessable to primary.

+ The first column `GTID_state_sent`:
  - It is populated by the last event that primary has sent to replica
    (only for semi-sync slave connection, but without need to know
    that replica actually obtained request,
    like it is case in asynchronous replication).
  - Primary executes `mysql_binlog` that first starts the `binlog_dump` thread.
    That thread starts `ack_receiver` thread, that returns second column
    of interest (in first iteration we don't care about).
    After `binlog_dump` thread creating, file is sent with
    `send_one_binlog_file()` function.
    This function is sending event with `send_events()` function,
    during which `send_event_to_slave()` function is executed.
    On that place we are creating the `thd->slave_info->gtid_state_sent` struct.

+ The second column `GTID_state_ack`:
  - It is populated by the `reply_packet_binlog` (a.k.a. `ack`) that is called,
    only for semi-sync replication. It is called on 2 places:
    a) during `binlog_dump` creation, after thread is added to
    `ack_reciver` and after thread is added as semi-sync slave. This
    should be first ack received from replica to primary.
    b) constantly in running phase of `ack_receiver` thread `run()`.
  - A the end of function `reply_packet_binlog` we are creating the
  struct `GTID_state_ack`

+ The third column `Sync_Status`
  - It should be filled with values `asynchronous`,`semi-sync active`,
    `semi-sync stale` in order to express the state of replica.
  - `semi-sync [active/stale]` related states depend on the value of `need_sync`
     that is updated on master and will be `semi-sync active` iff:
    - primary and replicas are configured to be in semi-sync mode and
    - if the event is a transaction's ending event.
    Otherwise state is `semi-sync stale`.
  - state is `asynchronous` if semi-sync is disabled on master as fast
  check and if there thd is not semi-sync thread.

+ Handling of `rpl_semi_sync_master_timeout= 0` means that primary status
  `rpl_semi_sync_master_status` will remain ON instead of switching off to async
  and incrementing the counter updates.

+ PR closes #2374, #1427

Reviewer:<brandon.nesterenko@mariadb.com>
Thanks <knielsen@knielsen-hq.org> for reviewing the failure and
suppresions.

bb-10.4-mdev-30073 2023-08-19 06:12:41 UTC
MDEV-30073 Wrong result on 2nd execution of PS for query with NOT EXISTS

Author: Igor Babaev
Author Date: 2023-08-19 06:12:41 UTC

MDEV-30073 Wrong result on 2nd execution of PS for query with NOT EXISTS

This is a preliminary patch to check possible failures in buildbot.

bb-10.5-MDEV-31892 2023-08-18 07:05:58 UTC
MDEV-31892 Server crash upon moving InnoDB table with

Author: THIRUNARAYANAN BALATHANDAYUTHAPANI
Author Date: 2023-08-18 07:05:25 UTC

MDEV-31892 Server crash upon moving InnoDB table with
   fulltext index between databases

- InnoDB tries to open the auxilary table which
starts with the name of old databases. So it leads
to abort of server.

row_merge_create_fts_sort_index(): Pass new table
for the temporary fts sort index to be created

fts_rename_aux_tables(): Iterate all the indexes
to rename the auxiliary index tables.

bb-11.0-mdev-31586 2023-08-18 06:34:49 UTC
MDEV-31586 Make the MDEV-31463 test more fitting and stable

Author: Yuchen Pei
Author Date: 2023-07-31 04:49:01 UTC

MDEV-31586 Make the MDEV-31463 test more fitting and stable

The original test in the report of MDEV-31463 is contrived and
nondeterministic, causing MDEV-31586. We update the test to make it
more directly addresses the underlying cause of MDEV-31463, namely
errors from queries sent to the data node not consumed when trying to
set lock wait timeout. This is achieved through the debug sync
facility.

bb-11.2-mdev-31586 2023-08-18 06:29:04 UTC
MDEV-31586 Make the MDEV-31463 test more fitting and stable

Author: Yuchen Pei
Author Date: 2023-07-31 04:49:01 UTC

MDEV-31586 Make the MDEV-31463 test more fitting and stable

The original test in the report of MDEV-31463 is contrived and
nondeterministic, causing MDEV-31586. We update the test to make it
more directly addresses the underlying cause of MDEV-31463, namely
errors from queries sent to the data node not consumed when trying to
set lock wait timeout. This is achieved through the debug sync
facility.

bb-11.1-mdev-31586 2023-08-18 06:23:14 UTC
MDEV-31586 Make the MDEV-31463 test more fitting and stable

Author: Yuchen Pei
Author Date: 2023-07-31 04:49:01 UTC

MDEV-31586 Make the MDEV-31463 test more fitting and stable

The original test in the report of MDEV-31463 is contrived and
nondeterministic, causing MDEV-31586. We update the test to make it
more directly addresses the underlying cause of MDEV-31463, namely
errors from queries sent to the data node not consumed when trying to
set lock wait timeout. This is achieved through the debug sync
facility.

bb-10.11-spetrunia-merge 2023-08-17 10:44:05 UTC
Merge 10.10 into 10.11

Author: Sergey Petrunia
Author Date: 2023-08-17 08:58:17 UTC

Merge 10.10 into 10.11

bb-11.3-MDEV-31496-sargable-casefold 2023-08-16 11:05:42 UTC
MDEV-31496: Make optimizer handle UCASE(varchar_col)=...

Author: Sergey Petrunia
Author Date: 2023-06-19 14:53:16 UTC

MDEV-31496: Make optimizer handle UCASE(varchar_col)=...

(Review input addressed)
If the properties of the used collation allow, do the following
equivalent rewrites:

1. UPPER(key_col)=expr -> key_col=expr
   expr=UPPER(key_col) -> expr=key_col
   (also rewrite both sides of the equality at the same time)

2. UPPER(key_col) IN (constant-list) -> key_col IN (constant-list)

- Mark utf8mb{3,4}_general_ci as collations that allow this.
- Add optimizer_switch='sargable_casefold=ON' to control this.
  (ON by default in this patch)
- Cover the rewrite in Optimizer Trace, rewrite name is
  "sargable_casefold_removal".

bb-10.4-MDEV-31004 2023-08-14 14:26:04 UTC
MDEV-31004: Create cte-protocol

Author: Lena Startseva
Author Date: 2023-08-14 14:26:04 UTC

MDEV-31004: Create cte-protocol

Added new protocol for MTR tests: cte-protocol. This protocol
converts all queries started with "SELECT" into non-recursive
common table expression (CTE). Also added possibility to enable/
disable cte-protocol ("--disable_cte_protocol/--enable_cte_protocol")

bb-10.9-MDEV-31432-v2 2023-08-14 11:03:05 UTC
MDEV-31432 tmp_table field accessed after free

Author: Sergey Petrunia
Author Date: 2023-08-14 08:09:51 UTC

MDEV-31432 tmp_table field accessed after free

Before this patch, the code in Item_field::print() used
this convention (described in sql_explain.h:ExplainDataStructureLifetime):

- By default, the table that Item_field refers to is accessible.
- ANALYZE and SHOW {EXPLAIN|ANALYZE} may print Items after some
  temporary tables have been dropped. They use
  QT_DONT_ACCESS_TMP_TABLES flag. When it is ON, Item_field::print
  will not access the table it refers to, if it is a temp.table

The bug was that EXPLAIN statement also may compute subqueries (depending
on subquery context and @@expensive_subquery_limit setting). After the
computation, the subquery calls JOIN::cleanup(true) which drops some of
its temporary tables. Calling Item_field::print() that refer to such table
will cause an access to free'd memory.

In this patch, we take into account that query optimization can compute
a subquery and discard its temporary tables. Item_field::print() now
assumes that any temporary table might have already been dropped.
This means QT_DONT_ACCESS_TMP_TABLES flag is not needed - we imply it is
always present.

But we also make one exception: derived tables are not freed in
JOIN::cleanup() call. They are freed later in close_thread_tables(),
at the same time when regular tables are closed.
Because of that, Item_field::print may assume that temp.tables
representing derived tables are available.

Initial patch by: Rex Jonston
Reviewed by: Monty <monty@mariadb.org>

bb-10.6-MDEV-30100-MDEV-25340 2023-08-11 14:01:57 UTC
MDEV-25340 Server startup with large innodb_buffer_pool_size takes a long time

Author: Marko Mäkelä
Author Date: 2023-08-11 14:01:57 UTC

MDEV-25340 Server startup with large innodb_buffer_pool_size takes a long time

buf_pool_t::create(), buf_pool_t::chunk_t::create(): Only initialize
the first page descriptor of each chunk.

buf_pool_t::lazy_allocate(): Lazily initialize a previously allocated
page descriptor and advance buf_pool_t::chunk_t::blocks_end until
the allocated capacity has been reached (blocks_end == blocks + size).

buf_pool_t::lazy_allocate_size(): Return the number of allocation requests
that buf_pool_t::lazy_allocate() can serve.

buf_pool_t::fully_initialized: Set if lazy_allocate_size() == 0.

Most references to chunk->size have been replaced with
chunk->blocks_end - chunk->blocks.

bb-10.9-MDEV-31432 2023-08-11 07:28:34 UTC
MDEV-31432: fix testcase.

Author: Sergey Petrunia
Author Date: 2023-08-11 07:28:34 UTC

MDEV-31432: fix testcase.

10.9 2023-08-10 19:19:03 UTC
Merge branch '10.6' into 10.9

Author: Oleksandr "Sanja" Byelkin
Author Date: 2023-08-10 19:19:03 UTC

Merge branch '10.6' into 10.9

bb-10.9-release 2023-08-10 19:19:03 UTC
Merge branch '10.6' into 10.9

Author: Oleksandr "Sanja" Byelkin
Author Date: 2023-08-10 19:19:03 UTC

Merge branch '10.6' into 10.9

bb-11.2-MDEV-31799 2023-08-10 10:23:11 UTC
MDEV-31799 Unexpected ER_TRG_NO_SUCH_ROW_IN_TRG and server crash after ALTER ...

Author: Dmitry Shulga
Author Date: 2023-08-10 10:23:11 UTC

MDEV-31799 Unexpected ER_TRG_NO_SUCH_ROW_IN_TRG and server crash after ALTER TABLE

This bug report was caused by implementation of the task MDEV-5816
(Stored programs: validation of stored program statements).
Changing metadata of a table that has a trigger on AFTER UPDATE or AFTER DELETE
resulted in unexpected output of the error ER_TRG_NO_SUCH_ROW_IN_TR.
It was caused by the fact that characteristics of the trigger dependent on
changed table's metadata wasn't set in a new lex object created on re-parsing
of a failing trigger statement.

To fix the bug the data member lex->trg_chistics.action_time and
lex->trg_chistics.event must be set into real values of the trigger
whose statement being re-parsed.

bb-10.4-linuxjedi-MDEV-19210 2023-08-10 06:44:41 UTC
MDEV-19210: do not run pre and post scripts as root

Author: Christian Hesse
Author Date: 2023-08-09 00:18:36 UTC

MDEV-19210: do not run pre and post scripts as root

Now that we do not pollute systemd's environment but write private
environment files running these as root is not longer required. So
let's drop `PermissionsStartOnly=true`.

Debian adds extra `ExecStartPre=` and `ExecStartPost=`, though.
Use special executable prefix for full privileges there. (See
systemd.service(5) for details.)

bb-11.1-monty 2023-08-09 15:25:31 UTC
Don't give a warning about Event_scheduler for --bootstrap

Author: Monty
Author Date: 2023-08-09 15:25:31 UTC

Don't give a warning about Event_scheduler for --bootstrap

The reason is that --bootstrap is used to initialize the server and
a lot of processes are not started in this case. Event scheduler is
not an exception.

This fix also removes an unexpected warning about event scheduler when
running mariadb_install_db.

bb-11.0-release-mdev30143 2023-08-09 14:30:27 UTC
MDEV-30143 Fix unstable test

Author: Oleg Smirnov
Author Date: 2023-08-09 14:30:27 UTC

MDEV-30143 Fix unstable test

bb-10.6-MDEV-31877 2023-08-09 12:47:06 UTC
MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log...

Author: Sergey Petrunia
Author Date: 2023-08-09 12:47:06 UTC

MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log verbosity

Remove redundant delete_explain_query() calls in

sp_instr_set::exec_core(), sp_instr_set_row_field::exec_core(),
sp_instr_set_row_field_by_name::exec_core().

These calls are made before the SP instruction's tables are
"closed" by close_thread_tables() call.

When we call close_thread_tables() after that, we no longer
can collect engine's counter variables, as they use the data
structures that are located in the Explain Data Structures.

Also, these delete_explain_query() calls are redundant, as
sp_lex_keeper::reset_lex_and_exec_core() has another
delete_explain_query() call, which is located in the right
location after the close_thread_tables() call.

bb-10.4-MDEV-31005 2023-08-09 11:17:35 UTC
MDEV-31005: Make working cursor-protocol

Author: Lena Startseva
Author Date: 2023-07-19 05:34:38 UTC

MDEV-31005: Make working cursor-protocol

Updated tests: cases with bugs or which cannot be run
with the cursor-protocol were excluded with
"--disable_cursor_protocol"/"--enable_cursor_protocol"

bb-11.0-monty 2023-08-09 07:28:00 UTC
MDEV-31501 Assertion `cond_selectivity <= 1.000000001' failed (actual value 1...

Author: Monty
Author Date: 2023-08-08 18:02:23 UTC

MDEV-31501 Assertion `cond_selectivity <= 1.000000001' failed (actual value 1.125)

The problem was that because there was no good indexes for the lineitem
table make_join_select() tried to do a last attempt to find a usable key
and called test_quick_select().
test_quick_select() found an index with fewer matching rows then every
before and that caused a problem in get_range_limit_read_cost(),
which assumes that 'best_rows' is the minium rows matched when all
conditions has been taken into account and thus smaller than rows found
in the range.
Fixed by adjusting best_rows to the least rows in any index after
test_quick_select() has been called.

bb-10.10-MDEV-31173-galera 2023-08-08 02:30:15 UTC
MDEV-31173 : Server crashes when setting wsrep_cluster_address after adding i...

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2023-06-14 05:55:58 UTC

MDEV-31173 : Server crashes when setting wsrep_cluster_address after adding invalid value to wsrep_allowlist table

Problem was that wsrep_schema tables were not marked as
category information. Fix allows access to wsrep_schema
tables even when node is detached.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

bb-10.10-mdev-31524 2023-08-08 02:18:30 UTC
MDEV-31524 Fixing spider table param / variable overriding

Author: Yuchen Pei
Author Date: 2023-07-07 01:07:05 UTC

MDEV-31524 Fixing spider table param / variable overriding

The existing (incorrect) overriding mechanism is:

Non-minus-one var value overrides table param overrides default value.

Before MDEV-27169, unspecified var value is -1. So if the user sets
both the var to be a value other than -1 and the table param, the var
value will prevail, which is incorrect.

After MDEV-27169, unspecified var value is default value. So if the
user does not set the var but sets the table param, the default value
will prevail, which is even more incorrect.

This patch fixes it so that table param, if specified, always
overrides var value, and the latter if not specified or set to -1,
falls back to the default value

We achieve this by replacing all such overriding in spd_param.cc with
macros that override in the correct way, and removing all the
"overriding -1" lines involving table params in
spider_set_connect_info_default() except for those table params not
defined as sysvar/thdvar in spd_params.cc

We also introduced macros for non-overriding sysvar and thdvar, so
that the code is cleaner and less error-prone

In server versions where MDEV-27169 has not been applied, we also
backport the patch, that is, replacing -1 default values with real
default values

In server versions where MDEV-28006 has not been applied, we do the
same for udf params

bb-10.4-MDEV-31173-galera 2023-08-08 02:03:33 UTC
MDEV-31173 : Server crashes when setting wsrep_cluster_address after adding i...

Author: =?utf-8?q?Jan_Lindstr=C3=B6m?=
Author Date: 2023-06-15 11:51:56 UTC

MDEV-31173 : Server crashes when setting wsrep_cluster_address after adding invalid value to wsrep_allowlist table

Problem was that wsrep_schema tables were not marked as
category information. Fix allows access to wsrep_schema
tables even when node is detached.

This is 10.4-10.9 version of fix.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>

10.4-MDEV-31005 2023-08-07 17:04:50 UTC
MDEV-31005: Make working cursor-protocol

Author: Lena Startseva
Author Date: 2023-07-19 05:34:38 UTC

MDEV-31005: Make working cursor-protocol

Updated tests: cases with bugs or which cannot be run
with the cursor-protocol were excluded with
"--disable_cursor_protocol"/"--enable_cursor_protocol"

bb-11.2-getcpu-counter 2023-08-05 00:33:31 UTC
optimize ib_counter_t with getcpu

Author: Nikita Malyavin
Author Date: 2023-08-04 23:42:48 UTC

optimize ib_counter_t with getcpu

getcpu is not an ultimate solution, since by the ultimate default it is a
syscall.

However there is a set of platforms where it is implemented via vdso:
https://github.com/search?q=repo%3Alattera%2Fglibc%20__vdso_getcpu&type=code

After linux added rseq, redhat developers have implemented its support in
glibc, specifically to speed up getcpu:
https://bugzilla.redhat.com/show_bug.cgi?id=2024347
rseq is supported as of v2.35 https://lwn.net/Articles/883104/

bb-10.9-MDEV-30100 2023-08-04 14:12:33 UTC
Merge

Author: Marko Mäkelä
Author Date: 2023-08-04 14:12:33 UTC

Merge

bb-11.2-MDEV-30100 2023-08-04 14:08:57 UTC
MDEV-30100 (11.2 version)

Author: Marko Mäkelä
Author Date: 2023-08-04 14:08:57 UTC

MDEV-30100 (11.2 version)

bb-10.6-mdev-31524-post-merge-fix 2023-08-04 08:52:19 UTC
MDEV-31524 Post-merge fixup

Author: Yuchen Pei
Author Date: 2023-08-04 08:38:51 UTC

MDEV-31524 Post-merge fixup

bb-10.4-georg 2023-08-04 08:49:23 UTC
MDEV-31653:

Author: Georg Richter
Author Date: 2023-08-04 08:49:23 UTC

MDEV-31653:

Added support for CHACHA20-POLY1305 cipher suite (TLS v1.3)

bb-10.10-release-spider-fix 2023-08-04 08:28:31 UTC
Spider: fix 10.9->10.10 merge

Author: Yuchen Pei
Author Date: 2023-08-04 08:28:31 UTC

Spider: fix 10.9->10.10 merge

bb-10.5-mdev-31743 2023-08-03 09:25:48 UTC
MDEV-31743 Server crash in store_length, assertion failure in Type_handler_st...

Author: Oleg Smirnov
Author Date: 2023-07-26 12:09:32 UTC

MDEV-31743 Server crash in store_length, assertion failure in Type_handler_string_result::sort_length

After MDEV-21580 the truncation of SORT_FIELD::length
  set_if_smaller(sortorder->length, thd->variables.max_sort_length)

became conditional:
  if (is_variable_sized())
    set_if_smaller(length, thd->variables.max_sort_length)

To provide correct functioning of is_variable_sized() SORT_FIELD::type
must be set properly. This commit adds the necessary initialization
of SORT_FIELD::type to JOIN_TAB::remove_duplicates() as it is done
in filesort's sortlength() function.

DBUG_ASSERT is added to sortlength() just in case to prevent
a possible uint32 overflow

bb-10.9-mdbf-535-test 2023-08-02 02:23:51 UTC
MDBF-535 [exp] break spider/bugfix.mdev_29562, see whether it shows up

Author: Yuchen Pei
Author Date: 2023-08-02 02:23:51 UTC

MDBF-535 [exp] break spider/bugfix.mdev_29562, see whether it shows up

bb-10.5-MDEV-29693-v2 2023-08-01 12:15:54 UTC
MDEV-29693 ANALYZE TABLE still flushes table definition cache when engine-ind...

Author: Oleg Smirnov
Author Date: 2022-10-15 10:54:40 UTC

MDEV-29693 ANALYZE TABLE still flushes table definition cache when engine-independent statistics is used

This commits enables reloading of engine-independent statistics
without flushing the table from table definition cache. This is
achieved by using shared ownership of the statistics between TABLE
and TABLE_SHARE structures. The updated statistics replace the ones
stored in TABLE_SHARE but TABLE objects continue using the old ones
to guarantee consistency for the optimizer. Once there are no
objects referencing the old statistics they are deallocated

bb-11.0-ycp-mdev-26151-exp 2023-08-01 07:53:41 UTC
MDEV-26151 Try spider/bg.direct_aggregate_part with nonzero casual read

Author: Yuchen Pei
Author Date: 2023-08-01 07:53:41 UTC

MDEV-26151 Try spider/bg.direct_aggregate_part with nonzero casual read

Here we set the value to be 23. Changing it to 1 does not make any
difference.

bb-11.2-mdev-22534-unsquashed 2023-08-01 06:02:58 UTC
MDEV-22534 Avoid self-referencing Item_ref in Item_ref::transform()

Author: Yuchen Pei
Author Date: 2023-08-01 05:43:16 UTC

MDEV-22534 Avoid self-referencing Item_ref in Item_ref::transform()

After transforming the referenced item to a potentially new item,
check whether the new item can reach ref by dereferencing, and if so,
do not change the item tree as that would cause self-referencing.

bb-10.4-midenok-tmp 2023-07-31 13:57:18 UTC
Revert "MDEV-30528 Assertion in dtype_get_at_most_n_mbchars"

Author: midenok
Author Date: 2023-07-31 11:42:02 UTC

Revert "MDEV-30528 Assertion in dtype_get_at_most_n_mbchars"

This reverts commit add0c01bae4cd2ed435755feb1240a5dbc1c85c1

Duplicates must be avoided in FTS_DOC_ID_INDEX

bb-11.0-ycp-mdev-26151-hypothesis 2023-07-31 07:03:00 UTC
MDEV-26151 [debug] Query-conn pairs are encountered only once

Author: Yuchen Pei
Author Date: 2023-07-31 07:03:00 UTC

MDEV-26151 [debug] Query-conn pairs are encountered only once

...in spider_check_and_get_casual_read_conn().

bb-11.0-ycp-mdev-31586 2023-07-31 05:00:07 UTC
MDEV-31586 Make the MDEV-31463 test more fitting and stable

Author: Yuchen Pei
Author Date: 2023-07-31 04:49:01 UTC

MDEV-31586 Make the MDEV-31463 test more fitting and stable

The original test in the report of MDEV-31463 is contrived and
nondeterministic, causing MDEV-31586. We update the test to make it
more directly addresses the underlying cause of MDEV-31463, namely
errors from queries sent to the data node not consumed when trying to
set lock wait timeout. This is achieved through the debug sync
facility.

bb-10.4-MDEV-29917-galera 2023-07-28 08:59:23 UTC
MDEV-29917: Galera test suite cleanup

Author: Julius Goryavsky
Author Date: 2023-07-28 08:59:23 UTC

MDEV-29917: Galera test suite cleanup

Tests for galera are made more stable, including by making
changes similar to those that were previously made for ES
edition, in addition, tests that refer to already fixed
problems are removed from the disabled list.

bb-11.0-ycp-mdev-26151 2023-07-28 06:08:09 UTC
MDEV-31787 MDEV-26151 Add a test exercising non-0 spider_casual_read

Author: Yuchen Pei
Author Date: 2023-07-27 04:55:50 UTC

MDEV-31787 MDEV-26151 Add a test exercising non-0 spider_casual_read

Also:
- clean up spider_check_and_get_casual_read_conn() and
  spider_check_and_set_autocommit()
- remove a couple of commented out code blocks

bb-10.5-midenok 2023-07-27 15:12:58 UTC
MDEV-29727 ALTER and CREATE with default partitioning

Author: midenok
Author Date: 2023-07-27 11:21:35 UTC

MDEV-29727 ALTER and CREATE with default partitioning
    differently react to SQL_MODE => unusable SHOW CREATE

Use abort_on_warning dependent on strict mode over create new table
like it is done for copy data and inplace alter.

bb-11.1-igor 2023-07-27 06:11:17 UTC
MDEV-31150 Crash on 2nd execution of update using mergeable derived table

Author: Igor Babaev
Author Date: 2023-07-27 05:59:25 UTC

MDEV-31150 Crash on 2nd execution of update using mergeable derived table

This bug caused crashes of the server on the second execution of update
statements that used mergeable derived tables. The crashes happened in
the function multi_update_check_table_access() when the code tried to
dereference the pointer stored in field TABLE_LIST::TABLE for a mergeable
derived table. The fact is this field is set to NULL after the first
execution of the query. At the same any action performed by the function
is actually not needed for derived tables.

Approved by Oleksandr Byelkin <sanja@mariadb.com>

bb-10.5-release-galera 2023-07-27 05:16:51 UTC
MDEV-29917: Galera test suite cleanup

Author: Julius Goryavsky
Author Date: 2023-07-27 04:57:59 UTC

MDEV-29917: Galera test suite cleanup

Tests for galera are made more stable, including by making
changes similar to those that were previously made for ES
edition, in addition, tests that refer to already fixed
problems are removed from the disabled list.

bb-11.1-ycp-mdev-22534 2023-07-26 04:29:08 UTC
MDEV-22534 Decorrelate IN subquery

Author: Yuchen Pei
Author Date: 2023-05-19 10:06:31 UTC

MDEV-22534 Decorrelate IN subquery

Transform

in (select inner_col' from inner_table where inner_col = outer_col)

to

, outer_col in (select inner_col', inner_col from inner_table)

Achieved by implementing Item_in_subselect::exists2in_processor(),
accompanied with comprehensive test coverage. Factored out common code
between the two transformations.

Caveat:

- Cannot recognise bad item mismatch in equalities that causes
  materialization to not materialize down the road

bb-10.4-check-toku-ci-failure 2023-07-25 05:09:58 UTC
MDEV-31400 [test] a dummy commit to check toku ci failure

Author: Yuchen Pei
Author Date: 2023-07-25 05:09:58 UTC

MDEV-31400 [test] a dummy commit to check toku ci failure

toku tests fail amd64-ubuntu-2004-fulltest at
93eb87f895449a89e51bed03bd324b11c9efb20c

it also fails say tokudb.simple_join_tokudb_innodb at its parent
commit (7d968f8c8aaca01614dfb462d9bbf4e667316265) locally with the
same error message, but for some reason the builder
amd64-ubuntu-2004-fulltest was not run on that commit.

This is a no-op commit that hopefully triggers the builder.

bb-11.2-mdev-31400 2023-07-25 03:50:47 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-11.1-mdev-31400 2023-07-25 03:49:21 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-11.0-mdev-31400 2023-07-25 03:48:02 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.11-mdev-31400 2023-07-25 03:33:48 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.10-mdev-31400 2023-07-25 03:31:07 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.6-mdev-31400 2023-07-25 03:29:28 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-07-25 03:10:52 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.5-mdev-31400 2023-07-25 03:27:56 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-07-25 03:10:52 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.9-mdev-22979-31400 2023-07-25 02:46:55 UTC
MDEV-22979 MDEV-27233 MDEV-28218 Fixing spider init bugs

Author: Yuchen Pei
Author Date: 2023-07-20 02:10:26 UTC

MDEV-22979 MDEV-27233 MDEV-28218 Fixing spider init bugs

Fix spider init bugs (MDEV-22979, MDEV-27233, MDEV-28218) while
preventing regression on old ones (MDEV-30370, MDEV-29904)

Two things are changed:

First, Spider initialisation is made fully synchronous, i.e. it no
longer happens in a background thread. Adapted from the original fix
by nayuta for MDEV-27233. This change itself would cause failure when
spider is initialised early, by plugin-load-add, due to dependency on
Aria and udf function creation, which are fixed in the second and
third parts below. Requires SQL Service, thus porting earlier versions
requires MDEV-27595

Second, if spider is initialised before udf_init(), create udf by
inserting into `mysql.func`, otherwise do it by `CREATE FUNCTION` as
usual. This change may be generalised in MDEV-31401.

Also factor out some clean-up queries from deinit_spider.inc for use
of spider init tests.

A minor caveat is that early spider initialisation will fail if the
server is bootstrapped for the first time, due to missing `mysql`
database which needs to be created by the bootstrap script.

bb-10.9-mdev-31400 2023-07-25 02:40:41 UTC
MDEV-31400 Simple plugin dependency resolution

Author: Yuchen Pei
Author Date: 2023-06-13 09:46:03 UTC

MDEV-31400 Simple plugin dependency resolution

We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.

bb-10.5-mdbf-535-test 2023-07-25 00:26:07 UTC
MDBF-535 Test the buildbot change by breaking a spider test

Author: Yuchen Pei
Author Date: 2023-07-25 00:26:07 UTC

MDBF-535 Test the buildbot change by breaking a spider test

bb-11.2-ps2-MDEV-31003 2023-07-24 14:11:05 UTC
MDEV-31003: Second execution for ps-protocol

Author: Lena Startseva
Author Date: 2023-07-24 14:11:05 UTC

MDEV-31003: Second execution for ps-protocol

Update tests for version 11.2

bb-11.1-ps2-MDEV-31003 2023-07-24 11:44:18 UTC
MDEV-31003: Second execution for ps-protocol

Author: Lena Startseva
Author Date: 2023-07-24 11:44:18 UTC

MDEV-31003: Second execution for ps-protocol

Update tests for version 11.1

bb-11.0-ps2-MDEV-31003 2023-07-24 10:35:41 UTC
MDEV-31003: Second execution for ps-protocol

Author: Lena Startseva
Author Date: 2023-07-24 10:35:41 UTC

MDEV-31003: Second execution for ps-protocol

Update tests for version 11.0

801900 of 2463 results
This repository contains Public information 
Everyone can see this information.

Subscribers