[MDEV-424] Overflow / value truncated warning is not produced on a SELECT containing such a value in WHERE clause Created: 2012-08-02  Updated: 2013-01-01  Resolved: 2013-01-01

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.25
Fix Version/s: 5.5.29

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-369 Mismatches in MySQL engines test suite Closed

 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.



 Comments   
Comment by Sergei Golubchik [ 2013-01-01 ]

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.

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