From 275f4e494cacd403d28b01f8e3356a6669ef8e13 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Oct 2013 08:29:06 +0200 Subject: Add support for SQLite 3.3.6 That's what is still shipped with RHEL5. --- odb/sqlite/connection.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'odb/sqlite/connection.cxx') diff --git a/odb/sqlite/connection.cxx b/odb/sqlite/connection.cxx index f4e7259..188d59f 100644 --- a/odb/sqlite/connection.cxx +++ b/odb/sqlite/connection.cxx @@ -51,12 +51,22 @@ namespace odb f |= SQLITE_OPEN_NOMUTEX; #endif - const string& vfs (db.vfs ()); - sqlite3* h (0); + + // sqlite3_open_v2() was only addedin SQLite 3.5.0. + // +#if SQLITE_VERSION_NUMBER >= 3005000 + const string& vfs (db.vfs ()); int e ( sqlite3_open_v2 ( n.c_str (), &h, f, (vfs.empty () ? 0 : vfs.c_str ()))); +#else + // Readonly opening not supported in SQLite earlier than 3.5.0. + // + assert ((f & SQLITE_OPEN_READONLY) == 0); + int e (sqlite3_open (n.c_str (), &h)); +#endif + handle_.reset (h); if (e != SQLITE_OK) -- cgit v1.1