[MDEV-4701] Sequence: value out of range Created: 2013-06-24  Updated: 2013-10-31  Resolved: 2013-10-31

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.0.5

Type: Bug Priority: Major
Reporter: Federico Razzoli Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

MariaDB [test]> SELECT 0 - seq AS seq FROM seq_1_to_1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(0 - `test`.`seq_1
_to_1`.`seq`)'



 Comments   
Comment by Sergei Golubchik [ 2013-10-31 ]

Yes, this always happens when you do an unsigned subtraction and end up with a negative result, like in

SELECT 0 - CAST(1 AS UNSIGNED);

if you need that to work, either cast an unsigned integer to signed or set sql_mode to NO_UNSIGNED_SUBTRACTION.

Generated at Thu Feb 08 06:58:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.