mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
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:
parent
3ad4027a51
commit
3e43606de6
1 changed files with 3 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue