Lines Matching refs:pTab

27 **    pSrc->a[0].pTab       Pointer to the Table object
33 Table *pTab;
35 pTab = sqlite3LocateTable(pParse, 0, pItem->zName, pItem->zDatabase);
36 sqlite3DeleteTable(pParse->db, pItem->pTab);
37 pItem->pTab = pTab;
38 if( pTab ){
39 pTab->nRef++;
42 pTab = 0;
44 return pTab;
52 int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
63 if( ( IsVirtual(pTab)
64 && sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 )
65 || ( (pTab->tabFlags & TF_Readonly)!=0
69 sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName);
74 if( !viewOk && pTab->pSelect ){
75 sqlite3ErrorMsg(pParse,"cannot modify %s because it is a view",pTab->zName);
229 Table *pTab; /* The table from which records will be deleted */
230 const char *zDb; /* Name of database holding pTab */
235 int iCur; /* VDBE Cursor number for pTab */
260 pTab = sqlite3SrcListLookup(pParse, pTabList);
261 if( pTab==0 ) goto delete_from_cleanup;
267 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
268 isView = pTab->pSelect!=0;
278 /* If pTab is really a view, make sure it has been initialized.
280 if( sqlite3ViewGetColumnNames(pParse, pTab) ){
284 if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){
287 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
290 rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb);
301 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
308 sqlite3AuthContextPush(pParse, &sContext, pTab->zName);
325 sqlite3MaterializeView(pParse, pTab, pWhere, iCur);
351 if( rcauth==SQLITE_OK && pWhere==0 && !pTrigger && !IsVirtual(pTab)
352 && 0==sqlite3FkRequired(pParse, pTab, 0, 0)
355 sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt,
356 pTab->zName, P4_STATIC);
357 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
358 assert( pIdx->pSchema==pTab->pSchema );
376 regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid);
393 sqlite3OpenTableAndIndices(pParse, pTab, iCur, OP_OpenWrite);
400 if( IsVirtual(pTab) ){
401 const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
402 sqlite3VtabMakeWritable(pParse, pTab);
409 sqlite3GenerateRowDelete(pParse, pTab, iCur, iRowid, count, pTrigger, OE_Default);
417 if( !isView && !IsVirtual(pTab) ){
418 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
466 ** 1. A read/write cursor pointing to pTab, the table containing the row
469 ** 2. Read/write cursors for all indices of pTab must be open as
480 Table *pTab, /* Table containing the row to be deleted */
502 if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
509 pParse, pTrigger, 0, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onconf
511 mask |= sqlite3FkOldmask(pParse, pTab);
513 pParse->nMem += (1 + pTab->nCol);
518 for(iCol=0; iCol<pTab->nCol; iCol++){
520 sqlite3ExprCodeGetColumnOfTable(v, pTab, iCur, iCol, iOld+iCol+1);
526 TK_DELETE, 0, TRIGGER_BEFORE, pTab, iOld, onconf, iLabel
538 sqlite3FkCheck(pParse, pTab, iOld, 0);
541 /* Delete the index and table entries. Skip this step if pTab is really
544 if( pTab->pSelect==0 ){
545 sqlite3GenerateRowIndexDelete(pParse, pTab, iCur, 0);
548 sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_TRANSIENT);
555 sqlite3FkActions(pParse, pTab, 0, iOld);
559 TK_DELETE, 0, TRIGGER_AFTER, pTab, iOld, onconf, iLabel
575 ** 1. A read/write cursor pointing to pTab, the table containing the row
578 ** 2. Read/write cursors for all indices of pTab must be open as
586 Table *pTab, /* Table containing the row to be deleted */
594 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
603 ** regOut. The key with be for index pIdx which is an index on pTab.
604 ** iCur is the index of a cursor open on the pTab table and pointing to
621 Table *pTab = pIdx->pTable;
630 if( idx==pTab->iPKey ){
634 sqlite3ColumnDefault(v, pTab, idx, -1);