/ Check-in [92131195]
Login

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

Overview
Comment:Disable the ability to have multiple values in the VALUES clause of an INSERT statement when SQLITE_OMIT_COMPOUND_SELECT is used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 92131195d0c24c0116992db51ed5d8316626ba57
User & Date: drh 2012-02-10 17:38:58
Context
2012-02-10
20:43
Fix a warning coming from the Solaris Studio compiler. check-in: 33294bbd user: drh tags: trunk
18:18
Pull the latest trunk changes into the apple-osx branch. check-in: e2485986 user: drh tags: apple-osx
17:54
Pull all the latest trunk changes into the sessions branch. check-in: 361fb66a user: drh tags: sessions
17:38
Disable the ability to have multiple values in the VALUES clause of an INSERT statement when SQLITE_OMIT_COMPOUND_SELECT is used. check-in: 92131195 user: drh tags: trunk
03:10
Fix an important bug in the handling of EINTR in unixRead(). Never came up on x86 but crashes on sparc. check-in: 1a16db0b user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/parse.y.

707
708
709
710
711
712
713




714
715
716
717
718
719
720
...
726
727
728
729
730
731
732

733
734
735
736
737
738
739
  sqlite3ExprListDelete(pParse->db, $$.pList);
  sqlite3SelectDelete(pParse->db, $$.pSelect);
}
valuelist(A) ::= VALUES LP nexprlist(X) RP. {
  A.pList = X;
  A.pSelect = 0;
}




valuelist(A) ::= valuelist(X) COMMA LP exprlist(Y) RP. {
  Select *pRight = sqlite3SelectNew(pParse, Y, 0, 0, 0, 0, 0, 0, 0, 0);
  if( X.pList ){
    X.pSelect = sqlite3SelectNew(pParse, X.pList, 0, 0, 0, 0, 0, 0, 0, 0);
    X.pList = 0;
  }
  A.pList = 0;
................................................................................
    pRight->op = TK_ALL;
    pRight->pPrior = X.pSelect;
    pRight->selFlags |= SF_Values;
    pRight->pPrior->selFlags |= SF_Values;
    A.pSelect = pRight;
  }
}


%type inscollist_opt {IdList*}
%destructor inscollist_opt {sqlite3IdListDelete(pParse->db, $$);}
%type inscollist {IdList*}
%destructor inscollist {sqlite3IdListDelete(pParse->db, $$);}

inscollist_opt(A) ::= .                       {A = 0;}







>
>
>
>







 







>







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
...
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
  sqlite3ExprListDelete(pParse->db, $$.pList);
  sqlite3SelectDelete(pParse->db, $$.pSelect);
}
valuelist(A) ::= VALUES LP nexprlist(X) RP. {
  A.pList = X;
  A.pSelect = 0;
}

// Since a list of VALUEs is inplemented as a compound SELECT, we have
// to disable the value list option if compound SELECTs are disabled.
%ifndef SQLITE_OMIT_COMPOUND_SELECT
valuelist(A) ::= valuelist(X) COMMA LP exprlist(Y) RP. {
  Select *pRight = sqlite3SelectNew(pParse, Y, 0, 0, 0, 0, 0, 0, 0, 0);
  if( X.pList ){
    X.pSelect = sqlite3SelectNew(pParse, X.pList, 0, 0, 0, 0, 0, 0, 0, 0);
    X.pList = 0;
  }
  A.pList = 0;
................................................................................
    pRight->op = TK_ALL;
    pRight->pPrior = X.pSelect;
    pRight->selFlags |= SF_Values;
    pRight->pPrior->selFlags |= SF_Values;
    A.pSelect = pRight;
  }
}
%endif SQLITE_OMIT_COMPOUND_SELECT

%type inscollist_opt {IdList*}
%destructor inscollist_opt {sqlite3IdListDelete(pParse->db, $$);}
%type inscollist {IdList*}
%destructor inscollist {sqlite3IdListDelete(pParse->db, $$);}

inscollist_opt(A) ::= .                       {A = 0;}