From 1bc85b268333b7c8eec62d4d5324067978fafc98 Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Thu, 8 Mar 2012 04:53:49 +0000 Subject: Create meta table atomically. http://crbug.com/111376 happened because a crash between creation and population of the meta table could leave a meta table returning 0 for the version numbers, even though no client ever stored 0 for the versions. This makes creation and population atomic. Additionally, version numbers are restricted to positive values, to prevent this case from being masked in the future. BUG=116306 TEST=none Review URL: http://codereview.chromium.org/9592026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125557 0039d316-1c4b-4281-b951-d872f2087c98 --- sql/meta_table.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/meta_table.h') diff --git a/sql/meta_table.h b/sql/meta_table.h index 497d918..03ec705 100644 --- a/sql/meta_table.h +++ b/sql/meta_table.h @@ -26,7 +26,8 @@ class SQL_EXPORT MetaTable { // Initializes the MetaTableHelper, creating the meta table if necessary. For // new tables, it will initialize the version number to |version| and the - // compatible version number to |compatible_version|. + // compatible version number to |compatible_version|. Versions must be + // greater than 0 to distinguish missing versions (see GetVersionNumber()). bool Init(Connection* db, int version, int compatible_version); // Resets this MetaTable object, making another call to Init() possible. -- cgit v1.1