Commit graph

202032 commits

Author SHA1 Message Date
Georg Richter
bec6e0d1f9 Updated Connector/C
Updated Connector/C (latest 3.4) and fixed mysqlbinlog
2025-01-20 10:24:13 +01:00
Monty
6be42c7276 Removed test not related to utf8mb4_0900 from ctype_utf8mb4_0900.test 2025-01-18 10:41:43 +02:00
Monty
653f68784a MDEV-35865 atomic.alter_table times out often
The problem was that get_collation_number_internal() loops over all
collations for finding a collation based on name. For looking up
utf8mb4_0900_ aliases it used 22633 character strings comparisons at
startup.

Fixed by adding the MariaDB internal collation number in the "0900" alias
lookup array. This is fine as collation numbers never changes.

Discussed-with: serg@mariadb.com
2025-01-18 10:41:43 +02:00
Sergei Golubchik
b22eacc976 fix sporadic failures of main.alter_table_online
progress updates aren't deterministic, occasionally they can be
skipped (if `LOCK_thd_data` is locked). This isn't a problem as such,
but breaks tests that wait for a specific value of the progress
(and threads waiting for a specific value of the progress, exactly,
lock `LOCK_thd_data` which prevents the progress from being updated)

In this particular case, though, there is no need to wait for
progress = 100, because "Waiting for table metadata lock" happens
only at the end of stage = 4 anyway.
2025-01-17 14:16:41 +01:00
Sergei Golubchik
1643a258d2 update wsrep test for 26.4.21 2025-01-15 21:23:33 +01:00
Sergei Golubchik
904f2e4b2d fix galera tests for 11.4 2025-01-15 21:22:48 +01:00
Sergei Golubchik
f1da9dbf5e MDEV-20912 fix test results
followup for 7fcaab7aaa
2025-01-15 09:51:19 +01:00
Sergei Golubchik
c40709660f MDEV-35773 fix test results
followup for 437550b7cf
2025-01-15 09:49:33 +01:00
Sergei Golubchik
f1a7693bc0 Merge branch '10.11' into 11.4 2025-01-14 23:45:41 +01:00
Sergei Golubchik
4469540d39 MDEV-35810 fix test results
followup for aa35f62f1c
2025-01-14 14:01:28 +01:00
Sergei Golubchik
b04fb9fb43 MDEV-34062 compilation failure on 32bit
extra/mariabackup/xtrabackup.cc:3407:15: error: conversion from ‘lsn_t’ {aka ‘long long unsigned int’} to ‘size_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]

followup for 6acada713a
2025-01-14 13:59:22 +01:00
Sergei Golubchik
9d80422f79 MDEV-26266 disable the test on 10.11 for now 2025-01-14 13:49:24 +01:00
Daniel Black
e55fe2c2e3 MDEV-32686 Use Red Hat package notes in compilation
This tests the compile using a spec file. This spec
file is defined by environment variables.

If the spec file doesn't exist (SLES/OpenSUSE),
isn't supported (e.g. clang), or has incorrect environment
variables the linker flag won't be used.

Stripping output avoid gcc ICE bug
https://bugzilla.redhat.com/show_bug.cgi?id=2336272

Launcher used to make env variables show up in the
build step rather than just the configure step.
2025-01-14 14:22:30 +11:00
Daniel Black
5335681f67 MDEV-32686: Debian: include ELF package notes
Providing build information compiled into the
executable provides the ability of core file
handlers to access information on the distro
and source package version. This information
can sometime be lost between the source and
an upstream bug report.

The Debian dh-package-notes includes the
makefile included in debian/rules that
sets linking flags to the right values.

The jammy version of dh-package-notes does
not include the same makefile implementation
as the others.

ref: https://systemd.io/ELF_PACKAGE_METADATA/

fix
2025-01-14 14:22:30 +11:00
Marko Mäkelä
46aaf328ce MDEV-35830 Fix innodb_undo_log_truncate in backup
recv_sys_t::parse(): Correctly handle the storing==BACKUP case,
and simplify some logic around storing==YES as well.

The added test mariabackup.undo_truncate is based on an idea of
Thirunarayanan Balathandayuthapani. It nondeterministically (not on
every run) covers this logic, including the function backup_undo_trunc(),
for both innodb_encrypt_log=ON and innodb_encrypt_log=OFF.

Reviewed by: Debarun Banerjee
2025-01-13 16:57:11 +02:00
Marko Mäkelä
aa35f62f1c MDEV-35810 Missing error handling in log resizing
log_t::resize_start(): If the ib_logfile101 cannot be created,
be sure to reset log_sys.resize_lsn.

log_t::resize_abort(): In case SET GLOBAL innodb_log_file_size is
aborted, delete the ib_logfile101.
2025-01-13 10:41:40 +02:00
Marko Mäkelä
4fc3a44bab MDEV-33447 fixup: pmem_persist() on RISC-V and LoongArch
Let us enable pmem_persist() on RISC-V and LoongArch, because those are
available in the Debian CI.
In commit 3f9f5ca48e these were initially
disabled by default.

According to the available documentation, these instructions are
available in all ISA versions. On LoongArch there would also be
__builtin_loongarch_dbar() that generates the same code.
2025-01-13 07:28:40 +02:00
Marko Mäkelä
42e6058629 MDEV-35785 innodb_log_file_mmap is not defined on 32-bit systems
innodb_log_file_mmap: Use a constant documentation string that
refers to persistent memory also when it is not available in the build.

HAVE_INNODB_MMAP: Remove, and unconditionally enable this code.

log_mmap(): On 32-bit systems, ensure that the size fits in 32 bits.

log_t::resize_start(), log_t::resize_abort(): Only handle memory-mapping
if HAVE_PMEM is defined. The generic memory-mapped interface is only for
reading the log in recovery. Writable memory mappings are only for
persistent memory, that is, Linux file systems with mount -o dax.

Reviewed by: Debarun Banerjee, Otto Kekäläinen
2025-01-13 07:27:17 +02:00
ParadoxV5
f361ad75b3 MDEV-35431: fix InnoDB flags error size specifier
This came after I prepared .
2025-01-12 13:56:06 +11:00
Daniel Black
f014d5872b MDEV-35554 call to function show_binlog_space_total()
through pointer to incorrect function type.

The argument is void* rather than char*.

This shows up with UBSAN testing under clang.
2025-01-12 09:51:51 +11:00
Sergei Golubchik
221aa5e08f Merge branch '10.6' into 10.11 2025-01-10 13:14:42 +01:00
Sergei Golubchik
311e88c67a fix rocksdb tests for buildbot 2025-01-10 13:13:53 +01:00
Sergei Golubchik
542edc7743 MDEV-35720 fix the test case
* cleanup after itself
* disable cursor protocol for SELECT ... INTO
2025-01-10 13:13:29 +01:00
Marko Mäkelä
4704435068 MDEV-35802 Race condition in log_t::persist()
log_t::persist(): Remove the parameter holding_latch, and assert
latch_holding_any(). We used to avoid acquiring a latch when log
resizing was not in progress. That allowed a race condition to occur
where log_t::write_checkpoint() has just completed log resizing.
In that case, we could wrongly invoke pmem_persist() on the old
log_sys.buf instead of the new one, which was shortly before known
as log_sys.resize_buf.

log_write_persist(): A non-inline wrapper function that will
invoke log_sys.persist() while holding a shared log_sys.latch.
2025-01-10 08:15:09 +02:00
Marko Mäkelä
ff1f611a0d Avoid assert()
By default, CMAKE_BUILD_TYPE RelWithDebInfo or Release implies -DNDEBUG,
which disables the assert() macro. MariaDB is deviating from that.
Let us be explicit to use assert() only in debug builds.

This fixes up 1b8358d943
2025-01-10 06:50:50 +02:00
Marko Mäkelä
1b8358d943 Use assert() on RMW arguments
The macros ut_ad() and DBUG_ASSERT() can evaluate their argument twice.
That is wrong for any read-modify-write arguments.

Thanks to Nikita Malyavin for pointing this out.
2025-01-09 14:27:13 +02:00
Marko Mäkelä
bca4cc0bd6 Merge 10.11 into 11.4 2025-01-09 14:02:19 +02:00
Marko Mäkelä
81633f47c3 MDEV-35796 OPT_PAGE_CHECKSUM is ignored if innodb_encrypt_log=ON
recv_sys_t::parse(): When parsing an OPTION record, invoke
l.copy_if_needed() before checking if the payload is OPT_PAGE_CHECKSUM
followed by a 32-bit page checksum.

This fixes up the merge 57d4a242da of
commit 4179f93d28 (MDEV-18976).

The impact of this can be observed by running a debug instrumented
build on the test encryption.recovery_memory. There should be over
5,000 invocations of log_phys_t::page_checksum(). Without this fix,
there should be less than 100 of them (when the OPT_PAGE_CHECKSUM
byte happens to encrypt to itself).

Reviewed by: Debarun Banerjee
Tested by: Matthias Leich
2025-01-09 13:21:38 +02:00
Marko Mäkelä
ed13d93a25 Fix mariadb-backup --backup with innodb_undo_log_truncate=ON
This fixes another regression that had been introduced in
commit b249a059da (MDEV-34850).

This should prevent failures of mariadb-backup --backup of
the following type:

mariabackup: Failed to read undo log tablespace space id …
and there is no undo tablespace truncation redo record.

This error has not been hit by our internal testing, and we
currently have no regression test to cover this.
2025-01-09 13:18:42 +02:00
Marko Mäkelä
ea19a6b38c MDEV-35699 Multi-batch recovery occasionally fails
recv_sys_t::parse<storing=NO>(): Do invoke
fil_space_set_recv_size_and_flags() and do parse enough of page 0
to facilitate that.

This fixes a regression that had been introduced in
commit b249a059da (MDEV-34850).
In a multi-batch crash recovery, we would fail to invoke
fil_space_set_recv_size_and_flags() while parsing the remaining log,
before starting the first recovery batch.

Reviewed by: Debarun Banerjee
Tested by: Matthias Leich
2025-01-09 13:18:30 +02:00
Sergei Golubchik
addc828363 Merge branch '10.5' into 10.6 2025-01-09 10:15:53 +01:00
Sergei Golubchik
9ddecc2164 heap-buffer-overflow in mariadb-backup
write of NULL ptr after the end of the allocated buffer
2025-01-09 10:00:36 +01:00
Sergei Golubchik
90bd638159 32-bit rdiff fixes 2025-01-09 10:00:36 +01:00
Sergei Golubchik
9929a0a76e MDEV-32576 increase query length in the InnoDB deadlock output
* increase target buffer size to 3072
* remove the parameter, just use the buffer size as a limit
2025-01-09 10:00:36 +01:00
Sergei Golubchik
c478b1ba08 MDEV-35598 foreign key error is unnecessary truncated
truncate it at 512 bytes (max allowed by the protocol), not 192
2025-01-09 10:00:36 +01:00
Sergei Golubchik
d26b47dfd4 MDEV-35550 main.log_slow test failure: expects count(*) 5 got 4
when testing MDEV-34539 create a table specifically for the test,
don't use a system table as a shortcut to save a couple of lines.

followup for 8d813f080b
2025-01-09 10:00:36 +01:00
Sergei Golubchik
deb20fb751 MDEV-32919 Cannot select particular field from IS.tables in case table needs upgrade from MySQL 5.7
use the same condition in
fill_schema_table_from_frm() when open_table_from_share() fails, as in
fill_schema_table_from_frm() when tdc_aquire_share() fails and as in
fill_schema_table_from_open() when open_table_from_share() fails
2025-01-09 10:00:36 +01:00
Sergei Golubchik
cc99a41502 cleanup: extract common condition into a function 2025-01-09 10:00:36 +01:00
Sergei Golubchik
a0e5dd5433 mysqltest: fix --sorted_results
only sort actual results not warnings or metadata
also work for vertical results
warnings are sorted separately
2025-01-09 10:00:36 +01:00
Sergei Golubchik
9b941dc51f MDEV-34494 restore broken feedback plugin
it must report feedback_server_uid otherwise report stats won't work.
2025-01-09 10:00:36 +01:00
Sergei Golubchik
74532f2355 MCOL-5819 disable lto for ColumnStore 2025-01-09 10:00:35 +01:00
Sergei Golubchik
b79723ffe3 MDEV-35384 Table performance_schema.session_status and other two tables are not shown in information_schema.tables for normal users
get_all_tables() skipped tables if the user has no privileges on
the schema itself and no granted privilege on any tables in the schema.

that is, it was skipping performance_schema tables (privileges
on them aren't explicitly granted, but internally hard-coded)

To fix:

* extend ACL_internal_table_access::check() method with
  `bool any_combination_will_do`
* fix all perfschema privilege checks to take it into account.
* don't reuse table_acl_check object for all tables, initialize it
  for every table otherwise GRANT_INTERNAL_INFO will leak
* remove incorrect privilege check from get_all_tables()
2025-01-09 10:00:35 +01:00
Sergei Golubchik
0706c01b88 cleanup: innodb.innodb_information_schema
don't disable query/result log unless the output is unstable.

and even then don't, but replace away unstable parts.
2025-01-09 10:00:35 +01:00
Sergei Golubchik
725b5e7794 MDEV-35335 implicit commit at START TRANSACTION doesn't reset characteristics 2025-01-09 10:00:35 +01:00
Sergei Golubchik
82fd202fa4 fix "enforce no trailing \n in Diagnostic_area messages"
cannot have an assert in Warning_info::push_warning()
because SQL command SIGNAL can set an absolutely arbitrary
message, even an empty one or ending with '\n'

move the assert into push_warning() and my_message_sql().

followup for 9508a44c37
2025-01-09 09:28:28 +01:00
Marko Mäkelä
17f01186f5 Merge 10.11 into 11.4 2025-01-09 07:58:08 +02:00
Marko Mäkelä
990b010b09 MDEV-35438 Annotate InnoDB I/O functions with noexcept
Most InnoDB functions do not throw any exceptions, not even indirectly
std::bad_alloc, which could be thrown by a C++ memory allocation function.
Let us annotate many functions with noexcept in order to reduce the code
footprint related to exception handling.

Reviewed by: Thirunarayanan Balathandayuthapani
2025-01-09 07:43:24 +02:00
Oleg Smirnov
505b7127c9 MDEV-32411 Item_sum arguments incorrectly reset to temp table fields which causes crash
The issue is caused by a logic error in Item_sum::get_tmp_table_item() method:
it resets arguments of the item to point to the result fields during
change_ref_to_tmp_fields() call. However, Item_sum arguments must not be modified.
It is enough for Item_sum objects to call ancestor's implementation
Item::get_tmp_table_item().

This fix is in accordance with MySQL commit 2e3dc09087c24798c90e05163ed3d931f6b93db3

Reviewer: Oleksandr Byelkin <sanja@mariadb.com>
2025-01-09 11:35:09 +07:00
Tony Chen
28b2958082 Add MTR to verify behavior on incompatible TLS configuration
Add a simple test to verify the server behaves in a safe manner if configured
with ciphers that aren't compatible with the server certificate.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2025-01-09 11:22:11 +11:00
Tony Chen
2294ecdf0e Add MTR to ensure startup fails with invalid ssl-cipher
Add a simple test to verify that the server will fail to start up when no valid
cipher suites are passed to `ssl-cipher`.

As different TLS libraries and versions have differing cipher suite support, it
would be a good idea to ensure the server behaves in a safe manner if it is
configured with invalid cipher suites.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2025-01-09 11:22:11 +11:00