1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

The (unsupported) soundex() function returns '?000' when given a NULL.

Ticket #1845. (CVS 3233)

FossilOrigin-Name: 9372481f233e1563b5ee137535f0fbf19851ffad
This commit is contained in:
drh
2006-06-13 19:26:10 +00:00
parent 7f3759015a
commit 88897a72e9
3 changed files with 9 additions and 8 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.129 2006/06/13 17:39:00 drh Exp $
** $Id: func.c,v 1.130 2006/06/13 19:26:11 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -655,6 +655,7 @@ static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv
};
assert( argc==1 );
zIn = (u8*)sqlite3_value_text(argv[0]);
if( zIn==0 ) zIn = "";
for(i=0; zIn[i] && !isalpha(zIn[i]); i++){}
if( zIn[i] ){
zResult[0] = toupper(zIn[i]);