1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Rename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK. Make it so

that the current value of the setting can be interrogated.

FossilOrigin-Name: 7aff1d9a4cb17ecd5abab21ab032f35a78741dd641ddd8cbcc85fc4a81a0707d
This commit is contained in:
drh
2023-12-11 19:00:44 +00:00
parent 7d2eaae83e
commit ba5505657f
8 changed files with 36 additions and 23 deletions

View File

@@ -4660,15 +4660,24 @@ int sqlite3_test_control(int op, ...){
}
#endif
/* sqlite3_test_control(SQLITE_TESTCTRL_VALIDATE_JSONB, (u8)trueFalse);
/* sqlite3_test_control(SQLITE_TESTCTRL_JSON_SELFCHECK, &onOff);
**
** Activate or deactivate validation of JSONB that is generated from
** text. Off by default, as the validation is slow. Validation is
** only available if compiled using SQLITE_DEBUG.
**
** If onOff is initially 1, then turn it on. If onOff is initially
** off, turn it off. If onOff is initially -1, then change onOff
** to be the current setting.
*/
case SQLITE_TESTCTRL_VALIDATE_JSONB: {
case SQLITE_TESTCTRL_JSON_SELFCHECK: {
#if defined(SQLITE_DEBUG)
sqlite3Config.bJsonbValidate = (u8)(va_arg(ap, int)&0xff);
int *pOnOff = va_arg(ap, int*);
if( *pOnOff<0 ){
*pOnOff = sqlite3Config.bJsonSelfcheck;
}else{
sqlite3Config.bJsonSelfcheck = (u8)((*pOnOff)&0xff);
}
#endif
break;
}