mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
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>
This commit is contained in:
parent
4f1170d9db
commit
4b058a33df
1 changed files with 6 additions and 3 deletions
|
|
@ -3199,17 +3199,20 @@ static int reconnect(void)
|
|||
}
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
static void status_info_cb(void *data, enum enum_mariadb_status_info type,
|
||||
enum enum_session_state_type state_type, MARIADB_CONST_STRING *val)
|
||||
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
|
||||
{
|
||||
if (type == SESSION_TRACK_TYPE && state_type == SESSION_TRACK_SCHEMA)
|
||||
va_list ap;
|
||||
va_start(ap, type);
|
||||
if (type == SESSION_TRACK_TYPE && va_arg(ap, int) == SESSION_TRACK_SCHEMA)
|
||||
{
|
||||
MARIADB_CONST_STRING *val= va_arg(ap, MARIADB_CONST_STRING *);
|
||||
my_free(current_db);
|
||||
if (val->length)
|
||||
current_db= my_strndup(PSI_NOT_INSTRUMENTED, val->str, val->length, MYF(MY_FAE));
|
||||
else
|
||||
current_db= NULL;
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
#else
|
||||
#define mysql_optionsv(A,B,C,D) do { } while(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue