SQLite 3.39.3 Broken with SQLITE_OMIT_AUTOINIT 1
(1) By Nick Kooij (NickKooij) on 2022-09-06 10:19:14 [source]
Changes to the sqlite3_win32_set_directory8
function in version 3.39.3 break compilation when you disable auto-initialization:
#define SQLITE_OMIT_AUTOINIT 1
Specifically the variable rc
is now always accessed, but only only exists when SQLITE_OMIT_AUTOINIT
is not defined.
The fix is to move the declaration of rc
outside the preprocessor block:
SQLITE_API int sqlite3_win32_set_directory8(
unsigned long type, /* Identifier for directory being set or reset */
const char *zValue /* New value for directory being set or reset */
){
char **ppDirectory = 0;
int rc;
#ifndef SQLITE_OMIT_AUTOINIT
rc = sqlite3_initialize();
...
Best regards, and keep up the great work.
(2) By Stephan Beal (stephan) on 2022-09-06 10:23:56 in reply to 1 [link] [source]
Changes to the sqlite3_win32_set_directory8 function in version 3.39.3 break compilation when you disable auto-initialization
Just FYI, a new tool was added to the tree after the 3.39.3 release with which to test the OMIT options on Windows to help keep that from happening again.
(3) By Nick Kooij (NickKooij) on 2022-09-06 10:37:11 in reply to 2 [link] [source]
Thanks for the quick update.
Apologies for raising an already raised issue.
(4) By Richard Hipp (drh) on 2022-09-06 14:08:14 in reply to 1 [link] [source]
Check-in f74a5ea8c986dc33 on the SQLite trunk branch fixes this issue. It is simple to fix this by patching the sqlite3.c file directly. We are not planning to issue a new 3.39.4 release to address this problem, since SQLITE_OMIT_AUTOINIT is an unsupported compile-time option. However, as Stephan noted, I have taken steps to try to prevent breakage of legacy compile-time options on Windows for future releases.
(5) By anonymous on 2022-09-06 23:16:07 in reply to 4 [link] [source]
since SQLITE_OMIT_AUTOINIT is an unsupported compile-time option
According to #12 on Compile-time Options, SQLITE_OMIT_AUTOINIT
is recommended. Is that page in error?
(6) By Richard Hipp (drh) on 2022-09-06 23:24:00 in reply to 5 [link] [source]
It is not a tested compile-time option. Though, in light of the fact that it is a recommended compile-time option, I suppose it should be tested.
I'll make sure that is addressed prior to the next release.
(7.1) By Stephan Beal (stephan) on 2022-09-06 23:32:54 edited from 7.0 in reply to 5 [link] [source]
According to #12 on Compile-time Options, SQLITE_OMIT_AUTOINIT is recommended. Is that page in error?
See section 9 on that same page:
Important Note: The SQLITE_OMIT_* options may not work with the amalgamation. SQLITE_OMIT_* compile-time options usually work correctly only when SQLite is built from canonical source files.
Edit: please disregard. i misinterpreted the initial report as applying to the amalgamation.
(8) By Richard Hipp (drh) on 2022-09-06 23:32:46 in reply to 7.0 [link] [source]
So, clearly, we need to audit the SQLITE_OMIT_AUTOINIT compile-time option and figure out whether or not it is supported and/or recommended....