Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-19 Thread Alexey Pechnikov
Hello! On Saturday 19 December 2009 06:11:04 Igor Tandetnik wrote: > No, it's a table column. "Variable" here means a bound parameter. Basically, > something that doesn't change row to row, and so would benefit from caching. Thanks, I use the first constant value and this work. > Remember,

Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Igor Tandetnik
Alexey Pechnikov wrote: > On Friday 18 December 2009 16:22:47 Igor Tandetnik wrote: >> From http://www.sqlite.org/c3ref/get_auxdata.html : >> >> "SQLite is free to call the destructor and drop metadata on any parameter of >> any function at any time. The only guarantee is >> that the destructor

Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Alexey Pechnikov
Hello! Ok, I did realize this. Is my variant the best solution or I can enhance it? static void distinctonFunc( sqlite3_context *pCtx, /* Function context */ int nArg,/* Number of function arguments */ sqlite3_value **argv /* Values for all function arguments */ ){

Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Alexey Pechnikov
Hello! On Friday 18 December 2009 16:22:47 Igor Tandetnik wrote: > From http://www.sqlite.org/c3ref/get_auxdata.html : > > "SQLite is free to call the destructor and drop metadata on any parameter of > any function at any time. The only guarantee is that the destructor will be > called before

Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Alexey Pechnikov
Hello! On Friday 18 December 2009 16:22:47 Igor Tandetnik wrote: > From http://www.sqlite.org/c3ref/get_auxdata.html : > > "SQLite is free to call the destructor and drop metadata on any parameter of > any function at any time. The only guarantee is that the destructor will be > called before

Re: [sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Igor Tandetnik
Alexey Pechnikov wrote: > But the result is strange: > > sqlite> select value=0,counter(0),counter(value=0) from state; > 0|0|0 > 0|1|0 > 0|2|0 > 0|3|0 > > Of course I need to get the result of counter(value==0) equal to counter(0). > The result of "value=0" is always 0 and so counter(value=0)

[sqlite] Problem with sqlite3_get_auxdata

2009-12-18 Thread Alexey Pechnikov
Hello! I'm using the function from SQLite tests: static void counterFunc( sqlite3_context *pCtx, /* Function context */ int nArg,/* Number of function arguments */ sqlite3_value **argv /* Values for all function arguments */ ){ int i; int *pCounter; pCounter =