~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to jstests/covered_index_sort_1.js

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Simple covered index query test with sort
 
2
 
 
3
var coll = db.getCollection("covered_sort_1")
 
4
coll.drop()
 
5
for (i=0;i<10;i++) {
 
6
    coll.insert({foo:i})
 
7
}
 
8
for (i=0;i<10;i++) {
 
9
    coll.insert({foo:i})
 
10
}
 
11
for (i=0;i<5;i++) {
 
12
    coll.insert({bar:i})
 
13
}
 
14
coll.insert({foo:"1"})
 
15
coll.insert({foo:{bar:1}})
 
16
coll.insert({foo:null})
 
17
coll.ensureIndex({foo:1})
 
18
 
 
19
// Test no query and sort ascending
 
20
var plan = coll.find({}, {foo:1, _id:0}).sort({foo:1}).hint({foo:1}).explain()
 
21
assert.eq(true, plan.indexOnly, "sort.1.1 - indexOnly should be true on covered query")
 
22
assert.eq(0, plan.nscannedObjects, "sort.1.1 - nscannedObjects should be 0 for covered query")
 
23
 
 
24
// Test no query and sort descending
 
25
var plan = coll.find({}, {foo:1, _id:0}).sort({foo:-1}).hint({foo:1}).explain()
 
26
assert.eq(true, plan.indexOnly, "sort.1.2 - indexOnly should be true on covered query")
 
27
assert.eq(0, plan.nscannedObjects, "sort.1.2 - nscannedObjects should be 0 for covered query")
 
28
 
 
29
// Test range query with sort
 
30
var plan = coll.find({foo:{$gt:2}}, {foo:1, _id:0}).sort({foo:-1}).hint({foo:1}).explain()
 
31
assert.eq(true, plan.indexOnly, "sort.1.5 - indexOnly should be true on covered query")
 
32
assert.eq(0, plan.nscannedObjects, "sort.1.5 - nscannedObjects should be 0 for covered query")
 
33
 
 
34
print ('all tests pass')
 
 
b'\\ No newline at end of file'