Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-424

Overflow / value truncated warning is not produced on a SELECT containing such a value in WHERE clause

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.25
    • Fix Version/s: 5.5.29
    • Component/s: None
    • Labels:
      None

      Description

      It might be a variation of MDEV-414, but since it only seems to affect 5.5, I'm filing it separately.

      CREATE TABLE t2(c2 BIGINT NULL);
      INSERT INTO t2 VALUES (1),(2);
      SELECT * FROM t2 WHERE c2 = -9223372036854775809;
      c2
      

      On 5.3, this SELECT produces a warning:

      Warnings:
      Error	1916	Got overflow when converting '-9223372036854775809' to INT. Value truncated.
      

      It might be a bit strange that it has an error inside, but it worked the same way in MySQL 5.1, only the code was different:

      Warnings:
      Error	1292	Truncated incorrect DECIMAL value: ''
      

      In MySQL 5.5, it's a more traditional warning:

      Warnings:
      Warning	1292	Truncated incorrect DECIMAL value: ''
      

      But in MariaDB 5.5, no warning at all.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

              This is not a bug.
              The query returns no rows, because there are no rows in the table with the values equal to -9223372036854775809. What MariaDB does internally to verify that fact is not visible for the user, and should produce no warnings.

              Show
              serg Sergei Golubchik added a comment - This is not a bug. The query returns no rows, because there are no rows in the table with the values equal to -9223372036854775809. What MariaDB does internally to verify that fact is not visible for the user, and should produce no warnings.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: