/ Check-in [14784c31]
Login

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

Overview
Comment:Change the multiSelectOrderBy() routine to return non-zero if there has been any prior error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 14784c317bff05dd0a74e2596432dfd12c139391
User & Date: drh 2015-04-15 07:10:25
Context
2015-04-15
07:19
Remove an incorrect ALWAYS() from the table_info pragma. check-in: 0e087c01 user: drh tags: trunk
07:10
Change the multiSelectOrderBy() routine to return non-zero if there has been any prior error. check-in: 14784c31 user: drh tags: trunk
06:45
Fix a faulty assert() statement in the name resolver associated with the optimization that converts compound selects with ORDER BY COLLATE into subqueries. check-in: c72324ef user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
  }
  p->pPrior = pPrior;
  pPrior->pNext = p;

  /*** TBD:  Insert subroutine calls to close cursors on incomplete
  **** subqueries ****/
  explainComposite(pParse, p->op, iSub1, iSub2, 0);
  return SQLITE_OK;
}
#endif

#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
/* Forward Declarations */
static void substExprList(sqlite3*, ExprList*, int, ExprList*);
static void substSelect(sqlite3*, Select *, int, ExprList *);







|







3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
  }
  p->pPrior = pPrior;
  pPrior->pNext = p;

  /*** TBD:  Insert subroutine calls to close cursors on incomplete
  **** subqueries ****/
  explainComposite(pParse, p->op, iSub1, iSub2, 0);
  return pParse->nErr!=0;
}
#endif

#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
/* Forward Declarations */
static void substExprList(sqlite3*, ExprList*, int, ExprList*);
static void substSelect(sqlite3*, Select *, int, ExprList *);

Changes to test/select4.test.

793
794
795
796
797
798
799





800
801
802
803
804
805
806
    SELECT x FROM t2
    INTERSECT
    SELECT x FROM t2
    UNION ALL
    SELECT x FROM t2
    EXCEPT
    SELECT x FROM t2





  }
} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}

do_test select4-12.1 {
  sqlite3 db2 :memory:
  catchsql {
    SELECT 1 UNION SELECT 2,3 UNION SELECT 4,5 ORDER BY 1;







>
>
>
>
>







793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
    SELECT x FROM t2
    INTERSECT
    SELECT x FROM t2
    UNION ALL
    SELECT x FROM t2
    EXCEPT
    SELECT x FROM t2
  }
} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}
do_test select4-11.16 {
  catchsql {
    INSERT INTO t2(rowid) VALUES(2) UNION SELECT 3,4 UNION SELECT 5,6 ORDER BY 1;
  }
} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}

do_test select4-12.1 {
  sqlite3 db2 :memory:
  catchsql {
    SELECT 1 UNION SELECT 2,3 UNION SELECT 4,5 ORDER BY 1;