You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/02/11 04:21:35 UTC

svn commit: r1566977 - /subversion/trunk/subversion/libsvn_subr/sqlite.c

Author: breser
Date: Tue Feb 11 03:21:34 2014
New Revision: 1566977

URL: http://svn.apache.org/r1566977
Log:
Runtime check for SQLITE STAT bug.

Using SVN_ERR_UNSUPPORTED_FEATURE because using SVN_ERR_SQLITE_ERROR
just gets cleared and eventually we print a generic error about the 
working copy being corrupt.  Plan to add a new error code for things
like this in a separate commit for easier backports.

* subversion/libsvn_subr/sqlite.c
  (svn_sqlite__open): When using known bugy versions of SQLite check
    for the ENABLE_STAT3 and ENABLE_STAT4 options and error out.

Modified:
    subversion/trunk/subversion/libsvn_subr/sqlite.c

Modified: subversion/trunk/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sqlite.c?rev=1566977&r1=1566976&r2=1566977&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sqlite.c Tue Feb 11 03:21:34 2014
@@ -1076,6 +1076,20 @@ svn_sqlite__open(svn_sqlite__db_t **db, 
   SVN_ERR(svn_atomic__init_once(&sqlite_init_state,
                                 init_sqlite, NULL, scratch_pool));
 
+  /* runtime check for https://www.sqlite.org/src/info/4c86b126f2 */
+#if SQLITE_VERSION_NUMBER > 3008000 && SQLITE_VERSION_NUMBER < 3008004
+  if (sqlite3_compileoption_used("ENABLE_STAT3"))
+    return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                             _("'%s' compile time SQLite option is broken "
+                               "with SQLite 3.8.1 - 3.8.3"),
+                             "SQLITE_ENABLE_STAT3");
+  if (sqlite3_compileoption_used("ENABLE_STAT4"))
+    return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                             _("'%s' compile time SQLite option is broken "
+                               "with SQLite 3.8.1 - 3.8.3"),
+                             "SQLITE_ENABLE_STAT4");
+#endif
+
   *db = apr_pcalloc(result_pool, sizeof(**db));
 
   SVN_ERR(internal_open(&(*db)->db3, path, mode, scratch_pool));