[darwinbuild-changes] [761] branches/PR-7593824/darwinup/Database.cpp

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 10 15:59:24 PST 2010


Revision: 761
          http://trac.macosforge.org/projects/darwinbuild/changeset/761
Author:   wsiegrist at apple.com
Date:     2010-03-10 15:59:23 -0800 (Wed, 10 Mar 2010)
Log Message:
-----------
Only set schema_version when needed

Modified Paths:
--------------
    branches/PR-7593824/darwinup/Database.cpp

Modified: branches/PR-7593824/darwinup/Database.cpp
===================================================================
--- branches/PR-7593824/darwinup/Database.cpp	2010-03-10 23:47:59 UTC (rev 760)
+++ branches/PR-7593824/darwinup/Database.cpp	2010-03-10 23:59:23 UTC (rev 761)
@@ -141,6 +141,7 @@
 	if (!exists) {
 		// create schema since it is empty
 		assert(this->create_tables() == 0);
+		assert(this->set_schema_version(this->m_schema_version) == 0);
 	} else {
 		// not empty, but upgrade schema if needed
 		uint32_t version = this->get_schema_version();
@@ -148,6 +149,7 @@
 		if (version < this->m_schema_version) {
 			IF_DEBUG("Upgrading schema from %u to %u \n", version, this->m_schema_version);
 			assert(this->upgrade_schema(version) == 0);
+			assert(this->set_schema_version(this->m_schema_version) == 0);
 		}
 		if (version > this->m_schema_version) {
 			fprintf(stderr, "Error: this client is too old!\n");
@@ -155,8 +157,6 @@
 		}
 	}
 	
-	this->set_schema_version(this->m_schema_version);
-	
 	return res;	
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100310/404b6f59/attachment.html>


More information about the darwinbuild-changes mailing list