Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Not a Bug
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL)
Description
CREATE TABLE t (f char(8)); |
INSERT INTO t VALUES (''),(''); |
SELECT * FROM t WHERE f BETWEEN 'a' AND 3; |
SELECT * FROM t WHERE f >= 'a'; |
|
# Cleanup
|
DROP TABLE t; |
BETWEEN query returns a result set (with warnings), while less restrictive >= returns an empty result set.
SELECT * FROM t WHERE f BETWEEN 'a' AND 3; |
f
|
|
|
Warnings:
|
Warning 1292 Truncated incorrect DOUBLE value: ' ' |
Warning 1292 Truncated incorrect DOUBLE value: 'a' |
Warning 1292 Truncated incorrect DOUBLE value: ' ' |
Warning 1292 Truncated incorrect DOUBLE value: 'a' |
SELECT * FROM t WHERE f >= 'a'; |
f
|
DROP TABLE t; |
It may be not a bug at all, if 'a' is first cast to a number, and then both numbers are cast back to strings; but this is certainly weird behavior at the end, that a more restrictive condition (BETWEEN) returns more results than a less restrictive one (>=).