diff --git a/go/mysql/sqlerror/constants.go b/go/mysql/sqlerror/constants.go index 185f4862c91..9a89ee5fc0b 100644 --- a/go/mysql/sqlerror/constants.go +++ b/go/mysql/sqlerror/constants.go @@ -84,11 +84,12 @@ const ( ERKeyDoesNotExist = ErrorCode(1176) // permissions - ERDBAccessDenied = ErrorCode(1044) - ERAccessDeniedError = ErrorCode(1045) - ERKillDenied = ErrorCode(1095) - ERNoPermissionToCreateUsers = ErrorCode(1211) - ERSpecifiedAccessDenied = ErrorCode(1227) + ERDBAccessDenied = ErrorCode(1044) + ERAccessDeniedError = ErrorCode(1045) + ERKillDenied = ErrorCode(1095) + ERNoPermissionToCreateUsers = ErrorCode(1211) + ERSpecifiedAccessDenied = ErrorCode(1227) + ERBinlogCreateRoutineNeedSuper = ErrorCode(1419) // failed precondition ERNoDb = ErrorCode(1046) diff --git a/go/vt/vttablet/tabletmanager/vreplication/utils.go b/go/vt/vttablet/tabletmanager/vreplication/utils.go index efd744d5db3..20c797b75e7 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/utils.go +++ b/go/vt/vttablet/tabletmanager/vreplication/utils.go @@ -214,6 +214,7 @@ func isUnrecoverableError(err error) bool { sqlerror.ErrWrongValueForType, sqlerror.ERSPDoesNotExist, sqlerror.ERSpecifiedAccessDenied, + sqlerror.ERBinlogCreateRoutineNeedSuper, sqlerror.ERSyntaxError, sqlerror.ERTooBigRowSize, sqlerror.ERTooBigSet, diff --git a/go/vt/vttablet/tabletmanager/vreplication/utils_test.go b/go/vt/vttablet/tabletmanager/vreplication/utils_test.go index 2406796aace..b1d7b7d6d67 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/utils_test.go +++ b/go/vt/vttablet/tabletmanager/vreplication/utils_test.go @@ -161,6 +161,11 @@ func TestIsUnrecoverableError(t *testing.T) { err: sqlerror.NewSQLError(sqlerror.ERErrorDuringCommit, "unknown", "ERROR HY000: Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT"), expected: false, }, + { + name: "SQL error with ERBinlogCreateRoutineNeedSuper", + err: sqlerror.NewSQLError(sqlerror.ERBinlogCreateRoutineNeedSuper, "unknown", "error applying event: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) (errno 1419) (sqlstate HY000) during query: CREATE DEFINER=`root`@`localhost` TRIGGER upd_customer BEFORE UPDATE ON customer FOR EACH ROW SET @email = NEW.email + \" (updated)\""), + expected: true, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) {