1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-36397 Record change_user command in MTR output

MTR .result files currently do not contain output to indicate if a
change_user command has been executed in the corresponding .test files.

Record change_user command in the following format in MTR output only if
disable_query_log is set to false: change_user <user>,<password>,<db>;

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
This commit is contained in:
Fariha Shaikh
2025-04-21 21:26:19 +00:00
committed by Sergei Golubchik
parent 2ee2e2d0f3
commit 212fad1b7e
32 changed files with 241 additions and 11 deletions

View File

@@ -789,9 +789,21 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
sctx->proxy_user[0]= 0;
sctx->master_access= GLOBAL_ACLS; // Full rights
emb_transfer_connect_attrs(mysql);
/* Change database if necessary */
if (!(result= (db && db[0] && mysql_change_db(thd, &db_str, FALSE))))
result = 0;
if (db && db[0])
{
result = mysql_change_db(thd, &db_str, FALSE);
if (!result)
{
my_free(mysql->db);
mysql->db = my_strdup(PSI_NOT_INSTRUMENTED, db, MYF(0));
}
}
if (!result)
my_ok(thd);
thd->protocol->end_statement();
emb_read_query_result(mysql);
return result;