ScratchTables
in package
Creates the per-connection scratch table used while importing vocabulary.
temp_words used to be a persistent, globally-shared InnoDB table that every
import TRUNCATEd and refilled. That design caused two problems:
- Tablespace crashes. On file-per-table InnoDB,
TRUNCATEphysically drops and recreates the.ibd. When that file went missing (notably on Windows) the table was left with a missing tablespace and every subsequent import failed with InnoDB error 194 "Tablespace is missing for a table" (see issue #247). - Concurrency corruption. Because the table was shared, two imports running at once (or any two users in multi-user mode) read and truncated each other's rows.
It is now created per database connection with CREATE TEMPORARY TABLE, so
each request gets its own private copy. Temporary InnoDB tables live in the
shared session temporary tablespace (there is no per-table .ibd to orphan),
and they are dropped automatically when the connection closes.
Callers must ensureWords() before use, then clear rows with DELETE FROM —
never TRUNCATE, which is DDL that recreates the tablespace and implicitly
commits any open transaction.
(Text parsing no longer uses any scratch table — see TokenPersistence.)
Tags
Table of Contents
Methods
- ensureWords() : void
- Ensure the word-import staging table exists for this connection.
Methods
ensureWords()
Ensure the word-import staging table exists for this connection.
public
static ensureWords() : void
Holds the rows of a vocabulary import file before they are merged into
the words table.