Commit graph

196748 commits

Author SHA1 Message Date
Julius Goryavsky
3e34e4c161 MDEV-34820: wsrep_sst_mariabackup get_footprint() portability and accuracy fix
Added get_footprint() implementation for FreeBSD (and for other
non-Linux systems), and added "apparent file size" mode for Linux
to take into account the real file size (without compression) when
used with filesystems like ZFS.
2024-12-13 01:41:14 +01:00
Julius Goryavsky
b52f88edf8 MDEV-35387: wsrep_sst_rsync crash if aria_log_dir_path is defined
This commit fixes some functions in wsrep_sst_common
to ensure that now and in the future return codes from
a number of helper functions will be zero on success.
2024-12-13 01:41:07 +01:00
Julius Goryavsky
71a9b3bf16 galera sst scripts: fix for error hangling code
Fixed some issues in the script code, mainly related
to handling situations when a failure occurs:

1) the signal handler in the mariadb-backup SST script
   was using an uninitialized variable when trying to kill
   a hung streaming process;
2) inaccurate error messages were being logged sometime;
3) after completing SST, temporary or old (extra) files
   could remain in database directories.
2024-12-13 01:36:59 +01:00
Daniel Black
6dcd9de2a9 MDEV-34669: ER_NEED_REPREPARE on SELECT DEFAULT(name) FROM table1_containing_sequence
A prepared SELECT statement because of CF_REEXECUTION_FRAGILE needs to
check the table is the same definition as previously otherwise a
re-prepare of the statement can occur.

When running many 'SELECT DEFAULT(name) FROM table1_containing_sequence'
in parallel the TABLE_LIST::is_the_same_definition may be called when
m_table_ref_type is TABLE_REF_NULL because it hasn't been checked yet.

In this case populate the TABLE_LIST with the values determined by the
TABLE_SHARE and allow the execution to continue.

As a result of this, the main.ps_ddl test doesn't need to reprepare
as the defination hasn't changed. This is another case where
TABLE_LIST::is_the_same_definition is called when m_table_ref_type is
TABLE_REF_NULL, but that doesn't mean that the defination is different.
2024-12-13 08:07:00 +11:00
Alexander Barkov
ab9182470d MDEV-31366 Assertion `thd->start_time' failed in bool LOGGER::slow_log_print(THD*, const char*, size_t, ulonglong)
Fixing a wrong DBUG_ASSERT.

thd->start_time and thd->start_time_sec_part cannot be 0 at the same time.

But thd->start_time can be 0 when thd->start_time_sec_part is not 0,
e.g. after:

SET timestamp=0.99;
2024-12-12 20:32:56 +01:00
Oleksandr Byelkin
95fdfb733d In allocate_dynamic() fixed return value on error.
The previous value probably was copied from alloc_dynamic() where it
means number of elements.
2024-12-12 12:36:42 +01:00
Marko Mäkelä
9a25f2a5bb MDEV-35632: HandlerSocket uses deprecated auto_ptr
Let us suppress the deprecation warnings more specifically.

This fixes up commit d76f5774fe
2024-12-12 11:58:11 +02:00
Daniel Black
965e65d6bb MDEV-32686: Signal hander- minimise resource limit output.
Most resource limit information is excessive, particularly
limits that aren't limited.

We restructure the output by considering the Linux format
of /proc/limits which had its soft limits beginning at offset
26. "u"limited lines are skipped.

Example output:

Resource Limits (excludes unlimited resources):
Limit                     Soft Limit           Hard Limit           Units
Max stack size            8388608              unlimited            bytes
Max processes             127235               127235               processes
Max open files            32198                32198                files
Max locked memory         8388608              8388608              bytes
Max pending signals       127235               127235               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0

This is 8 lines less that what was before.

The FreeBSD limits file was /proc/curproc/rlimit and a different format
so a loss of non-Linux proc enabled OSes isn't expected.
2024-12-12 08:40:55 +11:00
Daniel Black
801587c821 MDEV-32686: minimise crash information
Provide bug url in addition to how to report the bug.

Remove obsolete information like key_buffers and used connections
as they haven't meaningfully added value to a bug report for quite
a while. Remove information that comes from long fixed interfaces
in glibc/kernel.

Encourage the use of a full backtrace from the core with debug
symbols.

Lets be realistic about the error messages, its the users we are addressing
not developers so wording around getting the information communicated
is the key aspect.

All the user readable text and instructions are in on place, as
non-understandable is the end of the reading process for the user.

Remove the duplicate printing of the query.
Use my_progname rather than "mysqld" to reflex the program name.

So the signal handler output is now in the form:
1. User instructions
2. Server Information
3. Stacktrace
4. connection/query/optimizer_switch
5. Core information and resource limits
6. Kernel information
2024-12-12 08:40:55 +11:00
Daniel Black
7181ea5663 MDEV-33245 SIGSEGV in wsrep_check_sequence
The segfault in wsrep_check_sequence is due to a
null pointer deference on:
  db_type= thd->lex->create_info.db_type->db_type;

Where create_info.db_type is null. This occured under
a used_engine==true condition which is set in the calling
function based on create_info.used_fields==HA_CREATE_USED_ENGINE.

However the create_info.used_fields was a left over
from the parsing of the previous failed CREATE TABLE where
because of its failure, db_type wasn't populated.

This is corrected by cleaning the create_info when we start
to parse ALTER SEQUENCE statements.

Other paths to wsrep_check_sequence is via CREATE SEQUENCE
and CREATE TABLE LIKE which both initialize the create_info
correctly.
2024-12-12 07:27:38 +11:00
Daniel Black
ee287821e3 MDEV-32561: WSREP FSM failure: (postfix) - enable galera.galera_sequences
The MDEV is fixed, so enable the test case again.
2024-12-12 07:27:38 +11:00
Daniel Black
807e4f320f Change my_umask{,_dir} to mode_t and remove os_innodb_umask
os_innodb_umask was of the incorrect type resulting in warnings
in clang-19. The correct type is mode_t.

As os_innodb_umask was set during innnodb_init from my_umask,
corrected the type there along with its companion my_umask_dir.
Because of this, the defaults mask values in innodb never
had an effect.

The resulting change allow found signed differences in
my_create{,_nosymlink}, open_nosymlinks:

mysys/my_create.c:47:20: error: operand of ?: changes signedness from ‘int’ to ‘mode_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
   47 |      CreateFlags ? CreateFlags : my_umask);

Ref: clang-19 warnings:

[55/123] Building CXX object storage/innobase/CMakeFiles/innobase.dir/os/os0file.cc.o
storage/innobase/os/os0file.cc:1075:46: warning: implicit conversion loses integer precision: 'ulint' (aka 'unsigned long') to 'mode_t' (aka 'unsigned int') [-Wshorten-64-to-32]
 1075 |                 file = open(name, create_flag | O_CLOEXEC, os_innodb_umask);
      |                        ~~~~                                ^~~~~~~~~~~~~~~
storage/innobase/os/os0file.cc:1249:46: warning: implicit conversion loses integer precision: 'ulint' (aka 'unsigned long') to 'mode_t' (aka 'unsigned int') [-Wshorten-64-to-32]
 1249 |                 file = open(name, create_flag | O_CLOEXEC, os_innodb_umask);
      |                        ~~~~                                ^~~~~~~~~~~~~~~
storage/innobase/os/os0file.cc:1381:45: warning: implicit conversion loses integer precision: 'ulint' (aka 'unsigned long') to 'mode_t' (aka 'unsigned int') [-Wshorten-64-to-32]
 1381 |         file = open(name, create_flag | O_CLOEXEC, os_innodb_umask);
      |                ~~~~                                ^~~~~~~~~~~~~~~
2024-12-11 17:21:01 +11:00
Daniel Black
bf7cfa2535 MDEV-35574 remove obsolete pthread_exit calls
Threads can normally exit without a explicit pthread_exit call.

There seem to date to old glibc bugs, many around 2.2.5.

The semi related bug was https://bugs.mysql.com/bug.php?id=82886.

To improve safety in the signal handlers DBUG_* code was removed.

These where also needed to avoid some MSAN unresolved stack issues.

This is effectively a backport of 2719cc4925.
2024-12-10 12:12:20 +11:00
Dave Gosselin
d92d271648 MDEV-35583 Tests failing on macOS
These tests rely on THR_KEY_mysys but it is not initialized.  On
Linux, the corresponding thread variable is null, but on macOS it has a
nonzero value.  In all cases, initialize the variable explicitly by
calling MY_INIT and my_end appropriately.
2024-12-10 11:46:28 +11:00
Oleksandr Byelkin
694d91da89 MDEV-35604: SIGSEGV in filter_query_type | log_statement_ex / auditing
Take into account that filter_query_type can get empty query after
skip_set_statement run on incorrect query.
2024-12-09 09:42:26 +01:00
Kristian Nielsen
2ab10fbec2 MDEV-24959: ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)
The Write_rows_log_event originally allocated the m_rows_buf up-front, and
thus is_valid() checks that the buffer is allocated correctly. But at some
point this was changed to allocate the buffer lazily on demand. This means
that a a valid event can now have m_rows_buf==NULL. The is_valid() code was
not changed, and thus is_valid() could return false on a valid event.

This caused a bug for REPLACE INTO t() VALUES(), () which generates a
write_rows event with no after image; then the m_rows_buf was never
allocated and is_valid() incorrectly returned false, causing an error in
some other parts of the code.

Also fix a couple of missing special cases in the code for mysqlbinlog to
correctly decode (in comments) row events with missing after image.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-12-05 08:17:35 +01:00
Kristian Nielsen
b4fde50b1f MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
The partitioning error handling code was looking at
thd->lex->alter_info.partition_flags in non-alter-table cases, in which cases
the value is stale and contains whatever was set by any earlier ALTER TABLE.
This could cause the wrong error code to be generated, which then in some cases
can cause replication to break with "different errorcode" error.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-12-05 08:17:35 +01:00
Kristian Nielsen
5a3a16154f MDEV-35514: Too much mtr output from analyze: sync_with_master
Limit SHOW BINLOG/RELAYLOG EVENTS in show_rpl_debug_info.inc to 200 lines.

Reviewed-by: Daniel Black <daniel@mariadb.org>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-12-05 08:17:35 +01:00
Kristian Nielsen
daea59a81d MDEV-31761: mariadb-binlog prints fractional timestamp part incorrectly
Fractional part < 100000 microseconds was printed without leading zeros,
causing such timestamps to be applied incorrectly in mariadb-binlog | mysql

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-12-05 08:17:35 +01:00
Oleksandr Byelkin
673936173f Make sql_acl_getsort.ic named in line with other files i.e. sql_acl_getsort.inl 2024-12-04 17:22:29 +01:00
Aleksey Midenkov
aa9d5aea48 MDEV-34770 GCC warning fix
kvm-bintar-trusty-x86: warning: ‘no_sanitize’ attribute directive
ignored [-Wattributes]

The attribute is supported since gcc 8.
2024-12-04 18:22:31 +03:00
Jason Cu
2bf9f0d422 MDEV-32395: update_depend_map_for_order: SEGV at /mariadb-11.3.0/sql/sql_select.cc:16583
MDEV-32329 (patch) pushdown from having into where: Server crashes at sub_select

When generating an Item_equal with a Item_ref that refers to a field
outside of a subselect, remove_item_direct_ref() causes the dependency
(depended_from) on the outer select to be lost, which causes trouble
for code downstream that can no longer determine the scope of the Item.
Not calling remove_item_direct_ref() retains the Item's dependency.

Test cases from MDEV-32395 and MDEV-32329 are included.

Some fixes from other developers:

Monty:
- Fixed wrong code in Item_equal::create_pushable_equalities()
  that could cause wrong item to be used if there was no matching items.
Daniel Black:
- Added test cases from MDEV-32329
Igor Babaev:
- Provided fix for removing call to remove_item_direct_ref() in
  eliminate_item_equal()

MDEV-32395: update_depend_map_for_order: SEGV at /mariadb-11.3.0/sql/sql_select.cc:16583

Include test cases from MDEV-32329.
2024-12-04 13:22:45 +02:00
Monty
8e9aa9c6b0 Fix MariadDB to compile with gcc 7.5.0
gcc 7.5.0 does not understand __attribute__((no_sanitize("undefined"))
I moved the usage of this attribute from sql/set_var.h to
include/my_attribute.h and created a macro for it depending on
compiler used.
2024-12-04 12:58:00 +02:00
Julius Goryavsky
818c84ad45 galera mtr tests: post-fix changes to test suite 2024-12-03 15:08:37 +01:00
Teemu Ollakka
a2575a0703 MDEV-35465 Async replication stops working on Galera async replica node when parallel replication is enabled
Parallel slave failed to retry in retry_event_group() with error

    WSREP: Parallel slave worker failed at wsrep_before_command() hook

Fix wsrep transaction cleanup/restart in retry_event_group() to properly
clean up previous transaction by calling wsrep_after_statement().
Also move call to reset error after call to wsrep_after_statement()
to make sure that it remains effective.

Add a MTR test galera_as_slave_parallel_retry to reproduce the error
when the fix is not present.

Other issues which were detected when testing with sysbench:

Check if parallel slave is killed for retry before waiting for prior
commits in THD::wsrep_parallel_slave_wait_for_prior_commit(). This
is required with slave-parallel-mode=optimistic to avoid deadlock
when a slave later in commit order manages to reach prepare phase
before a lock conflict is detected.

Suppress wsrep applier specific warning for slave threads.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 15:05:32 +01:00
Daniele Sciascia
c772344510 Allow mysqltest to run COMMIT statement under --ps-protocol
Fix the regular expression that determines which statements
can use the Prepared Statement API, when --ps-protocol is
used. The current regular expression allows COMMIT only if
it is followed by a whitespace.
Meaning that statement "COMMIT ;" is allowed to run with
prepared statements, while "COMMIT;" is not.
Fix the filter so that both are allowed.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 14:56:45 +01:00
Daniele Sciascia
85bcc7d263 MDEV-35446 Sporadic failure of galera.galera_insert_multi
Test failed sporadically when --ps-protocol was enabled:
a transaction that was BF aborted on COMMIT would succeed
instead of reporting the expected deadlock error.
The reason for the failure was that, depending on timing,
the transaction was BF aborted while the COMMIT statement
was being prepared through a COM_STMT_PREPARE command.
In the failing cases, the transaction was BF aborted
after COM_STMT_PREPARE had already disabled the diagnostics
area of the client. Attempt to override the deadlock error
towards the end of dispatch_command() would be skipped,
resulting in a successful COMMIT even if the transaction
is aborted.
This bug affected the following MTR tests:
 - galera_insert_multi
 - galera_nopk_unicode

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 14:55:09 +01:00
Aleksey Midenkov
b8ad202da1 MDEV-34770 UBSAN: runtime error: load of address 0x... with
insufficient space for an object of type 'uchar' in sys_vars.inl

Disable UBSAN for global_var_ptr()/session_var_ptr() (none of
"undefined" suboptions for gcc-13 worked).
2024-12-03 13:49:43 +03:00
Aleksey Midenkov
13f93da1f6 MDEV-33783 CREATE SERVER segfaults on wrong mysql.servers
Do basic checking of mysql.servers compatibility.
2024-12-03 13:49:43 +03:00
Aleksey Midenkov
27c25ceedb MDEV-31030 Assertion `!error' failed in ha_partition::update_row on UPDATE
Removing wrong assertion as division by zero was caused by valid
input.
2024-12-03 13:49:42 +03:00
Aleksey Midenkov
55b5993205 Cleanup: make_keypart_map inline
for easier debugging.
2024-12-03 13:49:42 +03:00
Aleksey Midenkov
3835437eb8 MDEV-15330 Cleanup: load_data.test removed 2024-12-03 13:49:42 +03:00
Aleksey Midenkov
c20f09ddcf Dtrace cmake fix for clang
When there are GCC-incompatible compiler flags dtrace fails like this:

gcc: error: unrecognized command-line option ‘-fno-limit-debug-info’
gcc: error: unrecognized command-line option ‘-mbranches-within-32B-boundaries’
"gcc .dtrace-temp.3fd6bacf.c" failed
Usage /usr/bin/dtrace [--help] [-h | -G] [-C [-I<Path>]] -s File.d [-o <File>]
2024-12-03 13:49:42 +03:00
Jan Lindström
8a32ae5d6d MDEV-32779 : galera_concurrent_ctas: assertion in the galera::ReplicatorSMM::finish_cert()
I could not reproduce reported assertion. However, I could
reporoduce test failure because missing wait_condition
and error in test case. Added missing wait_condition and
fixed error in test case to make test stable.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 03:19:35 +01:00
Jan Lindström
f219fb8489 MDEV-35355 : Galera test failure on galera_sr.mysql-wsrep-features#165
Problem was that in DeadlockChecker::trx_rollback() we hold lock_sys
before we call wsrep_handle_SR_rollback() where THD::LOCK_thd_data
(and some cases THD::LOCK_thd_kill) are acquired. This is against
current mutex ordering rules.

However, acquiring THD::LOCK_thd_data is not necessary because we
always are in victim_thd context, either client session is rolling
back or rollbacker thread should be in control. Therefore, we should
always use wsrep_thd_self_abort() and then no additional mutexes are
required.

Fixed by removing locking of THD::LOCK_thd_data and using only
wsrep_thd_self_abort(). In debug builds added assertions to
verify that we are always in victim_thd context.

This fix is for MariaDB 10.5 and we already have a test case
that sporadically fail in Jenkins before this fix.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 03:19:35 +01:00
Jan Lindström
af50783fcd MDEV-35471 : Sporadic failures in the galera_pc_recovery mtr test
For some reason InnoDB was disabled at --wsrep-recover call.
Added --loose-innodb to command like to make sure InnoDB is
enabled.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 03:19:35 +01:00
Jan Lindström
bf3e16eb81 MDEV-35467 : WSREP: read_completion_condition(): shutdown while in init ()
Ignore expected warning from Galera library when connections
are shutdown.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-12-03 03:19:35 +01:00
Yuchen Pei
d0fcac4450
MDEV-35422 Fix spider group by handler trying to use fake group by fields
This is a fixup of MDEV-26345 commit
77ed235d50.

In MDEV-26345 the spider group by handler was updated so that it uses
the item_ptr fields of Query::group_by and Query::order_by, instead of
item. This was and is because the call to
join->set_items_ref_array(join->items1) during the execution stage,
just before the execution replaces the order-by / group-by item arrays
with Item_temptable_field.

Spider traverses the item tree during the group by handler (gbh)
creation at the end of the optimization stage, and decides a gbh could
handle the execution of the query. Basically spider gbh can handle the
execution if it can construct a well-formed query, executes on the
data node, and store the results in the correct places. If so, it will
create one, otherwise it will return NULL and the execution will use
the usual handler (ha_spider instead of spider_group_by_handler). To
that end, the general principle is the items checked for creation
should be the same items later used for query construciton. Since in
MDEV-26345 we changed to use the item_ptr field instead of item field
of order-by and group-by in query construction, in this patch we do
the same for the gbh creation.

The item_ptr field could be the uninitialised NULL value during the
gbh creation. This is because the optimizer may replace a DISTINCT
with a GROUP BY, which only happens if the original GROUP BY is empty.
It creates the artificial GROUP BY by calling create_distinct_group(),
which creates the corresponding ORDER object with item field aligning
with somewhere in ref_pointer_array, but leaving item_ptr to be NULL.
When spider finds out that item_ptr is NULL, it knows there's some
optimizer skullduggery and it is passed a query different from the
original. Without a clear contract between the server layer and the
gbh, it is better to be safe than sorry and not create the gbh in this
case.

Also add a check and error reporting for the unlikely case of item_ptr
changing from non-NULL at gbh construction to NULL at execution to
prevent server crash.

Also, we remove a check added in MDEV-29480 of order by items being
aggregate functions. That check was added with the premise that spider
was including auxiliary SELECT items which is referenced by ORDER BY
items. This premise was no longer true since MDEV-26345, and caused
problems such as MDEV-29546, which was fixed by MDEV-26345.
2024-12-03 10:32:42 +11:00
Oleksandr Byelkin
5c86f3df33 MDEV-35522: MariaDB Audit does not detect all DCLs forms when masking password
1. skip OR REPLACE
 (to make it filter_query_type made recursive)

2. skip SET STATEMENT ... FOR before checking
statements with passwords
2024-12-02 15:44:12 +01:00
Alexander Barkov
3de412fbe8 MDEV-25593 Assertion `0' failed in Type_handler_temporal_result::Item_get_date on double EXECUTE
When binding to NULL, DEFAULT or IGNORE from an Item value, Item_param did not
change m_type_handler, so its value remained from the previous bind.
Thid led to DBUG_ASSERTs in Item_param::get_date() and
Timestamp_or_zero_datetime_native_null.

Fix:

Set Item_param::m_type_handler to &type_handler_null when
binding from an Item returning NULL.

This patch also fixes MDEV-35427.
2024-12-02 11:19:12 +01:00
Marko Mäkelä
ecf2e131bd MDEV-31174 fixup: clang++-20 -Wnontrivial-memcall 2024-12-02 11:04:38 +02:00
Alexander Barkov
01cc92e098 MDEV-34700 Connect SQLite3 MTR test fails due to various charset/collation related output changes
Re-recorded test results with the COLLATE clause, according to MDEV-29446.
2024-12-01 13:52:41 +04:00
Alexander Barkov
fdb6db6b47 MDEV-29462 ASAN: heap-use-after-free in Binary_string::copy on DO CONVERT
Item_char_typecast::val_str_generic() uses Item::str_value as a buffer.
Item::val_str_ascii() also used Item::str_value as a buffer.
As a result, str_value tried to copy to itself.

Fixing val_str_ascii() to use a local buffer instead of str_value.
2024-11-28 16:34:32 +04:00
Jan Lindström
f39217da0c MDEV-35473 : Sporadic failures in the galera_3nodes.galera_evs_suspect_timeout mtr test
Remove unnecessary sleep and replace it with proper wait_conditions.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-11-28 01:02:35 +01:00
Jan Lindström
e7e06b3cb7 MDEV-35481 : ER_LOCK_DEADLOCK instead of ER_NO_SUCH_TABLE in galera_var_ignore_apply_errors
Add wait_condition before select and set wsrep_sync_wait=0 to avoid
possible deadlock.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-11-28 01:02:35 +01:00
Jan Lindström
ff45fdac29 MDEV-35440 : Protocol error warning in the galera_wsrep_schema_detached test
Make sure that node_1 remains in primary view by increasing it's
weight. Add suppression on expected warnings because we kill
node_2.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2024-11-28 01:02:35 +01:00
Julius Goryavsky
8bc254dd62 MDEV-26516: WSREP: Record locking is disabled in this thread, but the table being modified
We periodically observe assertion failures in the mtr tests,
specifically in the /storage/innobase/row/row0ins.cc file,
following a WSREP error. The error message is: 'WSREP: record
locking is disabled in this thread, but the table being modified
is not mysql/wsrep_streaming_log: mysql/innodb_table_stats.'"
This issue seems to occur because, upon opening the table,
innodb_stats_auto_recalc may trigger, which Galera does not
anticipate. This commit should fix this bug.
2024-11-28 01:02:35 +01:00
Oleksandr Byelkin
0ea19c12fd MDEV-35507 ed25519 authentication plugin create user statement trigger plain text password in audit log
Mask also all cases of "password(PWD" in CREATE/ALTER USER and GRANT.
(minimal fix)
2024-11-27 19:45:33 +01:00
Ivan Prisyazhnyy
f39a61505f MDEV-33075 [backport/2f5174e556] use more robust self-pipe to wake up poll() in break_connect_loop()
Backport of 2f5174e556:
MDEV-33075 Resolve server shutdown issues on macOS, Solaris, and FreeBSD.

This commit addresses multiple server shutdown problems observed on macOS,
Solaris, and FreeBSD:

1. Corrected a non-portable assumption where socket shutdown was expected
to wake up poll() with listening sockets in the main thread.

Use more robust self-pipe to wake up poll() by writing to the pipe's write
end.

Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
2024-11-27 14:59:50 +02:00
Ivan Prisyazhnyy
c4cadb768f MDEV-33075 [backport/2f5174e556] fix rnd crash on macOS from pthread_kill(signal_handler)
Backport of 2f5174e556:
MDEV-33075 Resolve server shutdown issues on macOS, Solaris, and FreeBSD.

This commit addresses multiple server shutdown problems observed on macOS,
Solaris, and FreeBSD:

2. Fixed a random crash on macOS from pthread_kill(signal_handler)
when the signal_handler was detached and the thread had already exited.

Use more robust `kill(getpid(), SIGTERM)` to wake up the signal handler
thread.

Additionally, the shutdown code underwent light refactoring
for better readability and maintainability:

- Modified `break_connect_loop()` to no longer wait for the main thread,
  aligning behavior with Windows (since 10.4).
2024-11-27 14:59:50 +02:00