2015-05-10 21:06 GMT+02:00 Roger Binns <rogerb at rogerbinns.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> There is a forward declaration of sqlite3_dbstat_register (currently
> line 130871 in the 3.8.10.1 amalgamation):
>
> int sqlite3_dbstat_register(sqlite3*);
>
> Later is the actual implementation (currently line 155838 in the
> 3.8.10.1 amalgamation):
>
> SQLITE_API int SQLITE_STDCALL sqlite3_dbstat_register(sqlite3 *db){
>
> If SQLITE_API or SQLITE_STDCALL are set to anything then the
> inconsistency can cause a compiler error. In my case SQLITE_API is
> defined as static.
The function sqlite3_dbstat_register() shouln't be an exported function
at all, I would suggest to rename it to sqlite3DbstatInit, that would
be consistent with other compiled-in extensions (e.g. sqlite3RtreeInit)
and it would fix the problem you are describing.
Worse: the tcl extension uses sqlite3_dbstat_register() when compiled
with -DSQLITE_ENABLE_DBSTAT_VTAB=1, which means that
1) Initialization of the dbstat extension will be done twice.
2) If sqlite is not compiled with -DSQLITE_ENABLE_DBSTAT_VTAB=1, or
the function is renamed (as it should) it wouldn't even work.
The latter part is already fixed in the TEA version of SQLite.
Suggested patch:
<http://cyqlite.sourceforge.net/cgi-bin/sqlite/fdiff?v1=f2e740c1cc90060f&v2=39dc9592b8f99cf9&sbs=1>
Regards,
Jan Nijtmans