diff options
author | drh <drh@noemail.net> | 2014-09-02 15:49:47 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-09-02 15:49:47 +0000 |
commit | bf9ed6f9af8db145efb7294b1bb05b35fc70e7fc (patch) | |
tree | 870d850426bb945aee018a2dc2612f52f3248619 /src/analyze.c | |
parent | e1ed0b0e1787b0e5c6b2b59de4e2f161a82bec22 (diff) | |
parent | f8ede57a6165889316f8a9df8ac1166c7a568100 (diff) | |
download | sqlite-bf9ed6f9af8db145efb7294b1bb05b35fc70e7fc.tar.gz sqlite-bf9ed6f9af8db145efb7294b1bb05b35fc70e7fc.zip |
Merge the latest trunk changes, including the multi-threaded sorter, into
the sessions branch.
FossilOrigin-Name: d4cce2c71e64ab7b6a65a81b88b69445ed859351
Diffstat (limited to 'src/analyze.c')
-rw-r--r-- | src/analyze.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/analyze.c b/src/analyze.c index f9c03dc84..9920c32a8 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -387,8 +387,9 @@ static void stat4Destructor(void *pOld){ ** original WITHOUT ROWID table as N==K as a special case. ** ** This routine allocates the Stat4Accum object in heap memory. The return -** value is a pointer to the the Stat4Accum object encoded as a blob (i.e. -** the size of the blob is sizeof(void*) bytes). +** value is a pointer to the the Stat4Accum object. The datatype of the +** return value is BLOB, but it is really just a pointer to the Stat4Accum +** object. */ static void statInit( sqlite3_context *context, @@ -466,8 +467,11 @@ static void statInit( } #endif - /* Return a pointer to the allocated object to the caller */ - sqlite3_result_blob(context, p, sizeof(p), stat4Destructor); + /* Return a pointer to the allocated object to the caller. Note that + ** only the pointer (the 2nd parameter) matters. The size of the object + ** (given by the 3rd parameter) is never used and can be any positive + ** value. */ + sqlite3_result_blob(context, p, sizeof(*p), stat4Destructor); } static const FuncDef statInitFuncdef = { 2+IsStat34, /* nArg */ @@ -793,7 +797,7 @@ static const FuncDef statPushFuncdef = { ** Implementation of the stat_get(P,J) SQL function. This routine is ** used to query statistical information that has been gathered into ** the Stat4Accum object by prior calls to stat_push(). The P parameter -** is a BLOB which is decoded into a pointer to the Stat4Accum objects. +** has type BLOB but it is really just a pointer to the Stat4Accum object. ** The content to returned is determined by the parameter J ** which is one of the STAT_GET_xxxx values defined above. ** |