diff options
Diffstat (limited to 'src/mongo/db/exec/sbe/vm/vm.h')
-rw-r--r-- | src/mongo/db/exec/sbe/vm/vm.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/exec/sbe/vm/vm.h b/src/mongo/db/exec/sbe/vm/vm.h index 1d11e835858..b98f3261d12 100644 --- a/src/mongo/db/exec/sbe/vm/vm.h +++ b/src/mongo/db/exec/sbe/vm/vm.h @@ -79,8 +79,10 @@ std::pair<value::TypeTags, value::Value> genericCompare( auto lhsStr = getStringView(lhsTag, lhsValue); auto rhsStr = getStringView(rhsTag, rhsValue); - auto result = - op(comparator ? comparator->compare(lhsStr, rhsStr) : lhsStr.compare(rhsStr), 0); + auto result = op(comparator ? comparator->compare(StringData{lhsStr.data(), lhsStr.size()}, + StringData{rhsStr.data(), rhsStr.size()}) + : lhsStr.compare(rhsStr), + 0); return {value::TypeTags::Boolean, value::bitcastFrom<bool>(result)}; } else if (lhsTag == value::TypeTags::Date && rhsTag == value::TypeTags::Date) { |