/ Check-in [10715b05]
Login

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

Overview
Comment:Fix a faulty assert() in the compound-SELECT code generator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 10715b05f2201a63dca317f99ce39d3ce182e182
User & Date: drh 2015-04-16 16:22:27
Context
2015-04-16
17:31
Fix the VDBE so that it always uses the original opcode for profiling and debugging even after the pOp pointer has been updated due to a jump. check-in: 647495cf user: drh tags: trunk
16:22
Fix a faulty assert() in the compound-SELECT code generator. check-in: 10715b05 user: drh tags: trunk
16:04
Silently ignore requests to change the PRAGMA synchronous setting to an illegal integer value, rather than raising an assertion. check-in: e0a88176 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
#endif

    /* If this is a scalar select that is part of an expression, then
    ** store the results in the appropriate memory cell and break out
    ** of the scan loop.
    */
    case SRT_Mem: {
      assert( pIn->nSdst==1 );
      sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, 1);
      /* The LIMIT clause will jump out of the loop for us */
      break;
    }
#endif /* #ifndef SQLITE_OMIT_SUBQUERY */

    /* The results are stored in a sequence of registers







|







2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
#endif

    /* If this is a scalar select that is part of an expression, then
    ** store the results in the appropriate memory cell and break out
    ** of the scan loop.
    */
    case SRT_Mem: {
      assert( pIn->nSdst==1 || pParse->nErr>0 );  testcase( pIn->nSdst!=1 );
      sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, 1);
      /* The LIMIT clause will jump out of the loop for us */
      break;
    }
#endif /* #ifndef SQLITE_OMIT_SUBQUERY */

    /* The results are stored in a sequence of registers

Changes to test/select4.test.

114
115
116
117
118
119
120




121
122
123
124
125
126
127
    SELECT DISTINCT log FROM t1 ORDER BY log
    UNION ALL
    SELECT n FROM t1 WHERE log=3
    ORDER BY log;
  }} msg]
  lappend v $msg
} {1 {ORDER BY clause should come after UNION ALL not before}}





# Union operator
#
do_test select4-2.1 {
  execsql {
    SELECT DISTINCT log FROM t1
    UNION







>
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    SELECT DISTINCT log FROM t1 ORDER BY log
    UNION ALL
    SELECT n FROM t1 WHERE log=3
    ORDER BY log;
  }} msg]
  lappend v $msg
} {1 {ORDER BY clause should come after UNION ALL not before}}
do_catchsql_test select4-1.4 {
  SELECT (VALUES(0) INTERSECT SELECT(0) UNION SELECT(0) ORDER BY (0) UNION
          SELECT 0 UNION SELECT 0 ORDER BY 1);
} {1 {ORDER BY clause should come after UNION not before}}

# Union operator
#
do_test select4-2.1 {
  execsql {
    SELECT DISTINCT log FROM t1
    UNION