diff options
author | drh <drh@noemail.net> | 2010-09-30 00:50:49 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-09-30 00:50:49 +0000 |
commit | 9339da1f224fe26ff4304f21a1bfc158fda60727 (patch) | |
tree | b959b17fb858137575461cd9a2c133200c330c2d /src/expr.c | |
parent | fac2bd452a538dd274b257c7fc924c70cf6c7627 (diff) | |
download | sqlite-9339da1f224fe26ff4304f21a1bfc158fda60727.tar.gz sqlite-9339da1f224fe26ff4304f21a1bfc158fda60727.zip |
Rework the text to numeric conversion routines so that they work with either
UTF8 or UTF16 and do not require a NULL terminator. This allowed text to
numeric conversion without reallocating the string.
FossilOrigin-Name: 14eed3a0e0a45c6f2904a3a134aa27c159916f7b
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index 247463521..cf1823d9d 100644 --- a/src/expr.c +++ b/src/expr.c @@ -555,7 +555,7 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ /* Wildcard of the form "?nnn". Convert "nnn" to an integer and ** use it as the variable number */ i64 i; - int bOk = sqlite3Atoi64(&z[1], &i); + int bOk = sqlite3Atoi64(&z[1], &i, sqlite3Strlen30(&z[1]), SQLITE_UTF8); pExpr->iColumn = (ynVar)i; testcase( i==0 ); testcase( i==1 ); @@ -1918,7 +1918,7 @@ static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){ if( ALWAYS(z!=0) ){ double value; char *zV; - sqlite3AtoF(z, &value); + sqlite3AtoF(z, &value, sqlite3Strlen30(z), SQLITE_UTF8); assert( !sqlite3IsNaN(value) ); /* The new AtoF never returns NaN */ if( negateFlag ) value = -value; zV = dup8bytes(v, (char*)&value); @@ -1948,7 +1948,7 @@ static void codeInteger(Parse *pParse, Expr *pExpr, int negFlag, int iMem){ if( sqlite3FitsIn64Bits(z, negFlag) ){ i64 value; char *zV; - sqlite3Atoi64(z, &value); + sqlite3Atoi64(z, &value, sqlite3Strlen30(z), SQLITE_UTF8); if( negFlag ) value = -value; zV = dup8bytes(v, (char*)&value); sqlite3VdbeAddOp4(v, OP_Int64, 0, iMem, 0, zV, P4_INT64); |