Thursday 12 of November 2009 06:09:40 Dan Kennedy napisaƂ(a):
> I don't think you can use sqlite3_result_value() with a value
> that comes from a different database connection. At least not
> currently. The xColumn() method of the patched echo-vtab does
> that.
>
> Dan.

That is right.
I first tried to move out my external database connection out of cursor 
structure to table structure, and it did not helped, so problem is not in 
cursor having sqlite3* member.
But when I replaced:
sqlite3_result_value(ctx, sqlite3_column_value(pStmt, iCol));
with
sqlite3_result_null(ctx);
just to test it, sqlite stopped crashing.

So problem is in:
sqlite3_result_value(ctx, sqlite3_column_value(pStmt, iCol));
which works correctly if pStmt is connected to the same database that ctx, but 
leads to memory corruption if pStmt  query another database than connected with 
ctx.
For me this is eveident bug in SQlite library, or undocumented luck of 
functionality.
So is there any chance for fixing this in any predictable future - or at least 
logging it in bugs repository?

I will continue investigating this.
Thank you all for responses.
Grzegorz W.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to