/ Check-in [b51028ed]
Login

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

Overview
Comment:Ensure the sqlite3Select() routine always returns non-zero if an error has occurred.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b51028ed2f57f4245a7ebd9bdb99d1bcfaf1a01b
User & Date: dan 2015-04-16 07:19:23
Context
2015-04-16
08:54
Fix a problem in test file e_reindex.test. check-in: 5b3de939 user: dan tags: trunk
07:19
Ensure the sqlite3Select() routine always returns non-zero if an error has occurred. check-in: b51028ed user: dan tags: trunk
00:26
When parsing the schema, ignore any SQL that does not begin with "CREATE". check-in: d3c00d61 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  5479   5479       generateSortTail(pParse, p, &sSort, pEList->nExpr, pDest);
  5480   5480     }
  5481   5481   
  5482   5482     /* Jump here to skip this query
  5483   5483     */
  5484   5484     sqlite3VdbeResolveLabel(v, iEnd);
  5485   5485   
  5486         -  /* The SELECT was successfully coded.   Set the return code to 0
  5487         -  ** to indicate no errors.
  5488         -  */
  5489         -  rc = 0;
         5486  +  /* The SELECT has been coded. If there is an error in the Parse structure,
         5487  +  ** set the return code to 1. Otherwise 0. */
         5488  +  rc = (pParse->nErr>0);
  5490   5489   
  5491   5490     /* Control jumps to here if an error is encountered above, or upon
  5492   5491     ** successful coding of the SELECT.
  5493   5492     */
  5494   5493   select_end:
  5495   5494     explainSetInteger(pParse->iSelectId, iRestoreSelectId);
  5496   5495   

Changes to test/select1.test.

   303    303     set v [catch {execsql {SELECT f1 FROM test1 ORDER BY min(f1,f2)}} msg]
   304    304     lappend v $msg
   305    305   } {0 {11 33}}
   306    306   do_test select1-4.4 {
   307    307     set v [catch {execsql {SELECT f1 FROM test1 ORDER BY min(f1)}} msg]
   308    308     lappend v $msg
   309    309   } {1 {misuse of aggregate: min()}}
          310  +do_catchsql_test select1-4.5 {
          311  +  INSERT INTO test1(f1) SELECT f1 FROM test1 ORDER BY min(f1);
          312  +} {1 {misuse of aggregate: min()}}
   310    313   
   311    314   # The restriction not allowing constants in the ORDER BY clause
   312    315   # has been removed.  See ticket #1768
   313    316   #do_test select1-4.5 {
   314    317   #  catchsql {
   315    318   #    SELECT f1 FROM test1 ORDER BY 8.4;
   316    319   #  }