History log of /5.5.2/subjson/tests/ (Results 1 - 25 of 73)
Revision (<<< Hide revision tags) (Show revision tags >>>)Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
Revision tags: v5.1.2
c30c3d4c27-Jun-2018 Dave Rigby <daver@couchbase.com>

MB-30278: Reset cached Path component strings before use

There is an error in the handling of escaped paths (those containing a
backtick `) in Path::convert_escaped, in how path compoent

MB-30278: Reset cached Path component strings before use

There is an error in the handling of escaped paths (those containing a
backtick `) in Path::convert_escaped, in how path compoents are
cached.

The Path class maintains a cache of std::string path components; to
reduce the memory allocation overhead of convert_escaped(). Between
each call to Path::parse() the Path object is reset via clear(),
marking in-use path components as available.

However, the state of these cached, available compoents is /not/ reset
- i.e. the strings' data carries over from the previous call. As a
result when cached component objects are re-used then
convert_escaped() ends up appending to a non-empty string.

For example, a multi-mutation request which attempts to add 3
dictionary elements those name contains a backtick (key1`, key2` &
key3`) results in:

[ RUN ] Subdoc/SubdocTestappTest.MB_30278_SubdocBacktickMultiMutation/0_JsonNo
/Users/dave/repos/couchbase/server/source/kv_engine/tests/testapp/testapp.cc:895: Failure
Value of: actual
Actual: "{\"key1`\":1,\"key1`key2`\":2,\"key1`key2`key3`\":3}"
Expected: expected_value
Which is: "{\"key1`\":1,\"key2`\":2,\"key3`\":3}"

Note how key2` is incorrectly transformed into key1`key2`.

Resolve the issue by resetting the component object states in
Path::clear(); before adding them to the cached list. As such they are
in a 'pristine' state for re-use.

Change-Id: Ic4225bef2d6bb70fb6185e3bc0ddd87270ce3672
Reviewed-on: http://review.couchbase.org/96175
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>

show more ...

Revision tags: v5.0.0
80a9543e24-Mar-2017 Mark Nunberg <mnunberg@haskalah.org>

MB-23524: Allow non-ASCII characters in path

This fixes a bug where we were scanning for control characters using a
signed char rather than an unsigned type. This caused values above 0x7

MB-23524: Allow non-ASCII characters in path

This fixes a bug where we were scanning for control characters using a
signed char rather than an unsigned type. This caused values above 0x7f
to overflow and act as unsigned and would incorrectly be detected as
invalid characters.

Change-Id: Idfd23e1cc51d4bfb9abeee3cb2287771f218190e
Reviewed-on: http://review.couchbase.org/75689
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

121b39be19-Jul-2016 Mark Nunberg <mnunberg@haskalah.org>

add function to determine root type based on path/command

This will be needed when trying to determine the "baseline" type.

Change-Id: If78ce56d6eba89e9f540cd77f11a0bdfd5292393

add function to determine root type based on path/command

This will be needed when trying to determine the "baseline" type.

Change-Id: If78ce56d6eba89e9f540cd77f11a0bdfd5292393
Reviewed-on: http://review.couchbase.org/65958
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

f369754e21-Jul-2016 Mark Nunberg <mnunberg@haskalah.org>

add path-depth tests

This adds tests to ensure consistent behavior among commands when
dealing with path depth verification.

Change-Id: I4c84e502d56ccdf5712e00202fa6da891ba35cbb

add path-depth tests

This adds tests to ensure consistent behavior among commands when
dealing with path depth verification.

Change-Id: I4c84e502d56ccdf5712e00202fa6da891ba35cbb
Reviewed-on: http://review.couchbase.org/66043
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

e51529ef18-Jul-2016 Mark Nunberg <mnunberg@haskalah.org>

MB-20199: GET_COUNT: Count the size of objects

Change-Id: I8b9d25e66abccb91c229c916b47a543f8cb60000
Reviewed-on: http://review.couchbase.org/65902
Reviewed-by: Dave Rigby <daver@couc

MB-20199: GET_COUNT: Count the size of objects

Change-Id: I8b9d25e66abccb91c229c916b47a543f8cb60000
Reviewed-on: http://review.couchbase.org/65902
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

Revision tags: v4.5.0
4b8ca4d116-Feb-2016 Mark Nunberg <mnunberg@haskalah.org>

MB-18176: Optimize root-only append

This doesn't require a full scan of a potentially lengthy document.

Change-Id: Ida1c3db10df134482e61ba083077f5ab9bc01d10
Reviewed-on: http://

MB-18176: Optimize root-only append

This doesn't require a full scan of a potentially lengthy document.

Change-Id: Ida1c3db10df134482e61ba083077f5ab9bc01d10
Reviewed-on: http://review.couchbase.org/60065
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

3d8f744416-Feb-2016 Mark Nunberg <mnunberg@haskalah.org>

MB-18169: Refactor COUNTER error codes

Change-Id: Iaf0d833507d6f07da35e39bec38febd8c16c7760
Reviewed-on: http://review.couchbase.org/60051
Tested-by: buildbot <build@couchbase.com>

MB-18169: Refactor COUNTER error codes

Change-Id: Iaf0d833507d6f07da35e39bec38febd8c16c7760
Reviewed-on: http://review.couchbase.org/60051
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

64dbb0e116-Feb-2016 Mark Nunberg <mnunberg@haskalah.org>

Remove compat C symbols

Memcached (our only consumer thus far) no longer uses them

Change-Id: I22ebf337fb46034b0891493d814f152b7e5512f8
Reviewed-on: http://review.couchbase.org/

Remove compat C symbols

Memcached (our only consumer thus far) no longer uses them

Change-Id: I22ebf337fb46034b0891493d814f152b7e5512f8
Reviewed-on: http://review.couchbase.org/60049
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

2c682b4716-Dec-2015 Mark Nunberg <mnunberg@haskalah.org>

Fix wrong num_siblings calculation

Note that for some reason I can't make a test which fails with the old
code and succeeds with the new one; however I do remember running into
an is

Fix wrong num_siblings calculation

Note that for some reason I can't make a test which fails with the old
code and succeeds with the new one; however I do remember running into
an issue when *copying* the older code for something else.

Change-Id: Idc128797840172aa57cca971b5a17572c8756a66
Reviewed-on: http://review.couchbase.org/58399
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

9f2dfe6a16-Dec-2015 Mark Nunberg <mnunberg@haskalah.org>

Remove 'Match::has_key' field

This value can be implicitly determined by inspecting whether the actual
key is empty

Change-Id: Ia5f05d6d4cc4ea91975e2983fc986a8ebbb96071
Revi

Remove 'Match::has_key' field

This value can be implicitly determined by inspecting whether the actual
key is empty

Change-Id: Ia5f05d6d4cc4ea91975e2983fc986a8ebbb96071
Reviewed-on: http://review.couchbase.org/58398
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

5a685f4414-Dec-2015 Mark Nunberg <mnunberg@haskalah.org>

Use jsonsl_path_match instead of jpr_match

The new function allows for smaller, simpler code in match.cc

I've also started moving away from the `is_arridx` variable in
jpr_compo

Use jsonsl_path_match instead of jpr_match

The new function allows for smaller, simpler code in match.cc

I've also started moving away from the `is_arridx` variable in
jpr_component_st, as this is implied by a `ptype` of JSONSL_PATH_NUMERIC
using the newer path_match semantics.

Change-Id: Iaae694d52d7caec44676007dd79a3d343c64557e
Reviewed-on: http://review.couchbase.org/57788
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

cb6de48412-Nov-2015 Mark Nunberg <mnunberg@haskalah.org>

MB-16790: Disallow upsert with final array index component

This is never allowed, and results in a corrupted document.

Change-Id: I82f49c18be4bf02367e31af98a164253a657cae5
Revie

MB-16790: Disallow upsert with final array index component

This is never allowed, and results in a corrupted document.

Change-Id: I82f49c18be4bf02367e31af98a164253a657cae5
Reviewed-on: http://review.couchbase.org/57005
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

5579467b11-Nov-2015 Mark Nunberg <mnunberg@haskalah.org>

insert should return EINVAL if not passed an index

MISMATCH is reserved for dynamic mismatches against the actual document
contents, while EINVAL is determined without looking at the doc

insert should return EINVAL if not passed an index

MISMATCH is reserved for dynamic mismatches against the actual document
contents, while EINVAL is determined without looking at the document

Change-Id: I6671e86a612c5c0f0cb76752299ba020e66f83ac
Reviewed-on: http://review.couchbase.org/56919
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

23a2b7e503-Nov-2015 Mark Nunberg <mnunberg@haskalah.org>

MB-16695: Use mandatory JSON path escaping

Without path escaping we risk having invalid JSON. Additionally, some
sequences like '"' and '\"' might seem ambiguous (do they mean a literal

MB-16695: Use mandatory JSON path escaping

Without path escaping we risk having invalid JSON. Additionally, some
sequences like '"' and '\"' might seem ambiguous (do they mean a literal
escape-quote or just intend to place the quote). By restricting every
path component to be valid JSON we solve for inadvertently inserting bad
paths up the stack.

This commit also disables support for using \u-XXXX sequences in paths.
Despite them being valid JSON, they need to be normalized before they
are used in the parser. Support for u-escapes in paths will be present
when these escapes are properly normalized into utf8 within the path
parser.

Change-Id: Ia3c3bccf3b6e3006268635656d1c66ab4225a24f
Reviewed-on: http://review.couchbase.org/56617
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

63a6760409-Oct-2015 Mark Nunberg <mnunberg@haskalah.org>

Add test for replacing array index

Change-Id: I57437ac98f3555d53dedd914d217ffdc0dca69a6
Reviewed-on: http://review.couchbase.org/55963
Reviewed-by: Dave Rigby <daver@couchbase.com>

Add test for replacing array index

Change-Id: I57437ac98f3555d53dedd914d217ffdc0dca69a6
Reviewed-on: http://review.couchbase.org/55963
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

6d65d6ae08-Oct-2015 Mark Nunberg <mnunberg@haskalah.org>

Add multi value tests

We currently accept adding a "list" of values (so long as they are all
valid JSON elements and are valid when evaluated within an array
context). As such, we sh

Add multi value tests

We currently accept adding a "list" of values (so long as they are all
valid JSON elements and are valid when evaluated within an array
context). As such, we should test for this "feature" (even if we don't
publicly advertise it yet).

Change-Id: Ia3a32a1b71541030ae1528540b23198ff771eeff
Reviewed-on: http://review.couchbase.org/55930
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

886c2a5708-Oct-2015 Mark Nunberg <mnunberg@haskalah.org>

ADD_UNIQUE: Return error on multivalue and complex values

ADD_UNIQUE inspects its value as a single value using string comparison
with existing array values. More than a single value, or

ADD_UNIQUE: Return error on multivalue and complex values

ADD_UNIQUE inspects its value as a single value using string comparison
with existing array values. More than a single value, or non-primitive
values cannot be properly compared to existing values within the array
and should not be allowed as values.

Change-Id: I0b622be6caac8a1de973fb940e725774a3d09000
Reviewed-on: http://review.couchbase.org/55929
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

5702588308-Jul-2015 Mark Nunberg <mnunberg@haskalah.org>

Streaming optimizations and refactor

This refactors the match system to be more streamlined with respect to
stopping parsing as soon as a match is found. Changes include:

- Arra

Streaming optimizations and refactor

This refactors the match system to be more streamlined with respect to
stopping parsing as soon as a match is found. Changes include:

- Array operations are now more straightforward. No need to specify the
'first' or 'last' element to find an array.
- Match::loc_parent field removed. Consolidated into a single field,
loc_deepest.
- Match::loc_key is now only used for the actual key. No need to
specifically search for the last child. List append operations inspect
the number of children and prepend a comma to the new value.
- New match option, Match::GET_NUM_SIBLINGS, instructs the parser to
check if the match is the last child in the container. Used by REMOVE

Change-Id: I04619c8007782e0b0b713a593e709b136eaa8929
Reviewed-on: http://review.couchbase.org/52990
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

c72068bd03-Jun-2015 Mark Nunberg <mnunberg@haskalah.org>

Add extended validation for bad numeric inputs

This adds error codes for a delta with zero, or a delta value which is
an invalid number (cannot be parsed as a JSON number).

Chan

Add extended validation for bad numeric inputs

This adds error codes for a delta with zero, or a delta value which is
an invalid number (cannot be parsed as a JSON number).

Change-Id: Ic6eefce408956f3a472111f0e1e49298c33dbda8
Reviewed-on: http://review.couchbase.org/51715
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

a113d89f02-Jun-2015 Mark Nunberg <mnunberg@haskalah.org>

Use string inputs/outputs for counter operations

- Remove INCREMENT and DECREMENT commands. These are merged into a
single COUNTER command
- Remove set_delta. All commands now acce

Use string inputs/outputs for counter operations

- Remove INCREMENT and DECREMENT commands. These are merged into a
single COUNTER command
- Remove set_delta. All commands now accept strings
- Remove Result::numresult(). Use string result.

Change-Id: I43d018074cfd45a64c5a9657ee2f330fe40d7063
Reviewed-on: http://review.couchbase.org/51667
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

c0a1282206-May-2015 Dave Rigby <daver@couchbase.com>

Test DELETE on arrays

Change-Id: I81cf904eba15b418bc5d37ae96d0e30beda8b5c4
Reviewed-on: http://review.couchbase.org/51325
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: D

Test DELETE on arrays

Change-Id: I81cf904eba15b418bc5d37ae96d0e30beda8b5c4
Reviewed-on: http://review.couchbase.org/51325
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>

show more ...

cf2a10a328-May-2015 Dave Rigby <daver@couchbase.com>

ARRAY_INSERT: [-1] should not be a valid insertion point

According to the spec [-1] is not a valid insertion point for
ARRAY_INSERT.

Change-Id: If0a591faeb9b2d697097a8ca0a08cd2d

ARRAY_INSERT: [-1] should not be a valid insertion point

According to the spec [-1] is not a valid insertion point for
ARRAY_INSERT.

Change-Id: If0a591faeb9b2d697097a8ca0a08cd2d8c0ccea6
Reviewed-on: http://review.couchbase.org/51508
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

479cc1bb29-May-2015 Dave Rigby <daver@couchbase.com>

Fix off-by-one error in arithmetic limit checking

Change-Id: I32550fd6a1226a7cfacc434889fbd7040cb2c2d7
Reviewed-on: http://review.couchbase.org/51569
Tested-by: buildbot <build@couch

Fix off-by-one error in arithmetic limit checking

Change-Id: I32550fd6a1226a7cfacc434889fbd7040cb2c2d7
Reviewed-on: http://review.couchbase.org/51569
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Mark Nunberg <mark.nunberg@couchbase.com>

show more ...

296596cc21-May-2015 Mark Nunberg <mnunberg@haskalah.org>

Remove "built-in" result object

All subdoc operations must now operate on an external result

Change-Id: Ic17dc3ab37a021862a1d2a3f5cc464701135bf8d
Reviewed-on: http://review.couc

Remove "built-in" result object

All subdoc operations must now operate on an external result

Change-Id: Ic17dc3ab37a021862a1d2a3f5cc464701135bf8d
Reviewed-on: http://review.couchbase.org/51339
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>

show more ...

6405e19b21-May-2015 Mark Nunberg <mnunberg@haskalah.org>

Ensure buffers of internal Result object are cleared

This is done through simply setting m_result to NULL

Change-Id: I1ed6ea105e45e4e3869de9880f557e8990d9b7ca
Reviewed-on: http:

Ensure buffers of internal Result object are cleared

This is done through simply setting m_result to NULL

Change-Id: I1ed6ea105e45e4e3869de9880f557e8990d9b7ca
Reviewed-on: http://review.couchbase.org/51326
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

123