Commit 2bc3694b authored by marja@chromium.org's avatar marja@chromium.org

SQLitePersistentCookieStore fix: Don't abuse SQL_FROM_HERE.

SQL_FROM_HERE cannot be used in places where the corresponding SQL statement is
not unique.

BUG=NONE
TEST=NONE


Review URL: http://codereview.chromium.org/8856005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113575 0039d316-1c4b-4281-b951-d872f2087c98
parent 913b6158
...@@ -574,19 +574,20 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains( ...@@ -574,19 +574,20 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains(
const std::set<std::string>& domains) { const std::set<std::string>& domains) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
const char* sql; sql::Statement smt;
if (restore_old_session_cookies_) { if (restore_old_session_cookies_) {
sql = smt.Assign(db_->GetCachedStatement(
"SELECT creation_utc, host_key, name, value, path, expires_utc, " SQL_FROM_HERE,
"secure, httponly, last_access_utc, has_expires, persistent " "SELECT creation_utc, host_key, name, value, path, expires_utc, "
"FROM cookies WHERE host_key = ?"; "secure, httponly, last_access_utc, has_expires, persistent "
"FROM cookies WHERE host_key = ?"));
} else { } else {
sql = smt.Assign(db_->GetCachedStatement(
"SELECT creation_utc, host_key, name, value, path, expires_utc, " SQL_FROM_HERE,
"secure, httponly, last_access_utc, has_expires, persistent " "SELECT creation_utc, host_key, name, value, path, expires_utc, "
"FROM cookies WHERE host_key = ? AND persistent == 1"; "secure, httponly, last_access_utc, has_expires, persistent "
"FROM cookies WHERE host_key = ? AND persistent = 1"));
} }
sql::Statement smt(db_->GetCachedStatement(SQL_FROM_HERE, sql));
if (!smt) { if (!smt) {
NOTREACHED() << "select statement prep failed"; NOTREACHED() << "select statement prep failed";
db_.reset(); db_.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment