Skip to content
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

fix/windows-getTimeOfDay #557

Conversation

facetosea
Copy link
Contributor

No description provided.

@facetosea facetosea force-pushed the fix/xsren/TD-22018/windows-toolsGetTimeOfDay branch from c66ee75 to e6d6dc4 Compare January 24, 2023 16:47
Copy link
Contributor

@sangshuduo sangshuduo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems TDengine 3.0/main still use same logic of implementation. interested why taos-tools need to change.

@facetosea
Copy link
Contributor Author

Seems TDengine 3.0/main still use same logic of implementation. interested why taos-tools need to change.

In such a scenario, an error will occur. At the moment of x seconds and 999 milliseconds, the value of the variable ”t“ is obtained through toolsGetTimestampSec, and the value of the variable ”st” is obtained through the GetLocalTime function at the moment of x + 1 seconds and 0 milliseconds;

The code uses “t” to set tv->tv_sec, and uses milliseconds in “st” to assign tv->tv_usec; at this time, the value is wrong, x + 1 seconds 0 milliseconds, and it will read out x seconds 0 milliseconds incorrectly.

Copy link
Contributor

@sangshuduo sangshuduo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sangshuduo
Copy link
Contributor

Seems TDengine 3.0/main still use same logic of implementation. interested why taos-tools need to change.

In such a scenario, an error will occur. At the moment of x seconds and 999 milliseconds, the value of the variable ”t“ is obtained through toolsGetTimestampSec, and the value of the variable ”st” is obtained through the GetLocalTime function at the moment of x + 1 seconds and 0 milliseconds;

The code uses “t” to set tv->tv_sec, and uses milliseconds in “st” to assign tv->tv_usec; at this time, the value is wrong, x + 1 seconds 0 milliseconds, and it will read out x seconds 0 milliseconds incorrectly.

Any plan to fix similar issue of TDengine?

@sangshuduo sangshuduo merged commit eed30f5 into taosdata:develop Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants