Closed Bug 1588329 Opened 5 years ago Closed 5 years ago

Forgetting a site with more than 999 pages binds too many SQL variables

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: lina, Assigned: lina)

References

Details

Attachments

(4 files)

I have a looot of twitter.com/* pages in my history (for users and individual tweets), and tried to use "Forget About This Site" to clean them all up. Unfortunately, it looks like this statement doesn't chunk bound params, so I got an Error: Error(s) encountered during statement execution: too many SQL variables in the browser console.

I think this can happen anytime you try to remove more than 999 pages from history.

This is a wrapper around the sqlite3_limit interface that returns the
binding parameter limit. Adding this getter lets us clean up the inline
SQLITE_MAX_VARIABLE_NUMBER constants scattered around Places.

This commit builds on the last one to chunk all bound parameters.
In most cases, we just move the statements into a loop that
iterates over the chunks instead of the array. There are two
exceptions which need a bit more work: cleanupPages and remove.

In cleanupPages, we chunk pagesToRemove, and clean up
moz_updateoriginsdelete_temp and orphan icons after the loop. This
doesn't change functionality, because none of the statements that
follow depend on moz_origins, moz_icons, or frecency stats.

In remove, we now fetch page info for URLs and GUIDs in separate
statements. This makes chunking URL params easier.

Depends on D49073

Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcc1e4b3ac82
Introduce `mozIStorageAsyncConnection::variableLimit`. r=mak
https://hg.mozilla.org/integration/autoland/rev/a286bae2c308
Centralize array chunking in `PlacesUtils.chunkArray`. r=mak
https://hg.mozilla.org/integration/autoland/rev/9849e08517a6
Use the new `variableLimit` getter to chunk binding params in Places. r=mak
https://hg.mozilla.org/integration/autoland/rev/f1b176cc0766
Chunk bound params in bookmarks and history. r=mak
Regressions: 1589939
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: