Commit c313fa9a authored by mvrable@chromium.org's avatar mvrable@chromium.org

Fix a copy-paste error in the extension activity log code

I had a copy-paste error in some of the recently-implemented parts of
the extension activity log.  This fixes that.

I believe the bug is harmless because update_statement isn't used again
before it goes out of scope (so it's fine that it was clobbered) and
SQLite defaults to a null value for unbound parameters (so it's fine
that insert_statement wasn't initialized).

Still, I should get the code right and this fixes it.

Review URL: https://chromiumcodereview.appspot.com/22901002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217123 0039d316-1c4b-4281-b951-d872f2087c98
parent 122f2c45
......@@ -324,6 +324,11 @@ bool CountingPolicy::FlushDatabase(sql::Connection* db) {
update_statement.BindInt64(1, day_start.ToInternalValue());
update_statement.BindInt64(2, next_day.ToInternalValue());
for (size_t j = 0; j < matched_values.size(); j++) {
// A call to BindNull when matched_values contains -1 is likely not
// necessary as parameters default to null before they are explicitly
// bound. But to be completely clear, and in case a cached statement
// ever comes with some values already bound, we bind all parameters
// (even null ones) explicitly.
if (matched_values[j] == -1)
update_statement.BindNull(j + 3);
else
......@@ -347,7 +352,7 @@ bool CountingPolicy::FlushDatabase(sql::Connection* db) {
insert_statement.BindInt64(0, action.time().ToInternalValue());
for (size_t j = 0; j < matched_values.size(); j++) {
if (matched_values[j] == -1)
update_statement.BindNull(j + 1);
insert_statement.BindNull(j + 1);
else
insert_statement.BindInt64(j + 1, matched_values[j]);
}
......
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