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

(1) Vdbe makes a copy of column types. (2) Don't invalidate other cursors

when a statement or transaction is rolled back. (3) Update capi2.test for
the new API. (CVS 1597)

FossilOrigin-Name: 4f5e2530829ef91753b083b5f2a1d7332e311cb6
This commit is contained in:
danielk1977
2004-06-15 02:44:18 +00:00
parent 0c6cc4ed19
commit fbcd585fe6
8 changed files with 330 additions and 136 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.189 2004/06/12 09:25:18 danielk1977 Exp $
** $Id: select.c,v 1.190 2004/06/15 02:44:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -644,6 +644,7 @@ static const char *columnType(Parse *pParse, SrcList *pTabList, Expr *pExpr){
zType = "INTEGER";
}else{
zType = pTab->aCol[iCol].zType;
if( !zType ) zType = "";
}
}else{
switch( sqlite3ExprType(pExpr) ){
@@ -670,7 +671,10 @@ static void generateColumnTypes(
Expr *p = pEList->a[i].pExpr;
const char *zType = columnType(pParse, pTabList, p);
if( p==0 ) continue;
sqlite3VdbeSetColName(v, i+pEList->nExpr, zType, P3_STATIC);
/* The vdbe must make it's own copy of the column-type, in case the
** schema is reset before this virtual machine is deleted.
*/
sqlite3VdbeSetColName(v, i+pEList->nExpr, zType, strlen(zType));
}
}