/ Check-in [8824115a]
Login

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

Overview
Comment:Build and test fixes for SQLITE_OMIT_WINDOWFUNC builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:8824115a9776e876a3677f0cb479e311ee65584d43872b37766a146afec72d8f
User & Date: dan 2019-02-11 11:34:01
Context
2019-02-11
13:25
Fix typos in comments in fts5.h. No changes to code. check-in: c19e97bc user: dan tags: trunk
11:34
Build and test fixes for SQLITE_OMIT_WINDOWFUNC builds. check-in: 8824115a user: dan tags: trunk
11:04
Avoid using a "return void_function();" statement in void function sqlite3WalSnapshotUnlock(). It provokes a warning from some compilers. check-in: 4a4952d3 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

  1529   1529             sqlite3ErrorMsg(pParse, "aggregate functions are not allowed in "
  1530   1530                 "the GROUP BY clause");
  1531   1531             return WRC_Abort;
  1532   1532           }
  1533   1533         }
  1534   1534       }
  1535   1535   
         1536  +#ifndef SQLITE_OMIT_WINDOWFUNC
  1536   1537       if( IN_RENAME_OBJECT ){
  1537   1538         Window *pWin;
  1538   1539         for(pWin=p->pWinDefn; pWin; pWin=pWin->pNextWin){
  1539   1540           if( sqlite3ResolveExprListNames(&sNC, pWin->pOrderBy)
  1540   1541            || sqlite3ResolveExprListNames(&sNC, pWin->pPartition)
  1541   1542           ){
  1542   1543             return WRC_Abort;
  1543   1544           }
  1544   1545         }
  1545   1546       }
         1547  +#endif
  1546   1548   
  1547   1549       /* If this is part of a compound SELECT, check that it has the right
  1548   1550       ** number of expressions in the select list. */
  1549   1551       if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){
  1550   1552         sqlite3SelectWrongNumTermsError(pParse, p->pNext);
  1551   1553         return WRC_Abort;
  1552   1554       }

Changes to test/altertab2.test.

   175    175   } {
   176    176   {CREATE TRIGGER r1 AFTER INSERT ON "t1x" WHEN new.aaa NOT NULL BEGIN
   177    177       UPDATE "t1x" SET (c,ddd)=(aaa,b);
   178    178     END}
   179    179   }
   180    180   
   181    181   #-------------------------------------------------------------------------
          182  +ifcapable windowfunc {
   182    183   do_execsql_test 5.0 {
   183    184     CREATE TABLE t2(a);
   184    185     CREATE TRIGGER r2 AFTER INSERT ON t2 WHEN new.a NOT NULL BEGIN
   185    186       SELECT a, sum(a) OVER w1 FROM t2
   186    187         WINDOW w1 AS (
   187    188           PARTITION BY a ORDER BY a 
   188    189           ROWS BETWEEN 2 PRECEDING AND 3 FOLLOWING
................................................................................
   231    232         );
   232    233     END}
   233    234   }
   234    235   
   235    236   do_execsql_test 5.3 {
   236    237     INSERT INTO t2x VALUES(1);
   237    238   } {}
          239  +} ;# windowfunc
   238    240   
   239    241   #-------------------------------------------------------------------------
   240    242   
   241    243   do_execsql_test 6.0 {
   242    244     CREATE TABLE t3(a,b,c,d);
   243    245     CREATE TRIGGER r3 AFTER INSERT ON t3 WHEN new.a NOT NULL BEGIN
   244    246       SELECT a,b,c FROM t3 EXCEPT SELECT a,b,c FROM t3 ORDER BY a;

Changes to test/altertab3.test.

    16     16   
    17     17   # If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
    18     18   ifcapable !altertable {
    19     19     finish_test
    20     20     return
    21     21   }
    22     22   
           23  +ifcapable windowfunc {
    23     24   do_execsql_test 1.0 {
    24     25     CREATE TABLE t1(a, b);
    25     26     CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
    26     27       SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY a);
    27     28     END;
    28     29   }
    29     30   
................................................................................
    36     37   } {{CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
    37     38       SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY aaa);
    38     39     END}}
    39     40   
    40     41   do_execsql_test 1.3 {
    41     42     INSERT INTO t1 VALUES(1, 2);
    42     43   }
           44  +} ;# windowfunc
    43     45   
    44     46   #-------------------------------------------------------------------------
    45     47   reset_db
    46     48   do_execsql_test 2.0 {
    47     49     CREATE TABLE t1(a,b,c);
    48     50     CREATE TABLE t2(a,b,c);
    49     51     CREATE TRIGGER r1 AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN

Changes to test/autoindex5.test.

   124    124     ) FROM one;
   125    125   } {8.0}
   126    126   
   127    127   # Ticket https://www.sqlite.org/src/info/787fa716be3a7f65
   128    128   # Segfault due to multiple uses of the same subquery where the
   129    129   # subquery is implemented via coroutine.
   130    130   #
          131  +ifcapable windowfunc {
   131    132   sqlite3 db :memory:
   132    133   do_execsql_test 3.0 {
   133    134     -- This is the original test case reported on the mailing list
   134    135     CREATE TABLE artists (
   135    136       id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
   136    137       name varchar(255)
   137    138     );
................................................................................
   162    163             WHERE (name = 'Al')
   163    164           ) AS 't1'
   164    165           WHERE (x = 1)
   165    166         ))
   166    167         AND (albums.id IN (1, 2)))
   167    168     ));
   168    169   } {1 Ar}
          170  +} ;# windowfunc
          171  +
   169    172   # The remaining test cases were discovered (by Dan) during trouble-shooting
   170    173   sqlite3 db :memory:
   171    174   do_execsql_test 3.1 {
   172    175     CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
   173    176     CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
   174    177     CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
   175    178     CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);