Bug #119054 Incorrect SOUNDS LIKE result in WHERE clause with complex function arguments and type casting
Submitted: 22 Sep 10:35 Modified: 22 Sep 17:39
Reporter: zz z Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:9.4.0 8.4.6 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[22 Sep 10:35] zz z
Description:
The query incorrectly returns an empty set, while a verification query demonstrates that one row should have been returned. 

How to repeat:
CREATE TABLE IF NOT EXISTS t156 (c1 DECIMAL, c2 FLOAT) ;
INSERT INTO t156 (c1,c2) VALUES (611,1.009);
INSERT INTO t156 (c1,c2) VALUES (-788,-2.9309427E38);

SELECT * FROM t156 WHERE (((c2) SOUNDS LIKE (TIMESTAMPADD(MONTH, (BIN(-49)), c1)))) ; -- 0;
SELECT SUM(count) FROM (SELECT ((((c2) SOUNDS LIKE (TIMESTAMPADD(MONTH, (BIN(-49)), c1))))) IS TRUE AS count FROM t156) AS ta_norec; -- 1;
[22 Sep 17:39] MySQL Verification Team
Hi,

SOUNDS LIKE uses SOUNDEX that is only made to work properly with English words. Any other usage can cause unpredictable results.