1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

fix SQLITE_DETERMINISTIC compile error under old sqlite3

the centos7 version of sqlite3 doesn't have SQLITE_DETERMINISTIC
This commit is contained in:
Oliver Giles 2018-09-28 11:47:18 +03:00
parent 08b3f25a22
commit a7aac62897

View File

@ -51,7 +51,11 @@ static void stdevFinalize(sqlite3_context *context){
Database::Database(const char *path) { Database::Database(const char *path) {
sqlite3_open(path, &hdl); sqlite3_open(path, &hdl);
sqlite3_create_function(hdl, "STDEV", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC, NULL, NULL, stdevStep, stdevFinalize); int create_func_flags = SQLITE_UTF8;
#if SQLITE_VERSION_NUMBER >= 3008003
create_func_flags |= SQLITE_DETERMINISTIC;
#endif
sqlite3_create_function(hdl, "STDEV", 1, create_func_flags, NULL, NULL, stdevStep, stdevFinalize);
} }
Database::~Database() { Database::~Database() {