Re: [sqlite] sqlite3_initialize() before sqlite3_randomness()

2013-01-15 Thread Eric Sink


Yeah, I did read that page, but not well enough.

I saw this:

"Workstation applications using SQLite normally do not need to invoke 
either of these routines."


And this (all-caps emphasis mine):

"The sqlite3_initialize() routine is called internally by MANY other 
SQLite interfaces so that an application usually does not need to invoke 
sqlite3_initialize() directly."


But I missed this:

"it is recommended that applications always invoke sqlite3_initialize() 
directly prior to using any other SQLite interface"


So I ended up thinking maybe the current behavior was unknown or unintended.

Anyway.  Nothing to see here...

--
E




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_initialize() before sqlite3_randomness()

2013-01-15 Thread Kees Nuyt
On Tue, 15 Jan 2013 16:07:16 -0600, Eric Sink 
wrote:

>
>So it appears that if the very first SQLite function you call is 
>sqlite3_randomness(), it crashes.
>
>And if you call sqlite3_initialize() first, it does not crash.
>
>Just thought I should let somebody know...

It's documented:

http://sqlite.org/c3ref/initialize.html

" The sqlite3_initialize() routine is called internally by many other
SQLite interfaces so that an application usually does not need to invoke
sqlite3_initialize() directly. For example, sqlite3_open() calls
sqlite3_initialize() so the SQLite library will be automatically
initialized when sqlite3_open() is called if it has not be initialized
already. However, if SQLite is compiled with the SQLITE_OMIT_AUTOINIT
compile-time option, then the automatic calls to sqlite3_initialize()
are omitted and the application must call sqlite3_initialize() directly
prior to using any other SQLite interface. For maximum portability, it
is recommended that applications always invoke sqlite3_initialize()
directly prior to using any other SQLite interface. Future releases of
SQLite may require this. In other words, the behavior exhibited when
SQLite is compiled with SQLITE_OMIT_AUTOINIT might become the default
behavior in some future release of SQLite. "

Usually the first thing an application does is call sqlite3_open*() and
by default SQLITE_OMIT_AUTOINIT is not defined (yet).

-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_initialize() before sqlite3_randomness()

2013-01-15 Thread Eric Sink


So it appears that if the very first SQLite function you call is 
sqlite3_randomness(), it crashes.


And if you call sqlite3_initialize() first, it does not crash.

Just thought I should let somebody know...

--
E

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users