Skip to content

Commit 9df5db7

Browse files
[release-23.0] VReplication: Treat ER_BINLOG_CREATE_ROUTINE_NEED_SUPER as unrecoverable (#18784) (#18820)
Signed-off-by: Matt Lord <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Vaillancourt <[email protected]>
1 parent 863fb11 commit 9df5db7

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

go/mysql/sqlerror/constants.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ const (
8484
ERKeyDoesNotExist = ErrorCode(1176)
8585

8686
// permissions
87-
ERDBAccessDenied = ErrorCode(1044)
88-
ERAccessDeniedError = ErrorCode(1045)
89-
ERKillDenied = ErrorCode(1095)
90-
ERNoPermissionToCreateUsers = ErrorCode(1211)
91-
ERSpecifiedAccessDenied = ErrorCode(1227)
87+
ERDBAccessDenied = ErrorCode(1044)
88+
ERAccessDeniedError = ErrorCode(1045)
89+
ERKillDenied = ErrorCode(1095)
90+
ERNoPermissionToCreateUsers = ErrorCode(1211)
91+
ERSpecifiedAccessDenied = ErrorCode(1227)
92+
ERBinlogCreateRoutineNeedSuper = ErrorCode(1419)
9293

9394
// failed precondition
9495
ERNoDb = ErrorCode(1046)

go/vt/vttablet/tabletmanager/vreplication/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ func isUnrecoverableError(err error) bool {
214214
sqlerror.ErrWrongValueForType,
215215
sqlerror.ERSPDoesNotExist,
216216
sqlerror.ERSpecifiedAccessDenied,
217+
sqlerror.ERBinlogCreateRoutineNeedSuper,
217218
sqlerror.ERSyntaxError,
218219
sqlerror.ERTooBigRowSize,
219220
sqlerror.ERTooBigSet,

go/vt/vttablet/tabletmanager/vreplication/utils_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ func TestIsUnrecoverableError(t *testing.T) {
161161
err: sqlerror.NewSQLError(sqlerror.ERErrorDuringCommit, "unknown", "ERROR HY000: Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT"),
162162
expected: false,
163163
},
164+
{
165+
name: "SQL error with ERBinlogCreateRoutineNeedSuper",
166+
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)\""),
167+
expected: true,
168+
},
164169
}
165170
for _, tc := range testCases {
166171
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)