Lines Matching defs:pTab

28   Table *pTab = 0;
33 pTab = sqliteLocateTable(pParse, zTab, zDb);
34 pSrc->a[i].pTab = pTab;
36 return pTab;
44 int sqliteIsReadOnly(Parse *pParse, Table *pTab, int viewOk){
45 if( pTab->readOnly ){
46 sqliteErrorMsg(pParse, "table %s may not be modified", pTab->zName);
49 if( !viewOk && pTab->pSelect ){
50 sqliteErrorMsg(pParse, "cannot modify %s because it is a view",pTab->zName);
65 Table *pTab; /* The table from which records will be deleted */
66 const char *zDb; /* Name of database holding pTab */
71 int iCur; /* VDBE Cursor number for pTab */
94 pTab = sqliteSrcListLookup(pParse, pTabList);
95 if( pTab==0 ) goto delete_from_cleanup;
96 before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger,
98 after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger,
101 isView = pTab->pSelect!=0;
102 if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){
105 assert( pTab->iDb<db->nDb );
106 zDb = db->aDb[pTab->iDb].zName;
107 if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
111 /* If pTab is really a view, make sure it has been initialized.
113 if( isView && sqliteViewGetColumnNames(pParse, pTab) ){
139 sqliteAuthContextPush(pParse, &sContext, pTab->zName);
148 sqliteBeginWriteOperation(pParse, row_triggers_exist, pTab->iDb);
154 Select *pView = sqliteSelectDup(pTab->pSelect);
177 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
178 sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);
187 sqliteVdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb);
188 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
234 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
235 sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);
246 sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1,
259 sqliteOpenTableAndIndices(pParse, pTab, iCur);
268 sqliteGenerateRowDelete(db, v, pTab, iCur, pParse->trigStack==0);
276 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
281 sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1,
293 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
326 ** 1. A read/write cursor pointing to pTab, the table containing the row
329 ** 2. Read/write cursors for all indices of pTab must be open as
342 Table *pTab, /* Table containing the row to be deleted */
348 sqliteGenerateRowIndexDelete(db, v, pTab, iCur, 0);
361 ** 1. A read/write cursor pointing to pTab, the table containing the row
364 ** 2. Read/write cursors for all indices of pTab must be open as
373 Table *pTab, /* Table containing the row to be deleted */
380 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
386 if( idx==pTab->iPKey ){