diff options
author | drh <drh@noemail.net> | 2003-03-07 19:50:07 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2003-03-07 19:50:07 +0000 |
commit | 9468c7f489259174d8ec41b9db3adbdd87527b27 (patch) | |
tree | ef5d384ea50df82970bd98604991d37604de4e32 /src | |
parent | 2299706c2a10717fd3926e8d8252dcf465bac606 (diff) | |
download | sqlite-9468c7f489259174d8ec41b9db3adbdd87527b27.tar.gz sqlite-9468c7f489259174d8ec41b9db3adbdd87527b27.zip |
Do not allow an empty string to be inserted into an INTEGER PRIMARY KEY. (CVS 877)
FossilOrigin-Name: 2aba40bea5fc1c4aef8cfd4c790d40808821ca14
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index beca50611..e7b8732f9 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -36,7 +36,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.206 2003/03/01 19:45:34 drh Exp $ +** $Id: vdbe.c,v 1.207 2003/03/07 19:50:07 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -994,6 +994,7 @@ static int toInt(const char *zNum, int *pNum){ }else{ neg = 0; } + if( *zNum==0 ) return 0; while( isdigit(*zNum) ){ v = v*10 + *zNum - '0'; zNum++; @@ -1569,8 +1570,8 @@ void sqliteVdbeMakeReady( ** immediately. There will be no error message but the p->rc field is ** set to SQLITE_ABORT and this routine will return SQLITE_ERROR. ** -** A memory allocation error causes p->rc to be set SQLITE_NOMEM and this -** routien to return SQLITE_ERROR. +** A memory allocation error causes p->rc to be set to SQLITE_NOMEM and this +** routine to return SQLITE_ERROR. ** ** Other fatal errors return SQLITE_ERROR. ** |