[MDEV-6853] Unexpected zero result on 1 % <very small decimal> (wrong default precision of the returned result?) Created: 2014-10-08 Updated: 2015-01-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.40 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Technically, the second operand is outside DECIMAL precision (it has 30 zeros after the point), so it wouldn't be strange if the query considered it 0 and produced 0. But the current result is difficult to explain. MySQL 5.5 and PostgreSQL return a non-zero value:
|
| Comments |
| Comment by Elena Stepanova [ 2014-10-08 ] | |||||||||||||||||||||||||||
|
Actually, it's not really 0. If I assign the result of the expression to a variable, I can see the real value:
But if it's the problem with the default precision of a returned value, it can be seen on much simpler examples:
It is strange, I can't find in the documentation anything that would explain such low precision of the result. |