You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5702dfc
Browse filesBrowse the repository at this point in the historyBrowse files
Hold the --where rows in a temporary table instead of in PHP
The primary keys of the rows that --where selects were kept in PHP as
chunks of `pk IN (...)` predicates: memory grew with the number of
matching rows, a numeric-looking text key like '01' was written as the
number 1 and also matched '1', a failed page query ended the selection
silently with a partial key list, and prefiltering by the search string
could miss a match that a trigger adds to a later column.
Copy the keys of the matching rows database-side, with their exact
types, into an indexed temporary table per set of conditions, and
restrict each column's replacement and dry-run count to it. Stop with
an error before any column of the table is replaced if the table cannot
be created, with a hint about the CREATE TEMPORARY TABLES privilege, and
error out on SQLite, whose drop-in does not support CREATE TABLE ...
SELECT. Also stop when a page query of the PHP handler or a dry-run
count fails, instead of reporting a partial count.
Never replace the primary key columns of a table with --where, so a
row stays addressable by its key, and compare text primary keys as
strings when the PHP handler fetches a row or pages by key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
0 commit comments