/ Check-in [3d4b4f4f]
Login

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

Overview
Comment:Allow UNION ALL compounds to be promoted up to replace a simple wrapper SELECT even if the compounds are joins.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3d4b4f4fb7c1d9f1c742fef884383e9f50f8630e
User & Date: drh 2011-12-10 17:17:17
Context
2011-12-10
23:18
Minor cleanups of the compound-subquery flattening logic. New test cases added for joins the compound subquery. check-in: 5061d85f user: drh tags: trunk
17:17
Allow UNION ALL compounds to be promoted up to replace a simple wrapper SELECT even if the compounds are joins. check-in: 3d4b4f4f user: drh tags: trunk
15:55
Import the experimental parse-tree explainer, with fixes, from the tree-explain branch. Disabled by default. Use SQLITE_ENABLE_TREE_EXPLAIN to turn it on. check-in: bcbc7152 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  2808   2808         return 0;
  2809   2809       }
  2810   2810       for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){
  2811   2811         testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct );
  2812   2812         testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Aggregate );
  2813   2813         if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0
  2814   2814          || (pSub1->pPrior && pSub1->op!=TK_ALL) 
  2815         -       || NEVER(pSub1->pSrc==0) || pSub1->pSrc->nSrc!=1
         2815  +       || NEVER(pSub1->pSrc==0) || pSub1->pSrc->nSrc<1
  2816   2816         ){
  2817   2817           return 0;
  2818   2818         }
  2819   2819       }
  2820   2820   
  2821   2821       /* Restriction 18. */
  2822   2822       if( p->pOrderBy ){