mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Minor simplification of the cursor allocation logic for update.
FossilOrigin-Name: fdf71be65835e7e8915d16dd64114de35c4754ef5b94a2af6cac88a94817fb75
This commit is contained in:
@@ -201,16 +201,17 @@ void sqlite3Update(
|
||||
** need to occur right after the database cursor. So go ahead and
|
||||
** allocate enough space, just in case.
|
||||
*/
|
||||
pTabList->a[0].iCursor = iBaseCur = iDataCur = pParse->nTab++;
|
||||
iBaseCur = iDataCur = pParse->nTab++;
|
||||
iIdxCur = iDataCur+1;
|
||||
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
|
||||
testcase( pPk!=0 && pPk!=pTab->pIndex );
|
||||
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
|
||||
if( IsPrimaryKeyIndex(pIdx) && pPk!=0 ){
|
||||
if( pPk==pIdx ){
|
||||
iDataCur = pParse->nTab;
|
||||
pTabList->a[0].iCursor = iDataCur;
|
||||
}
|
||||
pParse->nTab++;
|
||||
}
|
||||
pTabList->a[0].iCursor = iDataCur;
|
||||
|
||||
/* Allocate space for aXRef[], aRegIdx[], and aToOpen[].
|
||||
** Initialize aXRef[] and aToOpen[] to their default values.
|
||||
|
Reference in New Issue
Block a user