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

sql: EXTRACT has a behavior inconsistent with pg and mysql #4291

Closed
knz opened this issue Feb 10, 2016 · 1 comment
Closed

sql: EXTRACT has a behavior inconsistent with pg and mysql #4291

knz opened this issue Feb 10, 2016 · 1 comment
Assignees
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.

Comments

@knz
Copy link
Contributor

knz commented Feb 10, 2016

See: http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT

"milliseconds: The seconds field, including fractional parts, multiplied by 1000. Note that this includes full seconds.
       SELECT EXTRACT(MILLISECONDS FROM TIME '17:12:28.5');
       Result: 28500
"

Our code only returns the fractional part.

Found while working on #4036.

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. SQL labels Feb 10, 2016
@knz knz self-assigned this Feb 10, 2016
@knz
Copy link
Contributor Author

knz commented Feb 10, 2016

So the situation is actually messier than that; PostgreSQL reports the seconds together with millis/micros, but MySQL reports only the fractional part. Humpf. Will look at a middle road.

@knz knz changed the title sql: EXTRACT should return seconds with milliseconds, microseconds and nanoseconds sql: EXTRACT has a behavior inconsistent with pg Feb 10, 2016
@knz knz changed the title sql: EXTRACT has a behavior inconsistent with pg sql: EXTRACT has a behavior inconsistent with pg and mysql Feb 10, 2016
@knz knz added C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. and removed C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Feb 10, 2016
@knz knz closed this as completed in #4300 Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.
Projects
None yet
Development

No branches or pull requests

1 participant