diff options
author | drh <drh@noemail.net> | 2015-09-11 00:26:04 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-09-11 00:26:04 +0000 |
commit | 46f76d6c3c7a5490999a992b3842b2fa707d2a7c (patch) | |
tree | 271dd40146fe86656b7de2ddbd8edabad0fcbbbe /src/vdbeapi.c | |
parent | 0b19c96935b38bb47ffac79a63f3507611e99ca3 (diff) | |
parent | f5ddb9c214b5e6237e9bfb878aa21cfd2ef129fc (diff) | |
download | sqlite-46f76d6c3c7a5490999a992b3842b2fa707d2a7c.tar.gz sqlite-46f76d6c3c7a5490999a992b3842b2fa707d2a7c.zip |
Add new interfaces sqlite3_value_subtype() and sqlite3_result_subtype().
Update the json1.c extension to take advantages of those interfaces to avoid
the goofy '$$' path syntax and to allow nested calls to json_array() and
json_object() that work as expected.
FossilOrigin-Name: db4152aef2253ed2a33e3cad01e0c6758e03f900
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index faf97634c..06b14e127 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -187,6 +187,9 @@ int sqlite3_value_int(sqlite3_value *pVal){ sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){ return sqlite3VdbeIntValue((Mem*)pVal); } +unsigned int sqlite3_value_subtype(sqlite3_value *pVal){ + return ((Mem*)pVal)->eSubtype; +} const unsigned char *sqlite3_value_text(sqlite3_value *pVal){ return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8); } @@ -365,6 +368,10 @@ void sqlite3_result_null(sqlite3_context *pCtx){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); sqlite3VdbeMemSetNull(pCtx->pOut); } +void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ + assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); + pCtx->pOut->eSubtype = eSubtype & 0xff; +} void sqlite3_result_text( sqlite3_context *pCtx, const char *z, |