MySQL - Value limit for mathematical operations

0

I have a question regarding the following situation:

I have two values not stored in a table.

Valor 1: 9223372036854775806 (Onde este é o valor máximo de um tipo de dado BIGINT)
Valor 2: 9999999999999999999999999999999999999999999999999999999999999999999999999999999 (Um número qualquer gigantesco)

When you perform the following operation ...

SELECT 9223372036854775807 + 1

The following error occurs:

Error Code: 1690. BIGINT value is out of range in '(9223372036854775807 + 1)'

Already in the following operation, it works normally ...

SELECT 9999999999999999999999999999999999999999999999999999999999999999999999999999999 +1

Result:

10000000000000000000000000000000000000000000000000000000000000000000000000000000

I wonder ...

If the limit for BIGINT is 9223372036854775807, why does not an error occur in the second operation?

    
asked by anonymous 19.04.2017 / 21:35

0 answers