summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-06-13 09:44:40 +0200
committerSergei Golubchik <serg@mariadb.org>2022-11-01 15:40:49 +0100
commit749c12782298dce721656cd357e339643a7d8af4 (patch)
treeb3191c214fe7b2d00b6c17bbb5e32f2074db4681
parent2bd41fc5bf765bb9b1b2caa872070b271fc7c039 (diff)
downloadmariadb-git-749c12782298dce721656cd357e339643a7d8af4.tar.gz
MDEV-5215 prerequisite of prerequisite: if DB is not mentioned in connect ignore errors of switching to it
-rw-r--r--client/mysqltest.cc25
-rw-r--r--mysql-test/main/init_connect.result32
-rw-r--r--mysql-test/main/init_connect.test34
-rw-r--r--mysql-test/main/userstat-badlogin-4824.result4
-rw-r--r--mysql-test/main/userstat-badlogin-4824.test4
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_load.inc8
-rw-r--r--mysql-test/suite/perfschema/r/connection_type_notwin.result2
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_h.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u.result8
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result8
-rw-r--r--mysql-test/suite/perfschema/t/connection_type_notwin.test2
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result4
17 files changed, 98 insertions, 81 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index f9e6610e874..99d02094c80 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5794,6 +5794,7 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
con - connection structure to be used
host, user, pass, - connection parameters
db, port, sock
+ default_db - 0 if db was explicitly passed
DESCRIPTION
This function will try to establish a connection to server and handle
@@ -5811,7 +5812,8 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
int connect_n_handle_errors(struct st_command *command,
MYSQL* con, const char* host,
const char* user, const char* pass,
- const char* db, int port, const char* sock)
+ const char* db, int port, const char* sock,
+ my_bool default_db)
{
DYNAMIC_STRING *ds;
int failed_attempts= 0;
@@ -5852,8 +5854,10 @@ int connect_n_handle_errors(struct st_command *command,
mysql_options(con, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqltest");
- while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
- CLIENT_MULTI_STATEMENTS))
+ while (!mysql_real_connect(con, host, user, pass,
+ (default_db ? "" : db),
+ port, (sock ? sock : 0),
+ CLIENT_MULTI_STATEMENTS))
{
/*
If we have used up all our connections check whether this
@@ -5893,6 +5897,13 @@ do_handle_error:
return 0; /* Not connected */
}
+ if (default_db && db && db[0] != '\0')
+ {
+ mysql_select_db(con, db);
+ // Ignore errors intentionally
+ }
+
+
var_set_errno(0);
handle_no_error(command);
revert_properties();
@@ -5946,6 +5957,7 @@ void do_connect(struct st_command *command)
int connect_timeout= 0;
char *csname=0;
struct st_connection* con_slot;
+ my_bool default_db;
static DYNAMIC_STRING ds_connection_name;
static DYNAMIC_STRING ds_host;
@@ -6152,7 +6164,12 @@ void do_connect(struct st_command *command)
/* Use default db name */
if (ds_database.length == 0)
+ {
dynstr_set(&ds_database, opt_db);
+ default_db= 1;
+ }
+ else
+ default_db= 0;
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
@@ -6167,7 +6184,7 @@ void do_connect(struct st_command *command)
if (connect_n_handle_errors(command, con_slot->mysql,
ds_host.str,ds_user.str,
ds_password.str, ds_database.str,
- con_port, ds_sock.str))
+ con_port, ds_sock.str, default_db))
{
DBUG_PRINT("info", ("Inserting connection %s in connection pool",
ds_connection_name.str));
diff --git a/mysql-test/main/init_connect.result b/mysql-test/main/init_connect.result
index 11bb6036156..1476d846078 100644
--- a/mysql-test/main/init_connect.result
+++ b/mysql-test/main/init_connect.result
@@ -1,23 +1,23 @@
-connect con0,localhost,root,,;
+connect con0,localhost,root,,test;
connection con0;
select hex(@a);
hex(@a)
NULL
-connect con1,localhost,user_1,,;
+connect con1,localhost,user_1,,test;
connection con1;
select hex(@a);
hex(@a)
610063
connection con0;
set global init_connect="set @a=2;set @b=3";
-connect con2,localhost,user_1,,;
+connect con2,localhost,user_1,,test;
connection con2;
select @a, @b;
@a @b
2 3
connection con0;
set GLOBAL init_connect=DEFAULT;
-connect con3,localhost,user_1,,;
+connect con3,localhost,user_1,,test;
connection con3;
select @a;
@a
@@ -25,7 +25,7 @@ NULL
connection con0;
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
-connect con4,localhost,user_1,,;
+connect con4,localhost,user_1,,test;
connection con4;
select hex(a) from t1;
hex(a)
@@ -33,7 +33,7 @@ hex(a)
616263
connection con0;
set GLOBAL init_connect="adsfsdfsdfs";
-connect con5,localhost,user_1,,;
+connect con5,localhost,user_1,,test;
connection con5;
select @a;
ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed)
@@ -53,7 +53,7 @@ create table t2 (y int);
create user mysqltest1@localhost;
grant all privileges on test.* to mysqltest1@localhost;
set global init_connect="create procedure p1() select * from t1";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
call p1();
x
@@ -69,7 +69,7 @@ begin\
select * from t1;\
set @x = x;
end";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
call p1(42);
count(*)
@@ -84,7 +84,7 @@ select @x;
connection con0;
disconnect con1;
set global init_connect="call p1(4711)";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select @x;
@x
@@ -92,7 +92,7 @@ select @x;
connection con0;
disconnect con1;
set global init_connect="drop procedure if exists p1";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
call p1();
ERROR 42000: PROCEDURE test.p1 does not exist
@@ -119,7 +119,7 @@ end;
end loop;
end|
set global init_connect="call p1(@sum)";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select @sum;
@sum
@@ -136,7 +136,7 @@ execute stmt1 using @v;
deallocate prepare stmt1;
end|
set global init_connect="call p1('t1', 11)";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select * from t1;
x
@@ -154,7 +154,7 @@ select count(*) into n from t1;
return n;
end|
set global init_connect="set @x = f1()";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select @x;
@x
@@ -162,7 +162,7 @@ select @x;
connection con0;
disconnect con1;
set global init_connect="create view v1 as select f1()";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select * from v1;
f1()
@@ -170,7 +170,7 @@ f1()
connection con0;
disconnect con1;
set global init_connect="drop view v1";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
@@ -182,7 +182,7 @@ after insert on t2
for each row
insert into t1 values (new.y);
set global init_connect="insert into t2 values (13), (17), (19)";
-connect con1,localhost,mysqltest1,,;
+connect con1,localhost,mysqltest1,,test;
connection con1;
select * from t1;
x
diff --git a/mysql-test/main/init_connect.test b/mysql-test/main/init_connect.test
index e96d02fe0d1..60549c3458e 100644
--- a/mysql-test/main/init_connect.test
+++ b/mysql-test/main/init_connect.test
@@ -10,31 +10,31 @@
--source include/add_anonymous_users.inc
-connect (con0,localhost,root,,);
+connect (con0,localhost,root,,test);
connection con0;
select hex(@a);
-connect (con1,localhost,user_1,,);
+connect (con1,localhost,user_1,,test);
connection con1;
select hex(@a);
connection con0;
set global init_connect="set @a=2;set @b=3";
-connect (con2,localhost,user_1,,);
+connect (con2,localhost,user_1,,test);
connection con2;
select @a, @b;
connection con0;
set GLOBAL init_connect=DEFAULT;
-connect (con3,localhost,user_1,,);
+connect (con3,localhost,user_1,,test);
connection con3;
select @a;
connection con0;
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
-connect (con4,localhost,user_1,,);
+connect (con4,localhost,user_1,,test);
connection con4;
select hex(a) from t1;
connection con0;
set GLOBAL init_connect="adsfsdfsdfs";
-connect (con5,localhost,user_1,,);
+connect (con5,localhost,user_1,,test);
connection con5;
# BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE
# We now throw a proper error message here:
@@ -72,7 +72,7 @@ grant all privileges on test.* to mysqltest1@localhost;
# Create a simple procedure
#
set global init_connect="create procedure p1() select * from t1";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
call p1();
drop procedure p1;
@@ -88,7 +88,7 @@ begin\
select * from t1;\
set @x = x;
end";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
call p1(42);
select @x;
@@ -99,7 +99,7 @@ disconnect con1;
# Just call it - this will not generate any output
#
set global init_connect="call p1(4711)";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select @x;
@@ -109,7 +109,7 @@ disconnect con1;
# Drop the procedure
#
set global init_connect="drop procedure if exists p1";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
--error ER_SP_DOES_NOT_EXIST
call p1();
@@ -145,7 +145,7 @@ end|
delimiter ;|
# Call the procedure with a cursor
set global init_connect="call p1(@sum)";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select @sum;
@@ -167,7 +167,7 @@ end|
delimiter ;|
# Call the procedure with prepared statements
set global init_connect="call p1('t1', 11)";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select * from t1;
@@ -188,7 +188,7 @@ end|
delimiter ;|
# Invoke a function
set global init_connect="set @x = f1()";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select @x;
@@ -198,7 +198,7 @@ disconnect con1;
# Create a view
#
set global init_connect="create view v1 as select f1()";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select * from v1;
@@ -208,7 +208,7 @@ disconnect con1;
# Drop the view
#
set global init_connect="drop view v1";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
--error ER_NO_SUCH_TABLE
select * from v1;
@@ -225,7 +225,7 @@ drop function f1;
# after insert on t2\
# for each row\
# insert into t1 values (new.y)";
-#connect (con1,localhost,mysqltest1,,);
+#connect (con1,localhost,mysqltest1,,test);
#connection con1;
#insert into t2 values (2), (4);
#select * from t1;
@@ -240,7 +240,7 @@ create trigger trg1
# Invoke trigger
set global init_connect="insert into t2 values (13), (17), (19)";
-connect (con1,localhost,mysqltest1,,);
+connect (con1,localhost,mysqltest1,,test);
connection con1;
select * from t1;
diff --git a/mysql-test/main/userstat-badlogin-4824.result b/mysql-test/main/userstat-badlogin-4824.result
index 757b20e0ce0..b32b05e649d 100644
--- a/mysql-test/main/userstat-badlogin-4824.result
+++ b/mysql-test/main/userstat-badlogin-4824.result
@@ -2,7 +2,7 @@ set @save_userstat=@@global.userstat;
create user foo@localhost identified by 'foo';
flush user_statistics;
set global userstat=1;
-connect foo, localhost, foo, foo;
+connect foo, localhost, foo, foo, test;
select 1;
1
1
@@ -12,7 +12,7 @@ select user, bytes_received from information_schema.user_statistics where user =
user bytes_received
foo 18
connect(localhost,foo,bar,test,MASTER_PORT,MASTER_SOCKET);
-connect foo, localhost, foo, bar;
+connect foo, localhost, foo, bar, test;
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
connection default;
select user, bytes_received from information_schema.user_statistics where user = 'foo';
diff --git a/mysql-test/main/userstat-badlogin-4824.test b/mysql-test/main/userstat-badlogin-4824.test
index 12cca9f12b3..3db3e10da15 100644
--- a/mysql-test/main/userstat-badlogin-4824.test
+++ b/mysql-test/main/userstat-badlogin-4824.test
@@ -12,7 +12,7 @@ create user foo@localhost identified by 'foo';
flush user_statistics;
set global userstat=1;
-connect(foo, localhost, foo, foo);
+connect(foo, localhost, foo, foo, test);
select 1;
disconnect foo;
connection default;
@@ -27,7 +27,7 @@ select user, bytes_received from information_schema.user_statistics where user =
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect(foo, localhost, foo, bar);
+connect(foo, localhost, foo, bar, test);
connection default;
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_load.inc b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
index b27a3113318..a4815eafd0f 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_load.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
@@ -39,7 +39,7 @@ execute dump_hosts;
#
# To avoid noise from main, the background threads are disabled.
-connect (con1, localhost, user1, , );
+connect (con1, localhost, user1, ,test);
--connection default
@@ -122,7 +122,7 @@ execute dump_hosts;
# select * from performance_schema.events_waits_history_long;
# select PROCESSLIST_USER, PROCESSLIST_HOST, INSTRUMENTED from performance_schema.threads;
-connect (con2, localhost, user2, , );
+connect (con2, localhost, user2, ,test);
--connection default
@@ -201,7 +201,7 @@ execute dump_accounts;
execute dump_users;
execute dump_hosts;
-connect (con3, localhost, user3, , );
+connect (con3, localhost, user3, ,test);
--connection default
@@ -280,7 +280,7 @@ execute dump_accounts;
execute dump_users;
execute dump_hosts;
-connect (con4, localhost, user4, , );
+connect (con4, localhost, user4, ,test);
--connection default
diff --git a/mysql-test/suite/perfschema/r/connection_type_notwin.result b/mysql-test/suite/perfschema/r/connection_type_notwin.result
index d0415cf8df6..079c71345b1 100644
--- a/mysql-test/suite/perfschema/r/connection_type_notwin.result
+++ b/mysql-test/suite/perfschema/r/connection_type_notwin.result
@@ -20,7 +20,7 @@ SET @old_general_log_file= @@global.general_log_file;
SET GLOBAL general_log_file = '.../log/rewrite_general_con.log';
SET GLOBAL log_output = 'FILE,TABLE';
SET GLOBAL general_log= 'ON';
-connect con1, localhost, root,,;
+connect con1, localhost, root,,test;
select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result
index 4ad4c773941..805378f5850 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate.result
@@ -83,7 +83,7 @@ root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -339,7 +339,7 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -663,7 +663,7 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -1045,7 +1045,7 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
index 9ce3bb7efe8..30948c2e611 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
@@ -82,7 +82,7 @@ root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -308,7 +308,7 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -574,7 +574,7 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -870,7 +870,7 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
index 6590c162dda..956ea6c6488 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
@@ -68,7 +68,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -266,7 +266,7 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -504,7 +504,7 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -772,7 +772,7 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
index b7cf3b8a5ce..fbaa9a8d83f 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
@@ -81,7 +81,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -277,7 +277,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -485,7 +485,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -695,7 +695,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
index 24de36da22b..af535623e9a 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
@@ -67,7 +67,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -235,7 +235,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -415,7 +415,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -597,7 +597,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
index 2f0c96d7234..1209d37667e 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
@@ -69,7 +69,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -297,7 +297,7 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -593,7 +593,7 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -947,7 +947,7 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
index 618201d9b85..39da9783c96 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
@@ -82,7 +82,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -308,7 +308,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -574,7 +574,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -870,7 +870,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
index d6dd322a70c..818c61e0630 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
@@ -68,7 +68,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con1, localhost, user1, , ;
+connect con1, localhost, user1, ,test;
connection default;
"================== Step 2 =================="
call dump_thread();
@@ -266,7 +266,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con2, localhost, user2, , ;
+connect con2, localhost, user2, ,test;
connection default;
"================== Step 4 =================="
call dump_thread();
@@ -504,7 +504,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con3, localhost, user3, , ;
+connect con3, localhost, user3, ,test;
connection default;
"================== Step 6 =================="
call dump_thread();
@@ -772,7 +772,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-connect con4, localhost, user4, , ;
+connect con4, localhost, user4, ,test;
connection default;
"================== Step 8 =================="
call dump_thread();
diff --git a/mysql-test/suite/perfschema/t/connection_type_notwin.test b/mysql-test/suite/perfschema/t/connection_type_notwin.test
index 07028e1fb81..bb96d690763 100644
--- a/mysql-test/suite/perfschema/t/connection_type_notwin.test
+++ b/mysql-test/suite/perfschema/t/connection_type_notwin.test
@@ -33,7 +33,7 @@ eval SET GLOBAL general_log_file = '$MYSQLTEST_VARDIR/log/rewrite_general_con.lo
SET GLOBAL log_output = 'FILE,TABLE';
SET GLOBAL general_log= 'ON';
-connect(con1, localhost, root,,);
+connect(con1, localhost, root,,test);
select NAME, PROCESSLIST_USER, PROCESSLIST_HOST, CONNECTION_TYPE
from performance_schema.threads
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index 9768040aa94..c676c671a87 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -476,8 +476,8 @@ TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,,,0
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT PROXY ON plug_dest TO plug',0
-TIME,HOSTNAME,plug,localhost,ID,0,CONNECT,test,,0
-TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0
+TIME,HOSTNAME,plug,localhost,ID,0,CONNECT,,,0
+TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,,`plug_dest`@`%`,0
TIME,HOSTNAME,plug,localhost,ID,ID,QUERY,test,'select USER(),CURRENT_USER()',0
TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,test,,0
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db,