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

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

?? select.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*** 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 SELECT statements in SQLite.**** $Id: select.c,v 1.310 2006/03/26 01:21:23 drh Exp $*/#include "sqliteInt.h"/*** Delete all the content of a Select structure but do not deallocate** the select structure itself.*/static void clearSelect(Select *p){  sqlite3ExprListDelete(p->pEList);  sqlite3SrcListDelete(p->pSrc);  sqlite3ExprDelete(p->pWhere);  sqlite3ExprListDelete(p->pGroupBy);  sqlite3ExprDelete(p->pHaving);  sqlite3ExprListDelete(p->pOrderBy);  sqlite3SelectDelete(p->pPrior);  sqlite3ExprDelete(p->pLimit);  sqlite3ExprDelete(p->pOffset);}/*** Allocate a new Select structure and return a pointer to that** structure.*/Select *sqlite3SelectNew(  ExprList *pEList,     /* which columns to include in the result */  SrcList *pSrc,        /* the FROM clause -- which tables to scan */  Expr *pWhere,         /* the WHERE clause */  ExprList *pGroupBy,   /* the GROUP BY clause */  Expr *pHaving,        /* the HAVING clause */  ExprList *pOrderBy,   /* the ORDER BY clause */  int isDistinct,       /* true if the DISTINCT keyword is present */  Expr *pLimit,         /* LIMIT value.  NULL means not used */  Expr *pOffset         /* OFFSET value.  NULL means no offset */){  Select *pNew;  Select standin;  pNew = sqliteMalloc( sizeof(*pNew) );  assert( !pOffset || pLimit );   /* Can't have OFFSET without LIMIT. */  if( pNew==0 ){    pNew = &standin;    memset(pNew, 0, sizeof(*pNew));  }  if( pEList==0 ){    pEList = sqlite3ExprListAppend(0, sqlite3Expr(TK_ALL,0,0,0), 0);  }  pNew->pEList = pEList;  pNew->pSrc = pSrc;  pNew->pWhere = pWhere;  pNew->pGroupBy = pGroupBy;  pNew->pHaving = pHaving;  pNew->pOrderBy = pOrderBy;  pNew->isDistinct = isDistinct;  pNew->op = TK_SELECT;  pNew->pLimit = pLimit;  pNew->pOffset = pOffset;  pNew->iLimit = -1;  pNew->iOffset = -1;  pNew->addrOpenVirt[0] = -1;  pNew->addrOpenVirt[1] = -1;  pNew->addrOpenVirt[2] = -1;  if( pNew==&standin) {    clearSelect(pNew);    pNew = 0;  }  return pNew;}/*** Delete the given Select structure and all of its substructures.*/void sqlite3SelectDelete(Select *p){  if( p ){    clearSelect(p);    sqliteFree(p);  }}/*** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the** type of join.  Return an integer constant that expresses that type** in terms of the following bit values:****     JT_INNER**     JT_CROSS**     JT_OUTER**     JT_NATURAL**     JT_LEFT**     JT_RIGHT**** A full outer join is the combination of JT_LEFT and JT_RIGHT.**** If an illegal or unsupported join type is seen, then still return** a join type, but put an error in the pParse structure.*/int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){  int jointype = 0;  Token *apAll[3];  Token *p;  static const struct {    const char zKeyword[8];    u8 nChar;    u8 code;  } keywords[] = {    { "natural", 7, JT_NATURAL },    { "left",    4, JT_LEFT|JT_OUTER },    { "right",   5, JT_RIGHT|JT_OUTER },    { "full",    4, JT_LEFT|JT_RIGHT|JT_OUTER },    { "outer",   5, JT_OUTER },    { "inner",   5, JT_INNER },    { "cross",   5, JT_INNER|JT_CROSS },  };  int i, j;  apAll[0] = pA;  apAll[1] = pB;  apAll[2] = pC;  for(i=0; i<3 && apAll[i]; i++){    p = apAll[i];    for(j=0; j<sizeof(keywords)/sizeof(keywords[0]); j++){      if( p->n==keywords[j].nChar           && sqlite3StrNICmp((char*)p->z, keywords[j].zKeyword, p->n)==0 ){        jointype |= keywords[j].code;        break;      }    }    if( j>=sizeof(keywords)/sizeof(keywords[0]) ){      jointype |= JT_ERROR;      break;    }  }  if(     (jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) ||     (jointype & JT_ERROR)!=0  ){    const char *zSp1 = " ";    const char *zSp2 = " ";    if( pB==0 ){ zSp1++; }    if( pC==0 ){ zSp2++; }    sqlite3ErrorMsg(pParse, "unknown or unsupported join type: "       "%T%s%T%s%T", pA, zSp1, pB, zSp2, pC);    jointype = JT_INNER;  }else if( jointype & JT_RIGHT ){    sqlite3ErrorMsg(pParse,       "RIGHT and FULL OUTER JOINs are not currently supported");    jointype = JT_INNER;  }  return jointype;}/*** Return the index of a column in a table.  Return -1 if the column** is not contained in the table.*/static int columnIndex(Table *pTab, const char *zCol){  int i;  for(i=0; i<pTab->nCol; i++){    if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i;  }  return -1;}/*** Set the value of a token to a '\000'-terminated string.*/static void setToken(Token *p, const char *z){  p->z = (u8*)z;  p->n = z ? strlen(z) : 0;  p->dyn = 0;}/*** Create an expression node for an identifier with the name of zName*/static Expr *createIdExpr(const char *zName){  Token dummy;  setToken(&dummy, zName);  return sqlite3Expr(TK_ID, 0, 0, &dummy);}/*** Add a term to the WHERE expression in *ppExpr that requires the** zCol column to be equal in the two tables pTab1 and pTab2.*/static void addWhereTerm(  const char *zCol,        /* Name of the column */  const Table *pTab1,      /* First table */  const char *zAlias1,     /* Alias for first table.  May be NULL */  const Table *pTab2,      /* Second table */  const char *zAlias2,     /* Alias for second table.  May be NULL */  int iRightJoinTable,     /* VDBE cursor for the right table */  Expr **ppExpr            /* Add the equality term to this expression */){  Expr *pE1a, *pE1b, *pE1c;  Expr *pE2a, *pE2b, *pE2c;  Expr *pE;  pE1a = createIdExpr(zCol);  pE2a = createIdExpr(zCol);  if( zAlias1==0 ){    zAlias1 = pTab1->zName;  }  pE1b = createIdExpr(zAlias1);  if( zAlias2==0 ){    zAlias2 = pTab2->zName;  }  pE2b = createIdExpr(zAlias2);  pE1c = sqlite3Expr(TK_DOT, pE1b, pE1a, 0);  pE2c = sqlite3Expr(TK_DOT, pE2b, pE2a, 0);  pE = sqlite3Expr(TK_EQ, pE1c, pE2c, 0);  ExprSetProperty(pE, EP_FromJoin);  pE->iRightJoinTable = iRightJoinTable;  *ppExpr = sqlite3ExprAnd(*ppExpr, pE);}/*** Set the EP_FromJoin property on all terms of the given expression.** And set the Expr.iRightJoinTable to iTable for every term in the** expression.**** The EP_FromJoin property is used on terms of an expression to tell** the LEFT OUTER JOIN processing logic that this term is part of the** join restriction specified in the ON or USING clause and not a part** of the more general WHERE clause.  These terms are moved over to the** WHERE clause during join processing but we need to remember that they** originated in the ON or USING clause.**** The Expr.iRightJoinTable tells the WHERE clause processing that the** expression depends on table iRightJoinTable even if that table is not** explicitly mentioned in the expression.  That information is needed** for cases like this:****    SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5**** The where clause needs to defer the handling of the t1.x=5** term until after the t2 loop of the join.  In that way, a** NULL t2 row will be inserted whenever t1.x!=5.  If we do not** defer the handling of t1.x=5, it will be processed immediately** after the t1 loop and rows with t1.x!=5 will never appear in** the output, which is incorrect.*/static void setJoinExpr(Expr *p, int iTable){  while( p ){    ExprSetProperty(p, EP_FromJoin);    p->iRightJoinTable = iTable;    setJoinExpr(p->pLeft, iTable);    p = p->pRight;  } }/*** This routine processes the join information for a SELECT statement.** ON and USING clauses are converted into extra terms of the WHERE clause.** NATURAL joins also create extra WHERE clause terms.**** The terms of a FROM clause are contained in the Select.pSrc structure.** The left most table is the first entry in Select.pSrc.  The right-most** table is the last entry.  The join operator is held in the entry to** the left.  Thus entry 0 contains the join operator for the join between** entries 0 and 1.  Any ON or USING clauses associated with the join are** also attached to the left entry.**** This routine returns the number of errors encountered.*/static int sqliteProcessJoin(Parse *pParse, Select *p){  SrcList *pSrc;                  /* All tables in the FROM clause */  int i, j;                       /* Loop counters */  struct SrcList_item *pLeft;     /* Left table being joined */  struct SrcList_item *pRight;    /* Right table being joined */  pSrc = p->pSrc;  pLeft = &pSrc->a[0];  pRight = &pLeft[1];  for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){    Table *pLeftTab = pLeft->pTab;    Table *pRightTab = pRight->pTab;    if( pLeftTab==0 || pRightTab==0 ) continue;    /* When the NATURAL keyword is present, add WHERE clause terms for    ** every column that the two tables have in common.    */    if( pLeft->jointype & JT_NATURAL ){      if( pLeft->pOn || pLeft->pUsing ){        sqlite3ErrorMsg(pParse, "a NATURAL join may not have "           "an ON or USING clause", 0);        return 1;      }      for(j=0; j<pLeftTab->nCol; j++){        char *zName = pLeftTab->aCol[j].zName;        if( columnIndex(pRightTab, zName)>=0 ){          addWhereTerm(zName, pLeftTab, pLeft->zAlias,                               pRightTab, pRight->zAlias,                              pRight->iCursor, &p->pWhere);                  }      }    }    /* Disallow both ON and USING clauses in the same join    */    if( pLeft->pOn && pLeft->pUsing ){      sqlite3ErrorMsg(pParse, "cannot have both ON and USING "        "clauses in the same join");      return 1;    }    /* Add the ON clause to the end of the WHERE clause, connected by    ** an AND operator.    */    if( pLeft->pOn ){      setJoinExpr(pLeft->pOn, pRight->iCursor);      p->pWhere = sqlite3ExprAnd(p->pWhere, pLeft->pOn);      pLeft->pOn = 0;    }    /* Create extra terms on the WHERE clause for each column named    ** in the USING clause.  Example: If the two tables to be joined are     ** A and B and the USING clause names X, Y, and Z, then add this    ** to the WHERE clause:    A.X=B.X AND A.Y=B.Y AND A.Z=B.Z    ** Report an error if any column mentioned in the USING clause is    ** not contained in both tables to be joined.    */    if( pLeft->pUsing ){      IdList *pList = pLeft->pUsing;      for(j=0; j<pList->nId; j++){        char *zName = pList->a[j].zName;        if( columnIndex(pLeftTab, zName)<0 || columnIndex(pRightTab, zName)<0 ){          sqlite3ErrorMsg(pParse, "cannot join using column %s - column "            "not present in both tables", zName);          return 1;        }        addWhereTerm(zName, pLeftTab, pLeft->zAlias,                             pRightTab, pRight->zAlias,                            pRight->iCursor, &p->pWhere);      }    }  }  return 0;}/*** Insert code into "v" that will push the record on the top of the** stack into the sorter.*/static void pushOntoSorter(  Parse *pParse,         /* Parser context */  ExprList *pOrderBy,    /* The ORDER BY clause */  Select *pSelect        /* The whole SELECT statement */){  Vdbe *v = pParse->pVdbe;  sqlite3ExprCodeExprList(pParse, pOrderBy);  sqlite3VdbeAddOp(v, OP_Sequence, pOrderBy->iECursor, 0);  sqlite3VdbeAddOp(v, OP_Pull, pOrderBy->nExpr + 1, 0);  sqlite3VdbeAddOp(v, OP_MakeRecord, pOrderBy->nExpr + 2, 0);  sqlite3VdbeAddOp(v, OP_IdxInsert, pOrderBy->iECursor, 0);  if( pSelect->iLimit>=0 ){    int addr1, addr2;    addr1 = sqlite3VdbeAddOp(v, OP_IfMemZero, pSelect->iLimit+1, 0);    sqlite3VdbeAddOp(v, OP_MemIncr, -1, pSelect->iLimit+1);    addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);    sqlite3VdbeJumpHere(v, addr1);    sqlite3VdbeAddOp(v, OP_Last, pOrderBy->iECursor, 0);    sqlite3VdbeAddOp(v, OP_Delete, pOrderBy->iECursor, 0);    sqlite3VdbeJumpHere(v, addr2);    pSelect->iLimit = -1;  }}/*** Add code to implement the OFFSET*/static void codeOffset(  Vdbe *v,          /* Generate code into this VM */  Select *p,        /* The SELECT statement being coded */  int iContinue,    /* Jump here to skip the current record */  int nPop          /* Number of times to pop stack when jumping */){  if( p->iOffset>=0 && iContinue!=0 ){    int addr;    sqlite3VdbeAddOp(v, OP_MemIncr, -1, p->iOffset);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合av第一页| 青青草国产精品亚洲专区无| 国产午夜精品一区二区| 欧美一区二区三区思思人| 欧美性猛交xxxxxx富婆| 岛国一区二区在线观看| 国产精品一区二区黑丝| 国产激情一区二区三区四区 | 91视频免费播放| 国产91丝袜在线播放九色| 另类小说欧美激情| 亚洲电影你懂得| 亚洲一区二区在线观看视频| 亚洲国产欧美日韩另类综合 | 麻豆成人在线观看| 日本中文字幕一区二区有限公司| 国产成人综合在线| 精品午夜一区二区三区在线观看 | 97久久超碰精品国产| 成人深夜视频在线观看| 丰满少妇久久久久久久| 国产精品综合在线视频| 国产99精品在线观看| 国产91综合一区在线观看| 国产a久久麻豆| caoporen国产精品视频| 99久久久久久| 欧美在线观看一区| 欧美视频在线一区二区三区 | 亚洲综合在线视频| 久久精品日韩一区二区三区| 国产日韩在线不卡| 亚洲国产高清不卡| 亚洲欧美在线高清| 亚洲精品亚洲人成人网在线播放| 亚洲一区二区视频在线观看| 日韩精品国产欧美| 日韩精品每日更新| 激情六月婷婷久久| 国产精品亚洲一区二区三区在线 | 国产.精品.日韩.另类.中文.在线.播放| 国产成人精品影视| 99精品久久只有精品| 在线观看日韩精品| 日韩欧美一级片| 国产日韩综合av| 亚洲欧美成人一区二区三区| 亚洲第一成人在线| 精久久久久久久久久久| 国精产品一区一区三区mba视频| 国产乱码一区二区三区| 91一区在线观看| 欧美色图天堂网| 日韩欧美一区中文| 国产欧美日韩不卡| 日本一区二区三区视频视频| 亚洲精品第1页| 日本欧美一区二区在线观看| 高潮精品一区videoshd| 欧美三区在线观看| 欧美精品一区二区三区蜜桃 | 成人免费在线观看入口| 午夜精品久久久久影视| 成人午夜av在线| 在线观看91av| 国产精品九色蝌蚪自拍| 夜夜嗨av一区二区三区四季av| 亚洲图片欧美视频| 国产乱人伦偷精品视频不卡| 欧美在线观看一区二区| 国产精品网站一区| 日韩国产欧美一区二区三区| 成人精品免费视频| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产在线播放一区| 在线视频国内自拍亚洲视频| 国产欧美日韩卡一| 奇米综合一区二区三区精品视频 | 91在线观看免费视频| 日韩三级视频中文字幕| 亚洲三级电影全部在线观看高清| 久久se精品一区精品二区| 在线精品国精品国产尤物884a | 最近中文字幕一区二区三区| 久久国产精品99精品国产| 欧美曰成人黄网| 国产精品久久夜| 久久成人av少妇免费| 欧美视频在线一区二区三区| 国产精品视频看| 美女任你摸久久| 欧美日韩和欧美的一区二区| 久久精品视频一区二区三区| 奇米影视一区二区三区小说| 在线欧美小视频| 国产精品全国免费观看高清| 精品一区二区在线免费观看| 色噜噜夜夜夜综合网| 亚洲国产精品成人久久综合一区 | 国产自产高清不卡| 6080午夜不卡| 亚洲成人av电影在线| 国产高清不卡一区| 久久美女艺术照精彩视频福利播放| 亚洲一区二区高清| 色88888久久久久久影院按摩| 国产精品视频一二三| 国产成人午夜高潮毛片| 久久综合久色欧美综合狠狠| 亚洲一区成人在线| 不卡视频一二三| 国产欧美日韩久久| 国产精品一区二区久久不卡 | 成人黄色在线视频| 久久九九久精品国产免费直播| 人禽交欧美网站| 欧美肥妇free| 日产欧产美韩系列久久99| 欧美日韩国产在线播放网站| 午夜精品久久一牛影视| 日韩欧美久久一区| 成人影视亚洲图片在线| 亚洲丝袜制服诱惑| 欧美日韩精品一区二区在线播放 | 5858s免费视频成人| 裸体在线国模精品偷拍| 久久久久久免费| 99re8在线精品视频免费播放| 亚洲一区成人在线| 精品日韩一区二区三区免费视频| 国产99久久久久| 一区二区在线免费| 日韩欧美区一区二| 成人午夜精品在线| 亚洲第一福利视频在线| 精品精品欲导航| av电影在线观看一区| 午夜成人免费视频| 国产亚洲精品bt天堂精选| 色综合色狠狠天天综合色| 日韩电影网1区2区| 国产欧美一区二区精品仙草咪| 97精品久久久久中文字幕| 亚洲不卡av一区二区三区| 精品国产乱码久久久久久蜜臀 | 中文字幕不卡的av| 欧美色图第一页| 高清不卡在线观看| 日韩在线观看一区二区| 国产婷婷色一区二区三区四区| 欧美性做爰猛烈叫床潮| 国产九色精品成人porny| 亚洲高清视频在线| 国产嫩草影院久久久久| 91精品国产欧美一区二区18| 99re成人在线| 国产尤物一区二区| 亚洲成av人片在线观看无码| 中文字幕欧美三区| 日韩午夜三级在线| 91久久久免费一区二区| 国模少妇一区二区三区| 偷拍与自拍一区| 日韩毛片精品高清免费| 亚洲精品一区二区三区福利| 欧美日韩不卡在线| 成人97人人超碰人人99| 久久er精品视频| 亚洲成人黄色影院| 亚洲视频一二区| 国产清纯在线一区二区www| 日韩一级片网站| 欧美日韩在线播放三区| 不卡的av电影| 国产盗摄一区二区三区| 男人的j进女人的j一区| 亚洲电影中文字幕在线观看| 日韩美女视频一区二区 | 日韩av网站免费在线| 一区二区三区中文字幕电影 | 亚洲欧美日韩国产一区二区三区| 欧美成人video| 欧美日韩午夜影院| 色综合夜色一区| 波多野结衣一区二区三区 | 日韩欧美高清一区| 欧美日韩一区中文字幕| 色婷婷激情一区二区三区| 成人h精品动漫一区二区三区| 国产一区二区三区| 秋霞电影一区二区| 亚洲va欧美va国产va天堂影院| 一区二区三区免费看视频| 最新中文字幕一区二区三区| 国产精品丝袜91| 日本一区二区免费在线观看视频| 欧美成人一区二区三区片免费| 91麻豆精品国产91久久久资源速度| 欧美日韩在线播| 欧美日韩一区在线|