mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Moving UPDATE towards the iDataCur/iIdxCur representation. Still not working
for WITHOUT ROWID, though. FossilOrigin-Name: deacbd21b50cc8c63a1572d14a4bbc7af4052d37
This commit is contained in:
35
src/insert.c
35
src/insert.c
@@ -1122,41 +1122,6 @@ insert_cleanup:
|
||||
#undef tmask
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Locate the "principle btree" for a table. This is the table itself for
|
||||
** ordinary tables, but for WITHOUT ROWID tables, the principle btree is the
|
||||
** PRIMARY KEY index.
|
||||
**
|
||||
** Inputs are pTab and baseCur. The *ppPk is written with a pointer to the
|
||||
** PRIMARY KEY index for WITHOUT ROWID tables or with NULL for ordinary
|
||||
** tables. The *piPkCur is written with the cursor to use, assuming that the
|
||||
** table cursor is baseCur and that index cursors are consecutively numbered
|
||||
** thereafter.
|
||||
*/
|
||||
void sqlite3PrincipleBtree(
|
||||
Table *pTab, /* The main Table object */
|
||||
int baseCur, /* VDBE cursor for main table. */
|
||||
Index **ppPk, /* Write PRIMARY KEY index of WITHOUT ROWID tables here */
|
||||
int *piPkCur /* Either baseCur or the cursor for *ppPk */
|
||||
){
|
||||
int pkCur;
|
||||
Index *pPk;
|
||||
if( !HasRowid(pTab) ){
|
||||
pkCur = baseCur+1;
|
||||
pPk = pTab->pIndex;
|
||||
while( ALWAYS(pPk) && pPk->autoIndex!=2 ){
|
||||
pPk=pPk->pNext;
|
||||
pkCur++;
|
||||
}
|
||||
}else{
|
||||
pkCur = baseCur;
|
||||
pPk = 0;
|
||||
}
|
||||
*ppPk = pPk;
|
||||
*piPkCur = pkCur;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Generate code to do constraint checks prior to an INSERT or an UPDATE.
|
||||
**
|
||||
|
||||
Reference in New Issue
Block a user