pgj commented on PR #4810:
URL: https://github.com/apache/couchdb/pull/4810#issuecomment-1787413943
It is the derived string upper limit that does not work. Consider the
following:
```erlang
> Lower = <<"A">>.
<<"A">>.
> Upper = <<Lower/binary, 16#10FFFF>>.
<<"A\377">>.
```
On CentOS 7:
```erlang
> couch_ejson_compare:get_icu_version().
{50,2,0,0}
> couch_ejson_compare:get_collator_version().
{58,0,6,50}
> mango_json:cmp(Lower, <<"AUS">>).
-1
> mango_json:cmp(<<"AUS">>, Upper).
1
```
On anywhere else (for example, locally):
```erlang
> couch_ejson_compare:get_icu_version().
{73,2,0,0}
> couch_ejson_compare:get_collator_version().
{153,120,0,0}
> mango_json:cmp(Lower, <<"AUS">>).
-1
> mango_json:cmp(<<"AUS">>, Upper).
-1
```
The `mango_json:cmp/2` function should return `-1` for every case. That
signals the "less than" result, which should hold for all. Apparently, `icu`
50 disagrees (as @nickva suspected) hence no documents are returned for the
range.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]