Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
Vladislav Vaintroub
MDEV-42549 Windows: apply autosized thread_pool_max/min_threads

TP_pool_win::init() set the autosized thread_pool_max_threads
(max_connections + 10) only on the variable and called
SetThreadpoolThreadMaximum() just for a user-given value. The pool kept
the Windows default of 500 threads, so with about 500 blocked sessions
a new connection could not log in. The autosized
thread_pool_min_threads had the same problem.

Always pass the final values to the pool.

Assisted-by: Claude:claude-sonnet-5-5
Vladislav Vaintroub
mysql_client_test: fix unused function warning in release builds

proxy_send_handshake_error() is only called from DBUG_OFF-guarded tests, so it is unused when built without debug.

Assisted-by: Claude:claude-sonnet-5-5
Yuchen Pei
MDEV-25848 Call hlindex_read_end in the QUICK_RANGE_SELECT_ARRAY destructor

In QUICK_RANGE_SELECT_ARRAY::get_next, hlindex_read_end() is only
called when the read result is EOF. This is skipped with LIMIT clause
not reading all rows. For an DELETE ... LIMIT ... statement this means
inited is not restored to NONE and delete_handler is not deleted
(leak). We fix this by calling hlindex_read_end in the
QUICK_RANGE_SELECT_ARRAY destructor, just like in JOIN_TAB::cleanup().
Elena Stepanova
MDEV-42521 Replication tests fail with ER_BINLOG_IN_USE when run after another test

12.3 changed RESET MASTER. The binlog-in-engine commit (7081f2a58ec)
added a check in MYSQL_BIN_LOG::reset_logs() in sql/log.cc. RESET MASTER
now fails with ER_BINLOG_IN_USE while any binlog dump thread is still
registered, even an idle one whose slave has already disconnected. Before
12.3, such leftover threads didn't block it, so the test passes there.

That commit also updated the test framework for this:
include/rpl_init.inc and include/rpl_reset.inc now kill dump threads
before RESET MASTER, and there is a new include/reset_master.inc
that kills them and retries. The fix is to use this include.

Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Susil Behera
Vladislav Vaintroub
main.mysql_client_test: show client output on failure

The output goes to var/log/mysql_client_test.out.log, so it is missing
from the test failure report and CI logs. Print the last 200 lines when
mysql_client_test fails.

Assisted-by: Claude:claude-sonnet-5-5
Jan Lindström
MDEV-42396 Setting wsrep_slave_threads while an applier thread exits leaves too few appliers

An applier that applies its next write set after a wsrep_slave_threads
decrease calls Wsrep_applier_service::check_exit_status(), which
accepts the pending reduction and marks the thread to exit, but stays
counted in wsrep_running_applier_threads until it actually finishes
exiting, well after this point. A wsrep_slave_threads increase that
lands in that window reads wsrep_running_applier_threads as if this
thread were going to keep running, and creates one fewer applier than
it should.

check_exit_status() now decrements wsrep_running_applier_threads
itself, in the same LOCK_wsrep_slave_threads critical section it
decides the thread must exit in, instead of waiting for the thread's
own exit path in wsrep_mysqld.cc to do it later. THD::wsrep_applier_is_exiting
tells that later code this thread's share of the count is already
accounted for, so it does not decrement it again.
wsrep_slave_count_change_update() now asserts LOCK_wsrep_slave_threads
is held, since it reads/writes state that a new applier thread
starting and an existing one exiting both write under that same lock.

Added galera.MDEV-42396, which pauses an exiting applier at a new
debug sync point right after it commits to exit (necessarily placed
there rather than in the thread's own generic exit path, where
thd->killed is already set and DEBUG_SYNC will not block an
already-killed thread), increases wsrep_slave_threads while paused,
and checks the right number of appliers end up running.

Assisted-by: Claude:claude-4.6-sonnet
Yuchen Pei
MDEV-25848 Call hlindex_read_end in the QUICK_RANGE_SELECT_ARRAY destructor

In QUICK_RANGE_SELECT_ARRAY::get_next, hlindex_read_end() is only
called when the read result is EOF. This is skipped with LIMIT clause
not reading all rows. For a DELETE ... LIMIT ... statement this means
inited is not restored to NONE and delete_handler is not deleted
(leak). We fix this by calling hlindex_read_end in the
QUICK_RANGE_SELECT_ARRAY destructor, just like in JOIN_TAB::cleanup().

This closes finding #8.
Rucha Deodhar
MDEV-MDEV-42699: DEFAULT(OLD) / DEFAULT(NEW) in trigger accepted at CREATE TRIGGER,
then fails with "Field '(null)' doesn't have a default value"

Analysis:
The parser rejects DEFAULT(<SP variable>) via get_item_splocal(), but
Item_trigger_row returns null there, so DEFAULT(OLD) is accepted. At
execution Item_default_value::tie_field() sees a non-field argument and
reports ER_NO_DEFAULT_FOR_FIELD with the unset item name, i.e. '(null)'.

Fix:
In tie_field(), if the argument is still a trigger row (not a column named
new/old), report ER_WRONG_COLUMN_NAME with OLD/NEW, as for SP variables.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Alexey Yurchenko
MGL-301 Add MTR tests and fix error reporting
Vladislav Vaintroub
Merge 13.2 into main
Rucha Deodhar
MDEV-42711: UBSAN: downcast of Item_trigger_row to Item_row in
Item_func_in::get_func_row_mm_tree on (x,y) IN (NEW, ...) in trigger

Analysis:
Item_func_in::get_func_row_mm_tree() casts every element of the IN list to
Item_row. In a trigger, NEW/OLD are Item_trigger_row, not Item_row, so
(x,y) IN (NEW,(1,2)) caused an invalid downcast (reported by UBSAN).

Fix:
Use the elements as plain Item and call the virtual element_index()/addr(),
which Item_trigger_row overrides, instead of casting to Item_row.
Elena Stepanova
MDEV-42594 rpl.rpl_binlog_directory fails on Windows with wrong result (slashes in the path)

Reviewed-by: Susil Behera
Andrei Elkin
MDEV-37990 Table_map events of a statement are written once per table

Binlogging in ROW format could write the Table_map event of one table
more than once for a statement. THD::binlog_write_table_maps() wrote an
event per TABLE of the lock sets, while a table can be open several
times for a statement, each time as a separate TABLE of one
TABLE_SHARE with the same table_map_id:
- under different aliases, e.g multi-table UPDATE or DELETE and stored
  functions,
- through several triggers or functions,
- when the FK prelocking adds a child table that is in the table list
  already: the table itself of a self-referencing FK, a table a
  trigger writes, and on a slave with --log-slave-updates the table
  of a received Table_map event.

A table map event is valid up to the end of the statement, so the
repeated ones only enlarged the binlog.

THD::binlog_write_table_maps() now writes the table map event only
once per table id. The function's per table loop makes sure
to skip duplicates.

The added rpl.rpl_row_table_map_dedup counts the Table_map events in
the binlogs of the master and of the slave for FK constraints (a
cascading DELETE, a transaction of two statements over an
ON UPDATE CASCADE child, a self-referencing table), a stored function
using a table under two aliases, triggers reaching a table twice, and a
statement over twenty tables, one of them under two aliases.

The results of the four rpl.*mixing_engines tests no longer have the
duplicate Table_map event they recorded.

Note table map events of tables that a statement locks for write but
writes no rows to are still written, e.g. for statements with
`ROLLBACK to sp` inside it or its substatements. They are redundant but
not duplicates, and not addressed here.

co-authored-by: [email protected]
Vladislav Vaintroub
MDEV-42002 PROXY header accepted after the first client packet

The PROXY header is only valid as the very first data sent by the client.
The server accepted it at any point of the connection phase, for example
after the SSL request, or as a reply to an authentication switch request.

Accept it only if the sequence number is 1, that is, nothing was read from
the client yet.

vio_reset() cleared the peer address while switching to TLS. Keep it, so
the real client address is not lost after the TLS handshake. After the
handshake the address is only used in print_aborted_warning().

Assisted-by: Claude:claude-sonnet-5-5
Rex Johnston
MDEV-41585 Wrong result with multi-table UPDATE with ORDER BY

When ORDER BY makes the join of a multi-table UPDATE resolve via a
temporary table, the join first writes all its rows to that table and
then, after sorting, reads them back and calls multi_update::send_data()
for each. MDEV-14551 made the rowids of the updated tables travel through
the join temp table (JOIN::add_fields_for_current_rowid() and
multi_update::prepare2()), but the SET values did not. The select list of
the join for the below SQL is empty, so send_data() evaluates it with
fill_record() against the tables' record buffers, which by then hold
the last row read during the join. Every updated row got the value computed
from that one row, e.g.

  UPDATE t1, t2 SET t2.v = t2.v + 1 ORDER BY t1.id

set all rows of t2 to the same value (as long as the ORDER BY is not
optimized away).

multi_update::initialize_tables() now adds the non-constant SET values
to JOIN::all_fields as hidden fields, the same way ORDER BY items and
the rowids are added, so they are computed into the join temp table
while the rows they read are current. It records the ref_ptrs slot of
each value in multi_update::value_slots[], and multi_update::prepare2()
replaces each value in values_for_table[] with the temp table item in
the same slot of the temp table's ref array. Recording the slot at push
time means prepare2() does not depend on const_item() giving the same
answer at optimization and at execution, and does nothing when the
values were not pushed.

The hidden fields need ref_ptrs slots.
st_select_lex::get_cardinality_of_ref_ptrs_slice() now reserves
item_list.elements more for the top-level select of an UPDATE.
This includes single-table UPDATE, because a prepared single-table
UPDATE can allocate the ref array on its first execution and run as a
multi-table UPDATE on a later one.

A consequence is that the SET values are now evaluated once per join
row written to the temp table, before LIMIT applies, instead of once
per updated row. For a value with side effects, such as NEXTVAL(), an
UPDATE with ORDER BY and LIMIT consumes one value per join row. The
test records this.

This commit was prepared with Claude Code (Opus 5.5), which analyzed
the problem, explored, presented possible fixes and implemented the
chosen one. Claude Code (Fable 5.1) reviewed the result, replaced the
items0[] pointer scan in prepare2() with the recorded slots, and added
the NEXTVAL test case.
Vladislav Vaintroub
CI: Windows - make bison caching and system info reusable actions

Backport the composite actions and the windows-amd64 rpl workflow changes from 11.4, to avoid merge conflicts later.

Assisted-by: Claude:claude-sonnet-5-5
Chaitanya-970
MDEV-41522 Check assignment targets for UPDATE privilege

Insert preparation switches column checks to SELECT for value
expressions. That setting was also used for the columns assigned by
ON DUPLICATE KEY UPDATE, so even s='c' failed without SELECT(s),
although a plain UPDATE worked with the same permissions.

Check assignment targets for UPDATE and use the existing scope helper
to restore the previous privilege and SQL command on every exit path.
Reads of protected base-table columns still require SELECT; assigning
a column without UPDATE permission is still rejected. No syntax is added.

Cover VALUES, SET, multi-row inserts, INSERT SELECT, column grants,
denied reads and writes, repeated prepared execution, REVOKE and a
definer view. Check stored rows as well as errors. Use the session-count
helpers except in view mode, where the existing connection-specific
wait avoids the counting helper's protocol exclusion.

The regression reproduced error 1143 on the original 10.11 server.
On the updated source it passes in normal, PS, cursor and view modes
without skips. The eleven selected existing insert, grant, view and
prepared-statement tests also pass locally.

Assisted-by: Codex:gpt-6.1-sol
Marko Mäkelä
MDEV-42589: FALLOC_FL_ZERO_RANGE is undefined in musl libc

log_t::header_rewrite(): Define FALLOC_FL_ZERO_RANGE according to
torvalds/linux@409332b65d3ed8cfa7a8030f1e9d52f372219642
in case the system headers fail to define that symbol.

Fixes up commit 0ad8886506d8bd0c7a6d368e3f481d954e8eb82f (MDEV-42009)
Rucha Deodhar
MDEV-42702: Assertion m_sp == m_thd->spcont->m_sp in
Item_splocal::this_item / SIGSEGV on FOR SYSTEM_TIME AS OF NEW in trigger

Analysis:
Item_trigger_row derives from Item_splocal but did not override this_item(),
so Vers_history_point::check_unit() ended up in Item_splocal::this_item(),
which looks up an SP variable in the routine context. A trigger row has no
such variable (its rcontext handler is null), hence the assertion/crash.

Fix:
Override this_item() (const and non-const) in Item_trigger_row to return
this, as is already done for this_item_addr().

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Rucha Deodhar
MDEV-42697: SIGSEGV in sortcmp / cmp_item_row::compare on NEW IN (..., OLD)
in trigger when OLD has a NULL string column

Analysis:
IN with a row skips the comparison when the row reports is_null(), which
cmp_item_row::store_value() sets via null_value if some column is NULL.
Item_trigger_row::is_null() ignored null_value and was true only when all
columns were NULL, so a row with a NULL column was compared and sortcmp()
got a NULL string.

Fix:
Make Item_trigger_row::is_null() return true if null_value is set, the same
as Item_row.
Rucha Deodhar
MDEV-42700: Column named new/old in a trigger query resolves to whole-row NEW/OLD

Analysis:
Item_trigger_row::fix_fields() treated any error from the lookup of a column
named new/old as "no such column", so e.g. an ambiguous column fell back to
the whole row. When the column was found, the replaced Item_trigger_row was
still checked for a scalar, giving ER_OPERAND_COLUMNS.

Fix:
Fall back to the trigger row only on ER_BAD_FIELD_ERROR and return other
errors. Make check_cols() expect one column once the item is replaced by a
column.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Rucha Deodhar
MDEV-42694: SIGABRT in Type_handler_composite::Item_sum_sum_fix_length_and_dec on SUM(NEW) in trigger on single-column table

Analysis:
Item_trigger_row::check_cols(1) accepted a row with one column as a scalar,
so SUM(NEW) on a single-column table passed the scalar check and reached
Item_sum_sum::fix_length_and_dec(), where the row type handler aborts.

Fix:
Do not accept NEW/OLD as a scalar in Item_trigger_row::check_cols() even if it
has one column (unless it was replaced by a column), as Item_splocal does for
ROW variables. The error is ER_OPERAND_COLUMNS.
Andrei Elkin
MDEV-37990 Galera test for redundant Table_map events

The Galera applier needs no code of its own for the redundant
Table_map events: it opens a table of an FK constraint twice, for the
Table_map event it received and for the FK prelocking, just like an
asynchronous slave does, and the previous commit of the MDEV makes
THD::binlog_write_table_maps() write one event per table.

The test dumps the binary logs of both nodes of a cluster and counts the
Table_map events per transaction and table. It fails on the server
without that fix, with
  SLAVE DUPLICATE: 8/dependent_with_cascade = 2
  MISMATCH 8/dependent_with_cascade: master=1 slave=2
for the final UPDATE, and passes with it.

The test and its result are those of the pull request #5121 (commits
497aa5506c3 and 1f6b6406396 by Pekka Lampio). Only the comments
of the test are corrected: the events are scoped by a statement, and the
duplicate arises within one statement, not across the row events of a
transaction.
Yuchen Pei
MDEV-42208 Do not consider direct update for UPDATE ... RETURNING ...

Just like direct delete is not considered for DELETE ... RETURNING ...

This is because metadata sending is skipped in the direct update route.
Vladislav Vaintroub
MDEV-23818 follow-up: main.client fails on Windows with vardir on another drive

Plain "cd" in cmd does not switch drives; use "cd /d" on Windows.

Assisted-by: Claude:claude-sonnet-5-5
Elena Stepanova
MDEV-42595 rpl.rpl_heartbeat modifies master_heartbeat_period, affects following tests

mysql-test/include/rpl_heartbeat.inc does
change master to ..., master_ssl_verify_server_cert=0, master_heartbeat_period= 0.5;
and its cleanup never puts it back.

13.x changed how CHANGE MASTER treats the heartbeat period, which
exposes the leak. In 10.11 any CHANGE MASTER that doesn't mention
MASTER_HEARTBEAT_PERIOD resets it to slave_net_timeout/2. In 13.x
the period is now an optional value. An unmentioned option stays
as it was. The between-test check doesn't catch it.

Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Susil Behera
Rucha Deodhar
MDEV-42695: SET NEW = ... in trigger on system-versioned table fails with ERROR 1054 Unknown column 'row_start' in 'NEW'

Analysis:
The whole row NEW/OLD was built from all columns except the internal ones, so
on a system-versioned table it also contained row_start and row_end. These
can't be looked up by name when assigned, giving ER_BAD_FIELD_ERROR, and
they made the row have more columns than the user sees.

Fix:
Skip the INVISIBLE_SYSTEM columns (row_start/row_end) when building the
columns of the whole row NEW/OLD.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Rucha Deodhar
MDEV-MDEV-42694: SIGABRT in Type_handler_composite::Item_sum_sum_fix_length_and_dec on SUM(NEW) in trigger on single-column table

Analysis:
Item_trigger_row::check_cols(1) accepted a row with one column as a scalar,
so SUM(NEW) on a single-column table passed the scalar check and reached
Item_sum_sum::fix_length_and_dec(), where the row type handler aborts.

Fix:
Do not accept NEW/OLD as a scalar in Item_trigger_row::check_cols() even if it
has one column (unless it was replaced by a column), as Item_splocal does for
ROW variables. The error is ER_OPERAND_COLUMNS.
Vladislav Vaintroub
CI, Windows ARM64 - increase MTR parallel workers

The low number of workers was used to workaround OOM on CI(likely, some
Windows memory manager bug)

OOM seems to be gone with image update. Increase the MTR parallel workers
to speed up the test.
Jan Lindström
MDEV-42565 Galera test failure on galera_3nodes.galera_duplicate_primary_value

Two concurrent brute-force (BF) applier transactions on the same node
can conflict on a record lock. MDEV-34836's wsrep_BF_has_to_wait()
dropped the seqno-order exception that the earlier MDEV-31658 fix
relied on: when neither side is streaming replication, an
earlier-ordered requester must not wait for a later-ordered holder,
since the holder is the one that is certified to be BF
aborted/replayed on conflict, never the requester. Without that
exception the two appliers can wait on each other with no resolution,
since neither is ever chosen as a deadlock victim, so the only way
out is a lock wait timeout (ER_LOCK_WAIT_TIMEOUT), matching the
reported test failure.

Restore the order check in wsrep_BF_has_to_wait(). Also add a
wait_condition before galera_duplicate_primary_value's final SELECT
on node_1, so the test does not depend solely on wsrep_sync_wait
causality to see the two appliers' writes.

Assisted-by: Claude:claude-4.6-sonnet
Rucha Deodhar
MDEV-42652: ASAN stack-use-after-return in Item_change_list::rollback_item_tree_changes on trigger reading view column named NEW

Analysis:
Item_trigger_row::fix_fields() passed the address of a local Item *col to
Item_field::fix_fields(). For a view column that call stores the address in
the item tree change list, which is rolled back after the function returned,
so the rollback wrote to a dead stack slot.

Fix:
Allocate the Item * slot on the THD mem_root, so that it lives as long as the
statement's items and is still valid when the changes are rolled back.
Vladislav Vaintroub
Merge 12.3 into 13.2