-
Notifications
You must be signed in to change notification settings - Fork 713
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
support high precision time in show processlist (I_S.processlist) #1084
Conversation
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.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
4f6d98e
to
4d7f90b
Compare
@inikep has updated the pull request. Re-import the pull request |
This PR was updated:
|
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.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@@ -4116,7 +4131,7 @@ ST_FIELD_INFO processlist_fields_info[] = { | |||
{"HOST", HOST_AND_PORT_LENGTH - 1, MYSQL_TYPE_STRING, 0, 0, "Host", 0}, | |||
{"DB", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, "Db", 0}, | |||
{"COMMAND", 16, MYSQL_TYPE_STRING, 0, 0, "Command", 0}, | |||
{"TIME", 7, MYSQL_TYPE_LONG, 0, 0, "Time", 0}, | |||
{"TIME", MAX_DOUBLE_STR_LENGTH, MYSQL_TYPE_DOUBLE, 0, 0, "Time", 0}, |
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.
Any particular reason for double vs. decimal as per the original diff?
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.
I noticed some issues for 5.6:
INFORMATION_SCHEMA.PROCESSLIST
"TIME" column defined asint(7)
(i.e. "display width = 7" assumes numbers up to9999999
) was replaced
withdecimal(9,6)
which can address only numbers from-999.999999
to
999.999999
store_result_field_processlist()
uses thedouble
data type in
5.6 to store time with
protocol->store(my_timeval_to_double(&tm_delta), 6, &tmp_str);
instead ofprotocol->store_decimal()
that should be used fordecimal(9,6)
I fixed these issues in my 8.0 port using:
'TIME' double NOT NULL DEFAULT '0'
for INFORMATION_SCHEMA.PROCESSLIST
sql/sql_show.cc
Outdated
else | ||
table->field[5]->store(0, false); | ||
table->field[5]->store((long)(time_delta / 1000000), false); |
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.
Should this also be a double to match the schema of processlist_fields_info? However, this still seems to be interpreted correctly from my testing.
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.
We have 2 cases it this patch. The first case is SHOW PROCESSLIST
which calls mysqld_list_processes()
. It works fine because a result field type is send along with data:
field_list.push_back(new Item_return_int("Time", 6, MYSQL_TYPE_DOUBLE));
table->field[5]->store((double)time_delta / 1000000);
and
field_list.push_back(field = new Item_return_int("Time", 7, MYSQL_TYPE_LONG));
table->field[5]->store((long)(time_delta / 1000000), false);
The second case is SELECT * FROM information_schema.processlist
that calls Fill_process_list::operator()
.
In this case we send a double
or a long
which is not correct according to a definition of the TIME
filed of INFORMATION_SCHEMA.PROCESSLIST
.
Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234) The variable is session settable Reference patch: facebook@b840ad76249 fbshipit-source-id: 7d58e50
4d7f90b
to
2bcc5de
Compare
@inikep has updated the pull request. Re-import the pull request |
I updated the patch that
|
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.
@hermanlee has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: b840ad76249 Pull Request resolved: #1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Reviewed By: yizhang82 Differential Revision: D19357091 Pulled By: mzait fbshipit-source-id: 2c42f8d
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 (facebook@fc8283e) Pulled By: mzait fbshipit-source-id: de5a1b3b891
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 (facebook@fc8283e) Pulled By: mzait fbshipit-source-id: de5a1b3b891
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 (facebook@fc8283e) Pulled By: mzait fbshipit-source-id: de5a1b3b891
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
…cebook#1084) (facebook#1084) Summary: The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second. This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234). The variable is session settable. Reference patch: facebook@b840ad76249 Pull Request resolved: facebook#1084 Differential Revision: D19357091 Pulled By: mzait
Summary:
The time information from 'show processlist' and in information_schema.processlist is at the granularity of a second
This diff provides an override (system variable) to display the time at the granularity of a micro-second (e.g, 0.001234)
The variable is session settable
Reference patch: b840ad76249
fbshipit-source-id: 7d58e50
TO DO: Please re-record
mysql-test/t/all_persisted_variables.test
withlet $total_persistent_vars=XXX + 1;
(a new variable).