From 246caf0e3a427a5c37487b51e42f38ed9ec50c49 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 6 Oct 2024 10:09:55 +0300 Subject: [PATCH] MySQL errors: `ERInnodbIndexCorrupt` (#16851) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/mysql/sqlerror/constants.go | 1 + go/vt/vttablet/tabletserver/tabletserver.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go/mysql/sqlerror/constants.go b/go/mysql/sqlerror/constants.go index a61239ce17b..ce4b38d3fda 100644 --- a/go/mysql/sqlerror/constants.go +++ b/go/mysql/sqlerror/constants.go @@ -123,6 +123,7 @@ const ( ErSPNotVarArg = ErrorCode(1414) ERRowIsReferenced2 = ErrorCode(1451) ErNoReferencedRow2 = ErrorCode(1452) + ERInnodbIndexCorrupt = ErrorCode(1817) ERDupIndex = ErrorCode(1831) ERInnodbReadOnly = ErrorCode(1874) diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index 4936516be72..75cd5dec08e 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -1620,7 +1620,7 @@ func convertErrorCode(err error) vtrpcpb.Code { sqlerror.ERTooLongString, sqlerror.ERDelayedInsertTableLocked, sqlerror.ERDupUnique, sqlerror.ERRequiresPrimaryKey, sqlerror.ERCantDoThisDuringAnTransaction, sqlerror.ERReadOnlyTransaction, sqlerror.ERCannotAddForeign, sqlerror.ERNoReferencedRow, sqlerror.ERRowIsReferenced, sqlerror.ERCantUpdateWithReadLock, sqlerror.ERNoDefault, sqlerror.EROperandColumns, sqlerror.ERSubqueryNo1Row, sqlerror.ERNonUpdateableTable, sqlerror.ERFeatureDisabled, sqlerror.ERDuplicatedValueInType, sqlerror.ERRowIsReferenced2, - sqlerror.ErNoReferencedRow2, sqlerror.ERWarnDataOutOfRange: + sqlerror.ErNoReferencedRow2, sqlerror.ERWarnDataOutOfRange, sqlerror.ERInnodbIndexCorrupt: errCode = vtrpcpb.Code_FAILED_PRECONDITION case sqlerror.EROptionPreventsStatement: errCode = vtrpcpb.Code_CLUSTER_EVENT