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
Kristian Nielsen
Fix some incorrect uses of off_t

The off_t type is POSIX, not standard C/C++, and generally should not be
used in non-platform specific code. (The main problem is that is is a
32-bit signed integer on 64-bit Windows, potentially causing integer
overflow).

Signed-off-by: Kristian Nielsen <[email protected]>
Alessandro Vetere
MDEV-41844 Test innodb.buf_pool_resize_pcur_restore is flaky

The procedure read_into_first_new_block() requires that the page of a
table is read into the first block that a buffer pool grow adds. While
history exists, the purge coordinator runs once per second. It reads
undo log pages, and purge_truncation_callback() reads the header page
of each rollback segment. On a slow builder, these reads can take the
first new block in all 5 attempts.

Stop purge for the duration of the test with FLUSH TABLES ... FOR
EXPORT on a separate connection. A read view does not stop these reads.
Remove the wait for purge between the two cases, because purge is
stopped.

purge_sys_t::stop() waits only for the purge coordinator. Runs of
purge_truncation_callback() that the coordinator submitted before can
still read pages after FLUSH TABLES ... FOR EXPORT returns. Add the
debug keyword purge_stop_wait_truncation, which makes
purge_sys_t::stop() also wait for these runs, and set it in the test.

Assisted-by: Claude:claude-opus-5-5
Sergei Golubchik
MDEV-41480 Failed ADD PARTITION with a #mysql50# partition name removes the table

mysql_write_frm(WFRM_WRITE_SHADOW) declared a local `error` shadowing
the function-level one, so a failed ha_create_partitioning_metadata()
returned success and ALTER continued to install the shadow frm.

Assisted-by: Claude:claude-5.5-opus
Sergei Golubchik
MDEV-41029 AddressSanitizer: use-after-poison - "install soname ha_rocksdb"

rocksdb tried to modify a read-only sysvar (ignore_db_dirs). It was
kind of fine on startup, even if hackish, but at INSTALL PLUGIN time
it meant violating the contract, read-only sysvar cannot be modified
at run-time.

let's ignore any ill-conceived attempts to modify ignore_db_dirs
at run-time. as a result, if RocksDB is installed with INSTALL PLUGIN
command, new #rocksdb directory will not be excluded from SHOW DATABASES
list until server restart.
liufeng
MDEV-33843: Server crash via XPath unary minus recursion

Analysis:
The stack overrun check added by MDEV-33843 is executed only in
my_xpath_parse_OrExpr(). The XPath grammar rule

  UnaryExpr ::= '-' UnaryExpr

recurses directly in my_xpath_parse_UnaryExpr(), so a path made of many
'-' tokens consumes one stack frame per token without any limit and
overruns the thread stack. UPDATEXML() and EXTRACTVALUE() parse the path
in fix_fields(), therefore any user who can run a SELECT can terminate
the server with

  SELECT UPDATEXML(NULL, REPEAT('-', 100000), 1);

Before this patch the statement makes the backend exit with SIGSEGV
(exit status 139) and the client reports "Lost connection to server
during query". The equivalent parenthesized expression is already
rejected with ER_STACK_OVERRUN_NEED_MORE because it re-enters
my_xpath_parse_OrExpr().

Fix:
Run check_stack_overrun() at the entry of my_xpath_parse_UnaryExpr(),
as my_xpath_parse_OrExpr() does, and add a regression case to
mysql-test/main/xml that expects ER_STACK_OVERRUN_NEED_MORE.

The same statement then returns the regular stack-overrun error and the
server stays alive. main.xml passes.
Jan Lindström
MDEV-40212 galera_duplicate_primary_value stalls on single applier

Failure:
- The test needs two write sets applied concurrently by two
  appliers on node 1, but never sets wsrep-slave-threads, so it
  defaults to 1.
- lock_wait_wsrep_kill's debug sync parks the applier thread
  itself on WAIT_FOR wsrep_after_kill_continue; with only one
  applier, the second write set has no free thread, and WAIT_FOR
  wsrep_after_kill_reached_2 blocks until --debug-sync-timeout
  (300s).
- The timeout does not fail the test, so it reports pass without
  ever reaching the concurrent brute-force state MDEV-31658 added
  it to cover.

Fix:
- Set wsrep-slave-threads=2 on node 1, so the two independent
  write sets apply concurrently, matching what the test is meant
  to exercise.

Assisted-by: Teemu Ollakka <[email protected]>
Assisted-by: https://mariadb.org/governance/governance-ai-policy/
Alexey Yurchenko
MDEV-35940, MDEV-35964 reenable MTR tests

As MDEV-35940, MDEV-35964 have been fixed, reenable tests disabled
because of them
Sergei Golubchik
MDEV-40374 I_S.metadata_lock_info shows schema/table that user has no privileges on

Apply the SHOW PROCESSLIST visibility rule: without PROCESS a user
sees only locks held by threads of the same account. That is enough
to find who blocks one's own statement in the case where the user
can KILL the blocker.

Assisted-by: Claude:claude-opus-5-5
Marko Mäkelä
MDEV-41813 OPTIMIZE TABLE makes tables grow

PageBulk::init(): Add a parameter for a hint page number, so that we will
try to allocate adjacent pages for the index.

After this change, the innodb_alter_copy_bulk=ON code path may actually
produce smaller files than the legacy code path.

Based on mysql/mysql-server@a3e2dbddec48ec229484bdf082b8c2f34ccf8c0b

Reviewed by: Thirunarayanan Balathandayuthapani
Sergei Golubchik
MDEV-38859 federated use-after-free with temp tables and savepoints

ha_init() added sizeof(SAVEPOINT) to savepoint_alloc_size after
startup engines were initialized, so an engine installed at runtime
got a savepoint_offset that already included sizeof(SAVEPOINT),
and (sv+1)+savepoint_offset counted it twice, pointing past
the end of the allocated SAVEPOINT.

Start savepoint_alloc_size at sizeof(SAVEPOINT) and make
savepoint_offset relative to the SAVEPOINT itself.

Assisted-by: Claude:claude-opus-5-5
Marko Mäkelä
fixup! 4b7f27348c38d44545f528015e2811ee5ee3291e
Sergei Golubchik
stack overflow opening a table with a too long path

CREATE TABLE allows .frm path of up to FN_REFLEN bytes, but buffers
for normalized_path + reg_ext were FN_REFLEN, leaving no room for \0.
A nonexistent table name could produce a path even longer than that.

* make buffers FN_REFLEN + 1
* in open_table_def(), treat a path that cannot fit as a missing frm

Assisted-by: Claude:claude-5.5-opus
Sergei Golubchik
MDEV-41946 CONNECT: table option value used as printf format string, crash in ha_connect::GetRealString

For partitioned tables GetRealString() and FileExists() substituted
the partition name into FILE_NAME (and other options) by passing the
option value to snprintf() as the format string.

Replace the first "%s" with the partition name and copy the rest
literally, as already done for SRCDEF.

Assisted-by: Claude:claude-opus-5-5
Sergei Golubchik
MDEV-41362 ASAN heap-buffer-overflow in validate/plugin_foreach_with_mask after password_reuse_check

allocate one byte more for `buff[key_len]=0` to work
Kristian Nielsen
MDEV-42237: Fix integer overflow of relay log position

The off_t type is 32-bit signed on Windows, casting the relay log position
to off_t will overflow when >= 2**31.

Signed-off-by: Kristian Nielsen <[email protected]>
Sergei Golubchik
MDEV-41504 COM_FIELD_LIST Integer Underflow Leading to Heap Over-read

reject COM_FIELD_LIST packets without a table name / wildcard separator.
Otherwise the wildcard started one byte past the packet end and its
length wrapped to UINT_MAX.

Assisted-by: Claude:claude-opus-5-5
Sergei Golubchik
CREATE VIEW with a long name writes .frm outside of the database directory

fn_format() silently drops the directory when the path is too long.
Use MY_SAFE_PATH in sql_create_definition_file() and fail with
ER_IDENT_CAUSES_TOO_LONG_PATH.

Assisted-by: Claude:claude-5.5-opus
Kristian Nielsen
Fix some incorrect uses of off_t

The off_t type is POSIX, not standard C/C++, and generally should not be
used in non-platform specific code. (The main problem is that is is a
32-bit signed integer on 64-bit Windows, potentially causing integer
overflow).

Signed-off-by: Kristian Nielsen <[email protected]>
Kristian Nielsen
MDEV-41658 fix Galera node crash when a parallel slave worker is bf_killed

A parallel-replication worker would assert in ha_rollback_trans() because
wsrep_after_statement() and ha_commit_trans()'s wsrep error path could
roll back its transaction before retry_event_group() unmarks it as
committing.

Skip mark_start_commit() when using Galera. Galera certification can cause
rollback of parallel replication transactions during commit when there is a
conflicting transaction outside of replication. This can cause to start the
next GCO too early, while the previous GCO still needs to rollback and
retry.

Do not fail replication with an error when wsrep_after_statement() fails due
to a retryable error like brute-force kill.

Signed-off-by: Kristian Nielsen <[email protected]>
Sergei Golubchik
MDEV-39752 use-of-uninitialized-value in ftb_parse_query_internal

maria_ft_get_word() does not set the word for bracket and quote tokens,
yet ftb_parse_query_internal() passes w.pos and w.len to
mysql_add_word() by value for every token. clang-16+ MSAN reports
passing uninitialized values as arguments.

Initialize w, as MDEV-33478 did for the MyISAM copy of this function.

Assisted-by: Claude:claude-opus-5-5
Alexey Botchkov
MDEV-41430 auth_pam_tool leaves zombie processes.

As the auth_pam_tool claims root privileges, the mariadbd can't kill
it if it hangs.
So instead of sending the SIGKILL to the auth_pam_tool we set the
alarm() there so it kills itself after the timeout.
The alarm counter is hardcoded to 100 seconds so the authentication
can be halted even if the connect_timeout allows it to be longer.
The auth_pam.c now calls the waitpid() without the WNOHANG, so it waits
for the auth_pam_tool to return. If the PAM module aggressively resets
the alarm or handles the SIGALARM the pam_auth() can hang forever.
Marko Mäkelä
fixup! 471877aef91b1069b7fa38f10a066f8881eaf0e1
Jan Lindström
MDEV-40211 galera_connect.inc sleeps one second on each invocation

Failure:
- galera_connect.inc sleeps 1 second, unconditionally, before every
  connect, as a 2015 workaround for a node racing its own join/IST
  against another node's concurrent join (MDEV-7178).
- ~700 tests in the galera/wsrep suites go through this include, so
  the blind sleep costs roughly that many seconds in a full run,
  whether or not any node is still joining.

Fix:
- Replace the sleep with include/galera_wait_ready.inc after
  connecting, polling the actual wsrep_ready state instead of
  guessing a fixed delay. galera_wait_ready.inc is the existing,
  already widely used helper for this, so this reuses it rather
  than adding a new check.
- Add a $galera_no_wait_ready opt-out for a node that is expected
  to join a non-Primary component and so never becomes ready;
  galera_pc_weight.test isolates node_1 before connecting node_3,
  so node_3 needs it.
- The ready check itself must not wait on causality: a test can
  legitimately connect a second session to a node whose applier is
  stuck behind a local lock (galera_lock_table.test does, via LOCK
  TABLES), and wsrep_sync_wait would otherwise block the check's own
  first query on that same stuck applier. Set it to 0 for the check
  and restore it from the global value afterward, without reading it
  back first, since even a bare SELECT of the session variable hits
  the same wait.

Assisted-by: https://mariadb.org/governance/governance-ai-policy/
Marko Mäkelä
fixup! 504234891164fe8a1b6065108f6ddaae7356067e
Marko Mäkelä
fixup! 7cfefd08e195bda8e03b0687632953656128ce7d
Sergei Golubchik
MDEV-39615 CONNECT: Privilege validation gap

A CONNECT sub-table of PROXY, TBL, XCL, OCCUR, PIVOT was opened
in-process without any privilege check, so a user with CREATE could
read and write any existing CONNECT table, including file-based ones
that otherwise require FILE.

Check privileges on the sub-table as if it were used directly instead
of the PROXY table, like in a SQL SECURITY INVOKER view: SELECT, INSERT,
SELECT+UPDATE or SELECT+DELETE depending on the mode, plus the
sub-table's own FILE privilege checks. Info commands fail silently,
as for other sub-table errors.

Non-CONNECT sub-tables are still accessed via a client connection with
the table's credentials.

Assisted-by: Claude:claude-5.5-opus
Sergei Golubchik
unix_socket: reject connections from the server process itself

CONNECT, FederatedX and Spider connect to the local server via the unix
socket with user-supplied credentials. unix_socket saw mysqld's own uid
as the peer, so anyone allowed to create such a table could log in as
the OS user mysqld runs under (mysql@localhost, ALL PRIVILEGES by default).

Let's fail authentication when the peer pid is the server's own pid.
On old FreeBSD (<13) that cannot get the peer pid allow everything
as before.

Assisted-by: Claude:claude-5.5-opus
Sergei Golubchik
MDEV-41123 bool show_role_grants(THD *, const char *, ACL_USER_BASE *, char *, size_t): Assertion `pair' failed

GRANT to a role that exists in memory but has no row in
mysql.global_priv took the "new role" path and called acl_insert_role(),
adding a second ACL_ROLE with the same name to acl_roles. DROP ROLE then
removed one of them, while user role_grants kept pointing to the other,
whose grant pair was already gone.

Reject the mismatch between the table and memory with
ER_PASSWORD_NO_MATCH, like replace_user_table() already does for users.

Also, remove repeatable role hash lookups, one is enough.

Assisted-by: Claude:claude-opus-5-5
Marko Mäkelä
Encapsulate all streaming in backup_sink
Marko Mäkelä
Fix Windows once more
Sergei Golubchik
MDEV-40862 mariadb-backup --backup crashes on database and table names that expand to nearly 255 bytes in the file system

* make_path_n() never grew the buffer and never updated its length
* local_open(): use MY_SAFE_PATH, a too long path must not fall back
  to a relative path in the current (source data) directory

Assisted-by: Claude:claude-5.5-opus
Marko Mäkelä
fixup! 4b7f27348c38d44545f528015e2811ee5ee3291e
Sergei Golubchik
MDEV-41520 Unescaped XID bytes in SESSION_TRACK_TRANSACTION_CHARACTERISTICS

* always print gtrid and bqual in hex
* don't try to be smart to print as few fields as possible
  - it was broken and could skip bqual, but still print formatID
* don't try to predict how many bytes it'll take. Print into a local
  buffer, then memcpy. Robust and costs just one memcpy.
Sergei Golubchik
CONNECT: CSV table discovery does not check the FILE privilege

connect_assisted_discovery() checks the FILE privilege before reading
the file for FMT, DBF, XML, INI, VEC, REST, JSON and BSON tables, but
not for CSV, so a user without FILE could make CSVColumns() open and
parse any file.

Add TAB_CSV to the list.

Assisted-by: Claude:claude-opus-5-5
Sergei Golubchik
MDEV-41830 ASAN stack-buffer-overflow in option file parser
Sergei Golubchik
MDEV-41944 CONNECT CSV discovery header overflows colname[]/len[]/typ[]/prc[]

CSVColumns() stored a column name pointer for every separator in the
header line without checking MAXCOL, so a header with more than 200
fields wrote past the end of the colname[] stack array, and the
resulting column count indexed len[], typ[], prc[] out of bounds.

Reject such headers with TOO_MANY_FIELDS, the same way data lines
are rejected.

Assisted-by: Claude:claude-opus-5-5
Sergei Golubchik
CONNECT: JSON/BSON/MongoDB discovery overflows column name and path buffers

JSONDISC::Find, BSONDISC::Find, CMGDISC::FindInDoc and JMGDISC::ColDesc
built column names and JSON paths in colname[65] and fmt[129] with
strncat() whose size argument wrapped around once the buffer was full,
or with a bare strcpy(), so long or deeply nested keys wrote past the
buffers. A top-level key of 64 characters or more was copied with
strncpy() and left colname unterminated.

Add PlugAppend() that appends with safe_strcat() and fails with
"Column name or path too long" if the result does not fit, and use
it for all these buffers.

Assisted-by: Claude:claude-opus-5-5
Marko Mäkelä
backup::append_async(): Linux-specific backup::append() of immutable files
Kristian Nielsen
Fix corrupt query string in mysqltest embedded

The mysqltest --send command re-used the same buffer for the query string to
send to each connection thread. This caused a race where a following --send
could overwrite the query before the first connection thread had time to
copy out the string, resulting in executing a corrupt query.

Instead, allocate a new string for each --send and free it in the connection
thread.

This was seen as a sporadic failure in --embeded-server in test
innodb.temp_truncate_freed_race (and probably others).

Signed-off-by: Kristian Nielsen <[email protected]>