rpm-software-management / createrepo_c

C implementation of the createrepo.
http://rpm-software-management.github.io/createrepo_c
GNU General Public License v2.0
100 stars 93 forks source link

sqlite3_enable_shared_cache #404

Closed tpgxyz closed 11 months ago

tpgxyz commented 11 months ago

Hi, looks like there is no check if SQLite is compiled with -DSQLITE_OMIT_SHARED_CACHE According to SQLite upstream docs this option is recommended to use https://www.sqlite.org/c3ref/enable_shared_cache.html

sqlite3_enable_shared_cache

I’d surges to make this sqlite3_enable_shared_cache call conditional if SQLite is compiled with -DSQLITE_OMIT_SHARED_CACHE

ppisar commented 11 months ago

Thanks for the report. I'd rarher replace it together with sqlite3_open() with sqlite3_open_v2(,, SQLITE_OPEN_READWRITE|SQLITE_OPEN_SHAREDCACHE, NULL) call. Not only the flags works is ignored by sqlite builds compiled with -DSQLITE_OMIT_SHARED_CACHE, it also prevents from contaminating the shared cache use for SQLite connections not opend by createrepo_c library.

SQLITE_OPEN_SHAREDCACHE flag was added in sqlite-3.6.18 4 years ago.