1 diff -uNr sqlite-3.4.1/src/func.c.orig sqlite-3.4.1/src/func.c
2 --- sqlite-3.4.1/src/func.c.orig 2007-06-28 12:46:19.000000000 +0000
3 +++ sqlite-3.4.1/src/func.c 2007-07-23 11:39:52.000000000 +0000
8 +** Implementation of the sign() function
10 +static void signFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
12 + switch( sqlite3_value_type(argv[0]) ){
13 + case SQLITE_INTEGER: {
14 + i64 iVal = sqlite3_value_int64(argv[0]);
15 + iVal = (iVal > 0)? 1 : (iVal < 0)? -1 : 0;
16 + sqlite3_result_int64(context, iVal);
20 + sqlite3_result_null(context);
24 + double rVal = sqlite3_value_double(argv[0]);
25 + rVal = (rVal > 0)? 1.0 : (rVal < 0)? -1.0 : 0;
26 + sqlite3_result_double(context, rVal);
33 ** Implementation of the substr() function.
35 ** substr(x,p1,p2) returns p2 characters of x[] beginning with p1.
37 FUNCTION(substr, 2, 0, 0, substrFunc ),
38 FUNCTION(substr, 3, 0, 0, substrFunc ),
39 FUNCTION(abs, 1, 0, 0, absFunc ),
40 + FUNCTION(sign, 1, 0, 0, signFunc ),
41 #ifndef SQLITE_OMIT_FLOATING_POINT
42 FUNCTION(round, 1, 0, 0, roundFunc ),
43 FUNCTION(round, 2, 0, 0, roundFunc ),