Add ALGORITHM/LOCK support to Index operations#1057
Open
jamisonbryant wants to merge 3 commits into5.xfrom
Open
Add ALGORITHM/LOCK support to Index operations#1057jamisonbryant wants to merge 3 commits into5.xfrom
jamisonbryant wants to merge 3 commits into5.xfrom
Conversation
Extend the ALGORITHM and LOCK clause support added in PR #955 for Column operations to also cover Index operations. This allows addIndex to pass algorithm and lock options through the fluent API on MySQL. Changes: - Add algorithm/lock properties, getters/setters to Index class - Wire algorithm/lock through getAddIndexInstructions in MysqlAdapter - Handle FULLTEXT indexes which use post-steps (inline the clause) - Add 9 tests mirroring the Column algorithm/lock test coverage
There was a problem hiding this comment.
Pull request overview
Extends MySQL ALTER TABLE ... ALGORITHM=... / LOCK=... support from column operations to index operations by adding algorithm/lock options to the Index value object and wiring them through MysqlAdapter alter-instruction generation (including FULLTEXT special-casing).
Changes:
- Add
algorithmandlockproperties + getters/setters + option mapping tosrc/Db/Table/Index.php. - Pass index algorithm/lock options through
MysqlAdapter::getAddIndexInstructions()(including FULLTEXT post-step handling). - Add MySQL adapter integration tests for index algorithm/lock behaviors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
tests/TestCase/Db/Adapter/MysqlAdapterTest.php |
Adds new MySQL integration tests for index algorithm/lock options and batched behavior. |
src/Db/Table/Index.php |
Introduces algorithm/lock as supported index options via new properties and setters/getters. |
src/Db/Adapter/MysqlAdapter.php |
Wires algorithm/lock from Index into AlterInstructions and FULLTEXT SQL generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
markstory
reviewed
Mar 26, 2026
Verify that ALGORITHM and LOCK clauses appear in generated SQL using verbose logging, and exercise the fluent Column/Index builder path for both column and index operations.
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.
Summary
Extends the
ALGORITHMandLOCKclause support added in #955 (for Column operations) to also cover Index operations. This allowsaddIndexto pass algorithm and lock options through the fluent API on MySQL.Usage:
Changes:
algorithmandlockproperties, getters/setters, and valid options toIndexclassIndexthroughgetAddIndexInstructions()inMysqlAdapterNote: Drop index operations are out of scope, matching Column behavior where
getDropColumnInstructionsalso does not support algorithm/lock (the method signature only receives string parameters, not the object).Test plan
composer stan)