support WHERE predicate in indexes#2743
Conversation
|
|
Ito Test Report ❌13 test cases ran. 2 failed, 11 passed. Overall, 11 of 13 tests passed, confirming expected behavior for partial-index creation and enforcement, planner predicate-aware index usage, migration-batch failure visibility, concurrent duplicate-name index creation, and most catalog and replica-identity compatibility checks under real SQL engine paths (with only auth/bootstrap bypassed for deterministic local setup). The two validated regressions introduced by this PR are: a medium-severity catalog DDL rendering bug that truncates dotted/qualified index expressions in pg_get_indexdef/pg_indexes, and a high-severity ALTER TABLE REPLICA IDENTITY bug where commands return success but never persist state (relreplident remains default 'd'), risking incorrect schema diffing and replication assumptions. ❌ Failed (2)🟠 Dotted index expressions are truncated in catalog DDL
Relevant code:
cols := make([]string, len(index.Expressions()))
for i, expr := range index.Expressions() {
split := strings.Split(expr, ".")
if len(split) > 1 {
cols[i] = split[1]
} else {
cols[i] = expr
}
}
cols := make([]string, len(index.Expressions()))
for i, expr := range index.Expressions() {
split := strings.Split(expr, ".")
if len(split) > 1 {
cols[i] = split[1]
} else {
cols[i] = expr
}
}
|
Ito Diff Report ❌Tested: Across 10 test cases, the unified run had mixed results with 5 passing and 5 confirmed medium-severity failures: core tuple/record NULL handling now behaved consistently in the covered record-expression scenarios, but significant SQL and introspection defects remain. The key issues were lossy index-definition rendering in pg_get_indexdef/pg_indexes that truncates dotted expressions, ALTER TABLE ... REPLICA IDENTITY succeeding as a silent no-op with no relreplident change, and tuple IN path inconsistencies/unsafety where malformed operands can hit internal interface-conversion failure paths and equivalent subquery or VALUES forms fail with bool-comparison errors while direct tuple forms do not. ❌ Failures (2)🟠 Index introspection truncates dotted expressions
Relevant code:
cols := make([]string, len(index.Expressions()))
for i, expr := range index.Expressions() {
split := strings.Split(expr, ".")
if len(split) > 1 {
cols[i] = split[1]
} else {
cols[i] = expr
}
}
cols := make([]string, len(index.Expressions()))
for i, expr := range index.Expressions() {
split := strings.Split(expr, ".")
if len(split) > 1 {
cols[i] = split[1]
} else {
cols[i] = expr
}
}🟠 Replica identity command silently performs no operation
Relevant code:
case *tree.AlterTableOwner:
unsupportedWarnings = append(unsupportedWarnings, fmt.Sprintf("ALTER TABLE %s OWNER TO %s", tableName.String(), cmd.Owner))
case *tree.AlterTableComputed:
return nil, nil, errors.New("This command does not currently support multiple actions in one statement")
case *tree.AlterTableSetStatistics:
// is unsupported and ignored
case *tree.AlterTableRowLevelSecurity:
// is unsupported and ignored
case *tree.AlterTableReplicaIdentity:
// is unsupported and ignored
default:
return nil, nil, errors.Errorf("ALTER TABLE with unsupported command type %T", cmd)
// If there are no valid statements return a no-op statement
if len(noOps) > 0 && len(statements) == 0 {
return NewNoOp(noOps...), nil
}
// Otherwise emit warnings now, then return an AlterTable statement
// TODO: we don't have a way to send or store the warnings alongside a valid AlterTable statement. We could either
// get a *sql.Context here and emit warnings, or we could store the warnings in the Context and make the caller
// emit them before it sends |ReadyForQuery|
return &vitess.AlterTable{
Table: tableName,
Statements: statements,
}, nil✅ Verified Passing (5)↪️ Inherited from Prior Run (11)
|




















No description provided.