📄 dump
字号:
1.34 (drh 06-Oct-01): // UNIQUE constraints.1.1 (drh 29-May-00): //1.80 (drh 11-Aug-02): ccons ::= NULL onconf.1.43 (drh 29-Jan-02): ccons ::= NOT NULL onconf(R). {sqliteAddNotNull(pParse, R);}1.43 (drh 29-Jan-02): ccons ::= PRIMARY KEY sortorder onconf(R). {sqliteAddPrimaryKey(pParse,0,R);}1.93 (drh 27-Mar-03): ccons ::= UNIQUE onconf(R). {sqliteCreateIndex(pParse,0,0,0,R,0,0,0);}1.43 (drh 29-Jan-02): ccons ::= CHECK LP expr RP onconf.1.83 (drh 31-Aug-02): ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R).1.83 (drh 31-Aug-02): {sqliteCreateForeignKey(pParse,0,&T,TA,R);}1.83 (drh 31-Aug-02): ccons ::= defer_subclause(D). {sqliteDeferForeignKey(pParse,D);}1.74 (drh 17-Jun-02): ccons ::= COLLATE id(C). {1.88 (drh 18-Jan-03): sqliteAddCollateType(pParse, sqliteCollateType(C.z, C.n));1.74 (drh 17-Jun-02): }1.70 (drh 02-Jun-02): 1.83 (drh 31-Aug-02): // The next group of rules parses the arguments to a REFERENCES clause1.83 (drh 31-Aug-02): // that determine if the referential integrity checking is deferred or1.83 (drh 31-Aug-02): // or immediate and which determine what action to take if a ref-integ1.83 (drh 31-Aug-02): // check fails.1.83 (drh 31-Aug-02): //1.83 (drh 31-Aug-02): %type refargs {int}1.83 (drh 31-Aug-02): refargs(A) ::= . { A = OE_Restrict * 0x010101; }1.83 (drh 31-Aug-02): refargs(A) ::= refargs(X) refarg(Y). { A = (X & Y.mask) | Y.value; }1.83 (drh 31-Aug-02): %type refarg {struct {int value; int mask;}}1.83 (drh 31-Aug-02): refarg(A) ::= MATCH nm. { A.value = 0; A.mask = 0x000000; }1.83 (drh 31-Aug-02): refarg(A) ::= ON DELETE refact(X). { A.value = X; A.mask = 0x0000ff; }1.83 (drh 31-Aug-02): refarg(A) ::= ON UPDATE refact(X). { A.value = X<<8; A.mask = 0x00ff00; }1.83 (drh 31-Aug-02): refarg(A) ::= ON INSERT refact(X). { A.value = X<<16; A.mask = 0xff0000; }1.83 (drh 31-Aug-02): %type refact {int}1.83 (drh 31-Aug-02): refact(A) ::= SET NULL. { A = OE_SetNull; }1.83 (drh 31-Aug-02): refact(A) ::= SET DEFAULT. { A = OE_SetDflt; }1.83 (drh 31-Aug-02): refact(A) ::= CASCADE. { A = OE_Cascade; }1.83 (drh 31-Aug-02): refact(A) ::= RESTRICT. { A = OE_Restrict; }1.83 (drh 31-Aug-02): %type defer_subclause {int}1.83 (drh 31-Aug-02): defer_subclause(A) ::= NOT DEFERRABLE init_deferred_pred_opt(X). {A = X;}1.83 (drh 31-Aug-02): defer_subclause(A) ::= DEFERRABLE init_deferred_pred_opt(X). {A = X;}1.83 (drh 31-Aug-02): %type init_deferred_pred_opt {int}1.83 (drh 31-Aug-02): init_deferred_pred_opt(A) ::= . {A = 0;}1.83 (drh 31-Aug-02): init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;}1.83 (drh 31-Aug-02): init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;}1.1 (drh 29-May-00): 1.1 (drh 29-May-00): // For the time being, the only constraint we care about is the primary1.34 (drh 06-Oct-01): // key and UNIQUE. Both create indices.1.1 (drh 29-May-00): //1.1 (drh 29-May-00): conslist_opt ::= .1.1 (drh 29-May-00): conslist_opt ::= COMMA conslist.1.1 (drh 29-May-00): conslist ::= conslist COMMA tcons.1.26 (drh 04-Jan-01): conslist ::= conslist tcons.1.1 (drh 29-May-00): conslist ::= tcons.1.76 (drh 01-Jul-02): tcons ::= CONSTRAINT nm.1.43 (drh 29-Jan-02): tcons ::= PRIMARY KEY LP idxlist(X) RP onconf(R).1.43 (drh 29-Jan-02): {sqliteAddPrimaryKey(pParse,X,R);}1.43 (drh 29-Jan-02): tcons ::= UNIQUE LP idxlist(X) RP onconf(R).1.93 (drh 27-Mar-03): {sqliteCreateIndex(pParse,0,0,X,R,0,0,0);}1.43 (drh 29-Jan-02): tcons ::= CHECK expr onconf.1.83 (drh 31-Aug-02): tcons ::= FOREIGN KEY LP idxlist(FA) RP1.83 (drh 31-Aug-02): REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). {1.83 (drh 31-Aug-02): sqliteCreateForeignKey(pParse, FA, &T, TA, R);1.83 (drh 31-Aug-02): sqliteDeferForeignKey(pParse, D);1.83 (drh 31-Aug-02): }1.83 (drh 31-Aug-02): %type defer_subclause_opt {int}1.83 (drh 31-Aug-02): defer_subclause_opt(A) ::= . {A = 0;}1.83 (drh 31-Aug-02): defer_subclause_opt(A) ::= defer_subclause(X). {A = X;}1.43 (drh 29-Jan-02): 1.43 (drh 29-Jan-02): // The following is a non-standard extension that allows us to declare the1.43 (drh 29-Jan-02): // default behavior when there is a constraint conflict.1.43 (drh 29-Jan-02): //1.43 (drh 29-Jan-02): %type onconf {int}1.45 (drh 31-Jan-02): %type orconf {int}1.45 (drh 31-Jan-02): %type resolvetype {int}1.45 (drh 31-Jan-02): onconf(A) ::= . { A = OE_Default; }1.45 (drh 31-Jan-02): onconf(A) ::= ON CONFLICT resolvetype(X). { A = X; }1.45 (drh 31-Jan-02): orconf(A) ::= . { A = OE_Default; }1.45 (drh 31-Jan-02): orconf(A) ::= OR resolvetype(X). { A = X; }1.45 (drh 31-Jan-02): resolvetype(A) ::= ROLLBACK. { A = OE_Rollback; }1.45 (drh 31-Jan-02): resolvetype(A) ::= ABORT. { A = OE_Abort; }1.45 (drh 31-Jan-02): resolvetype(A) ::= FAIL. { A = OE_Fail; }1.45 (drh 31-Jan-02): resolvetype(A) ::= IGNORE. { A = OE_Ignore; }1.45 (drh 31-Jan-02): resolvetype(A) ::= REPLACE. { A = OE_Replace; }1.1 (drh 29-May-00): 1.34 (drh 06-Oct-01): ////////////////////////// The DROP TABLE /////////////////////////////////////1.1 (drh 29-May-00): //1.76 (drh 01-Jul-02): cmd ::= DROP TABLE nm(X). {sqliteDropTable(pParse,&X,0);}1.53 (drh 23-Feb-02): 1.53 (drh 23-Feb-02): ///////////////////// The CREATE VIEW statement /////////////////////////////1.53 (drh 23-Feb-02): //1.78 (drh 08-Jul-02): cmd ::= CREATE(X) temp(T) VIEW nm(Y) AS select(S). {1.78 (drh 08-Jul-02): sqliteCreateView(pParse, &X, &Y, S, T);1.53 (drh 23-Feb-02): }1.76 (drh 01-Jul-02): cmd ::= DROP VIEW nm(X). {1.55 (drh 03-Mar-02): sqliteDropTable(pParse, &X, 1);1.53 (drh 23-Feb-02): }1.1 (drh 29-May-00): 1.34 (drh 06-Oct-01): //////////////////////// The SELECT statement /////////////////////////////////1.1 (drh 29-May-00): //1.9 (drh 05-Jun-00): cmd ::= select(X). {1.54 (drh 02-Mar-02): sqliteSelect(pParse, X, SRT_Callback, 0, 0, 0, 0);1.9 (drh 05-Jun-00): sqliteSelectDelete(X);1.9 (drh 05-Jun-00): }1.9 (drh 05-Jun-00): 1.9 (drh 05-Jun-00): %type select {Select*}1.9 (drh 05-Jun-00): %destructor select {sqliteSelectDelete($$);}1.14 (drh 06-Jun-00): %type oneselect {Select*}1.14 (drh 06-Jun-00): %destructor oneselect {sqliteSelectDelete($$);}1.9 (drh 05-Jun-00): 1.14 (drh 06-Jun-00): select(A) ::= oneselect(X). {A = X;}1.52 (drh 18-Feb-02): select(A) ::= select(X) multiselect_op(Y) oneselect(Z). {1.28 (drh 11-Apr-01): if( Z ){1.14 (drh 06-Jun-00): Z->op = Y;1.14 (drh 06-Jun-00): Z->pPrior = X;1.28 (drh 11-Apr-01): }1.28 (drh 11-Apr-01): A = Z;1.14 (drh 06-Jun-00): }1.52 (drh 18-Feb-02): %type multiselect_op {int}1.52 (drh 18-Feb-02): multiselect_op(A) ::= UNION. {A = TK_UNION;}1.52 (drh 18-Feb-02): multiselect_op(A) ::= UNION ALL. {A = TK_ALL;}1.52 (drh 18-Feb-02): multiselect_op(A) ::= INTERSECT. {A = TK_INTERSECT;}1.52 (drh 18-Feb-02): multiselect_op(A) ::= EXCEPT. {A = TK_EXCEPT;}1.14 (drh 06-Jun-00): oneselect(A) ::= SELECT distinct(D) selcollist(W) from(X) where_opt(Y)1.38 (drh 06-Nov-01): groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). {1.68 (drh 24-May-02): A = sqliteSelectNew(W,X,Y,P,Q,Z,D,L.limit,L.offset);1.9 (drh 05-Jun-00): }1.6 (drh 31-May-00): 1.9 (drh 05-Jun-00): // The "distinct" nonterminal is true (1) if the DISTINCT keyword is1.9 (drh 05-Jun-00): // present and false (0) if it is not.1.9 (drh 05-Jun-00): //1.6 (drh 31-May-00): %type distinct {int}1.6 (drh 31-May-00): distinct(A) ::= DISTINCT. {A = 1;}1.11 (drh 06-Jun-00): distinct(A) ::= ALL. {A = 0;}1.6 (drh 31-May-00): distinct(A) ::= . {A = 0;}1.1 (drh 29-May-00): 1.9 (drh 05-Jun-00): // selcollist is a list of expressions that are to become the return1.39 (drh 16-Dec-01): // values of the SELECT statement. The "*" in statements like1.39 (drh 16-Dec-01): // "SELECT * FROM ..." is encoded as a special expression with an1.39 (drh 16-Dec-01): // opcode of TK_ALL.1.9 (drh 05-Jun-00): //1.1 (drh 29-May-00): %type selcollist {ExprList*}1.1 (drh 29-May-00): %destructor selcollist {sqliteExprListDelete($$);}1.1 (drh 29-May-00): %type sclp {ExprList*}1.1 (drh 29-May-00): %destructor sclp {sqliteExprListDelete($$);}1.1 (drh 29-May-00): sclp(A) ::= selcollist(X) COMMA. {A = X;}1.1 (drh 29-May-00): sclp(A) ::= . {A = 0;}1.69 (drh 24-May-02): selcollist(A) ::= sclp(P) expr(X) as(Y). {1.69 (drh 24-May-02): A = sqliteExprListAppend(P,X,Y.n?&Y:0);1.69 (drh 24-May-02): }1.39 (drh 16-Dec-01): selcollist(A) ::= sclp(P) STAR. {1.39 (drh 16-Dec-01): A = sqliteExprListAppend(P, sqliteExpr(TK_ALL, 0, 0, 0), 0);1.60 (drh 04-Apr-02): }1.76 (drh 01-Jul-02): selcollist(A) ::= sclp(P) nm(X) DOT STAR. {1.60 (drh 04-Apr-02): Expr *pRight = sqliteExpr(TK_ALL, 0, 0, 0);1.60 (drh 04-Apr-02): Expr *pLeft = sqliteExpr(TK_ID, 0, 0, &X);1.60 (drh 04-Apr-02): A = sqliteExprListAppend(P, sqliteExpr(TK_DOT, pLeft, pRight, 0), 0);1.39 (drh 16-Dec-01): }1.69 (drh 24-May-02): 1.69 (drh 24-May-02): // An option "AS <id>" phrase that can follow one of the expressions that1.69 (drh 24-May-02): // define the result set, or one of the tables in the FROM clause.1.69 (drh 24-May-02): //1.69 (drh 24-May-02): %type as {Token}1.76 (drh 01-Jul-02): as(X) ::= AS nm(Y). { X = Y; }1.76 (drh 01-Jul-02): as(X) ::= ids(Y). { X = Y; }1.76 (drh 01-Jul-02): as(X) ::= . { X.n = 0; }1.9 (drh 05-Jun-00): 1.1 (drh 29-May-00): 1.68 (drh 24-May-02): %type seltablist {SrcList*}1.68 (drh 24-May-02): %destructor seltablist {sqliteSrcListDelete($$);}1.68 (drh 24-May-02): %type stl_prefix {SrcList*}1.68 (drh 24-May-02): %destructor stl_prefix {sqliteSrcListDelete($$);}1.68 (drh 24-May-02): %type from {SrcList*}1.68 (drh 24-May-02): %destructor from {sqliteSrcListDelete($$);}1.1 (drh 29-May-00): 1.69 (drh 24-May-02): // A complete FROM clause.1.69 (drh 24-May-02): //1.61 (drh 06-Apr-02): from(A) ::= . {A = sqliteMalloc(sizeof(*A));}1.1 (drh 29-May-00): from(A) ::= FROM seltablist(X). {A = X;}1.69 (drh 24-May-02):
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -