Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
-
10.1.18
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2)); |
INSERT INTO t1 VALUES ( 'test',to_base64('test')), ('TEST', to_base64('TEST')); |
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2)); |
INSERT INTO t1 VALUES ( 'test',to_base64('test')), ('test', to_base64('TEST')); |
SELECT * FROM t1 ignore index(k1) WHERE f1='test' AND (f2= to_base64("test") OR f2= to_base64("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= to_base64("test") OR f2= to_base64("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= to_base64("TEST") OR f2= to_base64("test")); |
The three SELECT queries return three different result sets.
All three queries should return exactly the same result.
The same problem is repeatable with password():
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2)); |
INSERT INTO t1 VALUES ( 'test',password('test')), ('TEST', password('TEST')); |
SELECT * FROM t1 ignore index(k1) WHERE f1='test' AND (f2= password("test") OR f2= password("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= password("test") OR f2= password("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= password("TEST") OR f2= password("test")); |
The same problem is repeatable with hex():
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(64), UNIQUE KEY k1 (f1,f2)); |
INSERT INTO t1 VALUES ( 'test',hex('test')), ('TEST',hex('TEST')); |
SELECT * FROM t1 ignore index(k1) WHERE f1='test' AND (f2= hex("test") OR f2= hex("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= hex("test") OR f2= hex("TEST")); |
SELECT * FROM t1 WHERE f1='test' AND (f2= hex("TEST") OR f2= hex("test")); |
Attachments
Issue Links
- relates to
-
MDEV-10556 Assertion `0' failed in virtual void Item_sum_field::set_result_field(Field*)
- Closed
-
MDEV-10864 Wrong result for WHERE .. (f2=COMPRESS('test') OR f2=COMPRESS('TEST'))
- Closed