1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-09 11:41:36 +03:00
Commit Graph

1928 Commits

Author SHA1 Message Date
Marko Mäkelä
e8ef8c0055 Merge 10.11 into 11.4 2025-09-24 13:40:09 +03:00
Daniel Black
8c7077346c MDEV-35224 ASAN error in mariadb client with \c
Mariadb monitor when a line is cancelled, provided
its more than one line, passes that text to the
add_history of libedit. This string that has been
passed however isn't null terminated resulting
in an ASAN error within the libedit code.

fix_history where the add_history is called
is called by the com_clear, associated with
the \c command, and com_go. An using the c_ptr
adds a null character onto the end of the string.
2025-09-24 10:27:53 +10:00
Oleksandr Byelkin
15b1426c3a Merge branch '10.11' into bb-11.4-release 2025-09-15 16:17:33 +02:00
Daniel Black
bf60478fd6 MDEV-34388/MDEV-36701: mysql status_info_cb disable varargs warnings
Clang complains that the callback is using a variadic based on an enum.

client/mysql.cc:3207:16: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
 3207 |   va_start(ap, type);

This is part of the C/C API this has been referred as bug:
* CONC-789 MARIADB_OPT_STATUS_CALLBACK Variadic around enums is undefined behaviour

In the mean time, we are just disabling the warning.

Reviewer: Jimmy Hu <jimmy.hu@mariadb.com>
2025-09-11 10:02:43 +10:00
Daniel Black
4b058a33df Revert "MDEV-36701 command line client doesn't check session_track information (fix)"
This reverts commit 3e43606de6.

This caused Clang-18+ UBSAN errors:

SUMMARY: UndefinedBehaviorSanitizer: function-type-mismatch libmariadb/libmariadb/mariadb_lib.c:2723:17

+/libmariadb/libmariadb/mariadb_lib.c:2628:3: runtime error: call to function
  status_info_cb(void*, enum_mariadb_status_info, enum_session_state_type, st_ma_const_string*)
  through pointer to incorrect function type 'void (*)(void *, enum enum_mariadb_status_info, ...)'
+/client/mysql.cc:3204: note: status_info_cb(void*, enum_mariadb_status_info, enum_session_state_type, st_ma_const_string*) defined here

Reviewer: Jimmy Hu <jimmy.hu@mariadb.com>
2025-09-11 10:02:43 +10:00
Marko Mäkelä
257f4b30ef Merge 10.11 into 11.4 2025-09-03 10:32:56 +03:00
Nikita Malyavin
0108664a8a Merge branch 10.11 into 11.4
# Conflicts:
#	sql/handler.h
#	sql/log_event.h
#	sql/log_event_server.cc
2025-09-02 15:58:39 +02:00
Daniel Black
3e43606de6 MDEV-36701 command line client doesn't check session_track information (fix)
Corrects clang Wvargs warning:

client/mysql.cc:3205:16: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]

Because there is only one mode we are interested in that is tested
before the varargs this is safe to do.
2025-08-07 11:34:17 +10:00
Daniel Black
4f9221ae88 MDEV-36542: remove _lint macro which is unused
Attribute noreturn functions don't need
a return afterwards.

aria_pack was missing the noreturn attribute
on its my_end function.
2025-07-29 13:15:02 +10:00
Daniel Black
6fd57f478f MDEV-36542 Remove UNINIT_VAR(x)=x under UBSAN
Clang processes the "int x=x" code from UNINIT_VAR
literally resulting in an uninitialized read and write.
This is something we want to avoid. Gcc does the same
without emitting warnings.

As the UNINIT_VAR was around avoiding compiler false detection,
and clang doesn't false detect, is default action is a
noop.

Static analysers (examined Infer and SonarQube) are
clang based and have the same detection.

Using a __clang__ instead of WITH_UBSAN would acheived
a better result, however reviewer wanted to keep WITH_UBSAN
only.

LINT_INIT_STRUCT is no longer required, even a gcc-4.8.5
doesn't warn with this construct removed which matches
the comment that it was fixed in gcc ~4.7.

mysql.cc - all paths in com_go populate buff before use.

json: Item_func_json_merge::val_str
  LINT_INIT(js2) unneeded as usage in the previous statements
  it is explicitly initialized to NULL.

Item_func_json_contains_path::val_bool n_found is guarded
by an uninitialized read by mode_one and from
gcc-13.3.0 in Ubuntu 24.04 this is detected. As the only
remaining use of LINIT_INIT this usage has been applied
with the expanded macro with the unused _lint define removed.

The LINT_INIT macro is removed.

_ma_ck_delete - org_key only valid under share->now_transactional
likewise with _ma_ck_write_btree_with_log

connect engine never used anything that FORCE_INIT_OF_VARS
would change.

Reviewer: Monty
2025-07-29 13:15:02 +10:00
Sergei Golubchik
c4ed889b74 Merge branch '10.11' into 11.4 2025-07-28 19:40:10 +02:00
Sergei Golubchik
29277bf9d9 MDEV-36701 command line client doesn't check session_track information
subscribe for SESSION_TRACK_SCHEMA messages and change the db accordingly
2025-07-17 09:18:18 +02:00
Marko Mäkelä
17f01186f5 Merge 10.11 into 11.4 2025-01-09 07:58:08 +02:00
Marko Mäkelä
420d9eb27f Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00
Marko Mäkelä
b251cb6a4f Merge 10.5 into 10.6 2025-01-08 08:48:21 +02:00
Sergei Golubchik
b059f60510 MDEV-35704 Error message mispelled when altering table engine to MEMORY
reset progress report output before printing the error message.
need to flush(stdout), because error message goes to stderr
2025-01-07 16:31:39 +01:00
Marko Mäkelä
2719cc4925 Merge 10.11 into 11.4 2024-12-02 11:35:34 +02:00
Marko Mäkelä
3d23adb766 Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
Marko Mäkelä
7d4077cc11 Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
Alexander Barkov
225c17d35c MDEV-34090 Client allows to set character set to utf32 and crashes on the next command
Disallowing character sets with mbminlen>1 in the client.
2024-11-26 13:57:55 +04:00
Sergei Petrunia
2c3b298337 Merge 11.2 into 11.4 2024-09-09 14:40:02 +03:00
Sergei Petrunia
abd98336d2 Merge 10.11 -> 11.2 2024-09-09 13:50:38 +03:00
Julius Goryavsky
d058be62b8 Merge branch '10.6' into '10.11' 2024-09-02 03:49:03 +02:00
Julius Goryavsky
bac0804d81 Merge branch '10.5' into '10.6' 2024-09-01 06:51:25 +02:00
Marko Mäkelä
44733aa8cf Merge 11.2 into 11.4 2024-08-29 19:10:38 +03:00
Marko Mäkelä
e91a799458 Merge 10.11 into 11.2 2024-08-29 16:02:57 +03:00
Oleksandr Byelkin
5a61fd5819 MDEV-34831: MDEV-34704 introduces a typo, --qick
Fix MDEV-34704 typos.
2024-08-29 12:30:05 +02:00
Oleksandr Byelkin
3a1ff7398a Merge branch '10.6' into 10.11 2024-08-29 12:14:44 +02:00
Oleksandr Byelkin
a4654ecceb Merge branch '10.5' into 10.6 2024-08-29 11:28:01 +02:00
Oleksandr Byelkin
872dbec935 MDEV-34704 Quick mode produces the bug for mariadb client
--quick-max-column-width parameter added to limit field
    width in --quick mode.
2024-08-28 19:07:50 +02:00
Alexander Barkov
c4bf4ce948 Merge remote-tracking branch 'origin/11.2' into 11.4 2024-06-17 15:46:39 +04:00
Marko Mäkelä
d34289a3e2 Merge 10.11 into 11.1 2024-06-17 09:21:50 +03:00
Marko Mäkelä
346a0c1402 Merge 10.6 into 10.11 2024-06-17 09:08:07 +03:00
Marko Mäkelä
e60acae655 Merge 10.5 into 10.6 2024-06-17 08:40:07 +03:00
Monty
fef32fd9ad MDEV-34406 Enhance mariadb_upgrade to print failing query in case of error
To make this possible, it was also necessary to enhance the mariadb
client with the option --print-query-on-error.
This option can also be very useful when running a batch of queries
through the mariadb client and one wants to find out where things goes
wrong.

TODO: It would be good to enhance mariadb_upgrade to not call the mariadb
client for executing queries but instead do this internally.  This
would have made this patch much easier!

Reviewed by: Sergei Golubchik <serg@mariadb.com>
2024-06-16 10:51:33 +03:00
Marko Mäkelä
b81d717387 Merge 10.6 into 10.11 2024-06-11 12:50:10 +03:00
Marko Mäkelä
27834ebc91 Merge 10.5 into 10.6 2024-06-10 15:22:15 +03:00
Oleksandr Byelkin
77c4c0f256 MDEV-34203 Sandbox mode \- is not compatible with --binary-mode
"Process" sandbox short command put by masqldump to avoid an error.
2024-06-07 14:07:54 +02:00
Oleksandr Byelkin
99b370e023 Merge branch '11.2' into 11.4 2024-05-21 19:38:51 +02:00
Sergei Golubchik
f9807aadef Merge branch '10.11' into 11.0 2024-05-12 12:18:28 +02:00
Sergei Golubchik
a6b2f820e0 Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
Sergei Golubchik
7b53672c63 Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
Sergei Golubchik
2025597c0b MDEV-21778 Disable system commands in mysql/mariadb client
mysql --sandbox

disables system (\!), tee (\T), pager with an argument(\P foo), source (\.)

does *not* disable edit (\e). Use EDITOR=/bin/false to disable
or, for example, EDITOR=rnano for something more useful

does *not* disable pager (\P) without an argument. Use
PAGER=cat or, for example PAGER=less LESSSECURE=1 for something
more useful

using a disabled command is an error, which can be ignored with --force

Also, a "sandbox" command (\-) - enables the sandbox mode until EOF
(current file or the session, if interactive)
2024-05-06 17:16:10 +02:00
Sergei Golubchik
83aedeacc4 cleanup: remove __attribute__((unused)) from mysql.cc
the client is C++, use a much more concise C++ syntax

as a bonus, arguments that are used, are no longer marked "unused"
2024-05-06 17:16:10 +02:00
Sergei Golubchik
994a0de96b cleanup: reorder mysql help output 2024-05-06 17:16:10 +02:00
Sergei Golubchik
98b157fdee cleanup: unused OPT_xxx and client_priv.h 2024-05-06 17:16:10 +02:00
Oleksandr Byelkin
fa69b085b1 Merge branch '11.3' into 11.4 2024-02-15 13:53:21 +01:00
Sergei Golubchik
6b900330b9 show in mariadb cli whether server cert was verified 2024-02-04 22:19:19 +01:00
Sergei Golubchik
853bdf576f auto-disable --ssl-verify-server-cert in clients, if
* --ssl-verify-server-cert was not enabled explicitly, and
* CA was not specified, and
* fingerprint was not specified, and
* protocol is TCP, and
* no password was provided

insecure passwordless logins are common in test environment, let's
not break them. practically, it hardly makes sense to have strong
MitM protection if an attacker can simply login without a password.

Covers mariadb, mariadb-admin, mariadb-binlog, mariadb-dump
2024-02-04 22:19:19 +01:00
Sergei Golubchik
585c096aa5 cleanup: unify client's setting of ssl options 2024-02-03 11:25:13 +01:00