diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 1 | ||||
-rw-r--r-- | src/delete.c | 2 | ||||
-rw-r--r-- | src/fkey.c | 2 | ||||
-rw-r--r-- | src/vdbeblob.c | 4 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c index 666d1b8ba..556264193 100644 --- a/src/build.c +++ b/src/build.c @@ -1653,6 +1653,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ assert( pParse->pNewTable==pTab ); pPk = sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0); if( pPk==0 ) return; + pPk->autoIndex = 2; pTab->iPKey = -1; }else{ pPk = sqlite3PrimaryKeyIndex(pTab); diff --git a/src/delete.c b/src/delete.c index 5d7078a4b..522b378e8 100644 --- a/src/delete.c +++ b/src/delete.c @@ -399,8 +399,6 @@ void sqlite3DeleteFrom( */ sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, iTabCur, &iDataCur, &iIdxCur); - assert( iDataCur!=iTabCur ); - assert( iDataCur>=iIdxCur ); /* Loop over the primary keys to be deleted. */ addr = sqlite3VdbeAddOp1(v, OP_Rewind, iEph); diff --git a/src/fkey.c b/src/fkey.c index 95f1d632c..fc39d2fea 100644 --- a/src/fkey.c +++ b/src/fkey.c @@ -544,7 +544,7 @@ static void fkScanChildren( ** is taking place as part of a DELETE operation (operation D.2), omit the ** row being deleted from the scan by adding ($rowid != rowid) to the WHERE ** clause, where $rowid is the rowid of the row being deleted. */ - if( pTab==pFKey->pFrom && nIncr>0 ){ + if( pTab==pFKey->pFrom && nIncr>0 && HasRowid(pTab) /*FIXME*/ ){ Expr *pEq; /* Expression (pLeft = pRight) */ Expr *pLeft; /* Value from parent table row */ Expr *pRight; /* Column ref to child table */ diff --git a/src/vdbeblob.c b/src/vdbeblob.c index 4953579c6..0c4ebf6e4 100644 --- a/src/vdbeblob.c +++ b/src/vdbeblob.c @@ -178,6 +178,10 @@ int sqlite3_blob_open( pTab = 0; sqlite3ErrorMsg(pParse, "cannot open virtual table: %s", zTable); } + if( pTab && !HasRowid(pTab) ){ + pTab = 0; + sqlite3ErrorMsg(pParse, "cannot open table without rowid: %s", zTable); + } #ifndef SQLITE_OMIT_VIEW if( pTab && pTab->pSelect ){ pTab = 0; |