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
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-42324 CONNECTION of a MULTIPLE table is used as a format string

For ODBC tables with MULTIPLE=1 TDBODBC::GetFile() replaced the DBQ
value in CONNECTION with "%s" and TDBODBC::SetFile() passed the result
to snprintf() as the format string.

Store the parts of CONNECTION before and after the file name as two
strings and concatenate them with the file name.

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
Marko Mäkelä
fixup! 4b7f27348c38d44545f528015e2811ee5ee3291e
Marko Mäkelä
MDEV-39091 BACKUP SERVER of ENGINE=RocksDB

RocksDB is based on log structured merge trees (LSM trees)
that are immutable files. A consistent point-in-time snapshot
is obtained at BACKUP_LOCK_COMMIT cheaply via rdb_create_checkpoint(),
which is also what mariadb-backup is invoking via
SET GLOBAL rocksdb_create_checkpoint.

Under BACKUP_LOCK_COMMIT, a backup snapshot is created in #rocksdb under
rocksdb_datadir (by default, #rocksdb/#rocksdb in the server datadir).
This snapshot will be made available in #rocksdb subdirectory of the
backup target. The default rocksdb_datadir="./#rocksdb" makes restore
transparent: just point datadir to the backup directory or a restored
copy of it.

The transfer of the snapshot is deferred to BACKUP_FINISHED, after the
backup lock has been released, and finally the checkpoint is removed
from rocksdb_datadir.

Co-developed by: Thirunarayanan Balathandayuthapani
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
Marko Mäkelä
Add my_dir_open() written by Monty
kjarir
MDEV-10526: Add binary string support to bitwise operators and aggregates

Previously all bitwise operators and BIT_AND/BIT_OR/BIT_XOR converted
their arguments to BIGINT, silently truncating values wider than 64 bits.
This made them useless for INET6 addresses, UUIDs and other binary data.

When the arguments are binary strings (BINARY, VARBINARY, BLOB, but not
hex hybrids like 0xFF), the operators &, |, ^, ~, << and >> and the
aggregate functions BIT_AND, BIT_OR and BIT_XOR now work byte by byte
and return a binary string of the length of the operand(s).

Scalar operators:
- Implemented as Handler_str subclasses of the existing Item_handled_func
  handlers. Func_handler_bit_bin_to_bin and
  Func_handler_bit_op2_bin_to_bin hold the common code.
- Operands of different lengths give ER_INVALID_BITWISE_OPERANDS_SIZE
  as a warning and the result is NULL.
- The result collation is aggregated from the binary string argument(s),
  as for other string functions.

Aggregate functions:
- A binary accumulator initialized to the neutral value (0xFF for
  BIT_AND, 0x00 for BIT_OR and BIT_XOR).
- The result length is the length of the aggregated values, which may
  be shorter than the declared length (e.g. INET6_ATON() of an IPv4
  address). All values of a group must have the same length, otherwise
  ER_INVALID_BITWISE_OPERANDS_SIZE is raised.
- An empty set returns the neutral value of the declared length.
- The operand is limited to 512 bytes,
  ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE otherwise.
- The result data type is VARBINARY. val_int(), val_real(),
  val_decimal() and get_date() convert the binary string the same way
  as for the scalar operators.
- Window functions use per-bit counters, as for the 64-bit mode.
- reset_field()/update_field() support the binary mode for GROUP BY
  with a temporary table. Rows rejected by a FILTER clause (MDEV-24943)
  leave the field unchanged.
- direct_add() for a binary partial result, used by Spider.

MDEV-10526: Add Spider pushdown for bitwise aggregates

Push BIT_AND, BIT_OR and BIT_XOR down to the data nodes and merge the
partial results locally with direct_add(), in both integer and binary
string mode. The functions are associative and commutative, so the
partial results can be combined like for SUM, MIN and MAX.

In integer mode the partial result is parsed with strntoull10rnd():
row->val_int() overflows for values above LONGLONG_MAX.
A partial result that can not be parsed is an error, as any substitute
value would silently corrupt the merged result.

Aggregates with a FILTER clause are not pushed down.

MDEV-10526: Address review: test coverage, Spider empty data nodes

Add tests for the code paths reported as not covered:
- scalar operators: NULL in the first operand, empty strings, shift
  counts inside a byte, across bytes, out of range and negative
- aggregates: the binary result used as an integer, a boolean and a
  date, the integer result as a string, a double, a decimal and a date,
  data types that are not allowed, values of different lengths in a
  temporary table group and in a window, sliding frames removing
  values (also with FILTER), window functions over WITH ROLLUP
- Spider: groups whose partial results come from several data nodes
  (update_field() with direct_add()), empty data nodes, partial
  results that are not an integer, too long or NULL
- out of memory when allocating the result of an operator and the
  bit counters of a window function (debug builds)

Fix the bugs found by the new tests:
- A binary aggregate pushed down to Spider failed with
  ER_INVALID_BITWISE_OPERANDS_SIZE if the first data node had no rows
  and the values were shorter than the declared length. The neutral
  value of the declared length returned by such a node was taken as
  the first value. A neutral partial result is now always skipped,
  and ordinary values are not checked for it any more, so values of
  different lengths are always an error.
- A partial result longer than the declared length of the argument
  (the data node has a wider column) was written past the end of the
  accumulator. It is now rejected.

Remove the code that could not be reached:
- BIT_AND, BIT_OR and BIT_XOR never return NULL, so Item_sum_bit does
  not need to handle a NULL partial result or a NULL temporary table
  field. Spider returns an error for a NULL.
- The binary accumulator and the partial result are now kept in
  buffers inside Item_sum_bit: they are at most 512 bytes long. There
  is no allocation that can fail any more.
- The operators allocate the result in one common method, which also
  handles empty strings.
- Window functions never aggregate values of different lengths, and
  are never copied by copy_or_same(), this is now asserted.

MDEV-10526: Fix Spider bitwise aggregate tests for --ps-protocol

The prepared statement protocol changes the value of the
Spider_direct_aggregate status variable for the GROUP BY query, and
the stored procedure protocol adds a note to SHOW WARNINGS after an
error. Run that query without the prepared statement protocol and
show only the warnings of the query.
Thirunarayanan Balathandayuthapani
MDEV-39061 mariadb-backup compatible wrapper for BACKUP SERVER

This adds a shell script that lets users keep using their existing
mariadb-backup commands while the real work is done by the new
server-side BACKUP SERVER command. The goal is "drop-in": users
should not have to change their backup scripts.

mariadb-backup-server.sh : Understands the usual mariadb-backup
modes and translates each one.

mbstream-server.sh : lets streamed backups be unpacked by
pipelines that expect the mbstream CLI

mariadb-backup-pipe.sh is the stream sink that
BACKUP SERVER itself runs.

All three are documented in README.md.

--backup
========
Connects with the mariadb client and runs
"BACKUP SERVER TO '<dir>'".

Connection options (--user, --host, --port, --socket,
--defaults-file, ssl, ...) are passed through to the client.

--parallel=N becomes "<N+1> CONCURRENT": mariadb-backup
runs a dedicated log_copying_thread() besides its N data-copy
threads, while CONCURRENT counts every BACKUP SERVER worker.
The result is clamped to the 1..256 the parser accepts,
and to a minimum of 2.

After the backup it writes backup-prepare.cnf into the backup
directory, recording what --prepare needs later:
  - where mariadbd lives
  - InnoDB parameters (page size, data file path, undo tablespaces,
                      checksum algorithm, log file size)
  - If the server is encrypted then how to reload the
    encryption key plugin (the file_key_management variables),
    so an encrypted backup can be prepared without extra input.
  - every active provider_* compression plugin, with plugin-dir.

The providers matter because --prepare runs "mariadbd --bootstrap
--defaults-file=backup-prepare.cnf", which suppresses the
/etc/my.cnf.d snippet that normally enables a provider. Recovery has
to decompress a PAGE_COMPRESSED page before it can apply redo to it,
so without the provider it aborts with "Unable to apply log to
corrupted page". mariadb-backup carries the same plugins through
backup-my.cnf (encryption_plugin.cc QUERY_PLUGIN collects the
ENCRYPTION plugin and the provider_* DAEMON plugins together), so
this is parity with it rather than a new capability.

--backup --stream
=================
Runs "BACKUP SERVER WITH 'pipe'".
The server only accepts a bare command name, which it resolves
n the PATH of the mariadbd process after prepending mariadb-backup-,
so uses the installed mariadb-backup-pipe instead.

mariadb-backup-pipe writes the tar into
.mariadb-backup-pipe-<stream>.tar, a named pipe the wrapper
created in the server @@datadir and is already draining to
its own stdout.

The backup therefore reaches the consumer as it is produced and
never lands on local disk. The wrapper appends backup-prepare.cnf
as a final tar afterwards; the server's tar carries no
end-of-archive marker, so that trailing archive supplies the
only one and the whole stream extracts with a plain "tar -x".
The trailing archive is written with "tar -b 1" so that nothing
follows its end-of-archive marker. At the default blocking factor tar
pads the archive to 10240 bytes; the reader stops at the marker and
exits with the padding still unwritten, which on a small pipe is a
short write. tar treats a short write as fatal, so a backup that had
in fact completed was reported as failed.

--parallel is ignored here, with a warning.

Four properties follow from how BACKUP SERVER streams,
all differing from mariadb-backup:
- local: the stream command runs inside the server,
so the wrapper must share its filesystem;
- fifo lives in @@datadir, because mariadb-backup-pipe resolves it
relative to the working directory of mariadbd, so --stream needs
write access there;
- tar only: any --stream=<format> yields tar;
- single-threaded: one worker, so no parallel read either.
--target-dir is optional in stream mode;

mbstream-server.sh maps the mbstream CLI onto a plain
"tar -x"/"tar -c", so existing "mbstream -x"/"-c" pipelines
keep working on the wrapper's stream.

mbstream-only flags (-p/--parallel, ...) are accepted and
ignored; any other unknown option is rejected.

Environment overrides:
MARIADB (client),
MARIADBD (the --prepare bootstrap server) and
TAR (the tar implementation, e.g. TAR=bsdtar) can each be overridden.

To run the bootstrap under rr, put it in MARIADBD and
let rr's own _RR_TRACE_DIR choose the trace location, e.g.
  _RR_TRACE_DIR=/dev/shm/rr MARIADBD='rr record mariadbd'

--prepare
=========
Starts "mariadbd --bootstrap" on the backup directory using
backup-prepare.cnf as its defaults file, replays the archived redo
log between the start and target LSN read from backup.cnf,
then builds a fresh ib_logfile0 so a normal server can start
on the directory.

mariadbd is taken from the path recorded in backup-prepare.cnf
if that binary exists, otherwise by searching
/libexec, /sbin, /bin and the configured install directories.

PATH is not searched; set MARIADBD to point elsewhere.
User --defaults-file/-extra-file and encryption options are
layered onto the bootstrap.

--copy-back / --move-back
=========================
Copy or move a prepared backup into the datadir. The datadir
is created if missing, a non-empty datadir is refused unless
--force-non-empty-directories is given, and a chown
reminder is printed.

If --aria-log-dir-path is given, the Aria logs (aria_log_control,
aria_log.*) are relocated into that directory.

Packaging
=========
The wrapper is not installed by default and never replaces the
real mariadb-backup / mbstream binaries.
1. cmake -DWITH_MARIABACKUP_WRAPPER=ON (default OFF) controls it.
2. When ON, the scripts install as /usr/bin/mariadb-backup-server,
/usr/bin/mbstream-server and /usr/bin/mariadb-backup-pipe, tagged
COMPONENT Backup so they ship in the mariadb-backup package.
mariadb-backup-pipe must end up in the PATH of the mariadbd
process, not merely in the PATH of whoever runs the wrapper.
  mariadb-backup-pipe is generated unconditionally, because the
  mariabackup test suite needs it on the server's PATH even when the
  wrapper is not installed; only its install rule is gated.
3. RPM: nothing extra to do. the component handles it.
4. DEB: not wired. debian/rules uses --fail-missing and does not
enable the option, so the -server binaries are not listed.
To ship via DEB, make a paired change: add
-DWITH_MARIABACKUP_WRAPPER=ON in debian/rules and list all three of
usr/bin/mariadb-backup-server, usr/bin/mbstream-server and
usr/bin/mariadb-backup-pipe in debian/mariadb-backup.install together.
5. The real mariadb-backup/mbstream binaries and the
mariabackup symlink are left untouched; opt in via an alias or a
symlink early in PATH.

Limitations (not supported yet)
===============================
1) Incremental backup & prepare (--incremental-basedir,
  --incremental-dir, --apply-log-only)
2) --rollback-xa
3) Partial backup (--databases, --tables, --tables-file)
4) Output compression and encryption (--compress, --encrypt)
5) --export is accepted but only warns and runs a plain recovery
6) --extra-lsndir is ignored
7) --parallel is ignored with --stream
8) Windows: POSIX sh only, not installed on Windows

Behaviour differences from native mariadb-backup
================================================
- The wrapper needs the mariadb client on PATH for --backup;
--prepare needs mariadbd recorded in backup-prepare.cnf, in a
standard install directory, or named by MARIADBD
- BACKUP SERVER refuses an already-existing target directory
- BACKUP SERVER does copy the data file as raw pages without
checksum validation, so a corrupted table is not detected
at backup time
- --prepare only works on a wrapper-made backup: it
needs backup-prepare.cnf
- --stream is tar, not xbstream, local-only and single-threaded,
and needs write access to @@datadir for the fifo

Tests
=====
include/have_mariabackup_wrapper.inc redirects $XTRABACKUP to
mariadb-backup-server.sh and $XBSTREAM to mbstream-server.sh,
skipping when a wrapper or the mariadb client is unavailable.

include/have_mariabackup_combination.inc runs a test under both the
[CLIENT] mariadb-backup binary and the [SERVER] wrapper.

suite/mariabackup/suite.pm prepends the directory holding
mariadb-backup-pipe to PATH. BACKUP SERVER resolves the command in the
PATH of the mariadbd process, which mtr starts from the suite's
environment, so it has to be set there rather than with a --let at
--exec time. have_mariabackup_wrapper.inc skips the [SERVER]
combination when the helper is not on PATH.
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]>
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
Marko Mäkelä
Replace native API with my_dir_open()
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! 77311fbaf3e42d429c6c2f7ac3de1d9842b71d1b
Marko Mäkelä
fixup! 504234891164fe8a1b6065108f6ddaae7356067e
Marko Mäkelä
fixup! 7cfefd08e195bda8e03b0687632953656128ce7d
Marko Mäkelä
Revert "fixup! 7efc89bb39daf1d63015e130f62d139dc307c0ce"

This reverts commit 26c319d5d19cd4b865c88ed01111900a7c31214c.
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
Jan Lindström
MDEV-42284 fix galera_sr.mysql-wsrep#215 ER_LOCK_WAIT_TIMEOUT

Node_1's own causality wait (wsrep_sync_wait, on by default) blocked
its plain SELECT on t1 while the test held node_1's applier paused at
the sync.wsrep_apply_cb debug sync point, so the SELECT could not
reach the GTID the paused applier had not yet reached and timed out
with ER_LOCK_WAIT_TIMEOUT instead of returning.

Set wsrep_sync_wait = 0 on node_1 for that SELECT and the INSERT that
follows it, saved and restored around each of the test's three blocks.
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.
Marko Mäkelä
squash! e3994e5a387d754120584b1c52218c2f1374527c

Remove unused my_dir_rewind()
Marko Mäkelä
fixup! 7efc89bb39daf1d63015e130f62d139dc307c0ce
Marko Mäkelä
fixup! 7cfefd08e195bda8e03b0687632953656128ce7d
Marko Mäkelä
squash! 7cfefd08e195bda8e03b0687632953656128ce7d

Move most file-copying functions to mysys
and some file APIs to member functions of
backup_target and backup_sink.
Sergei Golubchik
MDEV-42070 handlersocket crashes after open_index with huge number of return fields

alloca() sizes in do_exec_on_index() and cmd_find_internal() depend
on client-controlled counts (return fields, filters) bounded only by
the request line length.

* make DENA_ALLOCA_ALLOCATE always use malloc
* free key_buf/filter_buf on the early "filterblob" return

Also, a huge statement id in open_index or IN list length in exec
resized a vector to 4G elements, aborting on std::bad_alloc.
Limit both to 1024.

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]>
Alexey Botchkov
Excessive json_nice() calls eliminated.

Item_json_func descendants now have val_json() doing
the job, returning the valid JSON as it is.
The val_str() gets the val_json() return and trims it with json_nice().