1
0
Fork 0

same as last.

This commit is contained in:
James 2014-08-07 09:53:06 +02:00
parent aff67afef4
commit 0a9502dae0
1 changed files with 13 additions and 13 deletions

View File

@ -222,7 +222,6 @@ int CompareAqlValues ( AqlValue const& left,
TRI_document_collection_t const* leftcoll, TRI_document_collection_t const* leftcoll,
AqlValue const& right, AqlValue const& right,
TRI_document_collection_t const* rightcoll ) { TRI_document_collection_t const* rightcoll ) {
// is this right? J thinks not.
if (_type != right._type) { if (_type != right._type) {
if (_type == EMPTY) { if (_type == EMPTY) {
return -1; return -1;
@ -231,11 +230,11 @@ int CompareAqlValues ( AqlValue const& left,
return 1; return 1;
} }
if (_type == JSON && right._type == SHAPED) { if (_type == JSON && right._type == SHAPED) {
triagens::basics::Json rjson = right.toJson(collection); triagens::basics::Json rjson = right.toJson(rightcoll);
return TRI_CompareValuesJson(_json->json(), rjson.json()); return TRI_CompareValuesJson(_json->json(), rjson.json());
} }
if (_type == SHAPED && right._type == JSON) { if (_type == SHAPED && right._type == JSON) {
triagens::basics::Json ljson = toJson(collection); triagens::basics::Json ljson = toJson(leftcoll);
return TRI_CompareValuesJson(ljson.json(), right._json->json()); return TRI_CompareValuesJson(ljson.json(), right._json->json());
} }
// No other comparisons are defined // No other comparisons are defined
@ -254,11 +253,12 @@ int CompareAqlValues ( AqlValue const& left,
TRI_EXTRACT_SHAPED_JSON_MARKER(l, _marker); TRI_EXTRACT_SHAPED_JSON_MARKER(l, _marker);
TRI_EXTRACT_SHAPED_JSON_MARKER(r, right._marker); TRI_EXTRACT_SHAPED_JSON_MARKER(r, right._marker);
return TRI_CompareShapeTypes(nullptr, nullptr, &l, nullptr, nullptr, &r, return TRI_CompareShapeTypes(nullptr, nullptr, &l, leftcoll->getShaper(),
collection->getShaper()); nullptr, nullptr, &r, rightcoll->getShaper());
} }
case DOCVEC: { //ptr to vector of AqlItemBlocks* case DOCVEC: {
//use lexicographic ordering of AqlValue regardless of block... // use lexicographic ordering of AqlValues regardless of block,
// DOCVECs have a single register coming from ReturnNode.
size_t lblock = 0; size_t lblock = 0;
size_t litem = 0; size_t litem = 0;
size_t rblock = 0; size_t rblock = 0;
@ -267,16 +267,16 @@ int CompareAqlValues ( AqlValue const& left,
while( lblock < _vector->size() && rblock < right._vector->size() ){ while( lblock < _vector->size() && rblock < right._vector->size() ){
AqlValue lval = ((*_vector->at(lblock)).getValue(litem, 0); AqlValue lval = ((*_vector->at(lblock)).getValue(litem, 0);
AqlValue rval = right._vector->at(rblock).getValue(ritem, 0); AqlValue rval = right._vector->at(rblock).getValue(ritem, 0);
cmp = CompareAqlValues(lval, lval.getDocumentCollection(0)
if(lval.compare(rval, rval.getDocumentCollection(0))!=0){ rval, rval.getDocumentCollection(0));
return this[lblock]->at(litem).compare(right[rblock]->at(ritem), if(cmp != 0){
getDocumentCollection(?)); return cmp;
} }
if(litem==this[lblock].size()-1){ if(litem == this[lblock].size()-1){
litem = 0; litem = 0;
lblock++; lblock++;
} }
if(ritem==right[rblock].size()-1){ if(ritem == right[rblock].size()-1){
ritem = 0; ritem = 0;
rblock++; rblock++;
} }