Skip to content

Commit 238f79b

Browse files
authored
session: fix tables_priv table schema(33599) (pingcap#33600)
close pingcap#33588
1 parent 6f28ac4 commit 238f79b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

session/bootstrap.go

+10
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,8 @@ const (
583583
version84 = 84
584584
// version85 updates bindings with status 'using' in mysql.bind_info table to 'enabled' status
585585
version85 = 85
586+
// version86 update mysql.tables_priv from SET('Select','Insert','Update') to SET('Select','Insert','Update','References').
587+
version86 = 86
586588
)
587589

588590
// currentBootstrapVersion is defined as a variable, so we can modify its value for testing.
@@ -676,6 +678,7 @@ var (
676678
upgradeToVer83,
677679
upgradeToVer84,
678680
upgradeToVer85,
681+
upgradeToVer86,
679682
}
680683
)
681684

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

1758+
func upgradeToVer86(s Session, ver int64) {
1759+
if ver >= version86 {
1760+
return
1761+
}
1762+
doReentrantDDL(s, "ALTER TABLE mysql.tables_priv MODIFY COLUMN Column_priv SET('Select','Insert','Update','References')")
1763+
}
1764+
17551765
func writeOOMAction(s Session) {
17561766
comment := "oom-action is `log` by default in v3.0.x, `cancel` by default in v4.0.11+"
17571767
mustExecute(s, `INSERT HIGH_PRIORITY INTO %n.%n VALUES (%?, %?, %?) ON DUPLICATE KEY UPDATE VARIABLE_VALUE= %?`,

0 commit comments

Comments
 (0)