scope of NO_UNSIGNED_SUBTRACTION

You are viewing an old version of this question. View the current version here.

sql_mode='NO_UNSIGNED_SUBTRACTION' is supposed to allow the subtraction of two unsigned integers. However, in MariaDB it seems to allow only subtractions involving only ONE unsigned integer.

show variables like "SQL_MODE"; (shows that NO_UNSIGNED_SUBTRACTION is on)

SELECT CAST(0 AS UNSIGNED) - 1; (works, in either order)

SELECT CAST(0 AS UNSIGNED) - cast(1 as unsigned); (fails in MariaDB 10.5.22, works in MySQL 5.6.40)

yields:

ERROR 1690 (22003): BIGINT value is out of range

Is this fixed in a later version of MariaDB?

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.