Skip to content

fix(db): exclude schema assets without the configured table prefix - #56173

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/db-pgsql-seq-filter
Open

joshtrichards wants to merge 1 commit into
masterfrom
jtr/db-pgsql-seq-filter

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Nov 3, 2025 •

Copy link
Copy Markdown
Member
  • Resolves: # (hard to say with certainty)

Summary

During conversion to PostgreSQL, the sequence filter could include sequences that don’t match the configured table prefix, causing unrelated sequences to be considered during resynchronization.

preg_match() returns 1 for a match, 0 for no match, and false on error. The previous !== false check accepted 0 as well as 1. Checking for === 1 ensures only actual prefix matches are included.

P.S. Exact same matter in ConvertType::getTables() itself, which runs before this and and for other database types, is dealt with in PR #56174.

TODO

  • Backport

Follow-up matters

  • PgSqlTools current lacks test coverage; should be dealt with in a follow-up PR

Checklist

@joshtrichards joshtrichards added this to the Nextcloud 33 milestone Nov 3, 2025
@joshtrichards
joshtrichards requested a review from a team as a code owner November 3, 2025 23:15
@joshtrichards joshtrichards added bug 3. to review Waiting for reviews labels Nov 3, 2025
@joshtrichards
joshtrichards requested review from ArtificialOwl and icewind1991 and removed request for a team November 3, 2025 23:15
@joshtrichards joshtrichards added the feature: database Database related DB label Nov 3, 2025
This was referenced Jan 7, 2026
This was referenced Jan 14, 2026
This was referenced Jan 29, 2026
This was referenced Feb 11, 2026
@blizzz blizzz modified the milestones: Nextcloud 33, Nextcloud 34 Feb 16, 2026
This was referenced Jun 5, 2026
@susnux susnux added the community pull requests from community label Jun 9, 2026
@susnux susnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
The schema assets filter previously used preg_match(... ) !== false, which treats 0 (no match) as true and caused non-matching assets to be accepted. Use preg_match(... ) === 1 so the filter only accepts actual matches and avoids false positives.

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards
joshtrichards force-pushed the jtr/db-pgsql-seq-filter branch from 8acbe3e to f880dfb Compare October 17, 2026 15:00
@joshtrichards joshtrichards added this to the Nextcloud 36 milestone Oct 17, 2026
@joshtrichards joshtrichards changed the title fix(db): make sure PgSqlTools filter only accepts actual matches fix(db): exclude schema assets without the configured table prefix Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug community pull requests from community feature: database Database related DB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants