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

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

?? trigger.c

?? Trolltech公司發布的基于C++圖形開發環境
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***** 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.*****************************************************************************/#include "sqliteInt.h"/*** Delete a linked list of TriggerStep structures.*/void sqliteDeleteTriggerStep(TriggerStep *pTriggerStep){  while( pTriggerStep ){    TriggerStep * pTmp = pTriggerStep;    pTriggerStep = pTriggerStep->pNext;    if( pTmp->target.dyn ) sqliteFree((char*)pTmp->target.z);    sqliteExprDelete(pTmp->pWhere);    sqliteExprListDelete(pTmp->pExprList);    sqliteSelectDelete(pTmp->pSelect);    sqliteIdListDelete(pTmp->pIdList);    sqliteFree(pTmp);  }}/*** This is called by the parser when it sees a CREATE TRIGGER statement** up to the point of the BEGIN before the trigger actions.  A Trigger** structure is generated based on the information available and stored** in pParse->pNewTrigger.  After the trigger actions have been parsed, the** sqliteFinishTrigger() function is called to complete the trigger** construction process.*/void sqliteBeginTrigger(  Parse *pParse,      /* The parse context of the CREATE TRIGGER statement */  Token *pName,       /* The name of the trigger */  int tr_tm,          /* One of TK_BEFORE, TK_AFTER, TK_INSTEAD */  int op,             /* One of TK_INSERT, TK_UPDATE, TK_DELETE */  IdList *pColumns,   /* column list if this is an UPDATE OF trigger */  SrcList *pTableName,/* The name of the table/view the trigger applies to */  int foreach,        /* One of TK_ROW or TK_STATEMENT */  Expr *pWhen,        /* WHEN clause */  int isTemp          /* True if the TEMPORARY keyword is present */){  Trigger *nt;  Table   *tab;  char *zName = 0;        /* Name of the trigger */  sqlite *db = pParse->db;  int iDb;                /* When database to store the trigger in */  DbFixer sFix;  /* Check that:   ** 1. the trigger name does not already exist.  ** 2. the table (or view) does exist in the same database as the trigger.  ** 3. that we are not trying to create a trigger on the sqlite_master table  ** 4. That we are not trying to create an INSTEAD OF trigger on a table.  ** 5. That we are not trying to create a BEFORE or AFTER trigger on a view.  */  if( sqlite_malloc_failed ) goto trigger_cleanup;  assert( pTableName->nSrc==1 );  if( db->init.busy   && sqliteFixInit(&sFix, pParse, db->init.iDb, "trigger", pName)   && sqliteFixSrcList(&sFix, pTableName)  ){    goto trigger_cleanup;  }  tab = sqliteSrcListLookup(pParse, pTableName);  if( !tab ){    goto trigger_cleanup;  }  iDb = isTemp ? 1 : tab->iDb;  if( iDb>=2 && !db->init.busy ){    sqliteErrorMsg(pParse, "triggers may not be added to auxiliary "       "database %s", db->aDb[tab->iDb].zName);    goto trigger_cleanup;  }  zName = sqliteStrNDup(pName->z, pName->n);  sqliteDequote(zName);  if( sqliteHashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){    sqliteErrorMsg(pParse, "trigger %T already exists", pName);    goto trigger_cleanup;  }  if( sqliteStrNICmp(tab->zName, "sqlite_", 7)==0 ){    sqliteErrorMsg(pParse, "cannot create trigger on system table");    pParse->nErr++;    goto trigger_cleanup;  }  if( tab->pSelect && tr_tm != TK_INSTEAD ){    sqliteErrorMsg(pParse, "cannot create %s trigger on view: %S",         (tr_tm == TK_BEFORE)?"BEFORE":"AFTER", pTableName, 0);    goto trigger_cleanup;  }  if( !tab->pSelect && tr_tm == TK_INSTEAD ){    sqliteErrorMsg(pParse, "cannot create INSTEAD OF"        " trigger on table: %S", pTableName, 0);    goto trigger_cleanup;  }#ifndef SQLITE_OMIT_AUTHORIZATION  {    int code = SQLITE_CREATE_TRIGGER;    const char *zDb = db->aDb[tab->iDb].zName;    const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb;    if( tab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;    if( sqliteAuthCheck(pParse, code, zName, tab->zName, zDbTrig) ){      goto trigger_cleanup;    }    if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(tab->iDb), 0, zDb)){      goto trigger_cleanup;    }  }#endif  /* INSTEAD OF triggers can only appear on views and BEGIN triggers  ** cannot appear on views.  So we might as well translate every  ** INSTEAD OF trigger into a BEFORE trigger.  It simplifies code  ** elsewhere.  */  if (tr_tm == TK_INSTEAD){    tr_tm = TK_BEFORE;  }  /* Build the Trigger object */  nt = (Trigger*)sqliteMalloc(sizeof(Trigger));  if( nt==0 ) goto trigger_cleanup;  nt->name = zName;  zName = 0;  nt->table = sqliteStrDup(pTableName->a[0].zName);  if( sqlite_malloc_failed ) goto trigger_cleanup;  nt->iDb = iDb;  nt->iTabDb = tab->iDb;  nt->op = op;  nt->tr_tm = tr_tm;  nt->pWhen = sqliteExprDup(pWhen);  nt->pColumns = sqliteIdListDup(pColumns);  nt->foreach = foreach;  sqliteTokenCopy(&nt->nameToken,pName);  assert( pParse->pNewTrigger==0 );  pParse->pNewTrigger = nt;trigger_cleanup:  sqliteFree(zName);  sqliteSrcListDelete(pTableName);  sqliteIdListDelete(pColumns);  sqliteExprDelete(pWhen);}/*** This routine is called after all of the trigger actions have been parsed** in order to complete the process of building the trigger.*/void sqliteFinishTrigger(  Parse *pParse,          /* Parser context */  TriggerStep *pStepList, /* The triggered program */  Token *pAll             /* Token that describes the complete CREATE TRIGGER */){  Trigger *nt = 0;          /* The trigger whose construction is finishing up */  sqlite *db = pParse->db;  /* The database */  DbFixer sFix;  if( pParse->nErr || pParse->pNewTrigger==0 ) goto triggerfinish_cleanup;  nt = pParse->pNewTrigger;  pParse->pNewTrigger = 0;  nt->step_list = pStepList;  while( pStepList ){    pStepList->pTrig = nt;    pStepList = pStepList->pNext;  }  if( sqliteFixInit(&sFix, pParse, nt->iDb, "trigger", &nt->nameToken)           && sqliteFixTriggerStep(&sFix, nt->step_list) ){    goto triggerfinish_cleanup;  }  /* if we are not initializing, and this trigger is not on a TEMP table,   ** build the sqlite_master entry  */  if( !db->init.busy ){    static VdbeOpList insertTrig[] = {      { OP_NewRecno,   0, 0,  0          },      { OP_String,     0, 0,  "trigger"  },      { OP_String,     0, 0,  0          },  /* 2: trigger name */      { OP_String,     0, 0,  0          },  /* 3: table name */      { OP_Integer,    0, 0,  0          },      { OP_String,     0, 0,  0          },  /* 5: SQL */      { OP_MakeRecord, 5, 0,  0          },      { OP_PutIntKey,  0, 0,  0          },    };    int addr;    Vdbe *v;    /* Make an entry in the sqlite_master table */    v = sqliteGetVdbe(pParse);    if( v==0 ) goto triggerfinish_cleanup;    sqliteBeginWriteOperation(pParse, 0, 0);    sqliteOpenMasterTable(v, nt->iDb);    addr = sqliteVdbeAddOpList(v, ArraySize(insertTrig), insertTrig);    sqliteVdbeChangeP3(v, addr+2, nt->name, 0);     sqliteVdbeChangeP3(v, addr+3, nt->table, 0);     sqliteVdbeChangeP3(v, addr+5, pAll->z, pAll->n);    if( nt->iDb==0 ){      sqliteChangeCookie(db, v);    }    sqliteVdbeAddOp(v, OP_Close, 0, 0);    sqliteEndWriteOperation(pParse);  }  if( !pParse->explain ){    Table *pTab;    sqliteHashInsert(&db->aDb[nt->iDb].trigHash,                      nt->name, strlen(nt->name)+1, nt);    pTab = sqliteLocateTable(pParse, nt->table, db->aDb[nt->iTabDb].zName);    assert( pTab!=0 );    nt->pNext = pTab->pTrigger;    pTab->pTrigger = nt;    nt = 0;  }triggerfinish_cleanup:  sqliteDeleteTrigger(nt);  sqliteDeleteTrigger(pParse->pNewTrigger);  pParse->pNewTrigger = 0;  sqliteDeleteTriggerStep(pStepList);}/*** Make a copy of all components of the given trigger step.  This has** the effect of copying all Expr.token.z values into memory obtained** from sqliteMalloc().  As initially created, the Expr.token.z values** all point to the input string that was fed to the parser.  But that** string is ephemeral - it will go away as soon as the sqlite_exec()** call that started the parser exits.  This routine makes a persistent** copy of all the Expr.token.z strings so that the TriggerStep structure** will be valid even after the sqlite_exec() call returns.*/static void sqlitePersistTriggerStep(TriggerStep *p){  if( p->target.z ){    p->target.z = sqliteStrNDup(p->target.z, p->target.n);    p->target.dyn = 1;  }  if( p->pSelect ){    Select *pNew = sqliteSelectDup(p->pSelect);    sqliteSelectDelete(p->pSelect);    p->pSelect = pNew;  }  if( p->pWhere ){    Expr *pNew = sqliteExprDup(p->pWhere);    sqliteExprDelete(p->pWhere);    p->pWhere = pNew;  }  if( p->pExprList ){    ExprList *pNew = sqliteExprListDup(p->pExprList);    sqliteExprListDelete(p->pExprList);    p->pExprList = pNew;  }  if( p->pIdList ){    IdList *pNew = sqliteIdListDup(p->pIdList);    sqliteIdListDelete(p->pIdList);    p->pIdList = pNew;  }}/*** Turn a SELECT statement (that the pSelect parameter points to) into** a trigger step.  Return a pointer to a TriggerStep structure.**** The parser calls this routine when it finds a SELECT statement in** body of a TRIGGER.  */TriggerStep *sqliteTriggerSelectStep(Select *pSelect){  TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));  if( pTriggerStep==0 ) return 0;  pTriggerStep->op = TK_SELECT;  pTriggerStep->pSelect = pSelect;  pTriggerStep->orconf = OE_Default;  sqlitePersistTriggerStep(pTriggerStep);  return pTriggerStep;}/*** Build a trigger step out of an INSERT statement.  Return a pointer** to the new trigger step.**** The parser calls this routine when it sees an INSERT inside the** body of a trigger.*/TriggerStep *sqliteTriggerInsertStep(  Token *pTableName,  /* Name of the table into which we insert */  IdList *pColumn,    /* List of columns in pTableName to insert into */  ExprList *pEList,   /* The VALUE clause: a list of values to be inserted */  Select *pSelect,    /* A SELECT statement that supplies values */  int orconf          /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */){  TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));  if( pTriggerStep==0 ) return 0;  assert(pEList == 0 || pSelect == 0);  assert(pEList != 0 || pSelect != 0);  pTriggerStep->op = TK_INSERT;  pTriggerStep->pSelect = pSelect;  pTriggerStep->target  = *pTableName;  pTriggerStep->pIdList = pColumn;  pTriggerStep->pExprList = pEList;  pTriggerStep->orconf = orconf;  sqlitePersistTriggerStep(pTriggerStep);  return pTriggerStep;}/*** Construct a trigger step that implements an UPDATE statement and return** a pointer to that trigger step.  The parser calls this routine when it** sees an UPDATE statement inside the body of a CREATE TRIGGER.*/TriggerStep *sqliteTriggerUpdateStep(  Token *pTableName,   /* Name of the table to be updated */  ExprList *pEList,    /* The SET clause: list of column and new values */  Expr *pWhere,        /* The WHERE clause */  int orconf           /* The conflict algorithm. (OE_Abort, OE_Ignore, etc) */){  TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));  if( pTriggerStep==0 ) return 0;  pTriggerStep->op = TK_UPDATE;  pTriggerStep->target  = *pTableName;  pTriggerStep->pExprList = pEList;  pTriggerStep->pWhere = pWhere;  pTriggerStep->orconf = orconf;  sqlitePersistTriggerStep(pTriggerStep);  return pTriggerStep;}/*** Construct a trigger step that implements a DELETE statement and return** a pointer to that trigger step.  The parser calls this routine when it** sees a DELETE statement inside the body of a CREATE TRIGGER.*/TriggerStep *sqliteTriggerDeleteStep(Token *pTableName, Expr *pWhere){  TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));  if( pTriggerStep==0 ) return 0;  pTriggerStep->op = TK_DELETE;  pTriggerStep->target  = *pTableName;  pTriggerStep->pWhere = pWhere;  pTriggerStep->orconf = OE_Default;  sqlitePersistTriggerStep(pTriggerStep);  return pTriggerStep;}/* ** Recursively delete a Trigger structure*/void sqliteDeleteTrigger(Trigger *pTrigger){  if( pTrigger==0 ) return;  sqliteDeleteTriggerStep(pTrigger->step_list);  sqliteFree(pTrigger->name);  sqliteFree(pTrigger->table);  sqliteExprDelete(pTrigger->pWhen);  sqliteIdListDelete(pTrigger->pColumns);  if( pTrigger->nameToken.dyn ) sqliteFree((char*)pTrigger->nameToken.z);  sqliteFree(pTrigger);}/* * This function is called to drop a trigger from the database schema.  * * This may be called directly from the parser and therefore identifies * the trigger by name.  The sqliteDropTriggerPtr() routine does the * same job as this routine except it take a spointer to the trigger * instead of the trigger name. * * Note that this function does not delete the trigger entirely. Instead it

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
**欧美大码日韩| 精品av久久707| 国产麻豆日韩欧美久久| 男女男精品网站| 日本特黄久久久高潮 | 色综合一个色综合| 成人午夜电影网站| 成人黄色免费短视频| 成人h版在线观看| 色婷婷综合久色| 欧美日韩一区中文字幕| 在线成人av影院| 精品91自产拍在线观看一区| xfplay精品久久| 中文在线免费一区三区高中清不卡| 国产亚洲精品aa| 亚洲精品videosex极品| 亚洲午夜免费福利视频| 日本不卡视频在线| 豆国产96在线|亚洲| 99久久婷婷国产| 欧美丰满少妇xxxbbb| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产精品美女久久久久av爽李琼| 综合色中文字幕| 五月综合激情婷婷六月色窝| 久久精品免费看| 成人av资源在线| 欧美另类高清zo欧美| 久久久美女毛片| 亚洲国产精品久久久久秋霞影院| 精品一区二区三区在线观看国产| 成人不卡免费av| 欧美日韩黄色一区二区| 久久精品一区二区三区不卡 | 欧美高清视频一二三区| 国产亚洲精品精华液| 亚洲国产精品久久不卡毛片| 国产精品一二一区| 欧美视频一区二| 国产精品国产精品国产专区不蜜 | 亚洲影视在线观看| 国内一区二区在线| 欧美三级视频在线播放| 国产日韩v精品一区二区| 亚洲成人动漫在线免费观看| 国产黄色91视频| 日韩精品专区在线| 一区二区三区日本| 成人一区二区三区中文字幕| 欧美一区二区观看视频| 一区二区三区中文字幕电影| 国产综合成人久久大片91| 在线视频欧美区| 国产精品进线69影院| 狠狠色综合日日| 日韩免费一区二区| 午夜av区久久| 欧美人xxxx| 一区二区三区免费在线观看| 成人午夜在线视频| 亚洲国产精华液网站w| 国产在线视频一区二区| 91超碰这里只有精品国产| 一区二区三区四区不卡在线| 不卡欧美aaaaa| 国产精品传媒视频| 成人综合婷婷国产精品久久| 国产网红主播福利一区二区| 国产一区二区视频在线| 亚洲精品在线网站| 精品一二线国产| 精品国产一区二区国模嫣然| 久久国产尿小便嘘嘘| 精品日韩欧美在线| 寂寞少妇一区二区三区| 久久影院午夜片一区| 国产乱色国产精品免费视频| 久久综合九色综合97婷婷女人| 久久精品国产精品青草| 精品999久久久| 成人深夜视频在线观看| 国产精品久久久久久久久搜平片 | 麻豆成人久久精品二区三区小说| 欧美日韩一区中文字幕| 免费在线看成人av| 久久综合网色—综合色88| 国产精品中文欧美| 国产精品免费aⅴ片在线观看| 99精品视频在线观看免费| 日韩理论在线观看| 精品视频全国免费看| 久久精品国产99| 国产喂奶挤奶一区二区三区| 成人av网站大全| 亚洲一区二区三区不卡国产欧美 | 久久综合综合久久综合| 久久久亚洲精品石原莉奈| av不卡免费在线观看| 一区二区久久久| 精品三级在线观看| 91亚洲国产成人精品一区二区三| 一区二区三区日韩欧美精品| 日韩欧美区一区二| 91一区二区三区在线观看| 午夜免费欧美电影| 中文字幕精品一区二区精品绿巨人| 91亚洲精华国产精华精华液| 日本色综合中文字幕| 欧美国产欧美亚州国产日韩mv天天看完整| 99久久99久久综合| 日韩高清欧美激情| 国产精品伦理一区二区| 欧美一三区三区四区免费在线看| 国产老妇另类xxxxx| 亚洲电影一级片| 国产精品久久久久久久久晋中| 欧美日韩一区二区三区高清| 国产精品888| 五月综合激情网| 国产精品不卡一区二区三区| 555夜色666亚洲国产免| 成人高清视频在线观看| 老司机精品视频导航| 亚洲影院久久精品| 国产精品久久久久久一区二区三区| 在线成人高清不卡| 色女孩综合影院| 福利一区二区在线| 老司机精品视频在线| 五月天网站亚洲| 亚洲精品欧美在线| 国产精品色婷婷久久58| 久久伊99综合婷婷久久伊| 欧美色欧美亚洲另类二区| 高清久久久久久| 激情成人午夜视频| 久久黄色级2电影| 天堂蜜桃一区二区三区| 亚洲图片欧美色图| 亚洲区小说区图片区qvod| 国产香蕉久久精品综合网| 精品99久久久久久| 亚洲天堂精品视频| 国产亚洲一区二区在线观看| 国产精品一区2区| 亚洲成人精品一区| 亚洲在线一区二区三区| 亚洲免费伊人电影| 亚洲精品亚洲人成人网| 亚洲色图在线看| 伊人色综合久久天天人手人婷| 亚洲色图第一区| 亚洲乱码日产精品bd| 伊人一区二区三区| 亚洲国产乱码最新视频| 婷婷六月综合网| 免费的成人av| 国产精品一区二区免费不卡 | 人禽交欧美网站| 日本美女一区二区三区视频| 蜜桃av噜噜一区二区三区小说| 日本中文在线一区| 精品在线你懂的| 国产东北露脸精品视频| 成人av电影在线网| 色94色欧美sute亚洲线路二| 欧美性猛片xxxx免费看久爱| 91麻豆精品国产91久久久更新时间| 91精品综合久久久久久| 久久综合久久综合久久综合| 中文字幕不卡的av| 伊人夜夜躁av伊人久久| 日韩1区2区3区| 国产精品亚洲午夜一区二区三区 | 蜜臀av亚洲一区中文字幕| 久久av老司机精品网站导航| 国产99久久久国产精品免费看| av成人免费在线观看| 欧美日韩aaa| 亚洲国产精品ⅴa在线观看| 亚洲制服丝袜一区| 激情av综合网| 欧美性大战久久久| 欧美成人综合网站| 亚洲另类春色校园小说| 裸体一区二区三区| 99久久久无码国产精品| 91麻豆精品久久久久蜜臀| 国产三级久久久| 日韩一区精品视频| www.亚洲激情.com| 欧美一区二区三区免费| 18欧美乱大交hd1984| 国内外成人在线视频| 欧美日韩亚洲综合| 亚洲视频免费观看| 国内成人精品2018免费看| 欧美综合欧美视频| 国产精品人成在线观看免费|