summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 07:25:01 +0000
committermal@chromium.org <mal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-13 07:25:01 +0000
commitd7c894cbfa32ba3ef750d09d423f50a7f7cd49ca (patch)
treee971b3e6c50a3b1984fe13e53209207512ef23bf
parent59db679d328106684ed297a6f5516cb47bb9a410 (diff)
downloadchromium_src-d7c894cbfa32ba3ef750d09d423f50a7f7cd49ca.zip
chromium_src-d7c894cbfa32ba3ef750d09d423f50a7f7cd49ca.tar.gz
chromium_src-d7c894cbfa32ba3ef750d09d423f50a7f7cd49ca.tar.bz2
Add DoesTableExist to meta_table on the 249 branch.
BUG= build fail TEST= build win Review URL: http://codereview.chromium.org/606046 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@39005 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/sql/meta_table.cc8
-rw-r--r--app/sql/meta_table.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/app/sql/meta_table.cc b/app/sql/meta_table.cc
index 03a1245..cf989d4 100644
--- a/app/sql/meta_table.cc
+++ b/app/sql/meta_table.cc
@@ -15,6 +15,12 @@ namespace sql {
static const char kVersionKey[] = "version";
static const char kCompatibleVersionKey[] = "last_compatible_version";
+// static
+bool MetaTable::DoesTableExist(sql::Connection* db) {
+ DCHECK(db);
+ return db->DoesTableExist("meta");
+}
+
MetaTable::MetaTable() : db_(NULL) {
}
@@ -24,7 +30,7 @@ MetaTable::~MetaTable() {
bool MetaTable::Init(Connection* db, int version, int compatible_version) {
DCHECK(!db_ && db);
db_ = db;
- if (!db_->DoesTableExist("meta")) {
+ if (!DoesTableExist(db)) {
if (!db_->Execute("CREATE TABLE meta"
"(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY,"
"value LONGVARCHAR)"))
diff --git a/app/sql/meta_table.h b/app/sql/meta_table.h
index 6ccee17..c997585 100644
--- a/app/sql/meta_table.h
+++ b/app/sql/meta_table.h
@@ -16,6 +16,8 @@ class Statement;
class MetaTable {
public:
+ // Returns true if the 'meta' table exists.
+ static bool DoesTableExist(Connection* db);
MetaTable();
~MetaTable();