<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/couchdb.git/src/mango/test/02-basic-find-test.py, branch decrease-indexer-transaction-time-limit</title>
<subtitle>github.com: apache/couchdb.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/'/>
<entry>
<title>update mango tests to work with Mango on FDB</title>
<updated>2020-04-06T15:55:49+00:00</updated>
<author>
<name>Garren Smith</name>
<email>garren.smith@gmail.com</email>
</author>
<published>2020-03-31T09:39:58+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=29ef7fb37007821edd8a0673226090cd47d48bab'/>
<id>29ef7fb37007821edd8a0673226090cd47d48bab</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix empty queries (#1783)</title>
<updated>2020-01-17T05:55:52+00:00</updated>
<author>
<name>Tony Sun</name>
<email>tony.sun427@gmail.com</email>
</author>
<published>2020-01-17T05:55:52+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=018ec6bf51b64fba48fe960dbbf7cb92b943fc81'/>
<id>018ec6bf51b64fba48fe960dbbf7cb92b943fc81</id>
<content type='text'>
* fix empty queries

Mango text indexes currently throw function clauses when queries in two
situations:

1) Empty Selector
2) Operators with empty arrays.

We fix this issue and change the behavior as follows:

1) Any empty selector will fall back on _all_docs (like json indexes).
2) $or, $and, $in, $all that specify an empty arrays
will be treated as no-op when combined with other operators.
3) A single no-nop query such as {"$or": []} will not be executed and
return nothing just like json indexes.
4) $nin with an empty array will return all docs that match the field,
just like json indexes.

Co-authored-by: Jan Lehnardt &lt;jan@apache.org&gt;
Co-authored-by: Peng Hui Jiang &lt;jiangphcn@apache.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* fix empty queries

Mango text indexes currently throw function clauses when queries in two
situations:

1) Empty Selector
2) Operators with empty arrays.

We fix this issue and change the behavior as follows:

1) Any empty selector will fall back on _all_docs (like json indexes).
2) $or, $and, $in, $all that specify an empty arrays
will be treated as no-op when combined with other operators.
3) A single no-nop query such as {"$or": []} will not be executed and
return nothing just like json indexes.
4) $nin with an empty array will return all docs that match the field,
just like json indexes.

Co-authored-by: Jan Lehnardt &lt;jan@apache.org&gt;
Co-authored-by: Peng Hui Jiang &lt;jiangphcn@apache.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Format and check all code using python black (#1776)</title>
<updated>2018-12-06T23:03:57+00:00</updated>
<author>
<name>Joan Touzet</name>
<email>wohali@users.noreply.github.com</email>
</author>
<published>2018-12-06T23:03:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=33d4f6d02715a204ef2dd7ddc4795aed5c1b72ce'/>
<id>33d4f6d02715a204ef2dd7ddc4795aed5c1b72ce</id>
<content type='text'>
The Makefile target builds a python3 venv at .venv and installs
black if possible. Since black is Python 3.6 and up only, we
skip the check on systems with an older Python 3.x.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Makefile target builds a python3 venv at .venv and installs
black if possible. Since black is Python 3.6 and up only, we
skip the check on systems with an older Python 3.x.</pre>
</div>
</content>
</entry>
<entry>
<title>Run mango tests with Python 3</title>
<updated>2018-11-26T22:49:33+00:00</updated>
<author>
<name>Nick Vatamaniuc</name>
<email>vatamane@apache.org</email>
</author>
<published>2018-10-03T19:11:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=9870a7c0aa1801bd30f19f8abfc3fbe8d45bae12'/>
<id>9870a7c0aa1801bd30f19f8abfc3fbe8d45bae12</id>
<content type='text'>
Before we were ignoring venv setup in the Makefile, so update the test runner
to use that instead of pestering developers to install those dependencies by
hand.

Issue #1632
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before we were ignoring venv setup in the Makefile, so update the test runner
to use that instead of pestering developers to install those dependencies by
hand.

Issue #1632
</pre>
</div>
</content>
</entry>
<entry>
<title>Add constant index fields to sort based on the selector (#1376)</title>
<updated>2018-06-20T19:12:27+00:00</updated>
<author>
<name>garren smith</name>
<email>garren.smith@gmail.com</email>
</author>
<published>2018-06-20T19:12:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=5b5c8a1dcb196eb461dcab17a52c3c27998c5372'/>
<id>5b5c8a1dcb196eb461dcab17a52c3c27998c5372</id>
<content type='text'>
This moves the sort check into the is_usable function for all indexes.
For map/reduce indexes it can add any constant fields e.g {a: {"$eq": 4}
to the prefix of the sort because it won't affect the actual sort but
will increase the chance that an index is selected. This is a user
experience fix to help a user if they don't add all the columns for an
index to the sort fields.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves the sort check into the is_usable function for all indexes.
For map/reduce indexes it can add any constant fields e.g {a: {"$eq": 4}
to the prefix of the sort because it won't affect the actual sort but
will increase the chance that an index is selected. This is a user
experience fix to help a user if they don't add all the columns for an
index to the sort fields.</pre>
</div>
</content>
</entry>
<entry>
<title>Test duplicate fields in Mango selector (#998)</title>
<updated>2017-11-23T09:26:07+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-11-23T09:26:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=a406cc0b6f9ebd1e7aecd258b2b015daab9393e0'/>
<id>a406cc0b6f9ebd1e7aecd258b2b015daab9393e0</id>
<content type='text'>
Adds a test to verify the behaviour of duplicate
fields in a Mango selector.

The fix for CVE-2017-12635 resulted in CouchDB's
JSON parser only recognising the last instance
of duplicated fields in a JSON object. This
represents a breaking change to Mango (_find)
because, previuously, all instances would have
been considered when evaluating a selector.

This test verifies that Mango now only considers
the last instance of a field, silently ignoring
those that appear before it.

TBD whether we can or should show an error when
this occurs, since this leads to predicates
silently being ignored.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a test to verify the behaviour of duplicate
fields in a Mango selector.

The fix for CVE-2017-12635 resulted in CouchDB's
JSON parser only recognising the last instance
of duplicated fields in a JSON object. This
represents a breaking change to Mango (_find)
because, previuously, all instances would have
been considered when evaluating a selector.

This test verifies that Mango now only considers
the last instance of a field, silently ignoring
those that appear before it.

TBD whether we can or should show an error when
this occurs, since this leads to predicates
silently being ignored.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix maximum key value when using JSON indexes (#881)</title>
<updated>2017-10-16T15:01:47+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-10-16T15:01:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=641aa568d011100aacdee6128da51b5a98fdbd8f'/>
<id>641aa568d011100aacdee6128da51b5a98fdbd8f</id>
<content type='text'>
Mango previously constrained range queries against JSON indexes
(map/reduce views) to startkey=[]&amp;endkey=[{}]. In Mango, JSON
index keys are always compound (i.e. always arrays), but this
restriction resulted in Mango failing to match documents where
the indexed value was an object.

For example, an index with keys:

[1],
[2],
[{"foo": 3}]

would be restricted such that only [1] and [2] were returned
if a range query was issued.

On its own, this behaviour isn't necessarily unintuitive, but
it is different from the behaviour of a non-indexed Mango
query, so the query results would change in the presence of an
index.

Additonally, it prevented operators or selectors which explicitly
depend on a full index scan (such as $exists) from returning a
complete result set.

This commit changes the maximum range boundary from {} to a 
value that collates higher than any JSON object, so all 
array/compound keys will be included.

Note that this uses an invalid UTF-8 character, so we depend
on the view engine not barfing when this is passed as a
parameter. In addition, we can't represent the value in JSON
so we need to subtitute is when returning a query plan
in the _explain endpoint.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mango previously constrained range queries against JSON indexes
(map/reduce views) to startkey=[]&amp;endkey=[{}]. In Mango, JSON
index keys are always compound (i.e. always arrays), but this
restriction resulted in Mango failing to match documents where
the indexed value was an object.

For example, an index with keys:

[1],
[2],
[{"foo": 3}]

would be restricted such that only [1] and [2] were returned
if a range query was issued.

On its own, this behaviour isn't necessarily unintuitive, but
it is different from the behaviour of a non-indexed Mango
query, so the query results would change in the presence of an
index.

Additonally, it prevented operators or selectors which explicitly
depend on a full index scan (such as $exists) from returning a
complete result set.

This commit changes the maximum range boundary from {} to a 
value that collates higher than any JSON object, so all 
array/compound keys will be included.

Note that this uses an invalid UTF-8 character, so we depend
on the view engine not barfing when this is passed as a
parameter. In addition, we can't represent the value in JSON
so we need to subtitute is when returning a query plan
in the _explain endpoint.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix incorrect index selection when sort specified (#866)</title>
<updated>2017-10-12T16:42:50+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-10-12T16:42:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=d0445f53a837db374e56eb59ede63694ed6e4c33'/>
<id>d0445f53a837db374e56eb59ede63694ed6e4c33</id>
<content type='text'>
It seems safe to assume that if a user specifies that
results should be sorted by a field, that field needs to exist
(but could be null) in the results returned.

In #816 we can only use an index if all its columns are
required to exist in the selector, so this improves
compatibility with the old behaviour by allowing sort
fields to be included in the index coverage check for
JSON indexes.

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It seems safe to assume that if a user specifies that
results should be sorted by a field, that field needs to exist
(but could be null) in the results returned.

In #816 we can only use an index if all its columns are
required to exist in the selector, so this improves
compatibility with the old behaviour by allowing sort
fields to be included in the index coverage check for
JSON indexes.

</pre>
</div>
</content>
</entry>
<entry>
<title>fix tests to be compatible for both python2 and python3 (#839)</title>
<updated>2017-09-27T23:45:54+00:00</updated>
<author>
<name>Tony Sun</name>
<email>tony.sun427@gmail.com</email>
</author>
<published>2017-09-27T23:45:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=355f0fc7b46c8c2d8d266517c9ebf6c11da0e7ea'/>
<id>355f0fc7b46c8c2d8d266517c9ebf6c11da0e7ea</id>
<content type='text'>
We change syntax issues that make the tests incompatible for python3
but also ensure that it still runs using python2.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We change syntax issues that make the tests incompatible for python3
but also ensure that it still runs using python2.</pre>
</div>
</content>
</entry>
<entry>
<title>include mrview options in _explain result</title>
<updated>2017-09-04T07:14:14+00:00</updated>
<author>
<name>Will Holley</name>
<email>willholley@gmail.com</email>
</author>
<published>2017-08-21T14:06:03+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/couchdb.git/commit/?id=ad292208f878786583f82fc328ef27c0d7dac033'/>
<id>ad292208f878786583f82fc328ef27c0d7dac033</id>
<content type='text'>
_explain previously returned the options passed in by the user but
not those modified at execution time by Mango. Now we include
index-specific options (mrargs for map/reduce indexes) in the output,
allowing us to see e.g. when include_docs was used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_explain previously returned the options passed in by the user but
not those modified at execution time by Mango. Now we include
index-specific options (mrargs for map/reduce indexes) in the output,
allowing us to see e.g. when include_docs was used.
</pre>
</div>
</content>
</entry>
</feed>
