[MDEV-27168] Non-deterministic results of datetime operation Created: 2021-12-04 Updated: 2021-12-14 Resolved: 2021-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Tadas Balaišis | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
I get different results from the same query executed (10.6.4-MariaDB) subsequently. I tried with HeidiSQL (11.3.0.6344) and MySQL Client (MariaDB 10.5 (x64)). Please check the file attached. Can you give an explanation? |
| Comments |
| Comment by Tadas Balaišis [ 2021-12-05 ] | |
|
I was hoping to get the same output like I get with
| |
| Comment by Sergei Golubchik [ 2021-12-13 ] | |
|
your "timestamp - timestamp" does not do what you think it does. Try:
you can see that the second column is the difference between values in two last columns. | |
| Comment by Tadas Balaišis [ 2021-12-14 ] | |
|
Well thank you for explanation. Anyway the numeric expression of datetime subtraction is still non-deterministic, therefore it's useless. For several samples I decided that this is number of seconds between. But that is not true. So I had to rewrite my views queries to use timestampdiff function. And I guess I'm not the last person to get into this trap. |