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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? update.c

?? 一個(gè)小型嵌入式數(shù)據(jù)庫(kù)SQLite的源碼,C語(yǔ)言
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*** 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 UPDATE statements.**** $Id: update.c,v 1.133 2006/06/27 13:20:21 drh Exp $*/#include "sqliteInt.h"#ifndef SQLITE_OMIT_VIRTUALTABLE/* Forward declaration */static void updateVirtualTable(  Parse *pParse,       /* The parsing context */  SrcList *pSrc,       /* The virtual table to be modified */  Table *pTab,         /* The virtual table */  ExprList *pChanges,  /* The columns to change in the UPDATE statement */  Expr *pRowidExpr,    /* Expression used to recompute the rowid */  int *aXRef,          /* Mapping from columns of pTab to entries in pChanges */  Expr *pWhere         /* WHERE clause of the UPDATE statement */);#endif /* SQLITE_OMIT_VIRTUALTABLE *//*** The most recently coded instruction was an OP_Column to retrieve the** i-th column of table pTab. This routine sets the P3 parameter of the ** OP_Column to the default value, if any.**** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table** was created, or added later to the table definition by an ALTER TABLE** command. If the latter, then the row-records in the table btree on disk** may not contain a value for the column and the default value, taken** from the P3 parameter of the OP_Column instruction, is returned instead.** If the former, then all row-records are guaranteed to include a value** for the column and the P3 value is not required.**** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written** into the sqlite_master table.)**** Therefore, the P3 parameter is only required if the default value for** the column is a literal number, string or null. The sqlite3ValueFromExpr()** function is capable of transforming these types of expressions into** sqlite3_value objects.*/void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){  if( pTab && !pTab->pSelect ){    sqlite3_value *pValue;    u8 enc = ENC(sqlite3VdbeDb(v));    Column *pCol = &pTab->aCol[i];    sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue);    if( pValue ){      sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM);    }else{      VdbeComment((v, "# %s.%s", pTab->zName, pCol->zName));    }  }}/*** Process an UPDATE statement.****   UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;**          \_______/ \________/     \______/       \________________/*            onError   pTabList      pChanges             pWhere*/void sqlite3Update(  Parse *pParse,         /* The parser context */  SrcList *pTabList,     /* The table in which we should change things */  ExprList *pChanges,    /* Things to be changed */  Expr *pWhere,          /* The WHERE clause.  May be null */  int onError            /* How to handle constraint errors */){  int i, j;              /* Loop counters */  Table *pTab;           /* The table to be updated */  int addr = 0;          /* VDBE instruction address of the start of the loop */  WhereInfo *pWInfo;     /* Information about the WHERE clause */  Vdbe *v;               /* The virtual database engine */  Index *pIdx;           /* For looping over indices */  int nIdx;              /* Number of indices that need updating */  int nIdxTotal;         /* Total number of indices */  int iCur;              /* VDBE Cursor number of pTab */  sqlite3 *db;           /* The database structure */  Index **apIdx = 0;     /* An array of indices that need updating too */  char *aIdxUsed = 0;    /* aIdxUsed[i]==1 if the i-th index is used */  int *aXRef = 0;        /* aXRef[i] is the index in pChanges->a[] of the                         ** an expression for the i-th column of the table.                         ** aXRef[i]==-1 if the i-th column is not changed. */  int chngRowid;         /* True if the record number is being changed */  Expr *pRowidExpr = 0;  /* Expression defining the new record number */  int openAll = 0;       /* True if all indices need to be opened */  AuthContext sContext;  /* The authorization context */  NameContext sNC;       /* The name-context to resolve expressions in */  int iDb;               /* Database containing the table being updated */#ifndef SQLITE_OMIT_TRIGGER  int isView;                  /* Trying to update a view */  int triggers_exist = 0;      /* True if any row triggers exist */#endif  int newIdx      = -1;  /* index of trigger "new" temp table       */  int oldIdx      = -1;  /* index of trigger "old" temp table       */  sContext.pParse = 0;  if( pParse->nErr || sqlite3MallocFailed() ){    goto update_cleanup;  }  db = pParse->db;  assert( pTabList->nSrc==1 );  /* Locate the table which we want to update.   */  pTab = sqlite3SrcListLookup(pParse, pTabList);  if( pTab==0 ) goto update_cleanup;  iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);  /* Figure out if we have any triggers and if the table being  ** updated is a view  */#ifndef SQLITE_OMIT_TRIGGER  triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges);  isView = pTab->pSelect!=0;#else# define triggers_exist 0# define isView 0#endif#ifdef SQLITE_OMIT_VIEW# undef isView# define isView 0#endif  if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){    goto update_cleanup;  }  if( sqlite3ViewGetColumnNames(pParse, pTab) ){    goto update_cleanup;  }  aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol );  if( aXRef==0 ) goto update_cleanup;  for(i=0; i<pTab->nCol; i++) aXRef[i] = -1;  /* If there are FOR EACH ROW triggers, allocate cursors for the  ** special OLD and NEW tables  */  if( triggers_exist ){    newIdx = pParse->nTab++;    oldIdx = pParse->nTab++;  }  /* Allocate a cursors for the main database table and for all indices.  ** The index cursors might not be used, but if they are used they  ** need to occur right after the database cursor.  So go ahead and  ** allocate enough space, just in case.  */  pTabList->a[0].iCursor = iCur = pParse->nTab++;  for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){    pParse->nTab++;  }  /* Initialize the name-context */  memset(&sNC, 0, sizeof(sNC));  sNC.pParse = pParse;  sNC.pSrcList = pTabList;  /* Resolve the column names in all the expressions of the  ** of the UPDATE statement.  Also find the column index  ** for each column to be updated in the pChanges array.  For each  ** column to be updated, make sure we have authorization to change  ** that column.  */  chngRowid = 0;  for(i=0; i<pChanges->nExpr; i++){    if( sqlite3ExprResolveNames(&sNC, pChanges->a[i].pExpr) ){      goto update_cleanup;    }    for(j=0; j<pTab->nCol; j++){      if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){        if( j==pTab->iPKey ){          chngRowid = 1;          pRowidExpr = pChanges->a[i].pExpr;        }        aXRef[j] = i;        break;      }    }    if( j>=pTab->nCol ){      if( sqlite3IsRowid(pChanges->a[i].zName) ){        chngRowid = 1;        pRowidExpr = pChanges->a[i].pExpr;      }else{        sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName);        goto update_cleanup;      }    }#ifndef SQLITE_OMIT_AUTHORIZATION    {      int rc;      rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,                           pTab->aCol[j].zName, db->aDb[iDb].zName);      if( rc==SQLITE_DENY ){        goto update_cleanup;      }else if( rc==SQLITE_IGNORE ){        aXRef[j] = -1;      }    }#endif  }  /* Allocate memory for the array apIdx[] and fill it with pointers to every  ** index that needs to be updated.  Indices only need updating if their  ** key includes one of the columns named in pChanges or if the record  ** number of the original table entry is changing.  */  for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){    if( chngRowid ){      i = 0;    }else {      for(i=0; i<pIdx->nColumn; i++){        if( aXRef[pIdx->aiColumn[i]]>=0 ) break;      }    }    if( i<pIdx->nColumn ) nIdx++;  }  if( nIdxTotal>0 ){    apIdx = sqliteMallocRaw( sizeof(Index*) * nIdx + nIdxTotal );    if( apIdx==0 ) goto update_cleanup;    aIdxUsed = (char*)&apIdx[nIdx];  }  for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){    if( chngRowid ){      i = 0;    }else{      for(i=0; i<pIdx->nColumn; i++){        if( aXRef[pIdx->aiColumn[i]]>=0 ) break;      }    }    if( i<pIdx->nColumn ){      apIdx[nIdx++] = pIdx;      aIdxUsed[j] = 1;    }else{      aIdxUsed[j] = 0;    }  }  /* Begin generating code.  */  v = sqlite3GetVdbe(pParse);  if( v==0 ) goto update_cleanup;  if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);  sqlite3BeginWriteOperation(pParse, 1, iDb);#ifndef SQLITE_OMIT_VIRTUALTABLE  /* Virtual tables must be handled separately */  if( IsVirtual(pTab) ){    updateVirtualTable(pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,                       pWhere);    pWhere = 0;    pTabList = 0;    goto update_cleanup;  }#endif  /* Resolve the column names in all the expressions in the  ** WHERE clause.  */  if( sqlite3ExprResolveNames(&sNC, pWhere) ){    goto update_cleanup;  }  /* Start the view context  */  if( isView ){    sqlite3AuthContextPush(pParse, &sContext, pTab->zName);  }  /* If we are trying to update a view, realize that view into  ** a ephemeral table.  */  if( isView ){    Select *pView;    pView = sqlite3SelectDup(pTab->pSelect);    sqlite3Select(pParse, pView, SRT_EphemTab, iCur, 0, 0, 0, 0);    sqlite3SelectDelete(pView);  }  /* Begin the database scan  */  pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0);  if( pWInfo==0 ) goto update_cleanup;  /* Remember the rowid of every item to be updated.  */  sqlite3VdbeAddOp(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, 0);  sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);  /* End the database scan loop.  */  sqlite3WhereEnd(pWInfo);  /* Initialize the count of updated rows  */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线无精精品入口| 成人免费视频caoporn| 久久久久久久电影| 99久久国产综合精品麻豆| 偷拍一区二区三区| 国产视频一区二区在线观看| 在线视频综合导航| 国产精品一二三区| 午夜私人影院久久久久| 国产精品入口麻豆原神| 91精品国产综合久久久久久| 91啪九色porn原创视频在线观看| 久久精品国产亚洲aⅴ| 亚洲一二三四区| 国产精品久久久久影院老司 | 国产精品综合网| 婷婷夜色潮精品综合在线| 国产精品久99| wwwwww.欧美系列| 91精品国产欧美一区二区18| 99国产一区二区三精品乱码| 国产乱码一区二区三区| 日韩一区精品字幕| 亚洲一二三专区| 亚洲男人的天堂一区二区| 国产精品日产欧美久久久久| 久久精品视频网| 欧美大白屁股肥臀xxxxxx| 欧美日韩国产综合久久| 在线观看免费成人| 色吧成人激情小说| 91在线观看地址| 97久久人人超碰| 波多野结衣一区二区三区| 国产成人午夜高潮毛片| 国产一区欧美日韩| 韩国av一区二区三区| 美日韩一级片在线观看| 免费在线观看日韩欧美| 爽爽淫人综合网网站| 亚洲高清视频的网址| 亚洲国产视频一区二区| 亚洲一区二区三区在线| 亚洲一区影音先锋| 亚洲国产日韩在线一区模特| 亚洲综合小说图片| 亚洲www啪成人一区二区麻豆| 亚洲大片在线观看| 日本欧美肥老太交大片| 美腿丝袜在线亚洲一区| 韩国成人福利片在线播放| 国产美女久久久久| 国产超碰在线一区| 国产99久久久国产精品潘金 | 成人免费看片app下载| 福利一区二区在线| 99精品一区二区三区| 色婷婷久久一区二区三区麻豆| 91国偷自产一区二区开放时间 | 欧美狂野另类xxxxoooo| 3d动漫精品啪啪一区二区竹菊| 9191精品国产综合久久久久久| 日韩一级高清毛片| 久久久久免费观看| 国产精品网站一区| 一区二区三区 在线观看视频| 亚洲福利一二三区| 久久国产精品99精品国产| 丁香六月久久综合狠狠色| 一本色道久久综合亚洲精品按摩| 欧美高清视频一二三区| 精品国产成人系列| 国产精品免费久久| 亚洲午夜av在线| 国产精品一区二区在线播放| 9i看片成人免费高清| 在线电影一区二区三区| 久久蜜桃av一区精品变态类天堂| 久久精品网站免费观看| 亚洲国产综合人成综合网站| 久久精品免费观看| aaa亚洲精品| 正在播放一区二区| 国产欧美视频一区二区| 亚洲一区二区偷拍精品| 国产精品中文有码| 欧美中文字幕一二三区视频| 精品人在线二区三区| 一卡二卡三卡日韩欧美| 精品一区二区三区免费| av不卡在线观看| 精品精品国产高清a毛片牛牛| 中文无字幕一区二区三区| 亚洲国产成人精品视频| 国产成人三级在线观看| 欧美精品xxxxbbbb| 国产精品久久毛片av大全日韩| 日本欧美加勒比视频| 色综合一区二区三区| 欧美草草影院在线视频| 亚洲综合一二区| 成人手机在线视频| 日韩精品一区二区三区蜜臀| 亚洲精品视频免费观看| 国产一区二区在线观看视频| 欧美日韩五月天| 最新日韩av在线| 国产一区二区三区综合| 欧美日韩国产天堂| 亚洲天堂免费看| 国产一区二区三区在线观看免费| 欧美视频在线一区| 136国产福利精品导航| 国产福利精品导航| 欧美电视剧免费全集观看| 亚洲国产精品一区二区久久| 成人av网站在线观看免费| 26uuu欧美| 美美哒免费高清在线观看视频一区二区| 91在线观看下载| 亚洲国产成人在线| 国产精品综合久久| 久久综合九色欧美综合狠狠 | 国产精品一线二线三线精华| 3d动漫精品啪啪| 天堂va蜜桃一区二区三区漫画版| 91网上在线视频| 亚洲图片你懂的| 成人avav在线| 国产精品久久久久久一区二区三区 | 国产人伦精品一区二区| 韩国一区二区三区| 精品欧美一区二区三区精品久久 | 免费久久99精品国产| 欧美一区二区在线不卡| 午夜欧美大尺度福利影院在线看| 色噜噜久久综合| 一区2区3区在线看| 欧美日韩综合在线免费观看| 亚洲成在人线免费| 欧美另类变人与禽xxxxx| 亚洲成av人片一区二区梦乃| 欧美亚洲综合久久| 亚洲成人一区在线| 欧美一个色资源| 久久se这里有精品| 久久色在线视频| 成人免费观看视频| 一区二区中文视频| 日本高清不卡视频| 亚洲午夜三级在线| 91精品国产色综合久久不卡电影| 老司机午夜精品99久久| 26uuu精品一区二区在线观看| 国产精品影视天天线| 一区在线播放视频| 欧美日韩午夜影院| 久久99热这里只有精品| 国产日韩欧美电影| 91在线观看视频| 日韩高清在线一区| 久久久久久久久久看片| 成人黄色片在线观看| 亚洲麻豆国产自偷在线| 欧美片网站yy| 国产麻豆精品一区二区| 日韩一区在线播放| 欧美日韩一区二区三区高清| 久久精品国产色蜜蜜麻豆| 亚洲国产成人午夜在线一区| 91国偷自产一区二区三区观看| 日本免费在线视频不卡一不卡二| 久久综合狠狠综合久久综合88| 成人av动漫网站| 日本不卡高清视频| 欧美国产丝袜视频| 欧美日韩国产123区| 国产在线精品一区二区三区不卡 | 狠狠色狠狠色综合| 最好看的中文字幕久久| 88在线观看91蜜桃国自产| 美女国产一区二区| 一区二区三区日本| www欧美成人18+| 欧美综合视频在线观看| 激情六月婷婷久久| 一区二区三区四区精品在线视频| 日韩你懂的在线播放| 色综合色狠狠综合色| 久久国产精品区| 一区二区三区四区av| 国产亚洲短视频| 91精品国产aⅴ一区二区| 成人97人人超碰人人99| 日本亚洲欧美天堂免费| 亚洲精品视频自拍| 久久久综合精品| 亚洲欧洲韩国日本视频| 欧美xxxx在线观看| 欧美在线短视频|