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
Elena Stepanova
MDEV-42628 rpl.rpl_do_grant incorrectly passes on Linux and fails on Windows

The test opens connection create_rout_db_slave with host "localhost",
the slave port and no socket. mysqltest then uses the default socket,
which is the master's. On Unix a connection to "localhost" goes
through the socket and ignores the port, so this "slave" connection
actually went to the master. On Windows "localhost" means TCP, so the
connection really reached the slave.

Since MDEV-35617, DROP USER emits
ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP (4227) when the dropped user
still has an active session. On Windows create_rout_db_slave was still
connected to the slave when DROP USER 'create_rout_db'@'localhost' ran
there, so the note appeared and the result did not match. On Unix the
slave had no such session, so the note never appeared, and the "slave"
part of the test had been running against the master.

Fix:
- pass $MASTER_MYSOCK / $SLAVE_MYSOCK explicitly, so each connection
  reaches the intended server on all platforms;
- disconnect create_rout_db_slave right after its last use, before
  DROP USER on the slave, and wait until the session is gone from
  information_schema.processlist, because the server finishes a
  disconnect only after the client has moved on.

Assisted-by: Claude:claude-opus-5-5
Elena Stepanova
Merge remote-tracking branch 'origin/bb-12.3-elenst' into bb-13.2-elenst
Monty
Removed compiler warning in ha_perfschema.cc
Elena Stepanova
main.type_int fails after merge to 12.3 (unrelated problem)

Temporary commit, not to be merged to real main
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
Elena Stepanova
Merge remote-tracking branch 'origin/bb-13.2-elenst' into bb-main-elenst
Elena Stepanova
MDEV-41085 Enable MTR tests on Windows: rpl suite
Monty
MDEV-39972 Incorrect result of $[last] of JSON

MDEV-40971 JSON Path Array Index 32-bit Integer Truncation Wraparound
( [ 2 3 2 + n ] ≡ [2 3 2+n]≡[n])
MDEV-40986 JSON edit functions' array-index 32-bit wraparound
(edit variant of M4 — modifies the wrong position)

- has_negative_path has to be set for every row. Before, it was only
  set when the path was parsed. If the path argument is a constant,
  c_path->parsed stays set after the first row and the path is not
  parsed again, but we still have to set has_negative_path if needed.
- Setting c_path->p.types_used= JSON_PATH_KEY_NULL in the loop was wrong
  as it reset the JSON_PATH_NEGATIVE_INDEX bit of constant paths. The
  reset is not needed, as json_path_setup() resets it.
- A range with only positive bounds no longer depends on the array sizes.
- Ensure we do not get integer overflow when calculating array indexes in
  json_path_setup(). An index that does not fit in an int is now a path
  syntax error.
Elena Stepanova
MDEV-42590 rpl.rpl_start_alter_restart_master leaves replication setup behind
Elena Stepanova
Merge remote-tracking branch 'origin/bb-10.11-elenst' into bb-11.4-elenst
Elena Stepanova
Merge remote-tracking branch 'origin/12.3-elenst' into bb-13.2-elenst
Elena Stepanova
Merge remote-tracking branch 'origin/bb-10.11-elenst' into bb-11.4-elenst
Elena Stepanova
MDEV-41085 Enable MTR tests on Windows: rpl suite
Elena Stepanova
MDEV-42633 rpl.rpl_row_loaddata_concurrent fails with Wrong offset or I/O error when run after another test

The test saves only the position from SHOW MASTER STATUS and then
sources show_binlog_events.inc without $binlog_file. The resulting
SHOW BINLOG EVENTS FROM <pos> therefore reads the first binlog file.
If an earlier test in the same server run rotated the binlog (for
example, rpl.rpl_parallel_wrong_exec_master_pos runs FLUSH LOGS), the
saved position belongs to a later file. In the first file it does not
start an event, so the test fails with:

  ERROR 1220 (HY000): Error when executing command SHOW BINLOG EVENTS:
  Wrong offset or I/O error

Added RESET MASTER at the start of the test, as
rpl_stm_loaddata_concurrent.test already does.

Assisted-by: Claude:claude-opus-5-5
Hemant Dangi
MDEV-42492: galera_sst_mariabackup_plugin_dir test fragility fixes

Issue:
- the test pins the exact number of times mdev42091_poc appears in
  mariabackup.prepare.log (FOUND 7); that count is incidental to
  mariabackup's own logging and isn't stable across platforms (FreeBSD
  produced 8), failing the result-file diff even though the test's
  actual assertion still held.
- node_2 is forced through a real restart/SST during cleanup, which can
  make Galera reassign auto_increment_offset on the membership change,
  leaking into mtr's end-of-test server-state check.

Solution:
- normalize the count with --replace_regex before the search, since only
  presence/absence matters.
- save/restore auto_increment_offset around the restart, per the existing
  convention used by other galera tests that restart a node.
Elena Stepanova
MDEV-42594 rpl.rpl_binlog_directory fails on Windows with wrong result (slashes in the path)
Elena Stepanova
Merge remote-tracking branch 'origin/bb-13.2-elenst' into bb-main-elenst
Monty
MDEV-39938 JSON_TABLE ignores negative indexes and 'last' in paths

The row path and NESTED PATH of JSON_TABLE gave no rows for paths
like $[-1], $[last] and $[1 to last], because
Json_table_nested_path::scan_next() passed no array sizes to
json_path_compare().

Fixed by counting the array sizes during the scan when the path has
negative indexes or 'last', in the same way as JSON_EXTRACT() does.

This also fixes the code from the MDEV-39972 fix that was only needed
because of the bug in json_table.
Elena Stepanova
MDEV-42628 rpl.rpl_do_grant incorrectly passes on Linux and fails on Windows

The test opens connection create_rout_db_slave with host "localhost",
the slave port and no socket. mysqltest then uses the default socket,
which is the master's. On Unix a connection to "localhost" goes
through the socket and ignores the port, so this "slave" connection
actually went to the master. On Windows "localhost" means TCP, so the
connection really reached the slave.

Since MDEV-35617, DROP USER emits
ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP (4227) when the dropped user
still has an active session. On Windows create_rout_db_slave was still
connected to the slave when DROP USER 'create_rout_db'@'localhost' ran
there, so the note appeared and the result did not match. On Unix the
slave had no such session, so the note never appeared, and the "slave"
part of the test had been running against the master.

Fix:
- pass $MASTER_MYSOCK / $SLAVE_MYSOCK explicitly, so each connection
  reaches the intended server on all platforms;
- disconnect create_rout_db_slave right after its last use, before
  DROP USER on the slave, and wait until the session is gone from
  information_schema.processlist, because the server finishes a
  disconnect only after the client has moved on.

Assisted-by: Claude:claude-opus-5-5
Alexey Yurchenko
MDEV-41907 mask sensitive data in the statements logged by wsrep

Use wsrep_thd_query() instead of thd->query() when logging
statements that can potentially contain sensitive data. Masking
is possible only for parsed statements, so don't log statements
before parsing.
Add MTR test to verify the fix.
Elena Stepanova
rpl.rpl_corrupted_decimal_precision fails with timeout

Due to MDEV-42580, if an earlier test ever set a replication filter,
the SQL abort expected in rpl.rpl_corrupted_decimal_precision
never happens, and the test fails with a timeout. To avoid it,
temporarily enforce the slave restart at the beginning of the test.
It should be removed when the bug is fixed
Teemu Ollakka
MDEV-42510 Galera: move the backup pause and resume to wsrep_backup.cc

The Galera rules for backup locks, FTWRL and the provider pause were in
backup.cc, lock.cc, mdl.cc, handler.cc and wsrep_mysqld.cc. No place
documented them as a whole.

Changes:
- New sql/wsrep_backup.h: documentation of the backup locks, the writes
  that they hold, the provider pause and desync, when a holder pauses,
  BF threads and backup locks, and the order of lock, pause, resume and
  release. mdl.h, mdl.cc, handler.cc and wsrep_mysqld.cc refer to it.
- New sql/wsrep_backup.cc: wsrep_backup_stage_pause(),
  wsrep_ftwrl_pause() and wsrep_backup_resume() replace the pause and
  resume code in backup_block_ddl(), backup_block_commit(),
  backup_end(), make_global_read_lock_block_commit() and
  unlock_global_read_lock(). wsrep_backup_pause() moves here and is
  static.
- THD::wsrep_desynced_backup_stage is now THD::wsrep_backup_paused, an
  Atomic_relaxed<bool>. FTWRL on a donor pauses without a desync. Other
  threads read the flag in wsrep_handle_mdl_conflict(), under the
  MDL_lock::m_rwlock that the holder takes after it sets the flag.
- ha_commit_trans() and wsrep_backup.h: say why a provider-ordered
  commit does not take MDL_BACKUP_COMMIT.

Behavior changes:
- UNLOCK TABLES resumes with resume_and_resync() also after a pause
  without a desync. It resyncs only after a desync, and it catches a
  resume failure.
- UNLOCK TABLES always resumes after a pause. Before, it did not resume
  when the node was not a donor and the session had wsrep_on=OFF.
- The holder flag is cleared after the resume, before the backup lock
  is released. A BF request in this window waits for the release.
- The resume DEBUG_SYNC points fire also when the holder did not pause.

Tests:
- galera_ftwrl_ordered_commit: new test. An applier waits for FTWRL1,
  and a local commit waits in the provider order for the applier. FTWRL
  gets FTWRL2 and pauses. If the local commit took MDL_BACKUP_COMMIT,
  FTWRL would fail with ER_LOCK_WAIT_TIMEOUT.

Assisted-by: Claude:claude-opus-5-5
Rex Johnston
MDEV-29527 Crash in ha_s3::discover_check_version on partitioned table

ha_partition opens its partitions lazily: a statement with an explicit
PARTITION clause, such as SELECT ... PARTITION (p1), only opens the
handlers of the listed partitions and records them in
m_opened_partitions. The TABLE is then returned to the table cache with
the other partition handlers created but never opened.

When a later statement takes that TABLE from the cache, open_table()
calls handler::discover_check_version(). ha_partition forwarded this
unconditionally to m_file[0]. Most engines use the default
implementation that just returns 0, but ha_s3 dereferences its
MARIA_HA (file->s->s3_path), which is NULL for a handler that was never
opened, and the server crashes.

Forward the check to the first partition that is actually open,
according to m_opened_partitions, instead. All partitions share the
table's .frm in S3, so any opened partition gives the same answer.
m_file_sample is not used for this as it is reset per statement by
open_read_partitions().

This commit was prepared with Claude Code (Opus 5.5), which reproduced
the crash on a local S3 server, captured it in an rr recording,
identified the unopened first partition from the recording, wrote the
fix and the test, and ran the s3, parts and main partition tests in
normal and --ps-protocol mode.
Alexey (Holyfoot) Botchkov
MDEV-42418 XMLISVALID: maxOccurs with trailing garbage, or above 2^63, is parsed wrongly.

Return error if the integer value of XML schema attribute has nondigital characters.
Avoid big positive -> negative integer conversion.
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
Elena Stepanova
MDEV-42586 rpl.warn_slaves_not_needed_for_purge fails when run in a chain of tests

The warning about the @@slave_connections_needed_for_purge default is
printed only once per server process: warn_slaves_not_needed_for_purge
is cleared by the first COM_REGISTER_SLAVE and whenever the variable is
set, either on the command line or with SET.

The test assumed the flag was still set when it started. MTR reuses
running servers between tests, so after a previous test whose slave
connected to the master, or after the test itself (it ends with
SET @@GLOBAL.slave_connections_needed_for_purge= DEFAULT), the flag was
already cleared. The warning was then never logged in this test's section
of the error log, and both expected-FOUND checks failed. This happened
with --repeat and when the test ran after another replication test.

Restart the master at the beginning of the test, before the slave
connects, so the test always starts with the flag set.

Assisted-by: Claude:claude-opus-5-5
Alexey Botchkov
MDEV-42405 XMLISVALID accepts malformed comments: "<!-->" and "--" inside a comment.

Chenge parser so it discards incorrect comments.
Elena Stepanova
MDEV-42567 rpl.rpl_change_master_implicit_gtid_warning fails with "Can't initialize replace" when run after another test

The test stopped the slave right after include/master-slave.inc and
then built CHANGE MASTER coordinates from SHOW SLAVE STATUS. But
master-slave.inc only waits for Slave_IO_Running=Yes, which the IO
thread reports right after sending COM_BINLOG_DUMP, before it has
received anything from the master. If STOP SLAVE arrives before the
master's initial fake Rotate event, Master_Log_File is still empty
and --replace_result fails with
"Can't initialize replace from 'replace_result $io_log_file ...'".

The race is lost reliably when the test runs after another
replication test (e.g. with --repeat) over a non-TLS replication
connection, which is the default in 10.11. There the master's dump
thread from the previous test is still waiting for binlog updates
when the slave reconnects, and kill_zombie_dump_threads() delays the
new dump by at least 100 ms. With TLS replication (the default in
11.4+) the old dump thread is already gone and the test passes;
11.4 with --skip-ssl fails the same way as 10.11.

Fix: sync the slave with the master before stopping it, so that the
IO thread has read the master's initial events and Master_Log_File
and Read_Master_Log_Pos are populated. The result file is unchanged.

Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Susil Behera
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
Elena Stepanova
MDEV-42594 rpl.rpl_binlog_directory fails on Windows with wrong result (slashes in the path)
Elena Stepanova
MDEV-42570 rpl.rpl_start_alter_restart_master fails when run in a chain of tests

The test shows the slave binary log from the beginning, including
the replicated mtr.add_suppression() transaction. How that transaction
ends in the slave binary log depends on the engine of
mysql.gtid_slave_pos, because the slave updates the table within
the same transaction. With Aria (the default under MTR) it ends with
Query COMMIT. With InnoDB, InnoDB takes part in the transaction and
it ends with Xid COMMIT.

Many replication tests change mysql.gtid_slave_pos to InnoDB and
don't restore it, for example rpl_start_alter_mysqlbinlog_1, and
check-testcase does not check table engines. When mtr reuses
the servers after such a test, the result mismatches. The test
passes after a restart or with --repeat, because then the table
is in Aria.

Set the engine of mysql.gtid_slave_pos on the slave to Aria
explicitly at the beginning of the test, so that the result
does not depend on previous tests.

Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Susil Behera
Alexey Yurchenko
MDEV-41902 wsrep_new_cluster flag is sticky after setting wsrep_cluster_address in runtime

Setting wsrep_cluster_address server variable to `gcomm://` initiates
bootstrap of a new primary configuration and for that it sets
wsrep_new_cluster flag. This flag is only for command line use,
make without it during runtime.

Add MTR test to verify this.
Elena Stepanova
MDEV-42586 rpl.warn_slaves_not_needed_for_purge fails when run in a chain of tests

The warning about the @@slave_connections_needed_for_purge default is
printed only once per server process: warn_slaves_not_needed_for_purge
is cleared by the first COM_REGISTER_SLAVE and whenever the variable is
set, either on the command line or with SET.

The test assumed the flag was still set when it started. MTR reuses
running servers between tests, so after a previous test whose slave
connected to the master, or after the test itself (it ends with
SET @@GLOBAL.slave_connections_needed_for_purge= DEFAULT), the flag was
already cleared. The warning was then never logged in this test's section
of the error log, and both expected-FOUND checks failed. This happened
with --repeat and when the test ran after another replication test.

Restart the master at the beginning of the test, before the slave
connects, so the test always starts with the flag set.

Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Susil Behera
Monty
MDEV-26448 CAST(expr AS JSON)

Until we have a true JSON TYPE, the definition of CAST(X to JSON) will be
IDENTICAL to:

IF X IS NULL
  RETURN NULL
ELSE IF X is of type temporal
  RETURN "X"    # Tagged as a JSON OBJECT. This matches MySQL 8.0
ELSE IF JSON_VALID(X)
  RETURN X      # Tagged as JSON object
ELSE
  GIVE_ERROR
FI
Elena Stepanova
MDEV-41085 Enable MTR tests on Windows: rpl suite
Thirunarayanan Balathandayuthapani
MDEV-42382 ALTER IGNORE TABLE ADD PRIMARY KEY / UNIQUE removes every row of a duplicate group, not just the extra rows

Problem:
========
ALTER IGNORE TABLE ... ALGORITHM=COPY (IGNORE_UNDO mode) keeps only
the latest insert undo log record. When an insert fails,
row_insert_for_mysql() rolls back to savept=0 to remove that
surviving record, assuming it belongs to the failed row.

That holds for a duplicate in a secondary index, which is reported
after the clustered index record and its undo log record were
written. A duplicate in the clustered index is detected before any
undo log record is written for the failed row. The surviving record
then belongs to the previous row, and rolling it back deletes a row
that must be kept.

Solution:
=========
row_insert_bulk_error(): new function, ATTRIBUTE_NOINLINE
ATTRIBUTE_COLD, which chooses the savepoint of a failed insert in
bulk insert or IGNORE_UNDO mode. In IGNORE_UNDO mode, if the
duplicate is in the clustered index (trx->error_info), return
trx->undo_no, so that nothing is rolled back because the failed row
left no undo log record. Otherwise return 0 as before.
Elena Stepanova
Merge remote-tracking branch 'origin/bb-11.8-elenst' into bb-12.3-elenst
Elena Stepanova
Merge remote-tracking branch 'origin/bb-11.4-elenst' into bb-11.8-elenst
bsrikanth-mariadb
MDEV-38303: Stop scan early when aggregate HAVING cannot become true

For a query without GROUP BY, such as

  SELECT COUNT(*) FROM t1 HAVING COUNT(*) < 10

the whole table was read even after the count reached 10 and the
condition could no longer be true.

Add Item_sum::having_false_is_final(op, c), which tells whether a
HAVING condition "aggregate op constant", once false, stays false as
more rows are added. Item_sum_count implements it for COUNT(..) < c,
COUNT(..) <= c and COUNT(..) = 0. Other aggregates return false, so
they are read in full as before.

JOIN::setup_having_stop_conds() collects such AND-parts of HAVING in a
List at the end of JOIN::make_aggr_tables_info(), in the optimizer.
An error there is returned to the caller. When the list is not empty,
setup_end_select_func() uses check_having_stop_conds() instead of
end_send_group(), so other queries pay nothing. It calls
end_send_group(), then checks the conditions after each row and returns
NESTED_LOOP_QUERY_LIMIT, the same way LIMIT stops a scan, once one is
false. The end-of-records step still runs, so HAVING is checked on the
final state.

Only used when it is safe:
- implicit grouping, with no temporary table, ROLLUP, window functions,
  PROCEDURE, optimized-away GROUP BY or correlated HAVING
- COUNT(DISTINCT) is excluded, as its value is known only at the end
- the comparison must be numeric. COUNT compared with a DATE is not
  monotonic, so it is not used
- the constant must be a non-NULL literal or a bound PS parameter. A
  <cache> item, such as an expression with a user variable (@v + 0) or
  a folded 5 + 5, is filled on its first read, which the shortcut would
  move to the first row. A user variable changed by a stored function
  during the scan would give a wrong result.
- a NULL result does not stop the scan

Like LIMIT, stopping early means the remaining rows are not read, so
errors and side effects from them no longer happen.

The code is in the new file sql/opt_having_shortcut.cc. Since the
decision is made at optimization time, it is also reported:
- EXPLAIN FORMAT=JSON shows "having_shortcut": true
- tabular EXPLAIN shows "Using having short-cut" in the Extra column
  of the first table
- the optimizer trace has a "having_shortcut" object with the
  stop_conditions

The plan only says the scan may stop. The tests also cover queries where
the plan shows the shortcut, but the scan is not stopped, or is stopped
late.
Monty
Updated sql-bench to benchmark json functions

Other things:
- Added compare-result --adjust to compare benchmark with different
  query/row count
- Have different configure options for MySQL and MariaDB
- Use highrest timers for tests for more accurate resutls