Index: backends/flint/flint_version.cc
===================================================================
--- backends/flint/flint_version.cc	(revision 9425)
+++ backends/flint/flint_version.cc	(revision 9426)
@@ -89,7 +89,7 @@
     }
 }
 
-void FlintVersion::read_and_check()
+void FlintVersion::read_and_check(bool readonly)
 {
     int fd = ::open(filename.c_str(), O_RDONLY|O_BINARY);
 
@@ -127,7 +127,8 @@
     const unsigned char *v;
     v = reinterpret_cast<const unsigned char *>(buf) + MAGIC_LEN;
     unsigned int version = v[0] | (v[1] << 8) | (v[2] << 16) | (v[3] << 24);
-    if (version >= 200704230 && version <= 200709120) {
+    if (version >= 200704230 && version < 200709120) {
+	if (readonly) return;
 	// Upgrade the database to the current version since any changes we
 	// make won't be compatible with older versions of Xapian.
 	string filename_save = filename;
Index: backends/flint/flint_version.h
===================================================================
--- backends/flint/flint_version.h	(revision 9425)
+++ backends/flint/flint_version.h	(revision 9426)
@@ -1,7 +1,7 @@
 /** @file flint_version.h
  * @brief FlintVersion class
  */
-/* Copyright (C) 2006 Olly Betts
+/* Copyright (C) 2006,2007 Olly Betts
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,9 +41,11 @@
 
     /** Read the version file and check it's a version we understand.
      *
+     *  @param readonly    true if the database is being opened readonly.
+     * 
      *  On failure, an exception is thrown.
      */
-    void read_and_check();
+    void read_and_check(bool readonly);
 };
 
 #endif
Index: backends/flint/flint_database.cc
===================================================================
--- backends/flint/flint_database.cc	(revision 9425)
+++ backends/flint/flint_database.cc	(revision 9426)
@@ -230,7 +230,7 @@
     // go back and open record_table again, until record_table has
     // the same revision as the last time we opened it.
 
-    version_file.read_and_check();
+    version_file.read_and_check(readonly);
     record_table.open();
     flint_revision_number_t revision = record_table.get_open_revision_number();
 
@@ -289,7 +289,7 @@
 FlintDatabase::open_tables(flint_revision_number_t revision)
 {
     DEBUGCALL(DB, void, "FlintDatabase::open_tables", revision);
-    version_file.read_and_check();
+    version_file.read_and_check(readonly);
     record_table.open(revision);
 
     // In case the position, value, synonym, and/or spelling tables don't
