|
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"));
|
|