Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: third_party/sqlite/src/test/distinct.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/delete4.test ('k') | third_party/sqlite/src/test/e_blobbytes.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2011 July 1 1 # 2011 July 1
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 CREATE TABLE t2(x); 215 CREATE TABLE t2(x);
216 INSERT INTO t2 216 INSERT INTO t2
217 SELECT DISTINCT 217 SELECT DISTINCT
218 CASE a WHEN 1 THEN x'0000000000' 218 CASE a WHEN 1 THEN x'0000000000'
219 WHEN 2 THEN zeroblob(5) 219 WHEN 2 THEN zeroblob(5)
220 ELSE 'xyzzy' END 220 ELSE 'xyzzy' END
221 FROM t1; 221 FROM t1;
222 SELECT quote(x) FROM t2 ORDER BY 1; 222 SELECT quote(x) FROM t2 ORDER BY 1;
223 } {'xyzzy' X'0000000000'} 223 } {'xyzzy' X'0000000000'}
224 224
225 #----------------------------------------------------------------------------
226 # Ticket [c5ea805691bfc4204b1cb9e9aa0103bd48bc7d34] (2014-12-04)
227 # Make sure that DISTINCT works together with ORDER BY and descending
228 # indexes.
229 #
230 do_execsql_test 5.1 {
231 DROP TABLE IF EXISTS t1;
232 CREATE TABLE t1(x);
233 INSERT INTO t1(x) VALUES(3),(1),(5),(2),(6),(4),(5),(1),(3);
234 CREATE INDEX t1x ON t1(x DESC);
235 SELECT DISTINCT x FROM t1 ORDER BY x ASC;
236 } {1 2 3 4 5 6}
237 do_execsql_test 5.2 {
238 SELECT DISTINCT x FROM t1 ORDER BY x DESC;
239 } {6 5 4 3 2 1}
240 do_execsql_test 5.3 {
241 SELECT DISTINCT x FROM t1 ORDER BY x;
242 } {1 2 3 4 5 6}
243 do_execsql_test 5.4 {
244 DROP INDEX t1x;
245 CREATE INDEX t1x ON t1(x ASC);
246 SELECT DISTINCT x FROM t1 ORDER BY x ASC;
247 } {1 2 3 4 5 6}
248 do_execsql_test 5.5 {
249 SELECT DISTINCT x FROM t1 ORDER BY x DESC;
250 } {6 5 4 3 2 1}
251 do_execsql_test 5.6 {
252 SELECT DISTINCT x FROM t1 ORDER BY x;
253 } {1 2 3 4 5 6}
254
255 #-------------------------------------------------------------------------
256 # 2015-11-23. Problem discovered by Kostya Serebryany using libFuzzer
257 #
258 db close
259 sqlite3 db :memory:
260 do_execsql_test 6.1 {
261 CREATE TABLE jjj(x);
262 SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1)
263 FROM sqlite_master;
264 } {jjj}
265 do_execsql_test 6.2 {
266 CREATE TABLE nnn(x);
267 SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1)
268 FROM sqlite_master;
269 } {mmm}
270
271
225 finish_test 272 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/delete4.test ('k') | third_party/sqlite/src/test/e_blobbytes.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698