1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

rework the VDBE engine. NULL is now distinct from "" (CVS 49)

FossilOrigin-Name: 6ea5cebf05562de00d2cf0b9e2aac5f3857638ee
This commit is contained in:
drh
2000-06-04 12:58:36 +00:00
parent 32aa77ed6e
commit c61053b771
11 changed files with 568 additions and 341 deletions

View File

@@ -24,7 +24,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements.
**
** $Id: insert.c,v 1.4 2000/06/03 18:06:53 drh Exp $
** $Id: insert.c,v 1.5 2000/06/04 12:58:38 drh Exp $
*/
#include "sqliteInt.h"
@@ -122,8 +122,11 @@ void sqliteInsert(
}
if( pField && j>=pField->nId ){
char *zDflt = pTab->aCol[i].zDflt;
if( zDflt==0 ) zDflt = "";
sqliteVdbeAddOp(v, OP_String, 0, 0, zDflt, 0);
if( zDflt==0 ){
sqliteVdbeAddOp(v, OP_Null, 0, 0, 0, 0);
}else{
sqliteVdbeAddOp(v, OP_String, 0, 0, zDflt, 0);
}
}else{
sqliteExprCode(pParse, pList->a[j].pExpr);
}
@@ -146,8 +149,11 @@ void sqliteInsert(
}
if( pField && j>=pField->nId ){
char *zDflt = pTab->aCol[idx].zDflt;
if( zDflt==0 ) zDflt = "";
sqliteVdbeAddOp(v, OP_String, 0, 0, zDflt, 0);
if( zDflt==0 ){
sqliteVdbeAddOp(v, OP_Null, 0, 0, 0, 0);
}else{
sqliteVdbeAddOp(v, OP_String, 0, 0, zDflt, 0);
}
}else{
sqliteExprCode(pParse, pList->a[j].pExpr);
}