Thanks to visit codestin.com
Credit goes to www.tutorialspoint.com

MySQL Exact Value Arithmetic Overflow Handling



MySQL exact-value arithmetic can handle overflow occurs during numerical expression assessment because overflow occurs depends on the range of the operands. The values used in arithmetic expressions changed to other data type can put away the overflow.

For example, after converting the BIGINT Maximum value to DECIMAL while adding 1 to it can handle the overflow as follows −

mysql> Select 9223372036854775807.0 + 1;
+---------------------------+
| 9223372036854775807.0 + 1 |
+---------------------------+
| 9223372036854775808.0     |
+---------------------------+
1 row in set (0.01 sec)
Updated on: 2020-01-30T07:11:01+05:30

90 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements