/ Check-in [d1e6bc91]
Login

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

Overview
Comment:Change an assert() in the aggregate query code generator into a testcase().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d1e6bc918b0c8e0701f5e15afb91b84a9004231b
User & Date: drh 2015-04-21 15:16:48
Context
2015-04-21
15:49
Fix an obscure problem with "INSERT INTO tbl(cols) SELECT" statements where the SELECT is a compound with an ORDER BY and "cols" is a strict subset of tbl's columns. check-in: 718d5d0e user: dan tags: trunk
15:16
Change an assert() in the aggregate query code generator into a testcase(). check-in: d1e6bc91 user: drh tags: trunk
12:06
Fix an fts4 problem to do with the handling of phrases that contain zero tokens. check-in: caba5be0 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  4604   4604         sqlite3ExprCodeExprList(pParse, pList, regAgg, SQLITE_ECEL_DUP);
  4605   4605       }else{
  4606   4606         nArg = 0;
  4607   4607         regAgg = 0;
  4608   4608       }
  4609   4609       if( pF->iDistinct>=0 ){
  4610   4610         addrNext = sqlite3VdbeMakeLabel(v);
  4611         -      assert( nArg==1 );
         4611  +      testcase( nArg==0 );  /* Error condition */
         4612  +      testcase( nArg>1 );   /* Also an error */
  4612   4613         codeDistinct(pParse, pF->iDistinct, addrNext, 1, regAgg);
  4613   4614       }
  4614   4615       if( pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
  4615   4616         CollSeq *pColl = 0;
  4616   4617         struct ExprList_item *pItem;
  4617   4618         int j;
  4618   4619         assert( pList!=0 );  /* pList!=0 if pF->pFunc has NEEDCOLL */

Changes to test/count.test.

   187    187   
   188    188   do_execsql_test count-5.1 {
   189    189     CREATE TABLE t5(a TEXT PRIMARY KEY, b VARCHAR(50)) WITHOUT ROWID;
   190    190     INSERT INTO t5 VALUES('bison','jazz');
   191    191     SELECT count(*) FROM t5;
   192    192   } {1}
   193    193   
          194  +do_catchsql_test count-6.1 {
          195  +  CREATE TABLE t6(x);
          196  +  SELECT count(DISTINCT) FROM t6 GROUP BY x;
          197  +} {1 {DISTINCT aggregates must have exactly one argument}}
          198  +
   194    199   finish_test