vitessio/vitess · error
strict index ordering is unsupported
Error message
strict index ordering is unsupported
What it means
ErrStrictIndexOrderingUnsupported is returned when the requested diff operation requires strict preservation of index ordering, which the schemadiff engine does not support. Index comparison in Vitess is order-insensitive, so a diff that depends on exact index ordinality cannot be honored.
Source
Thrown at go/vt/schemadiff/errors.go:30
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package schemadiff
import (
"errors"
"fmt"
"strings"
"vitess.io/vitess/go/sqlescape"
"vitess.io/vitess/go/vt/sqlparser"
)
var (
ErrEntityTypeMismatch = errors.New("mismatched entity type")
ErrStrictIndexOrderingUnsupported = errors.New("strict index ordering is unsupported")
ErrUnexpectedDiffAction = errors.New("unexpected diff action")
ErrUnexpectedTableSpec = errors.New("unexpected table spec")
ErrExpectedCreateTable = errors.New("expected a CREATE TABLE statement")
ErrExpectedCreateView = errors.New("expected a CREATE VIEW statement")
)
type ImpossibleApplyDiffOrderError struct {
UnorderedDiffs []EntityDiff
ConflictingDiffs []EntityDiff
}
func (e *ImpossibleApplyDiffOrderError) Error() string {
var b strings.Builder
conflictingStatements := e.ConflictingStatements()
fmt.Fprintf(&b, "no valid applicable order for diffs. %d diffs found conflicting:", len(conflictingStatements))
for _, s := range conflictingStatements {
b.WriteString("\n")
b.WriteString(s)View on GitHub (pinned to 01a25a7d17)
Solutions
- Compare indexes without strict ordering (use the default diff behavior)
- Normalize index order in both schemas before diffing
- Apply the generated diff instead of expecting identical DDL text
Defensive patterns
Strategy: validation
Validate before calling
if !indexOrdersMatch(a, b) { return fmt.Errorf("strict index ordering required but differs: %w", schemadiff.ErrStrictIndexOrderingUnsupported) } Try / catch
if err != nil {
if errors.Is(err, schemadiff.ErrStrictIndexOrderingUnsupported) {
// fall back to non-strict diff
}
} Prevention
- Normalize index declaration order in schema files
- Do not rely on index ordinality for equality
- Rely on generated diffs rather than byte-identical DDL
When it happens
Trigger: Requesting a diff mode that demands strict index ordering between two CREATE TABLE entities whose indexes have the same content but different declaration order.
Common situations: Comparing schemas where ALTERs over time reordered index definitions; teams expecting byte-exact DDL output for equal-but-reordered indexes.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- mismatched entity type
- unexpected diff action
- unexpected table spec
- expected a CREATE TABLE statement
- expected a CREATE VIEW statement
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/5507d55f975998f3.
Report an issue: GitHub.