Skip to content

Commit

Permalink
Change sqlite index to correct column
Browse files Browse the repository at this point in the history
Add schema to query string
Fixes brave/brave-browser#4663
  • Loading branch information
jdkuki committed Jun 7, 2019
1 parent a9a345f commit 5914e70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/brave_rewards/browser/publisher_info_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,9 @@ bool PublisherInfoDatabase::GetExcludedList(
}

// We will use every attribute from publisher_info
std::string query = "SELECT * FROM publisher_info WHERE excluded = 1";
std::string query = "SELECT publisher_id, verified, name,"
"favicon, url, provider "
"FROM publisher_info WHERE excluded = 1";

sql::Statement info_sql(db_.GetUniqueStatement(query.c_str()));

Expand All @@ -758,10 +760,10 @@ bool PublisherInfoDatabase::GetExcludedList(
auto info = ledger::PublisherInfo::New();
info->id = info_sql.ColumnString(0);
info->verified = info_sql.ColumnBool(1);
info->name = info_sql.ColumnString(3);
info->favicon_url = info_sql.ColumnString(4);
info->url = info_sql.ColumnString(5);
info->provider = info_sql.ColumnString(9);
info->name = info_sql.ColumnString(2);
info->favicon_url = info_sql.ColumnString(3);
info->url = info_sql.ColumnString(4);
info->provider = info_sql.ColumnString(5);

list->push_back(std::move(info));
}
Expand Down

0 comments on commit 5914e70

Please sign in to comment.