Add evidence marks associated with autoincrement.

FossilOrigin-Name: 0e918c54893c361fb005295847f89aadcbfae35d
This commit is contained in:
drh 2010-01-01 18:57:48 +00:00
parent 5cfa584831
commit c79c761f84
4 changed files with 22 additions and 17 deletions

View File

@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Add\scomments\sand\san\sassert()\sto\shelp\sclarify\sthe\soperation\sof\sthe\nsqlite3VdbeList()\sroutine\sused\sto\simplement\sEXPLAIN.
D 2009-12-31T20:35:08
C Add\sevidence\smarks\sassociated\swith\sautoincrement.
D 2010-01-01T18:57:48
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -163,7 +163,7 @@ F src/pragma.c 6936d7df5e04b9f996f8f320d15e65b6944b2caa
F src/prepare.c 170bd953058efe1c46b8ad9020d49cd6f40f0b45
F src/printf.c 644bc7d59df3dc56d6d8b9a510914bfc6b51bc69
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c e8e0866009405b24b81791b8cabc4463fd1d7ebb
F src/resolve.c 69a45df25039eb58e321653914ad670ffe49d486
F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
F src/select.c 0109b993c360d649857523abb72919e1794f9b45
F src/shell.c b9fae60b0f2ce306c20fa99e83c75023bf35f15b
@ -212,7 +212,7 @@ F src/update.c c0dc6b75ad28b76b619042d934f337b02acee208
F src/utf.c dad16adcc0c35ef2437dca125a4b07419d361052
F src/util.c ad4f03079ba0fe83590d1cc9197e8e4844e38592
F src/vacuum.c db6415fd0f1be191e16228457a6deb9f232e6ad6
F src/vdbe.c 5ed06318aac5d57849170a8bf39e807c22c5fedd
F src/vdbe.c e05765736504d9dbcbb3dfa8964932780002ec39
F src/vdbe.h bea1f0cd530775bdb58a340265f3cf3ee920e9b2
F src/vdbeInt.h d7ea821ac7813c9bea0fe87558c35e07b2c7c44d
F src/vdbeapi.c fc3787eb2f5487d4cc3444de42d56f2e39d311f5
@ -786,14 +786,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 97f8a886b6314b044a0522a88f569798fdfb3ef9
R ec2bfde20add495412a6ede87e046ffd
P e1ccdb93d79a6f7b16f1f59cc3ad78f8d02eae84
R e8f64ea35cd805e82f52b2a556e34139
U drh
Z 7d63ddb9262e6acf68d6ca4997c73dd9
Z 394e360eb5d1df957fe55c257efb31a6
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFLPQr+oxKgR168RlERAvY/AJ9kaCj6kLbG2bTFSo/X9qosbF5uHQCff9FG
yWtwufLA/m9wpfdsngsfSh4=
=0KpD
iD8DBQFLPkWvoxKgR168RlERAtsJAJwKfkre0Bw1zrZ2r7ADRBOPhGeUFwCeKg/n
1gzLrYYIpH++nnmQeRwJHWU=
=j3Nq
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
e1ccdb93d79a6f7b16f1f59cc3ad78f8d02eae84
0e918c54893c361fb005295847f89aadcbfae35d

View File

@ -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;
}

View File

@ -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;
}
}