mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Introduce the (experimental) sqlite3_result_error_toobig() API that
function implementations can use to signal SQLite that the function result is too big to represent. (CVS 3949) FossilOrigin-Name: 17c4235c492f746867c1d2b8621043b93f8aa10e
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
|
||||
** All other code has file scope.
|
||||
**
|
||||
** $Id: date.c,v 1.64 2007/05/04 13:15:56 drh Exp $
|
||||
** $Id: date.c,v 1.65 2007/05/08 15:15:02 drh Exp $
|
||||
**
|
||||
** NOTES:
|
||||
**
|
||||
@@ -774,7 +774,8 @@ static void strftimeFunc(
|
||||
sqlite3_value **argv
|
||||
){
|
||||
DateTime x;
|
||||
int n, i, j;
|
||||
u64 n;
|
||||
int i, j;
|
||||
char *z;
|
||||
const char *zFmt = (const char*)sqlite3_value_text(argv[0]);
|
||||
char zBuf[100];
|
||||
@@ -814,6 +815,9 @@ static void strftimeFunc(
|
||||
}
|
||||
if( n<sizeof(zBuf) ){
|
||||
z = zBuf;
|
||||
}else if( n>SQLITE_MAX_LENGTH ){
|
||||
sqlite3_result_error_toobig(context);
|
||||
return;
|
||||
}else{
|
||||
z = sqliteMalloc( n );
|
||||
if( z==0 ) return;
|
||||
|
Reference in New Issue
Block a user