summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-04-28 14:19:02 +0200
committerunknown <serg@serg.mylan>2004-04-28 14:19:02 +0200
commitfdee1cbbb43a668f50bc6496dae125786e78536b (patch)
tree7a838f867788c7a578b84c9493545b2123d12d19
parentb590c36a36d75c8e3867cef55e491107e4e92fde (diff)
downloadmariadb-git-fdee1cbbb43a668f50bc6496dae125786e78536b.tar.gz
bug#3556 - soundex
-rw-r--r--mysql-test/r/func_str.result6
-rw-r--r--mysql-test/t/func_str.test2
-rw-r--r--mysys/mf_soundex.c4
-rw-r--r--sql/item_strfunc.cc2
4 files changed, 7 insertions, 7 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 7d2668c8cf6..6be8e34c334 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -77,9 +77,9 @@ bbbb bb bbbbbbbb aaaa bbbb
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL')
this is a REAL test
-select soundex(''),soundex('he'),soundex('hello all folks');
-soundex('') soundex('he') soundex('hello all folks')
- H000 H4142
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
+soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb')
+ H000 H4142 I51231
select md5('hello');
md5('hello')
5d41402abc4b2a76b9719d911017c592
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 1eba49a9583..4043a238f0b 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -35,7 +35,7 @@ SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),r
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
-select soundex(''),soundex('he'),soundex('hello all folks');
+select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb');
select md5('hello');
select sha('abc');
select sha1('abc');
diff --git a/mysys/mf_soundex.c b/mysys/mf_soundex.c
index 6409caa356d..9fe54ffafa0 100644
--- a/mysys/mf_soundex.c
+++ b/mysys/mf_soundex.c
@@ -51,7 +51,7 @@ void soundex(register my_string out_pntr, my_string in_pntr,
if (remove_garbage)
{
- while (*in_pntr && isspace(*in_pntr)) /* Skipp pre-space */
+ while (*in_pntr && !isalpha(*in_pntr))
in_pntr++;
}
*out_pntr++ = toupper(*in_pntr); /* Copy first letter */
@@ -97,7 +97,7 @@ static char get_scode(char **ptr, pbool remove_garbage)
ch=toupper(**ptr);
if (ch < 'A' || ch > 'Z')
{
- if (isalpha(ch)) /* If exetended alfa (country spec) */
+ if (isalpha(ch)) /* If extended alpha (country spec) */
return '0'; /* threat as vokal */
return 0; /* Can't map */
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 31c2dc943e5..ac70ef2cbd3 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1422,7 +1422,7 @@ String *Item_func_soundex::val_str(String *str)
char *to= (char *) tmp_value.ptr();
char *from= (char *) res->ptr(), *end=from+res->length();
- while (from != end && isspace(*from)) // Skip pre-space
+ while (from != end && !isalpha(*from)) // Skip pre-space
from++; /* purecov: inspected */
if (from == end)
return &empty_string; // No alpha characters.