diff --git a/go/vt/vterrors/code.go b/go/vt/vterrors/code.go index aeddacc4a1e..b2f83b898b8 100644 --- a/go/vt/vterrors/code.go +++ b/go/vt/vterrors/code.go @@ -82,7 +82,6 @@ var ( VT12001 = errorWithoutState("VT12001", vtrpcpb.Code_UNIMPLEMENTED, "unsupported: %s", "This statement is unsupported by Vitess. Please rewrite your query to use supported syntax.") VT12002 = errorWithoutState("VT12002", vtrpcpb.Code_UNIMPLEMENTED, "unsupported: cross-shard foreign keys", "Vitess does not support cross shard foreign keys.") - VT12003 = errorWithoutState("VT12002", vtrpcpb.Code_UNIMPLEMENTED, "unsupported: foreign keys management at vitess", "Vitess does not support managing foreign keys tables.") // VT13001 General Error VT13001 = errorWithoutState("VT13001", vtrpcpb.Code_INTERNAL, "[BUG] %s", "This error should not happen and is a bug. Please file an issue on GitHub: https://github.com/vitessio/vitess/issues/new/choose.") @@ -148,7 +147,6 @@ var ( VT10001, VT12001, VT12002, - VT12003, VT13001, VT13002, VT14001, diff --git a/go/vt/vtgate/planbuilder/operators/ast_to_update_op.go b/go/vt/vtgate/planbuilder/operators/ast_to_update_op.go index fc33b030c9a..f1efb5d2a0b 100644 --- a/go/vt/vtgate/planbuilder/operators/ast_to_update_op.go +++ b/go/vt/vtgate/planbuilder/operators/ast_to_update_op.go @@ -59,7 +59,7 @@ func createOperatorFromUpdate(ctx *plancontext.PlanningContext, updStmt *sqlpars // If the delete statement has a limit, we don't support it yet. if updStmt.Limit != nil { - return nil, vterrors.VT12001("foreign keys management at vitess with limit") + return nil, vterrors.VT12001("update with limit with foreign key constraints") } return buildFkOperator(ctx, updOp, updClone, parentFks, childFks, vindexTable) @@ -180,7 +180,7 @@ func getFKRequirementsForUpdate(ctx *plancontext.PlanningContext, updateExprs sq func buildFkOperator(ctx *plancontext.PlanningContext, updOp ops.Operator, updClone *sqlparser.Update, parentFks []vindexes.ParentFKInfo, childFks []vindexes.ChildFKInfo, updatedTable *vindexes.Table) (ops.Operator, error) { // We only support simple expressions in update queries for foreign key handling. if sqlparser.IsNonLiteral(updClone.Exprs) { - return nil, vterrors.VT12001("foreign keys management at vitess with non-literal values") + return nil, vterrors.VT12001("update expression with non-literal values with foreign key constraints") } restrictChildFks, cascadeChildFks := splitChildFks(childFks) diff --git a/go/vt/vtgate/planbuilder/operators/fk_cascade.go b/go/vt/vtgate/planbuilder/operators/fk_cascade.go index f4528694c39..a9afbde0a7c 100644 --- a/go/vt/vtgate/planbuilder/operators/fk_cascade.go +++ b/go/vt/vtgate/planbuilder/operators/fk_cascade.go @@ -102,5 +102,5 @@ func (fkc *FkCascade) GetOrdering() ([]ops.OrderBy, error) { // ShortDescription implements the Operator interface func (fkc *FkCascade) ShortDescription() string { - return "FkCascade" + return "" } diff --git a/go/vt/vtgate/planbuilder/operators/fk_verify.go b/go/vt/vtgate/planbuilder/operators/fk_verify.go index fdafa91a141..8c2431d26fc 100644 --- a/go/vt/vtgate/planbuilder/operators/fk_verify.go +++ b/go/vt/vtgate/planbuilder/operators/fk_verify.go @@ -76,5 +76,5 @@ func (fkv *FkVerify) GetOrdering() ([]ops.OrderBy, error) { // ShortDescription implements the Operator interface func (fkv *FkVerify) ShortDescription() string { - return "FkVerify" + return "" } diff --git a/go/vt/vtgate/planbuilder/testdata/foreignkey_cases.json b/go/vt/vtgate/planbuilder/testdata/foreignkey_cases.json index 5d11416b426..c7666a07bea 100644 --- a/go/vt/vtgate/planbuilder/testdata/foreignkey_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/foreignkey_cases.json @@ -786,17 +786,17 @@ { "comment": "update in a table with limit - disallowed", "query": "update u_tbl2 set col2 = 'bar' limit 2", - "plan": "VT12001: unsupported: foreign keys management at vitess with limit" + "plan": "VT12001: unsupported: update with limit with foreign key constraints" }, { "comment": "update in a table with non-literal value - set null fail due to child update where condition", "query": "update u_tbl2 set m = 2, col2 = col1 + 'bar' where id = 1", - "plan": "VT12001: unsupported: foreign keys management at vitess with non-literal values" + "plan": "VT12001: unsupported: update expression with non-literal values with foreign key constraints" }, { "comment": "update in a table with non-literal value - with cascade fail as the cascade value is not known", "query": "update u_tbl1 set m = 2, col1 = x + 'bar' where id = 1", - "plan": "VT12001: unsupported: foreign keys management at vitess with non-literal values" + "plan": "VT12001: unsupported: update expression with non-literal values with foreign key constraints" }, { "comment": "update in a table with a child table having SET DEFAULT constraint - disallowed", @@ -811,7 +811,7 @@ { "comment": "update with fk on cross-shard with a where condition on non-literal value - disallowed", "query": "update tbl3 set coly = colx + 10 where coly = 10", - "plan": "VT12001: unsupported: foreign keys management at vitess with non-literal values" + "plan": "VT12001: unsupported: update expression with non-literal values with foreign key constraints" }, { "comment": "update with fk on cross-shard with a where condition",