John Stanton wrote:
> Have you checked to ensure that you database handle is correct?
> Your function inherits it as user data, but is it corrupted?
The db handle is passed correctly.
I'm starting to suspect that this is a bug of sqlite. Even a simple "select 0"
fails inside an aggregate. Here's some code that exemplifies this:
#include <sqlite3.h>
#include <stdio.h>
void MyAggregateFuncStep(sqlite3_context* context,int argc,sqlite3_value**
argv) {
// Do nothing
}
void MyAggregateFuncFinal(sqlite3_context* context) {
sqlite3 *db;
char *e;
db=sqlite3_user_data(context);
sqlite3_exec(db,"select 0;",NULL,NULL,&e);
if (e) printf("MyAggregateFuncFinal: %s\n",e);
sqlite3_result_null(context);
}
main() {
sqlite3 *db;
char *e;
sqlite3_open(NULL,&db);
sqlite3_create_function(db,"MyAggregateFunc",1,SQLITE_ANY,db,NULL,
MyAggregateFuncStep,MyAggregateFuncFinal);
sqlite3_exec(db,"select MyAggregateFunc(0);",NULL,NULL,&e);
if (e) printf("main: %s\n",e);
};
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------