-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
MDEV-36397 Record change_user command in MTR output #4012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
56f4c21
to
790bb72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, thanks! Result files became much easier to read!
See few comments inline.
client/mysqltest.cc
Outdated
@@ -4655,6 +4655,24 @@ void do_change_user(struct st_command *command) | |||
dynstr_set(&ds_db, mysql->db); | |||
} | |||
|
|||
/* Connection logging if enabled */ | |||
if (!disable_result_log && !disable_connect_log && !disable_query_log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is getting too complex, let's just have if (!disable_query_log)
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I've changed it as per your suggestion.
I did notice, however, that excluding !disable_result_log
from the check causes main.plugin_vars
to fail either locally or in the PR's CI/CD run.
Locally, I'm seeing a result length mismatch like so:
connection con2;
CALL p_show_vars(100);
connection default;
+change_user root,,test;
...
+change_user root,,test;
connection con1;
But after running the test with --record
and pushing my changes, in the CI/CD run, I'm seeing a result length mismatch like so:
connection con2;
CALL p_show_vars(100);
connection default;
-change_user root,,test;
...
-change_user root,,test;
+change_user root,,;
...
+change_user root,,;
connection con1;
What do you suggest I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, that what fails is debug-emb test step. On the amd64-debian-12-debug-embedded builder. It runs the mtr with the --embedded
switch, you can see it in the log. That is,
- run
cmake -DWITH_EMBEDDED_SERVER=1
make
(orninja
or whatever you're using)- run
./mtr --emb main.plugin_vars
- figure out why it's different in embedded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thanks for the tip
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 MTR output in the following format in MTR output only if enable_connect_log and enable_query_log is set to true: 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.
Don't forget to re-request review when you're ready. |
it looks like your main.plugin_vars test is still having a different result under embedded. |
I haven't pushed any changes to rectify the failure yet, I'm still working on the fix - thanks |
Description
MTR
.result
files currently do not contain output to indicate if achange_user
command has been executed in the corresponding.test
files.Record
change_user
command in the following format in MTR output only ifenable_connect_log
andenable_query_log
is set to true:change_user <user>,<password>,<db>;
Release Notes
N/A
How can this PR be tested?
Execute the main suite in mysql-test-run. This commit modifies tests in that suite.
For example, a
change_user root;
line in the.test
file will generate a newchange_user root,,;
line in the.result
file if no password or db is set.If a parameter (
user
,db
, orpassword
) is not specified, the current value for that parameter will be used in the output.Basing the PR against the correct MariaDB version
Copyright
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.