Repository navigation
fix(db): restore missing sb_bans composite indexes - #79
Merged
Merged
Conversation
Port of upstream sbpp#1605 (584ef2e). `702.php` adds `type_authid` / `type_ip` on `:prefix_bans`, but some long-lived installs carry a `config.version` past 702 without them, so 702 never runs there. Add a migration that creates both indexes idempotently (portable information_schema probe, no MariaDB-only `ADD INDEX IF NOT EXISTS`). Fork adaptations: - upstream's migration 812 lands as 815 (811-814 are taken here); - the `PruneBans()` half of the upstream fix (dropping the FORCE INDEX hints that fatal with error 1176 without the indexes) is not needed: this fork's PruneBans() never had the hints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dexes # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of upstream sbpp#1605.
Problem
702.phpadds thetype_authid/type_ipindexes on:prefix_bans, but some long-lived installs carry aconfig.versionpast 702 without them, so the migration never runs there. Upstream it madePruneBans()fatal (FORCE INDEX, error 1176). This fork'sPruneBans()never had the hints, so here it's "only" a full-table scan on every ban check / banlist / PruneBans.Fix
Updater migration 815 (upstream's 812; 811-814 are taken here) creates both indexes idempotently through an
information_schemaprobe (portable, no MariaDB-onlyIF NOT EXISTS). Fresh installs already get them fromstruc.sql.Tests
Updater815BansIndexesTest(drops the indexes, runs PruneBans, runs the migration twice) +UpdaterMigrationPortableSqlTest: OK.Merge before the plugin PR: that one adds migration 816 and is stacked on this branch.
CHANGELOG: 2.2.3-srcdslab (run updater required).