aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2015-08-28 15:50:24 +0000
committerdan <dan@noemail.net>2015-08-28 15:50:24 +0000
commit8f9ea2dc70cc160b4cae49887aa54b9e1464a22c (patch)
treee2b34af7e5f6173bb86cdcaf55a1ae9989820622 /src/insert.c
parentb8c7cfb8345831b58ee81f202580a557541c9472 (diff)
parentf6ec8d4f4cdd858c052f09091f2bac706ec9cde4 (diff)
downloadsqlite-8f9ea2dc70cc160b4cae49887aa54b9e1464a22c.tar.gz
sqlite-8f9ea2dc70cc160b4cae49887aa54b9e1464a22c.zip
Merge latest trunk into this branch.
FossilOrigin-Name: ab93024da7bd577d8850b417aff8597a8b3807fc
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/insert.c b/src/insert.c
index 05d84df84..c6a0ad705 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -69,7 +69,7 @@ void sqlite3OpenTable(
** is managed along with the rest of the Index structure. It will be
** released when sqlite3DeleteIndex() is called.
*/
-const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
+const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){
if( !pIdx->zColAff ){
/* The first time a column affinity string for a particular index is
** required, it is allocated and populated here. It is then stored as
@@ -81,7 +81,6 @@ const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
*/
int n;
Table *pTab = pIdx->pTable;
- sqlite3 *db = sqlite3VdbeDb(v);
pIdx->zColAff = (char *)sqlite3DbMallocRaw(0, pIdx->nColumn+1);
if( !pIdx->zColAff ){
db->mallocFailed = 1;
@@ -705,11 +704,13 @@ void sqlite3Insert(
sNC.pParse = pParse;
srcTab = -1;
assert( useTempTable==0 );
- nColumn = pList ? pList->nExpr : 0;
- for(i=0; i<nColumn; i++){
- if( sqlite3ResolveExprNames(&sNC, pList->a[i].pExpr) ){
+ if( pList ){
+ nColumn = pList->nExpr;
+ if( sqlite3ResolveExprListNames(&sNC, pList) ){
goto insert_cleanup;
}
+ }else{
+ nColumn = 0;
}
}