/ Check-in [92131195]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

   707    707     sqlite3ExprListDelete(pParse->db, $$.pList);
   708    708     sqlite3SelectDelete(pParse->db, $$.pSelect);
   709    709   }
   710    710   valuelist(A) ::= VALUES LP nexprlist(X) RP. {
   711    711     A.pList = X;
   712    712     A.pSelect = 0;
   713    713   }
          714  +
          715  +// Since a list of VALUEs is inplemented as a compound SELECT, we have
          716  +// to disable the value list option if compound SELECTs are disabled.
          717  +%ifndef SQLITE_OMIT_COMPOUND_SELECT
   714    718   valuelist(A) ::= valuelist(X) COMMA LP exprlist(Y) RP. {
   715    719     Select *pRight = sqlite3SelectNew(pParse, Y, 0, 0, 0, 0, 0, 0, 0, 0);
   716    720     if( X.pList ){
   717    721       X.pSelect = sqlite3SelectNew(pParse, X.pList, 0, 0, 0, 0, 0, 0, 0, 0);
   718    722       X.pList = 0;
   719    723     }
   720    724     A.pList = 0;
................................................................................
   726    730       pRight->op = TK_ALL;
   727    731       pRight->pPrior = X.pSelect;
   728    732       pRight->selFlags |= SF_Values;
   729    733       pRight->pPrior->selFlags |= SF_Values;
   730    734       A.pSelect = pRight;
   731    735     }
   732    736   }
          737  +%endif SQLITE_OMIT_COMPOUND_SELECT
   733    738   
   734    739   %type inscollist_opt {IdList*}
   735    740   %destructor inscollist_opt {sqlite3IdListDelete(pParse->db, $$);}
   736    741   %type inscollist {IdList*}
   737    742   %destructor inscollist {sqlite3IdListDelete(pParse->db, $$);}
   738    743   
   739    744   inscollist_opt(A) ::= .                       {A = 0;}