SQLite3 and threads

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 2 03:55:49 PST 2015


On Monday, 2 March 2015 at 07:20:49 UTC, Vitalie Colosov wrote:
> Now it all makes sense. Thank you.
> Maybe it would make also some sense if I would have gotten some 
> kind of exception trying to access the variable which was not 
> populated by the running thread, instead of successfully 
> getting empty string... so this would be observed easily during 
> the testing, but perhaps there are some reasons for it being 
> implemented the way it is, will keep learning.

In your case you probably accessed uninitialized variable. 
Sentinel values can be used for this, i.e. a value that, when 
accessed by sqlite, gives you a descriptive error. So if this 
sentinel value is set as default value for a query structure, you 
will get it in uninitialized variables by default and receive 
errors when they are used by sqlite.


More information about the Digitalmars-d-learn mailing list