typedef struct {
char const *filename;
uint32_t busy_timeout;
- bool bootstrapped;
+ bool bootstrap;
} rlm_sql_sqlite_t;
static const CONF_PARSER driver_config[] = {
if (!conn->db || (sql_check_error(conn->db, status) != RLM_SQL_OK)) {
sql_print_error(conn->db, status, "Error opening SQLite database \"%s\"", inst->filename);
#ifdef HAVE_SQLITE3_OPEN_V2
- if (!inst->bootstrapped) {
+ if (!inst->bootstrap) {
INFO("Use the sqlite driver 'bootstrap' option to automatically create the database file");
}
#endif
return -1;
}
- if (cf_pair_find(cs, "bootstrap") && !exists) {
+ if (cf_pair_find(cs, "bootstrap")) {
+ inst->bootstrap = true;
+ }
+
+ if (inst->bootstrap && !exists) {
#ifdef HAVE_SQLITE3_OPEN_V2
int status;
int ret;
}
return -1;
}
-
- inst->bootstrapped = true;
#else
WARN("sqlite3_open_v2() not available, cannot bootstrap database. "
"Upgrade to SQLite >= 3.5.1 if you need this functionality");