Skip to content

Commit d5ff65f

Browse files
committed
WL#5924 : merge to mysql-trunk
2 parents 8030137 + 66ba850 commit d5ff65f

56 files changed

Lines changed: 2109 additions & 50 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/mysql.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,9 @@ sig_handler handle_kill_signal(int sig)
14231423
}
14241424

14251425
kill_mysql= mysql_init(kill_mysql);
1426+
mysql_options(kill_mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
1427+
mysql_options4(kill_mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
1428+
"program_name", "mysql");
14261429
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
14271430
"", opt_mysql_port, opt_mysql_unix_port,0))
14281431
{
@@ -4508,6 +4511,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
45084511
if (opt_default_auth && *opt_default_auth)
45094512
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
45104513

4514+
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
4515+
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
4516+
"program_name", "mysql");
45114517
if (!mysql_real_connect(&mysql, host, user, password,
45124518
database, opt_mysql_port, opt_mysql_unix_port,
45134519
connect_flag | CLIENT_MULTI_STATEMENTS))

client/mysqladmin.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ int main(int argc,char *argv[])
369369
if (opt_default_auth && *opt_default_auth)
370370
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
371371

372+
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
373+
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
374+
"program_name", "mysqladmin");
372375
if (sql_connect(&mysql, option_wait))
373376
{
374377
/*

client/mysqlbinlog.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,9 @@ static Exit_status safe_connect()
16361636
mysql_options(mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
16371637
shared_memory_base_name);
16381638
#endif
1639+
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
1640+
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
1641+
"program_name", "mysqlbinlog");
16391642
if (!mysql_real_connect(mysql, host, user, pass, 0, port, sock, 0))
16401643
{
16411644
error("Failed on connect: %s", mysql_error(mysql));

client/mysqlcheck.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ static int dbConnect(char *host, char *user, char *passwd)
862862
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
863863

864864
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
865+
mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
866+
mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD,
867+
"program_name", "mysqlcheck");
865868
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
866869
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
867870
{

client/mysqldump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,9 @@ static int connect_to_db(char *host, char *user,char *passwd)
15111511
if (opt_default_auth && *opt_default_auth)
15121512
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
15131513

1514+
mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
1515+
mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD,
1516+
"program_name", "mysqldump");
15141517
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
15151518
NULL,opt_mysql_port,opt_mysql_unix_port,
15161519
0)))

client/mysqlimport.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ static MYSQL *db_connect(char *host, char *database,
453453
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
454454

455455
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
456+
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
457+
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
458+
"program_name", "mysqlimport");
456459
if (!(mysql_real_connect(mysql,host,user,passwd,
457460
database,opt_mysql_port,opt_mysql_unix_port,
458461
0)))

client/mysqlshow.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ int main(int argc, char **argv)
143143
if (opt_default_auth && *opt_default_auth)
144144
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
145145

146+
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
147+
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
148+
"program_name", "mysqlshow");
146149
if (!(mysql_real_connect(&mysql,host,user,opt_password,
147150
(first_argument_uses_wildcards) ? "" :
148151
argv[0],opt_mysql_port,opt_mysql_unix_port,

client/mysqlslap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ int main(int argc, char **argv)
355355
if (opt_default_auth && *opt_default_auth)
356356
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
357357

358+
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
359+
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
360+
"program_name", "mysqlslap");
358361
if (!opt_only_print)
359362
{
360363
if (!(mysql_real_connect(&mysql, host, user, opt_password,

client/mysqltest.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5224,6 +5224,10 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
52245224
verbose_msg("Connecting to server %s:%d (socket %s) as '%s'"
52255225
", connection '%s', attempt %d ...",
52265226
host, port, sock, user, name, failed_attempts);
5227+
5228+
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
5229+
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
5230+
"program_name", "mysqltest");
52275231
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
52285232
CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
52295233
{
@@ -5325,6 +5329,8 @@ int connect_n_handle_errors(struct st_command *command,
53255329
dynstr_append_mem(ds, ";\n", 2);
53265330
}
53275331

5332+
mysql_options(con, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
5333+
mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqltest");
53285334
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
53295335
CLIENT_MULTI_STATEMENTS))
53305336
{

include/errmsg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ extern const char *client_errors[]; /* Error messages */
102102
#define CR_NEW_STMT_METADATA 2057
103103
#define CR_ALREADY_CONNECTED 2058
104104
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
105-
#define CR_ERROR_LAST /*Copy last error nr:*/ 2059
105+
#define CR_DUPLICATE_CONNECTION_ATTR 2060
106+
#define CR_ERROR_LAST /*Copy last error nr:*/ 2060
106107
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
107108

108109
#endif /* ERRMSG_INCLUDED */

0 commit comments

Comments
 (0)