Skip to content

Commit

Permalink
Merge branch 'master' into V0.9.7.4-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
christkv committed Jan 2, 2012
2 parents cde9864 + ea8b40b commit fe97513
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
7 changes: 5 additions & 2 deletions HISTORY
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
0.9.7-3 2011-12-30
0.9.7.3-1 2012-01-02
* Fix to make db.bson_serializer and db.bson_deserializer work as it did previously

0.9.7.3 2011-12-30
* Moved BSON_BINARY_SUBTYPE_DEFAULT from BSON object to Binary object and removed the BSON_BINARY_ prefixes
* Removed Native BSON types, C++ parser uses JS types (faster due to cost of crossing the JS-C++ barrier for each call)
* Added build fix for 0.4.X branch of Node.js where GetOwnPropertyNames is not defined in v8
* Fix for wire protocol parser for corner situation where the message is larger than the maximum socket buffer in node.js (Issue #464, #461, #447)
* Connection pool status set to connected on poolReady, isConnected returns false on anything but connected status (Issue #455)

0.9.7-2-5 2011-12-22
0.9.7.2-5 2011-12-22
* Brand spanking new Streaming Cursor support Issue #458 (https://github.com/christkv/node-mongodb-native/pull/458) thanks to Mr Aaron Heckmann

0.9.7.2-4 2011-12-21
Expand Down
7 changes: 6 additions & 1 deletion lib/mongodb/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ var Db = exports.Db = function(databaseName, serverConfig, options) {
// Contains all the connections for the db
try {
this.native_parser = this.options.native_parser;
// The bson lib
var bsonLib = this.options.native_parser ? require('../../external-libs/bson') : new require('./bson/bson');
// Fetch the serializer object
var BSON = this.options.native_parser ? require('../../external-libs/bson').BSON : new require('./bson/bson').BSON;
var BSON = bsonLib.BSON;
// Create a new instance
this.bson = new BSON([b.Long, b.ObjectID, b.Binary, b.Code, b.DBRef, b.Symbol, b.Double, b.Timestamp, b.MaxKey, b.MinKey]);
// Backward compatibility to access types
this.bson_deserializer = bsonLib;
this.bson_serializer = bsonLib;
} catch (err) {
// If we tried to instantiate the native driver
throw "Native bson parser not compiled, please compile or avoid using native_parser=true";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ "name" : "mongodb"
, "description" : "A node.js driver for MongoDB"
, "keywords" : ["mongodb", "mongo", "driver", "db"]
, "version" : "0.9.7-3"
, "version" : "0.9.7-3-1"
, "author" : "Christian Amor Kvalheim <[email protected]>"
, "contributors" : [ "Aaron Heckmann",
"Christoph Pojer",
Expand Down
7 changes: 7 additions & 0 deletions test/connection_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ var tests = testCase({
})
},

testAccessToSerializationObjects : function(test) {
var db = new Db(MONGODB, new Server("127.0.0.1", mongodb.Connection.DEFAULT_PORT, {auto_reconnect: true, poolSize: 4, socketOptions:{keepAlive:100}, ssl:useSSL}),{native_parser: (process.env['TEST_NATIVE'] != null)});
test.ok(db.bson_serializer.ObjectID != null);
test.ok(db.bson_deserializer.ObjectID != null);
test.done();
},

noGlobalsLeaked : function(test) {
var leaks = gleak.detectNew();
test.equal(0, leaks.length, "global var leak detected: " + leaks.join(', '));
Expand Down

0 comments on commit fe97513

Please sign in to comment.