Skip to content

Commit

Permalink
Quota database: remove extra sql::Statement::step() call
Browse files Browse the repository at this point in the history
I believe this will lead to an error when step() has already returned
false, which could explain SQLITE_MISUSE values. Removing this might
sidestep that error, but we're still left wondering why the statement
is failing to return data.

(cherry picked from commit 17d19c5)

Bug: 1446886
Change-Id: I5e1f7300f208aa8f3551678ccdcaff7559182c50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4569298
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1151904}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4590710
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/branch-heads/5790@{#387}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
Evan Stade authored and Krishna Govind committed Jun 6, 2023
1 parent a2070b1 commit 0d06948
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions storage/browser/quota/quota_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1238,10 +1238,9 @@ QuotaErrorOr<BucketInfo> QuotaDatabase::CreateBucketInternal(
/*last_accessed=*/now,
/*last_modified=*/now, statement);
QuotaErrorOr<BucketInfo> result = BucketInfoFromSqlStatement(statement);
const bool done = !statement.Step();
DCHECK(done);

if (result.has_value()) {
CHECK(!statement.Step());
// Commit immediately so that we persist the bucket metadata to disk before
// we inform other services / web apps (via the Buckets API) that we did so.
// Once informed, that promise should persist across power failures.
Expand Down

0 comments on commit 0d06948

Please sign in to comment.