-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expression: modify the mean result of time type #21514
Conversation
My test case failed, because, in the test environment, the process of reading query results is inconsistent with that in the production environment。This mainly refers to the difference between functions There is no problem with the following test cases executed on the command line. Test case:
Test result:
|
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.
What about not directly compare the string result. Parse the float to compare.
/reward 300 |
Reward success. |
Maybe it doesn't make any sense? Because it can pass the test without any modification. |
The test case |
tk.MustExec("insert into t0 values ('1000-01-01', '-838:59:59', '1000-01-01 00:00:00', '1970-01-01 08:00:01')") | ||
tk.MustExec("insert into t0 values ('9999-12-31', '838:59:59', '9999-12-31 23:59:59', '2038-01-19 11:14:07')") | ||
result := tk.MustQuery("select avg(c1), avg(c2), avg(c3), avg(c4) from t0") | ||
result.Check(testkit.Rows("54995666 0 54995666117979.5 20040110095704")) |
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.
It seems not as expected.
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.
Do you want me to compare float values?
Are there any related tools in the test suite...
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.
OK, the unit test doesn't go through the client connection. The manual test with the MySQL client is right.
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.
LGTM
tk.MustExec("insert into t0 values ('1000-01-01', '-838:59:59', '1000-01-01 00:00:00', '1970-01-01 08:00:01')") | ||
tk.MustExec("insert into t0 values ('9999-12-31', '838:59:59', '9999-12-31 23:59:59', '2038-01-19 11:14:07')") | ||
result := tk.MustQuery("select avg(c1), avg(c2), avg(c3), avg(c4) from t0") | ||
result.Check(testkit.Rows("54995666 0 54995666117979.5 20040110095704")) |
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.
OK, the unit test doesn't go through the client connection. The manual test with the MySQL client is right.
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.
LGTM
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@ou-bing, Congratulations, you get 300 in this PR, and your total score is 600 in challenge program. |
What problem does this PR solve?
Issue Number: close #17726
What is changed and how it works?
What's Changed:
modify the mean result of time type.
How it Works:
Force 4 decimal places.
Release note