summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 18:24:01 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 18:24:01 +0000
commitab184cc284a629e1139363257d1b9082b4cb2e33 (patch)
tree384f681e12898a3c2ff7c3c7e38aa9ba57583d63 /chrome
parent70f45c3f2b52eb71f15e707c9f21ff98c221758e (diff)
downloadchromium_src-ab184cc284a629e1139363257d1b9082b4cb2e33.zip
chromium_src-ab184cc284a629e1139363257d1b9082b4cb2e33.tar.gz
chromium_src-ab184cc284a629e1139363257d1b9082b4cb2e33.tar.bz2
Trivial patch: add whitespace to some SQL statements to turn "INSERT INTO foo(bar,baz)VALUES(?,?)" into "INSERT INTO foo (bar, baz) VALUES (?,?)" (which is the way we have it in most of our code).
This was annoying me while I tried to track down cases where we omitted the appropriate fieldnames from our SQL statements. Review URL: http://codereview.chromium.org/8855 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/history/text_database.cc4
-rw-r--r--chrome/browser/history/url_database.cc6
-rw-r--r--chrome/browser/history/visit_database.cc6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_bloom.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_impl.cc10
5 files changed, 13 insertions, 15 deletions
diff --git a/chrome/browser/history/text_database.cc b/chrome/browser/history/text_database.cc
index ef1d706..482db21 100644
--- a/chrome/browser/history/text_database.cc
+++ b/chrome/browser/history/text_database.cc
@@ -228,7 +228,7 @@ bool TextDatabase::AddPageData(Time time,
// Add to the pages table.
SQLITE_UNIQUE_STATEMENT(add_to_pages, *statement_cache_,
- "INSERT INTO pages(url,title,body)VALUES(?,?,?)");
+ "INSERT INTO pages (url, title, body) VALUES (?,?,?)");
if (!add_to_pages.is_valid())
return false;
add_to_pages->bind_string(0, url);
@@ -243,7 +243,7 @@ bool TextDatabase::AddPageData(Time time,
// Add to the info table with the same rowid.
SQLITE_UNIQUE_STATEMENT(add_to_info, *statement_cache_,
- "INSERT INTO info(rowid,time) VALUES(?,?)");
+ "INSERT INTO info (rowid, time) VALUES (?,?)");
if (!add_to_info.is_valid())
return false;
add_to_info->bind_int64(0, rowid);
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc
index 83b038b..b8bf2c9 100644
--- a/chrome/browser/history/url_database.cc
+++ b/chrome/browser/history/url_database.cc
@@ -113,9 +113,9 @@ URLID URLDatabase::AddURLInternal(const history::URLRow& info,
// HISTORY_URL_ROW_FIELDS because that specifies the table name which is
// invalid in the insert syntax.
#define ADDURL_COMMON_SUFFIX \
- "(url,title,visit_count,typed_count,"\
- "last_visit_time,hidden,favicon_id)"\
- "VALUES(?,?,?,?,?,?,?)"
+ " (url, title, visit_count, typed_count, "\
+ "last_visit_time, hidden, favicon_id) "\
+ "VALUES (?,?,?,?,?,?,?)"
const char* statement_name;
const char* statement_sql;
if (is_temporary) {
diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc
index fbba4d4..09f1231 100644
--- a/chrome/browser/history/visit_database.cc
+++ b/chrome/browser/history/visit_database.cc
@@ -101,9 +101,9 @@ void VisitDatabase::FillVisitVector(SQLStatement& statement,
VisitID VisitDatabase::AddVisit(VisitRow* visit) {
SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(),
- "INSERT INTO visits("
- "url,visit_time,from_visit,transition,segment_id,is_indexed)"
- "VALUES(?,?,?,?,?,?)");
+ "INSERT INTO visits "
+ "(url, visit_time, from_visit, transition, segment_id, is_indexed) "
+ "VALUES (?,?,?,?,?,?)");
if (!statement.is_valid())
return 0;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
index 59e9c6c..041e1bf 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc
@@ -919,7 +919,7 @@ bool SafeBrowsingDatabaseBloom::RemoveSubs(SBPair* adds,
SQLITE_UNIQUE_STATEMENT(
sub_prefix_tmp,
*statement_cache_,
- "INSERT INTO sub_prefix_tmp (chunk,add_chunk,prefix) VALUES (?,?,?)");
+ "INSERT INTO sub_prefix_tmp (chunk, add_chunk, prefix) VALUES (?,?,?)");
if (!sub_prefix_tmp.is_valid()) {
NOTREACHED();
return false;
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
index 9f47afd..6414a0e 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc
@@ -396,12 +396,12 @@ void SafeBrowsingDatabaseImpl::WriteInfo(int host_key,
int id) {
SQLITE_UNIQUE_STATEMENT(statement1, *statement_cache_,
"INSERT OR REPLACE INTO hosts"
- "(host,entries)"
+ "(host, entries)"
"VALUES (?,?)");
SQLITE_UNIQUE_STATEMENT(statement2, *statement_cache_,
"INSERT OR REPLACE INTO hosts"
- "(id,host,entries)"
+ "(id, host, entries)"
"VALUES (?,?,?)");
SqliteCompiledStatement& statement = id == 0 ? statement1 : statement2;
@@ -766,8 +766,7 @@ void SafeBrowsingDatabaseImpl::AddChunkInformation(
int list_id, ChunkType type, int chunk_id, const std::string& hostkeys) {
STATS_COUNTER(L"SB.ChunkInsert", 1);
SQLITE_UNIQUE_STATEMENT(statement, *statement_cache_,
- "INSERT INTO chunks"
- "(list_id,chunk_type,chunk_id,hostkeys)"
+ "INSERT INTO chunks (list_id, chunk_type, chunk_id, hostkeys) "
"VALUES (?,?,?,?)");
if (!statement.is_valid()) {
NOTREACHED();
@@ -892,8 +891,7 @@ void SafeBrowsingDatabaseImpl::RemoveChunkId(int list_id,
int SafeBrowsingDatabaseImpl::AddList(const std::string& name) {
SQLITE_UNIQUE_STATEMENT(statement, *statement_cache_,
- "INSERT INTO list_names"
- "(id,name)"
+ "INSERT INTO list_names (id, name) "
"VALUES (NULL,?)");
if (!statement.is_valid()) {
NOTREACHED();