Record the database name in addition to the table name for DELETE, INSERT,
and UPDATE statements. (CVS 879)
FossilOrigin-Name: a5d8fc95ee58dc3205a0bbbcadaa3b9c902a941b
diff --git a/src/expr.c b/src/expr.c
index 8ee9802..47a7dd1 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.88 2003/01/31 17:16:37 drh Exp $
+** $Id: expr.c,v 1.89 2003/03/20 01:16:59 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -184,12 +184,12 @@
SrcList *sqliteSrcListDup(SrcList *p){
SrcList *pNew;
int i;
+ int nByte;
if( p==0 ) return 0;
- pNew = sqliteMalloc( sizeof(*pNew) );
+ nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
+ pNew = sqliteMalloc( nByte );
if( pNew==0 ) return 0;
pNew->nSrc = p->nSrc;
- pNew->a = sqliteMalloc( p->nSrc*sizeof(p->a[0]) );
- if( pNew->a==0 && p->nSrc != 0 ) return 0;
for(i=0; i<p->nSrc; i++){
pNew->a[i].zName = sqliteStrDup(p->a[i].zName);
pNew->a[i].zAlias = sqliteStrDup(p->a[i].zAlias);