Bug #48289 Soundex not truncating result.
Submitted: 25 Oct 2009 13:20 Modified: 25 Oct 2009 15:05
Reporter: Andrew Hutchings Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.40 OS:Any
Assigned to: CPU Architecture:Any

[25 Oct 2009 13:20] Andrew Hutchings
Description:
The Soundex algorithm should truncate the result after the first 3 digits.  This does not appear to be happening, yet zero-fill stops on the 3rd digit.

How to repeat:
mysql> select soundex('travelling');
+-----------------------+
| soundex('travelling') |
+-----------------------+
| T61452                |
+-----------------------+
1 row in set (0.00 sec)

mysql> select soundex('trav');
+-----------------+
| soundex('trav') |
+-----------------+
| T610            |
+-----------------+
1 row in set (0.00 sec)
[25 Oct 2009 13:59] Andrew Hutchings
Verified in MySQL 5.1.40 and 5.0.86.
[25 Oct 2009 15:05] Sergei Golubchik
It works as documented. See
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_soundex
"
A standard soundex string is four characters long, but the SOUNDEX()  function returns an arbitrarily long string. You can use SUBSTRING() on the result to get a standard soundex string.
"