Merged changes from ENG-6879-json-set-field: re-enabled the SET_FIELD
function; and simplified tests using the testProcWithValidJSON method in
place of the (almost) same 4 lines of code, repeated over and over.
TestFunctionsForJSON: updated testFIELDFunctionWithInvalidIndexNotation
& testSET_FIELDFunctionWithInvalidIndexNotation, adding tests of very
large array indexes; also, updated testProcWithInvalidJSON to print the
expectedErrorMessage when no error is detected. [I swear I checked this
in before, but it disappeared.]
TestFunctionsForJSON: added tests of the SET_FIELD (JSON) function:
using various data types; adding new fields (as opposed to updating
existing ones); using ad hoc queries (using “@AdHoc”); called with
array[-1] (meaning just beyond the last value), or with an index larger
than its current size (which also adds an additional value on the end,
filling with nulls if needed); using array index notation on a nameless
array.
And tests of the FIELD function: called with array[-1] (meaning the last
value), or with an index larger than its current size (which returns
null); of its case sensitivity; and additional tests of a nameless
array.
Also tweaked the existing invalid query tests; added (private)
debugPrintJsonDoc method, called at various points, which prints the
specified JSON docs, only if DEBUG is true; and improved a few comments.
TestFunctionsForJSON: added tests of the FIELD (JSON) function using ad
hoc queries (with “@AdHoc”); and tests using the wrong number of
parameters (to Stored Procs).
TestFunctionsForJSON: added new test method
testSET_FIELDFunctionWithMisplacedDotOrIndexNotation, which tests the
SET_FIELD (JSON) function using “misplaced” arguments like ‘foo.bar’ or
‘foo[0]’, where foo is a previously defined primitive field, or array
(for the ‘.bar’ case), or object (for the ‘[0]’ case).
TestFunctionsForJSON: added new test method
testSET_FIELDFunctionWithNullValues, which tests the SET_FIELD (JSON)
function using null values (quoted and not), and related queries; also a
new version of (private) method testProcWithValidJSON, with the first
arg a String; and related Stored Procs NullSetFieldDocProc,
NullSetFieldProc and SelectSetFieldProc.
TestFunctionsForJSON: added tests for invalid ad-hoc queries, and
especially for new bugs ENG-6978 & -6979 (involving arrays with very
large indexes); made minor additions and fixes for tests of FIELD; also
tweaked testProcWithValidJSON and testProcWithInvalidJSON (& added a new
version of the latter), to give more information when they fail; and
added optional ‘print’ arg to (private) debugPrintJsonDoc method (which
is now called by testProcWithInvalidJSON).
Merge branch 'master' into ENG-6879-more-json-set-field
TestFunctionsForJSON: added testFIELDFunctionWithNullValues method,
modeled on testSET_FIELDFunctionWithNullValues, but taking some existing
queries from testFIELDFunction; also added a few queries to
testSET_FIELDFunctionWithNullValues; and added a new SelectFieldProc
stored proc.
To prevent crashes, etc. preemptively enforce limits on json array indexes.
Merge remote-tracking branch 'origin/ENG-6879-more-json-set-field' into ENG-6979-json-index-limit
ENG-6979, ENG-6978 Enforce JSON array index limit of 500000 ONLY for SET_FIELD, adjust tests for different failure modes.
Merge pull request #1697 from VoltDB/ENG-6979-json-index-limit

Eng 6979 json index limit
Merge pull request #1702 from VoltDB/ENG-6879-more-json-set-field

Eng 6879 more json set field