mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Change json_group_object() so that it ignores entries where the label
is NULL. [forum:/forumpost/e5bd251fb5|Forum post e5bd251fb5]. FossilOrigin-Name: 28215d131cd970a2756338579fb6b6091ab155be8f419505cae8ac918956165c
This commit is contained in:
14
src/json.c
14
src/json.c
@@ -4850,18 +4850,20 @@ static void jsonObjectStep(
|
||||
UNUSED_PARAMETER(argc);
|
||||
pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr));
|
||||
if( pStr ){
|
||||
z = (const char*)sqlite3_value_text(argv[0]);
|
||||
n = sqlite3Strlen30(z);
|
||||
if( pStr->zBuf==0 ){
|
||||
jsonStringInit(pStr, ctx);
|
||||
jsonAppendChar(pStr, '{');
|
||||
}else if( pStr->nUsed>1 ){
|
||||
}else if( pStr->nUsed>1 && z!=0 ){
|
||||
jsonAppendChar(pStr, ',');
|
||||
}
|
||||
pStr->pCtx = ctx;
|
||||
z = (const char*)sqlite3_value_text(argv[0]);
|
||||
n = sqlite3Strlen30(z);
|
||||
jsonAppendString(pStr, z, n);
|
||||
jsonAppendChar(pStr, ':');
|
||||
jsonAppendSqlValue(pStr, argv[1]);
|
||||
if( z!=0 ){
|
||||
jsonAppendString(pStr, z, n);
|
||||
jsonAppendChar(pStr, ':');
|
||||
jsonAppendSqlValue(pStr, argv[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
static void jsonObjectCompute(sqlite3_context *ctx, int isFinal){
|
||||
|
Reference in New Issue
Block a user