Skip to content

Commit

Permalink
session: fix tables_priv table schema (#33599)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Mar 30, 2022
1 parent d4ec947 commit e15e6d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ const (
version84 = 84
// version85 updates bindings with status 'using' in mysql.bind_info table to 'enabled' status
version85 = 85
// version86 update mysql.tables_priv from SET('Select','Insert','Update') to SET('Select','Insert','Update','References').
version86 = 86
)

// currentBootstrapVersion is defined as a variable, so we can modify its value for testing.
Expand Down Expand Up @@ -676,6 +678,7 @@ var (
upgradeToVer83,
upgradeToVer84,
upgradeToVer85,
upgradeToVer86,
}
)

Expand Down Expand Up @@ -1752,6 +1755,13 @@ func upgradeToVer85(s Session, ver int64) {
mustExecute(s, fmt.Sprintf("UPDATE HIGH_PRIORITY mysql.bind_info SET status= '%s' WHERE status = '%s'", bindinfo.Enabled, bindinfo.Using))
}

func upgradeToVer86(s Session, ver int64) {
if ver >= version86 {
return
}
doReentrantDDL(s, "ALTER TABLE mysql.tables_priv MODIFY COLUMN Column_priv SET('Select','Insert','Update','References')")
}

func writeOOMAction(s Session) {
comment := "oom-action is `log` by default in v3.0.x, `cancel` by default in v4.0.11+"
mustExecute(s, `INSERT HIGH_PRIORITY INTO %n.%n VALUES (%?, %?, %?) ON DUPLICATE KEY UPDATE VARIABLE_VALUE= %?`,
Expand Down

0 comments on commit e15e6d0

Please sign in to comment.