亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品一区二区黑丝| 91色九色蝌蚪| 亚洲视频一区二区在线| 视频一区中文字幕| 欧美日韩国产一级二级| 亚洲激情自拍视频| 色噜噜狠狠色综合欧洲selulu| 久久精品男人的天堂| 国产福利一区二区三区在线视频| 日韩精品中午字幕| 国产综合久久久久久鬼色 | 国产网站一区二区三区| 免费人成精品欧美精品| 欧美一区二区精品久久911| 午夜亚洲国产au精品一区二区| 99re66热这里只有精品3直播 | 欧美丝袜自拍制服另类| 最新中文字幕一区二区三区 | 久久精品亚洲国产奇米99| 国内成+人亚洲+欧美+综合在线| 精品国产a毛片| 国精产品一区一区三区mba视频| 精品美女在线播放| 粉嫩13p一区二区三区| 日韩美女久久久| 欧美一二三区在线观看| 精品一区二区免费在线观看| 欧美激情一区在线观看| 欧美中文字幕亚洲一区二区va在线 | 99久久国产综合精品色伊| 亚洲香肠在线观看| 国产蜜臀97一区二区三区| 成人精品高清在线| 日韩在线观看一区二区| 精品福利视频一区二区三区| 91在线无精精品入口| 免费看欧美女人艹b| 国产精品乱人伦| 欧美www视频| 欧美日韩中文字幕一区| 成人国产精品免费观看| 麻豆国产欧美一区二区三区| 国产精品久久久久久久久快鸭| 欧美日韩色一区| 白白色亚洲国产精品| 国产精品一区二区无线| 蜜臂av日日欢夜夜爽一区| 一区二区三区不卡视频| 中文字幕在线不卡国产视频| 精品国产凹凸成av人导航| 91精品国产91久久久久久一区二区| av亚洲精华国产精华| 国产成人亚洲精品狼色在线| 久久精品国产成人一区二区三区| 午夜av区久久| 性久久久久久久| 美女视频黄 久久| 麻豆国产欧美日韩综合精品二区| 亚洲一区二区三区自拍| 天天影视涩香欲综合网| 日本怡春院一区二区| 激情欧美日韩一区二区| 国产福利一区二区三区视频| 国产高清不卡一区| 97se亚洲国产综合在线| 欧美日韩在线一区二区| 欧美亚洲禁片免费| 91精品国产91久久综合桃花 | 欧美亚洲综合久久| 欧美系列在线观看| 666欧美在线视频| 中文字幕国产一区二区| 中文字幕+乱码+中文字幕一区| 国产精品乱码久久久久久| 综合激情成人伊人| 五月激情综合色| 国产一区二区影院| 精品久久国产老人久久综合| 99精品国产99久久久久久白柏| 一本色道a无线码一区v| 精品奇米国产一区二区三区| 国产精品天美传媒| 毛片av一区二区三区| 99久免费精品视频在线观看 | 色综合中文字幕| 日韩亚洲欧美一区二区三区| 国产精品久久久一区麻豆最新章节| 亚洲摸摸操操av| 日本欧美大码aⅴ在线播放| 成人夜色视频网站在线观看| 色婷婷综合五月| 国产精品免费免费| 国产精品1区二区.| 欧美日韩精品一二三区| 亚洲欧美一区二区在线观看| 国产精品一二三四| 精品国产自在久精品国产| 婷婷国产在线综合| av不卡免费在线观看| 国产精品久久久一本精品| 国产一区二区日韩精品| 日韩亚洲欧美一区| 日本视频在线一区| 日韩精品一区二区三区中文不卡 | 免费在线观看不卡| 精品一区二区三区在线视频| 欧美日韩国产影片| 亚洲国产乱码最新视频| 在线观看亚洲专区| 天天影视涩香欲综合网| 666欧美在线视频| 美洲天堂一区二卡三卡四卡视频| 欧美日韩一级大片网址| 偷窥少妇高潮呻吟av久久免费| 欧美色图天堂网| 亚洲成人av在线电影| 精品免费视频.| 久久99精品久久久久久| 中文字幕av在线一区二区三区| av电影在线观看不卡| 日韩一区在线播放| 欧美色图片你懂的| 日韩经典中文字幕一区| 2014亚洲片线观看视频免费| 久久 天天综合| 一区二区三区四区高清精品免费观看| 91蝌蚪porny| 久久精品99久久久| 亚洲制服欧美中文字幕中文字幕| 91精品国产色综合久久久蜜香臀| 国产福利视频一区二区三区| 国产精品精品国产色婷婷| 欧美日韩免费在线视频| 成人一区二区三区在线观看| 日本特黄久久久高潮| 日韩美女久久久| 国产欧美一区二区三区鸳鸯浴| 欧美午夜理伦三级在线观看| 福利电影一区二区| 精品无人码麻豆乱码1区2区| 亚洲精品亚洲人成人网| 国产欧美综合在线| 国产清纯在线一区二区www| 日韩一区二区不卡| 在线成人小视频| 色94色欧美sute亚洲13| 91在线国产福利| 国v精品久久久网| 国产激情视频一区二区三区欧美| 免费成人你懂的| 日本美女视频一区二区| 亚洲va韩国va欧美va精品 | 国产精品二三区| 国产精品三级视频| 欧美国产精品中文字幕| 国产精品久久久久久久久果冻传媒| 精品福利视频一区二区三区| 欧美一区二区三区免费| 欧美sm极限捆绑bd| 久久久国产精品午夜一区ai换脸| 久久久www免费人成精品| 中文字幕av免费专区久久| 最新日韩av在线| 婷婷激情综合网| 国产九九视频一区二区三区| 国产精品1区二区.| 欧美丝袜丝nylons| 欧美一级理论片| 欧美韩国一区二区| 午夜久久久久久久久久一区二区| 人人狠狠综合久久亚洲| 懂色av一区二区夜夜嗨| 欧美在线观看视频在线| 欧美日韩高清一区二区不卡| 日韩视频一区二区三区在线播放| 久久久.com| 亚欧色一区w666天堂| 国产成人午夜电影网| 91精品在线免费观看| 中文字幕一区二区三区视频| 婷婷国产v国产偷v亚洲高清| 99视频超级精品| 日韩欧美久久久| 亚洲国产精品人人做人人爽| 国产精品一区二区男女羞羞无遮挡| av资源网一区| 久久久久成人黄色影片| 亚洲成人综合视频| 色欧美日韩亚洲| 亚洲欧美国产毛片在线| 国产精品影视天天线| 精品国产乱码久久久久久浪潮| 亚洲国产视频a| 欧美婷婷六月丁香综合色| 国产精品免费看片| 91在线丨porny丨国产| 国产精品视频你懂的| 成人性生交大片免费看中文| 欧美精品一区二区三区一线天视频| 丝瓜av网站精品一区二区|