/ Check-in [7e30c021]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove old commented-out code from parse.y. Fix some over-length source lines in parse.y. No logical changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7e30c021abe5a559918efaa5fc0b21db8ca782ad
User & Date: drh 2012-12-18 13:12:03
Context
2012-12-18
16:07
Resolve names in FROM-clause subqueries prior to resolving names in the result set expressions of a SELECT statement. check-in: 9b67c633 user: drh tags: trunk
13:12
Remove old commented-out code from parse.y. Fix some over-length source lines in parse.y. No logical changes. check-in: 7e30c021 user: drh tags: trunk
11:59
On atomic-write capable systems, if copying the contents of an in-memory journal to disk fails, close the (on disk) journal file before returning the error to the caller. This causes the subsequent rollback operation to use the in-memory journal. Fix for [df678d738adb]. check-in: 8183d8d7 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

   495    495   // in a SELECT statement.  "stl_prefix" is a prefix of this list.
   496    496   //
   497    497   stl_prefix(A) ::= seltablist(X) joinop(Y).    {
   498    498      A = X;
   499    499      if( ALWAYS(A && A->nSrc>0) ) A->a[A->nSrc-1].jointype = (u8)Y;
   500    500   }
   501    501   stl_prefix(A) ::= .                           {A = 0;}
   502         -seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) indexed_opt(I) on_opt(N) using_opt(U). {
          502  +seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) indexed_opt(I)
          503  +                  on_opt(N) using_opt(U). {
   503    504     A = sqlite3SrcListAppendFromTerm(pParse,X,&Y,&D,&Z,0,N,U);
   504    505     sqlite3SrcListIndexedBy(pParse, A, &I);
   505    506   }
   506    507   %ifndef SQLITE_OMIT_SUBQUERY
   507    508     seltablist(A) ::= stl_prefix(X) LP select(S) RP
   508    509                       as(Z) on_opt(N) using_opt(U). {
   509    510       A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,S,N,U);
................................................................................
   515    516       }else{
   516    517         Select *pSubquery;
   517    518         sqlite3SrcListShiftJoinType(F);
   518    519         pSubquery = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0);
   519    520         A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,pSubquery,N,U);
   520    521       }
   521    522     }
   522         -  
   523         -  // A seltablist_paren nonterminal represents anything in a FROM that
   524         -  // is contained inside parentheses.  This can be either a subquery or
   525         -  // a grouping of table and subqueries.
   526         -  //
   527         -//  %type seltablist_paren {Select*}
   528         -//  %destructor seltablist_paren {sqlite3SelectDelete(pParse->db, $$);}
   529         -//  seltablist_paren(A) ::= select(S).      {A = S;}
   530         -//  seltablist_paren(A) ::= seltablist(F).  {
   531         -//     sqlite3SrcListShiftJoinType(F);
   532         -//     A = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0);
   533         -//  }
   534    523   %endif  SQLITE_OMIT_SUBQUERY
   535    524   
   536    525   %type dbnm {Token}
   537    526   dbnm(A) ::= .          {A.z=0; A.n=0;}
   538    527   dbnm(A) ::= DOT nm(X). {A = X;}
   539    528   
   540    529   %type fullname {SrcList*}
................................................................................
   649    638   
   650    639   where_opt(A) ::= .                    {A = 0;}
   651    640   where_opt(A) ::= WHERE expr(X).       {A = X.pExpr;}
   652    641   
   653    642   ////////////////////////// The UPDATE command ////////////////////////////////
   654    643   //
   655    644   %ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
   656         -cmd ::= UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W) orderby_opt(O) limit_opt(L).  {
          645  +cmd ::= UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W)
          646  +        orderby_opt(O) limit_opt(L).  {
   657    647     sqlite3SrcListIndexedBy(pParse, X, &I);
   658    648     sqlite3ExprListCheckLength(pParse,Y,"set list"); 
   659    649     W = sqlite3LimitWhere(pParse, X, W, O, L.pLimit, L.pOffset, "UPDATE");
   660    650     sqlite3Update(pParse,X,Y,W,R);
   661    651   }
   662    652   %endif
   663    653   %ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
   664         -cmd ::= UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W).  {
          654  +cmd ::= UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y)
          655  +        where_opt(W).  {
   665    656     sqlite3SrcListIndexedBy(pParse, X, &I);
   666    657     sqlite3ExprListCheckLength(pParse,Y,"set list"); 
   667    658     sqlite3Update(pParse,X,Y,W,R);
   668    659   }
   669    660   %endif
   670    661   
   671    662   %type setlist {ExprList*}