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.
This commit is contained in:
Daniel Black 2025-08-06 14:39:06 +10:00
commit 3e43606de6

View file

@ -3199,20 +3199,17 @@ static int reconnect(void)
}
#ifndef EMBEDDED_LIBRARY
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
static void status_info_cb(void *data, enum enum_mariadb_status_info type,
enum enum_session_state_type state_type, MARIADB_CONST_STRING *val)
{
va_list ap;
va_start(ap, type);
if (type == SESSION_TRACK_TYPE && va_arg(ap, int) == SESSION_TRACK_SCHEMA)
if (type == SESSION_TRACK_TYPE && state_type == 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)