亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? delete.c

?? Trolltech公司發布的基于C++圖形開發環境
?? C
字號:
/*** 2001 September 15**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** This file contains C code routines that are called by the parser** to handle DELETE FROM statements.**** $Id: qt/delete.c   3.3.4   edited Mar 30 2004 $*/#include "sqliteInt.h"/*** Look up every table that is named in pSrc.  If any table is not found,** add an error message to pParse->zErrMsg and return NULL.  If all tables** are found, return a pointer to the last table.*/Table *sqliteSrcListLookup(Parse *pParse, SrcList *pSrc){  Table *pTab = 0;  int i;  for(i=0; i<pSrc->nSrc; i++){    const char *zTab = pSrc->a[i].zName;    const char *zDb = pSrc->a[i].zDatabase;    pTab = sqliteLocateTable(pParse, zTab, zDb);    pSrc->a[i].pTab = pTab;  }  return pTab;}/*** Check to make sure the given table is writable.  If it is not** writable, generate an error message and return 1.  If it is** writable return 0;*/int sqliteIsReadOnly(Parse *pParse, Table *pTab, int viewOk){  if( pTab->readOnly ){    sqliteErrorMsg(pParse, "table %s may not be modified", pTab->zName);    return 1;  }  if( !viewOk && pTab->pSelect ){    sqliteErrorMsg(pParse, "cannot modify %s because it is a view",pTab->zName);    return 1;  }  return 0;}/*** Process a DELETE FROM statement.*/void sqliteDeleteFrom(  Parse *pParse,         /* The parser context */  SrcList *pTabList,     /* The table from which we should delete things */  Expr *pWhere           /* The WHERE clause.  May be null */){  Vdbe *v;               /* The virtual database engine */  Table *pTab;           /* The table from which records will be deleted */  const char *zDb;       /* Name of database holding pTab */  int end, addr;         /* A couple addresses of generated code */  int i;                 /* Loop counter */  WhereInfo *pWInfo;     /* Information about the WHERE clause */  Index *pIdx;           /* For looping over indices of the table */  int iCur;              /* VDBE Cursor number for pTab */  sqlite *db;            /* Main database structure */  int isView;            /* True if attempting to delete from a view */  AuthContext sContext;  /* Authorization context */  int row_triggers_exist = 0;  /* True if any triggers exist */  int before_triggers;         /* True if there are BEFORE triggers */  int after_triggers;          /* True if there are AFTER triggers */  int oldIdx = -1;             /* Cursor for the OLD table of AFTER triggers */  sContext.pParse = 0;  if( pParse->nErr || sqlite_malloc_failed ){    pTabList = 0;    goto delete_from_cleanup;  }  db = pParse->db;  assert( pTabList->nSrc==1 );  /* Locate the table which we want to delete.  This table has to be  ** put in an SrcList structure because some of the subroutines we  ** will be calling are designed to work with multiple tables and expect  ** an SrcList* parameter instead of just a Table* parameter.  */  pTab = sqliteSrcListLookup(pParse, pTabList);  if( pTab==0 )  goto delete_from_cleanup;  before_triggers = sqliteTriggersExist(pParse, pTab->pTrigger,                          TK_DELETE, TK_BEFORE, TK_ROW, 0);  after_triggers = sqliteTriggersExist(pParse, pTab->pTrigger,                          TK_DELETE, TK_AFTER, TK_ROW, 0);  row_triggers_exist = before_triggers || after_triggers;  isView = pTab->pSelect!=0;  if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){    goto delete_from_cleanup;  }  assert( pTab->iDb<db->nDb );  zDb = db->aDb[pTab->iDb].zName;  if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){    goto delete_from_cleanup;  }  /* If pTab is really a view, make sure it has been initialized.  */  if( isView && sqliteViewGetColumnNames(pParse, pTab) ){    goto delete_from_cleanup;  }  /* Allocate a cursor used to store the old.* data for a trigger.  */  if( row_triggers_exist ){     oldIdx = pParse->nTab++;  }  /* Resolve the column names in all the expressions.  */  assert( pTabList->nSrc==1 );  iCur = pTabList->a[0].iCursor = pParse->nTab++;  if( pWhere ){    if( sqliteExprResolveIds(pParse, pTabList, 0, pWhere) ){      goto delete_from_cleanup;    }    if( sqliteExprCheck(pParse, pWhere, 0, 0) ){      goto delete_from_cleanup;    }  }  /* Start the view context  */  if( isView ){    sqliteAuthContextPush(pParse, &sContext, pTab->zName);  }  /* Begin generating code.  */  v = sqliteGetVdbe(pParse);  if( v==0 ){    goto delete_from_cleanup;  }  sqliteBeginWriteOperation(pParse, row_triggers_exist, pTab->iDb);  /* If we are trying to delete from a view, construct that view into  ** a temporary table.  */  if( isView ){    Select *pView = sqliteSelectDup(pTab->pSelect);    sqliteSelect(pParse, pView, SRT_TempTable, iCur, 0, 0, 0);    sqliteSelectDelete(pView);  }  /* Initialize the counter of the number of rows deleted, if  ** we are counting rows.  */  if( db->flags & SQLITE_CountRows ){    sqliteVdbeAddOp(v, OP_Integer, 0, 0);  }  /* Special case: A DELETE without a WHERE clause deletes everything.  ** It is easier just to erase the whole table.  Note, however, that  ** this means that the row change count will be incorrect.  */  if( pWhere==0 && !row_triggers_exist ){    if( db->flags & SQLITE_CountRows ){      /* If counting rows deleted, just count the total number of      ** entries in the table. */      int endOfLoop = sqliteVdbeMakeLabel(v);      int addr;      if( !isView ){        sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);        sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);      }      sqliteVdbeAddOp(v, OP_Rewind, iCur, sqliteVdbeCurrentAddr(v)+2);      addr = sqliteVdbeAddOp(v, OP_AddImm, 1, 0);      sqliteVdbeAddOp(v, OP_Next, iCur, addr);      sqliteVdbeResolveLabel(v, endOfLoop);      sqliteVdbeAddOp(v, OP_Close, iCur, 0);    }    if( !isView ){      sqliteVdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb);      for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){        sqliteVdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb);      }    }  }  /* The usual case: There is a WHERE clause so we have to scan through  ** the table and pick which records to delete.  */  else{    /* Begin the database scan    */    pWInfo = sqliteWhereBegin(pParse, pTabList, pWhere, 1, 0);    if( pWInfo==0 ) goto delete_from_cleanup;    /* Remember the key of every item to be deleted.    */    sqliteVdbeAddOp(v, OP_ListWrite, 0, 0);    if( db->flags & SQLITE_CountRows ){      sqliteVdbeAddOp(v, OP_AddImm, 1, 0);    }    /* End the database scan loop.    */    sqliteWhereEnd(pWInfo);    /* Open the pseudo-table used to store OLD if there are triggers.    */    if( row_triggers_exist ){      sqliteVdbeAddOp(v, OP_OpenPseudo, oldIdx, 0);    }    /* Delete every item whose key was written to the list during the    ** database scan.  We have to delete items after the scan is complete    ** because deleting an item can change the scan order.    */    sqliteVdbeAddOp(v, OP_ListRewind, 0, 0);    end = sqliteVdbeMakeLabel(v);    /* This is the beginning of the delete loop when there are    ** row triggers.    */    if( row_triggers_exist ){      addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end);      sqliteVdbeAddOp(v, OP_Dup, 0, 0);      if( !isView ){        sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);        sqliteVdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);      }      sqliteVdbeAddOp(v, OP_MoveTo, iCur, 0);      sqliteVdbeAddOp(v, OP_Recno, iCur, 0);      sqliteVdbeAddOp(v, OP_RowData, iCur, 0);      sqliteVdbeAddOp(v, OP_PutIntKey, oldIdx, 0);      if( !isView ){        sqliteVdbeAddOp(v, OP_Close, iCur, 0);      }      sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1,           oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,	  addr);    }    if( !isView ){      /* Open cursors for the table we are deleting from and all its      ** indices.  If there are row triggers, this happens inside the      ** OP_ListRead loop because the cursor have to all be closed      ** before the trigger fires.  If there are no row triggers, the      ** cursors are opened only once on the outside the loop.      */      pParse->nTab = iCur + 1;      sqliteOpenTableAndIndices(pParse, pTab, iCur);      /* This is the beginning of the delete loop when there are no      ** row triggers */      if( !row_triggers_exist ){         addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end);      }      /* Delete the row */      sqliteGenerateRowDelete(db, v, pTab, iCur, pParse->trigStack==0);    }    /* If there are row triggers, close all cursors then invoke    ** the AFTER triggers    */    if( row_triggers_exist ){      if( !isView ){        for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){          sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum);        }        sqliteVdbeAddOp(v, OP_Close, iCur, 0);      }      sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1,           oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,	  addr);    }    /* End of the delete loop */    sqliteVdbeAddOp(v, OP_Goto, 0, addr);    sqliteVdbeResolveLabel(v, end);    sqliteVdbeAddOp(v, OP_ListReset, 0, 0);    /* Close the cursors after the loop if there are no row triggers */    if( !row_triggers_exist ){      for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){        sqliteVdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum);      }      sqliteVdbeAddOp(v, OP_Close, iCur, 0);      pParse->nTab = iCur;    }  }  sqliteVdbeAddOp(v, OP_SetCounts, 0, 0);  sqliteEndWriteOperation(pParse);  /*  ** Return the number of rows that were deleted.  */  if( db->flags & SQLITE_CountRows ){    sqliteVdbeAddOp(v, OP_ColumnName, 0, 1);    sqliteVdbeChangeP3(v, -1, "rows deleted", P3_STATIC);    sqliteVdbeAddOp(v, OP_Callback, 1, 0);  }delete_from_cleanup:  sqliteAuthContextPop(&sContext);  sqliteSrcListDelete(pTabList);  sqliteExprDelete(pWhere);  return;}/*** This routine generates VDBE code that causes a single row of a** single table to be deleted.**** The VDBE must be in a particular state when this routine is called.** These are the requirements:****   1.  A read/write cursor pointing to pTab, the table containing the row**       to be deleted, must be opened as cursor number "base".****   2.  Read/write cursors for all indices of pTab must be open as**       cursor number base+i for the i-th index.****   3.  The record number of the row to be deleted must be on the top**       of the stack.**** This routine pops the top of the stack to remove the record number** and then generates code to remove both the table record and all index** entries that point to that record.*/void sqliteGenerateRowDelete(  sqlite *db,        /* The database containing the index */  Vdbe *v,           /* Generate code into this VDBE */  Table *pTab,       /* Table containing the row to be deleted */  int iCur,          /* Cursor number for the table */  int count          /* Increment the row change counter */){  int addr;  addr = sqliteVdbeAddOp(v, OP_NotExists, iCur, 0);  sqliteGenerateRowIndexDelete(db, v, pTab, iCur, 0);  sqliteVdbeAddOp(v, OP_Delete, iCur,    (count?OPFLAG_NCHANGE:0) | OPFLAG_CSCHANGE);  sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v));}/*** This routine generates VDBE code that causes the deletion of all** index entries associated with a single row of a single table.**** The VDBE must be in a particular state when this routine is called.** These are the requirements:****   1.  A read/write cursor pointing to pTab, the table containing the row**       to be deleted, must be opened as cursor number "iCur".****   2.  Read/write cursors for all indices of pTab must be open as**       cursor number iCur+i for the i-th index.****   3.  The "iCur" cursor must be pointing to the row that is to be**       deleted.*/void sqliteGenerateRowIndexDelete(  sqlite *db,        /* The database containing the index */  Vdbe *v,           /* Generate code into this VDBE */  Table *pTab,       /* Table containing the row to be deleted */  int iCur,          /* Cursor number for the table */  char *aIdxUsed     /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */){  int i;  Index *pIdx;  for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){    int j;    if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue;    sqliteVdbeAddOp(v, OP_Recno, iCur, 0);    for(j=0; j<pIdx->nColumn; j++){      int idx = pIdx->aiColumn[j];      if( idx==pTab->iPKey ){        sqliteVdbeAddOp(v, OP_Dup, j, 0);      }else{        sqliteVdbeAddOp(v, OP_Column, iCur, idx);      }    }    sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0);    if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx);    sqliteVdbeAddOp(v, OP_IdxDelete, iCur+i, 0);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合狠狠综合久久综合88 | 国产精品国产三级国产普通话三级 | 日韩无一区二区| 国产午夜亚洲精品不卡| 亚洲一区二区精品3399| 国产在线观看一区二区| 欧美日韩视频专区在线播放| 中文久久乱码一区二区| 蜜桃精品视频在线| 欧美无乱码久久久免费午夜一区| 国产情人综合久久777777| 免费一级欧美片在线观看| 色狠狠综合天天综合综合| 欧美国产日本视频| 欧美色图一区二区三区| 欧美激情中文不卡| 国产久卡久卡久卡久卡视频精品| 欧美日韩大陆在线| 亚洲午夜一区二区| 色婷婷精品大在线视频| 亚洲婷婷综合色高清在线| 国产精品正在播放| 久久久久久久久久久久电影| 伦理电影国产精品| 日韩情涩欧美日韩视频| 天天综合网 天天综合色| 欧美午夜一区二区三区| 一区二区三区日本| 色一情一乱一乱一91av| 综合色天天鬼久久鬼色| voyeur盗摄精品| 国产精品高潮呻吟| 成人精品亚洲人成在线| 国产精品美女久久久久高潮| 成人中文字幕合集| 自拍偷自拍亚洲精品播放| 99久久精品费精品国产一区二区| 欧美激情一区三区| 成人18视频日本| 亚洲人吸女人奶水| 欧美最猛黑人xxxxx猛交| 亚洲人xxxx| 在线播放91灌醉迷j高跟美女 | 成人免费三级在线| 亚洲国产成人一区二区三区| 国产成人99久久亚洲综合精品| 国产亚洲综合av| 99久久婷婷国产综合精品电影 | 久久国产麻豆精品| 精品国产在天天线2019| 国产乱码字幕精品高清av| 国产女主播视频一区二区| 波多野结衣在线一区| 一区二区三区四区在线| 日韩视频国产视频| 成人听书哪个软件好| 一区二区三区精品在线| 日韩欧美在线1卡| 成人午夜大片免费观看| 亚洲图片有声小说| 久久久综合九色合综国产精品| 大胆欧美人体老妇| 久久天天做天天爱综合色| 99久久伊人精品| 视频在线观看一区二区三区| 精品成人a区在线观看| 99久久婷婷国产综合精品电影| 亚洲mv在线观看| 中国av一区二区三区| 欧美日韩精品高清| 国产成人在线色| 亚洲区小说区图片区qvod| 精品免费一区二区三区| 92精品国产成人观看免费| 久久成人羞羞网站| 一区二区高清视频在线观看| 精品国产乱码久久久久久久久 | 亚洲国产中文字幕在线视频综合 | 韩国成人在线视频| 亚洲免费视频成人| 久久青草欧美一区二区三区| 欧美吞精做爰啪啪高潮| 国产成人在线视频免费播放| 日本女优在线视频一区二区| 国产精品色婷婷久久58| 日韩欧美区一区二| 色偷偷久久人人79超碰人人澡| 精品制服美女丁香| 亚洲国产va精品久久久不卡综合| 日本一二三不卡| 精品国产露脸精彩对白| 欧美夫妻性生活| 91久久人澡人人添人人爽欧美| 国产精品综合av一区二区国产馆| 日本一不卡视频| 亚洲综合在线五月| 国产精品福利电影一区二区三区四区| 欧美xxxxx牲另类人与| 欧美日韩在线播放三区四区| 99精品视频一区二区三区| 韩国一区二区三区| 久久国产麻豆精品| 琪琪久久久久日韩精品| 日韩中文字幕1| 亚洲国产视频一区二区| 一区二区欧美国产| 亚洲精品水蜜桃| 亚洲女同女同女同女同女同69| 中文字幕第一页久久| 欧美精品一区二区久久久| 日韩一区二区影院| 精品三级av在线| 欧美一级国产精品| 91精品国产综合久久精品性色| 欧美视频日韩视频| 欧美视频一区二区在线观看| 欧美国产精品中文字幕| 国产清纯白嫩初高生在线观看91 | 日韩视频免费观看高清在线视频| 欧美二区在线观看| 欧美一卡二卡三卡四卡| 日韩女优av电影在线观看| 欧美成人a∨高清免费观看| 日韩视频123| 精品国产乱码久久久久久蜜臀| 久久久蜜桃精品| 国产精品乱人伦一区二区| 国产精品二三区| 亚洲一区二区在线免费观看视频| 夜夜嗨av一区二区三区四季av| 亚洲18女电影在线观看| 日本不卡一二三区黄网| 国产在线视频不卡二| 岛国精品一区二区| 欧美亚一区二区| 日韩欧美中文一区二区| 久久亚洲捆绑美女| 亚洲欧洲另类国产综合| 亚洲午夜免费视频| 99精品视频在线播放观看| 亚洲综合视频在线| 亚洲精品精品亚洲| 亚洲成人动漫av| 国产一区二区在线免费观看| 成人午夜精品在线| 911精品产国品一二三产区| 亚洲欧洲制服丝袜| 全国精品久久少妇| 国产高清一区日本| 欧美影院精品一区| 欧美精品一区二区久久久| 国产精品成人网| 免费观看在线综合色| 成人免费精品视频| 正在播放亚洲一区| 欧美国产日韩精品免费观看| 亚洲二区视频在线| 国产大片一区二区| 欧美日韩和欧美的一区二区| 国产女主播在线一区二区| 亚洲电影视频在线| 高清在线成人网| 6080亚洲精品一区二区| 国产精品国产三级国产普通话99 | 久久国产生活片100| 色婷婷国产精品综合在线观看| 精品国产乱码久久久久久1区2区 | 亚洲视频在线一区二区| 裸体一区二区三区| 欧美影院一区二区三区| 欧美激情综合五月色丁香小说| 婷婷亚洲久悠悠色悠在线播放| 不卡区在线中文字幕| 久久综合丝袜日本网| 日本aⅴ亚洲精品中文乱码| 91麻豆国产福利在线观看| 久久久久久电影| 麻豆精品新av中文字幕| 欧美顶级少妇做爰| 亚洲大片在线观看| 在线观看欧美精品| 亚洲天堂中文字幕| 成人午夜av影视| 久久久久久久久久美女| 久久97超碰国产精品超碰| 欧美精品v日韩精品v韩国精品v| 综合久久给合久久狠狠狠97色| 国产黄色精品视频| 精品国产凹凸成av人导航| 久久精品av麻豆的观看方式| 欧美精品1区2区3区| 亚洲一区二区三区视频在线 | 成人高清在线视频| 国产亚洲人成网站| 成人性视频免费网站| 国产日韩欧美一区二区三区乱码 | 国产精品网曝门| 国产成人精品亚洲777人妖| 久久久99久久精品欧美| 精品一区二区在线视频|