Skip to content

Commit

Permalink
Handle error conversion code
Browse files Browse the repository at this point in the history
Signed-off-by: Dirkjan Bussink <[email protected]>
  • Loading branch information
dbussink committed Jul 24, 2024
1 parent fd5ca47 commit 427d137
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/mysql/sqlerror/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ const (
ERDupIndex = ErrorCode(1831)
ERInnodbReadOnly = ErrorCode(1874)

ERVectorConversion = ErrorCode(6138)

// already exists
ERDbCreateExists = ErrorCode(1007)
ERTableExists = ErrorCode(1050)
Expand Down
1 change: 1 addition & 0 deletions go/mysql/sqlerror/sql_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ var stateToMysqlCode = map[vterrors.State]mysqlCode{
vterrors.KillDeniedError: {num: ERKillDenied, state: SSUnknownSQLState},
vterrors.BadNullError: {num: ERBadNullError, state: SSConstraintViolation},
vterrors.InvalidGroupFuncUse: {num: ERInvalidGroupFuncUse, state: SSUnknownSQLState},
vterrors.VectorConversion: {num: ERVectorConversion, state: SSUnknownSQLState},
}

func getStateToMySQLState(state vterrors.State) mysqlCode {
Expand Down
2 changes: 2 additions & 0 deletions go/vt/vterrors/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ const (
CharacterSetMismatch
WrongParametersToNativeFct

VectorConversion

// No state should be added below NumOfStates
NumOfStates
)
Expand Down
1 change: 1 addition & 0 deletions go/vt/vttablet/tabletmanager/vreplication/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func isUnrecoverableError(err error) bool {
sqlerror.ERWrongParametersToProcedure,
sqlerror.ERWrongUsage,
sqlerror.ERWrongValue,
sqlerror.ERVectorConversion,
sqlerror.ERWrongValueCountOnRow:
log.Errorf("Got unrecoverable error: %v", sqlErr)
return true
Expand Down

0 comments on commit 427d137

Please sign in to comment.