[MDEV-21631] soundex function returns more than 4 characters depending on argument Created: 2020-02-02  Updated: 2020-02-02  Resolved: 2020-02-02

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.3.20
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Trevor Veary Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: innodb
Environment:

Red Hat Linux Fedora Core 31



 Description   

select soundex('GRUMBACH')

result: 'G6512'
It should be char(4) not char(5)
Oracle and MSSQL both return 'G651'

same problem with values 'HEURTEBISE', 'REIGNARD', 'BERTHELIN'.

soundex('ROSENBERG') returns 6 characters: 'R25162'



 Comments   
Comment by Sergei Golubchik [ 2020-02-02 ]

This is intentional and documented, see https://mariadb.com/kb/en/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.

Generated at Thu Feb 08 09:08:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.