From bb1475d24de29984933e0ceca4bfb45f09fdfca4 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 24 Nov 2009 11:13:13 -0500 Subject: [PATCH 1/2] add boost version to sysinfo --- SConstruct | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 1b54dd055c7f3..4bf1153736cc4 100644 --- a/SConstruct +++ b/SConstruct @@ -631,10 +631,13 @@ def add_exe(target): def setupBuildInfoFile( outFile ): version = getGitVersion() sysInfo = getSysInfo() - contents = "#include \"stdafx.h\"\n" - contents += "#include \n" - contents += "namespace mongo { const char * gitVersion(){ return \"" + version + "\"; } }\n" - contents += "namespace mongo { const char * sysInfo(){ return \"" + sysInfo + "\"; } }\n" + contents = '\n'.join([ + '#include "stdafx.h"', + '#include ', + '#include ', + 'namespace mongo { const char * gitVersion(){ return "' + version + '"; } }', + 'namespace mongo { const char * sysInfo(){ return "' + sysInfo + ' BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; } }', + ]) if os.path.exists( outFile ) and open( outFile ).read().strip() == contents.strip(): return From 76469ff66f940042312d5fc9e5ff6eaca2ef1daa Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 24 Nov 2009 12:01:32 -0500 Subject: [PATCH 2/2] minor: test case for compound sort including failing test case for compound sort involving _id --- jstests/sort5.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 jstests/sort5.js diff --git a/jstests/sort5.js b/jstests/sort5.js new file mode 100644 index 0000000000000..a589355a743d6 --- /dev/null +++ b/jstests/sort5.js @@ -0,0 +1,21 @@ +var t = db.sort5; +t.drop(); + +t.save({_id: 5, x: 1, y: {a: 5, b: 4}}); +t.save({_id: 7, x: 2, y: {a: 7, b: 3}}); +t.save({_id: 2, x: 3, y: {a: 2, b: 3}}); +t.save({_id: 9, x: 4, y: {a: 9, b: 3}}); + +// test compound sorting + +assert.eq( [4,2,3,1] , t.find().sort({"y.b": 1 , "y.a" : -1 }).map( function(z){ return z.x; } ) , "A no index" ); +t.ensureIndex({"y.b": 1, "y.a": -1}); +assert.eq( [4,2,3,1] , t.find().sort({"y.b": 1 , "y.a" : -1 }).map( function(z){ return z.x; } ) , "A index" ); +assert(t.validate().valid, "A valid"); + +// test sorting on compound key involving _id + +// assert.eq( [4,2,3,1] , t.find().sort({"y.b": 1 , _id : -1 }).map( function(z){ return z.x; } ) , "B no index" ); +// t.ensureIndex({"y.b": 1, "_id": -1}); +// assert.eq( [4,2,3,1] , t.find().sort({"y.b": 1 , _id : -1 }).map( function(z){ return z.x; } ) , "B index" ); +// assert(t.validate().valid, "B valid");