[MDEV-20427] conversion of LONGLONG_MAX to double and back to long long results in LONGLONG_MIN Created: 2019-08-26 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data types, Server |
| Affects Version/s: | 5.5, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Here are funny casts https://godbolt.org/z/K6Rvnc It could happen here https://github.com/mariadb/server/blob/10.1/sql/sql_time.cc#L406 and here https://github.com/mariadb/server/blob/10.1/include/my_time.h#L122 I wasn't able to write a test and found these bugs by reading the code. |
| Comments |
| Comment by Sergei Golubchik [ 2019-08-28 ] |
|
Had it just a few days ago in EXPLAIN, see https://github.com/mariadb/server/commit/4f321289af20427d59aa7c46da (ulonglong)(double)~0ULL was 0 on Linux/gcc and -9223372036854775808 on Windows/VS2019 |