OLD | NEW |
1 /* | 1 /* |
2 ** 2001 September 15 | 2 ** 2001 September 15 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 A.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &X); | 847 A.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &X); |
848 if( A.pExpr ) sqlite3GetInt32(&X.z[1], &A.pExpr->iTable); | 848 if( A.pExpr ) sqlite3GetInt32(&X.z[1], &A.pExpr->iTable); |
849 } | 849 } |
850 }else{ | 850 }else{ |
851 spanExpr(&A, pParse, TK_VARIABLE, &X); | 851 spanExpr(&A, pParse, TK_VARIABLE, &X); |
852 sqlite3ExprAssignVarNumber(pParse, A.pExpr); | 852 sqlite3ExprAssignVarNumber(pParse, A.pExpr); |
853 } | 853 } |
854 spanSet(&A, &X, &X); | 854 spanSet(&A, &X, &X); |
855 } | 855 } |
856 expr(A) ::= expr(E) COLLATE ids(C). { | 856 expr(A) ::= expr(E) COLLATE ids(C). { |
857 A.pExpr = sqlite3ExprAddCollateToken(pParse, E.pExpr, &C); | 857 A.pExpr = sqlite3ExprAddCollateToken(pParse, E.pExpr, &C, 1); |
858 A.zStart = E.zStart; | 858 A.zStart = E.zStart; |
859 A.zEnd = &C.z[C.n]; | 859 A.zEnd = &C.z[C.n]; |
860 } | 860 } |
861 %ifndef SQLITE_OMIT_CAST | 861 %ifndef SQLITE_OMIT_CAST |
862 expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). { | 862 expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). { |
863 A.pExpr = sqlite3PExpr(pParse, TK_CAST, E.pExpr, 0, &T); | 863 A.pExpr = sqlite3PExpr(pParse, TK_CAST, E.pExpr, 0, &T); |
864 spanSet(&A,&X,&Y); | 864 spanSet(&A,&X,&Y); |
865 } | 865 } |
866 %endif SQLITE_OMIT_CAST | 866 %endif SQLITE_OMIT_CAST |
867 expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP(E). { | 867 expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP(E). { |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 uniqueflag(A) ::= . {A = OE_None;} | 1193 uniqueflag(A) ::= . {A = OE_None;} |
1194 | 1194 |
1195 %type idxlist {ExprList*} | 1195 %type idxlist {ExprList*} |
1196 %destructor idxlist {sqlite3ExprListDelete(pParse->db, $$);} | 1196 %destructor idxlist {sqlite3ExprListDelete(pParse->db, $$);} |
1197 %type idxlist_opt {ExprList*} | 1197 %type idxlist_opt {ExprList*} |
1198 %destructor idxlist_opt {sqlite3ExprListDelete(pParse->db, $$);} | 1198 %destructor idxlist_opt {sqlite3ExprListDelete(pParse->db, $$);} |
1199 | 1199 |
1200 idxlist_opt(A) ::= . {A = 0;} | 1200 idxlist_opt(A) ::= . {A = 0;} |
1201 idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} | 1201 idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;} |
1202 idxlist(A) ::= idxlist(X) COMMA nm(Y) collate(C) sortorder(Z). { | 1202 idxlist(A) ::= idxlist(X) COMMA nm(Y) collate(C) sortorder(Z). { |
1203 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &C); | 1203 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &C, 1); |
1204 A = sqlite3ExprListAppend(pParse,X, p); | 1204 A = sqlite3ExprListAppend(pParse,X, p); |
1205 sqlite3ExprListSetName(pParse,A,&Y,1); | 1205 sqlite3ExprListSetName(pParse,A,&Y,1); |
1206 sqlite3ExprListCheckLength(pParse, A, "index"); | 1206 sqlite3ExprListCheckLength(pParse, A, "index"); |
1207 if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; | 1207 if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; |
1208 } | 1208 } |
1209 idxlist(A) ::= nm(Y) collate(C) sortorder(Z). { | 1209 idxlist(A) ::= nm(Y) collate(C) sortorder(Z). { |
1210 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &C); | 1210 Expr *p = sqlite3ExprAddCollateToken(pParse, 0, &C, 1); |
1211 A = sqlite3ExprListAppend(pParse,0, p); | 1211 A = sqlite3ExprListAppend(pParse,0, p); |
1212 sqlite3ExprListSetName(pParse, A, &Y, 1); | 1212 sqlite3ExprListSetName(pParse, A, &Y, 1); |
1213 sqlite3ExprListCheckLength(pParse, A, "index"); | 1213 sqlite3ExprListCheckLength(pParse, A, "index"); |
1214 if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; | 1214 if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; |
1215 } | 1215 } |
1216 | 1216 |
1217 %type collate {Token} | 1217 %type collate {Token} |
1218 collate(C) ::= . {C.z = 0; C.n = 0;} | 1218 collate(C) ::= . {C.z = 0; C.n = 0;} |
1219 collate(C) ::= COLLATE ids(X). {C = X;} | 1219 collate(C) ::= COLLATE ids(X). {C = X;} |
1220 | 1220 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 with(A) ::= WITH wqlist(W). { A = W; } | 1464 with(A) ::= WITH wqlist(W). { A = W; } |
1465 with(A) ::= WITH RECURSIVE wqlist(W). { A = W; } | 1465 with(A) ::= WITH RECURSIVE wqlist(W). { A = W; } |
1466 | 1466 |
1467 wqlist(A) ::= nm(X) idxlist_opt(Y) AS LP select(Z) RP. { | 1467 wqlist(A) ::= nm(X) idxlist_opt(Y) AS LP select(Z) RP. { |
1468 A = sqlite3WithAdd(pParse, 0, &X, Y, Z); | 1468 A = sqlite3WithAdd(pParse, 0, &X, Y, Z); |
1469 } | 1469 } |
1470 wqlist(A) ::= wqlist(W) COMMA nm(X) idxlist_opt(Y) AS LP select(Z) RP. { | 1470 wqlist(A) ::= wqlist(W) COMMA nm(X) idxlist_opt(Y) AS LP select(Z) RP. { |
1471 A = sqlite3WithAdd(pParse, W, &X, Y, Z); | 1471 A = sqlite3WithAdd(pParse, W, &X, Y, Z); |
1472 } | 1472 } |
1473 %endif SQLITE_OMIT_CTE | 1473 %endif SQLITE_OMIT_CTE |
OLD | NEW |