Skip to content

Commit d793fd9

Browse files
abnegateclaude
andcommitted
fix(sqlite): align getSizeOfCollection FTS prefix with createFulltextIndex
testSizeFullText asserts the collection size grows after a fulltext index is created. The size LIKE pattern was hardcoded to "{namespace}_{collection}_" while the FTS5 tables now use getFulltextTablePrefix, which under sharedTables embeds the tenant segment. With the two paths diverging, the FTS5 shadow tables (`_data`, `_idx`, `_docsize`, `_config`) didn't match the dbstat LIKE and the size came out unchanged. Reuse getFulltextTablePrefix so the naming stays in lockstep regardless of shared-tables mode. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dde905c commit d793fd9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Database/Adapter/SQLite.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,11 @@ public function getSizeOfCollection(string $collection): int
452452
$namespace = $this->getNamespace();
453453
$name = $namespace . '_' . $collection;
454454
$permissions = $namespace . '_' . $collection . '_perms';
455-
$ftsPrefix = "{$namespace}_{$collection}_";
455+
// Reuse getFulltextTablePrefix so the LIKE prefix tracks the same
456+
// tenant-aware naming createFulltextIndex uses. Hardcoding
457+
// "{namespace}_{collection}_" diverged under sharedTables once the
458+
// FTS5 tables started carrying a tenant segment.
459+
$ftsPrefix = $this->getFulltextTablePrefix($collection);
456460

457461
// FTS5 virtual tables don't show up in dbstat themselves — their
458462
// storage is backed by shadow tables named `<vtable>_data`,

0 commit comments

Comments
 (0)