Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.0.3
    • Fix Version/s: 10.0.5
    • Component/s: None
    • 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`)'
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            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.

            Show
            serg Sergei Golubchik added a comment - 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.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: