diff --git a/db/jsobj.cpp b/db/jsobj.cpp index f32d49c9cbd..7a918c9e0e4 100644 --- a/db/jsobj.cpp +++ b/db/jsobj.cpp @@ -29,6 +29,9 @@ int Element::size() { case String: x = valuestrsize() + 4 + 1; break; + case DBRef: + x = valuestrsize() + 4 + 12 + 1; + break; case Object: case Array: x = objsize() + 1; @@ -52,7 +55,7 @@ int Element::size() { if( !eoo() ) { const char *next = data + totalSize; - if( *next < 0 || *next > RegEx ) { + if( *next < 0 || *next > DBRef ) { // bad type. cout << "*********************************************\n"; cout << "Bad data or size in Element::size()" << endl; diff --git a/db/jsobj.h b/db/jsobj.h index bbef2714798..de5c15e4b6c 100644 --- a/db/jsobj.h +++ b/db/jsobj.h @@ -18,7 +18,8 @@ class JSObjBuilder; EOO = end of object */ enum JSType { EOO = 0, Number=1, String=2, Object=3, Array=4, BinData=5, - Undefined=6, jstOID=7, Bool=8, Date=9 , jstNULL=10, RegEx=11 }; + Undefined=6, jstOID=7, Bool=8, Date=9 , jstNULL=10, RegEx=11 , + DBRef=12 }; /* subtypes of BinData. bdtCustom and above are ones that the JS compiler understands, but are diff --git a/db/makefile b/db/makefile index a2355e4763c..a51f211306d 100644 --- a/db/makefile +++ b/db/makefile @@ -33,3 +33,8 @@ cleandb: /usr/local/lib/libpcrecpp.a: cat pcre.txt +pcre: + curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.4.tar.gz + tar -xzf pcre-7.4.tar.gz + cd pcre-7.4 && ./configure --enable-utf8 --with-match-limit=200000 --with-match-limit-recursion=4000 && make && make install +