SQLite

Check-in [e7991bc510]
Login

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

Overview
Comment:New requirements marks on compound SELECT statements.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e7991bc510f63f3594603a91f6f3b32e94d90e72
User & Date: drh 2015-03-05 01:29:51.655
Context
2015-03-05
14:29
Revert "PRAGMA index_info" to output only three columns, for complete compatibility with prior versions. The new "PRAGMA index_xinfo" can be used to get the extra information in 4th, 5th, and 6th columns. (check-in: fc543c2c5c user: drh tags: trunk)
01:29
New requirements marks on compound SELECT statements. (check-in: e7991bc510 user: drh tags: trunk)
2015-03-04
23:14
New requirements marks on INSERT and INDEXED BY and on some sqlite3_config() options. (check-in: c298ea0bd9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/limit.test.
246
247
248
249
250
251
252






253
254
255
256
257
258
259
  execsql {
    SELECT * FROM t6 LIMIT 0 OFFSET 1
  }
} {}

# Make sure LIMIT works well with compound SELECT statements.
# Ticket #393






#
ifcapable compound {
do_test limit-7.1.1 {
  catchsql {
    SELECT x FROM t2 LIMIT 5 UNION ALL SELECT a FROM t6;
  }
} {1 {LIMIT clause should come after UNION ALL not before}}







>
>
>
>
>
>







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
  execsql {
    SELECT * FROM t6 LIMIT 0 OFFSET 1
  }
} {}

# Make sure LIMIT works well with compound SELECT statements.
# Ticket #393
#
# EVIDENCE-OF: R-13512-64012 In a compound SELECT, only the last or
# right-most simple SELECT may contain a LIMIT clause.
#
# EVIDENCE-OF: R-03782-50113 In a compound SELECT, the LIMIT clause
# applies to the entire compound, not just the final SELECT.
#
ifcapable compound {
do_test limit-7.1.1 {
  catchsql {
    SELECT x FROM t2 LIMIT 5 UNION ALL SELECT a FROM t6;
  }
} {1 {LIMIT clause should come after UNION ALL not before}}
Changes to test/select4.test.
101
102
103
104
105
106
107




108
109
110
111
112
113
114
      SELECT log FROM t1 WHERE n IN 
        (SELECT DISTINCT log FROM t1 UNION ALL
         SELECT n FROM t1 WHERE log=3)
      ORDER BY log;
    }
  } {0 1 2 2 3 3 3 3}
}




do_test select4-1.3 {
  set v [catch {execsql {
    SELECT DISTINCT log FROM t1 ORDER BY log
    UNION ALL
    SELECT n FROM t1 WHERE log=3
    ORDER BY log;
  }} msg]







>
>
>
>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
      SELECT log FROM t1 WHERE n IN 
        (SELECT DISTINCT log FROM t1 UNION ALL
         SELECT n FROM t1 WHERE log=3)
      ORDER BY log;
    }
  } {0 1 2 2 3 3 3 3}
}

# EVIDENCE-OF: R-02644-22131 In a compound SELECT statement, only the
# last or right-most simple SELECT may have an ORDER BY clause.
#
do_test select4-1.3 {
  set v [catch {execsql {
    SELECT DISTINCT log FROM t1 ORDER BY log
    UNION ALL
    SELECT n FROM t1 WHERE log=3
    ORDER BY log;
  }} msg]