/ Check-in [6197b492]
Login

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

Overview
Comment:An additional memory leak in the parser fixed. Ticket #3911. (CVS 6751)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6197b492714e16396941ae6ba61f90f708d54728
User & Date: drh 2009-06-12 03:47:37
Context
2009-06-12
11:42
Remove a C++-ism from the code. Ticket #3912. (CVS 6752) check-in: bc729bc3 user: drh tags: trunk
03:47
An additional memory leak in the parser fixed. Ticket #3911. (CVS 6751) check-in: 6197b492 user: drh tags: trunk
03:27
Make sure nested queries with USING clauses do not leak memory. Preliminary fix for ticket #3911. (CVS 6750) check-in: bd341a10 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains SQLite's grammar for SQL.  Process this file
    13     13   ** using the lemon parser generator to generate C code that runs
    14     14   ** the parser.  Lemon will also generate a header file containing
    15     15   ** numeric codes for all of the tokens.
    16     16   **
    17         -** @(#) $Id: parse.y,v 1.279 2009/06/12 02:27:15 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.280 2009/06/12 03:47:37 drh Exp $
    18     18   */
    19     19   
    20     20   // All token codes are small integers with #defines that begin with "TK_"
    21     21   %token_prefix TK_
    22     22   
    23     23   // The type of the data attached to each token is Token.  This is also the
    24     24   // default type for non-terminals.
................................................................................
   495    495   %ifndef SQLITE_OMIT_SUBQUERY
   496    496     seltablist(A) ::= stl_prefix(X) LP select(S) RP
   497    497                       as(Z) on_opt(N) using_opt(U). {
   498    498       A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,S,N,U);
   499    499     }
   500    500     seltablist(A) ::= stl_prefix(X) LP seltablist(F) RP
   501    501                       as(Z) on_opt(N) using_opt(U). {
   502         -    if( X==0 && Z.n==0 && N==0 && U==0 ){
          502  +    if( X==0 ){
          503  +      sqlite3ExprDelete(pParse->db, N);
          504  +      sqlite3IdListDelete(pParse->db, U);
   503    505         A = F;
   504    506       }else{
   505    507         Select *pSubquery;
   506    508         sqlite3SrcListShiftJoinType(F);
   507    509         pSubquery = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0);
   508    510         A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,pSubquery,N,U);
   509    511       }