Hi Alexey, On 11/25/2018 09:05 AM, Alexander Barkov wrote:
What do you think if we do this: - add THD* memver to the MYSQL_TIME_STATUS structure, so we can get rid of the THD * parameter to many functions? - send one MYSQL_TIME_STATUS* to the add_nanoseconds() instead of three {thd, &status->warnings, and status->nanoseconds} ?
Changing all functions that accept both &warn and nsec to accept a pointer to MYSQL_TIME_STATUS instead, like this:
< xxxx(thd, &status->warnings, and status->nanoseconds);
xxxx(thd, &status);
is a very good idea.
I'd avoid mix "thd" to MYSQL_TIME_STATUS though. It's a pure C structure.
Does it sound OK?
I tried this, but this does not save anything. See the attached patch. git diff --stat sql/sql_time.cc | 6 +++--- sql/sql_type.cc | 2 +- sql/sql_type.h | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) In all other places "*warn" and "nsec" come from different places (not from the same MYSQL_TIME_STATUS). Btw, MYSQL_TIME_STATUS is actually an interface to low level pure C conversion functions like str_to_xxx() and number_to_xxx(). Let's not propagate it all around the code. Can we leave the relevant code as is? Thanks.