aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/resolve.c4
-rw-r--r--src/vdbe.c13
2 files changed, 11 insertions, 6 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 51f7560a1..26a6cc03e 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -253,7 +253,7 @@ static int lookupName(
}
}
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) ){
- iCol = -1;
+ iCol = -1; /* IMP: R-44911-55124 */
}
if( iCol<pTab->nCol ){
cnt++;
@@ -281,7 +281,7 @@ static int lookupName(
*/
if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){
cnt = 1;
- pExpr->iColumn = -1;
+ pExpr->iColumn = -1; /* IMP: R-44911-55124 */
pExpr->affinity = SQLITE_AFF_INTEGER;
}
diff --git a/src/vdbe.c b/src/vdbe.c
index 10401a47a..aef20c592 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -3663,7 +3663,7 @@ case OP_NewRowid: { /* out2-prerelease */
goto abort_due_to_error;
}
if( res ){
- v = 1;
+ v = 1; /* IMP: R-61914-48074 */
}else{
assert( sqlite3BtreeCursorIsValid(pC->pCursor) );
rc = sqlite3BtreeKeySize(pC->pCursor, &v);
@@ -3671,7 +3671,7 @@ case OP_NewRowid: { /* out2-prerelease */
if( v==MAX_ROWID ){
pC->useRandomRowid = 1;
}else{
- v++;
+ v++; /* IMP: R-29538-34987 */
}
}
}
@@ -3695,7 +3695,7 @@ case OP_NewRowid: { /* out2-prerelease */
sqlite3VdbeMemIntegerify(pMem);
assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
- rc = SQLITE_FULL;
+ rc = SQLITE_FULL; /* IMP: R-12275-61338 */
goto abort_due_to_error;
}
if( v<pMem->u.i+1 ){
@@ -3708,6 +3708,11 @@ case OP_NewRowid: { /* out2-prerelease */
sqlite3BtreeSetCachedRowid(pC->pCursor, v<MAX_ROWID ? v+1 : 0);
}
if( pC->useRandomRowid ){
+ /* IMPLEMENTATION-OF: R-48598-02938 If the largest ROWID is equal to the
+ ** largest possible integer (9223372036854775807) then the database
+ ** engine starts picking candidate ROWIDs at random until it finds one
+ ** that is not previously used.
+ */
assert( pOp->p3==0 ); /* We cannot be in random rowid mode if this is
** an AUTOINCREMENT table. */
v = db->lastRowid;
@@ -3723,7 +3728,7 @@ case OP_NewRowid: { /* out2-prerelease */
cnt++;
}while( cnt<100 && rc==SQLITE_OK && res==0 );
if( rc==SQLITE_OK && res==0 ){
- rc = SQLITE_FULL;
+ rc = SQLITE_FULL; /* IMP: R-38219-53002 */
goto abort_due_to_error;
}
}