Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Dec 14, 2022
1 parent a678f60 commit 8b9a945
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ const (
modify_count bigint(64) NOT NULL,
count bigint(64) NOT NULL,
version bigint(64) NOT NULL comment 'stats version which corresponding to stats:version in EXPLAIN',
create_time datetime(6) NOT NULL,
source varchar(40) NOT NULL,
create_time datetime(6) NOT NULL,
UNIQUE KEY table_version (table_id, version),
KEY table_create_time (table_id, create_time)
);`
Expand Down Expand Up @@ -2198,7 +2198,7 @@ func upgradeToVer109(s Session, ver int64) {
if ver >= version109 {
return
}
doReentrantDDL(s, "ALTER TABLE mysql.stats_meta_history ADD COLUMN `source` varchar(40) NOT NULL after `version`;")
doReentrantDDL(s, "ALTER TABLE mysql.stats_meta_history ADD COLUMN IF NOT EXISTS `source` varchar(40) NOT NULL after `version`;")
}

func writeOOMAction(s Session) {
Expand Down
2 changes: 1 addition & 1 deletion session/bootstrap_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestUpgradeVersion84(t *testing.T) {
{"modify_count", "bigint(64)"},
{"count", "bigint(64)"},
{"version", "bigint(64)"},
{"source", "varchar(16)"},
{"source", "varchar(40)"},
{"create_time", "datetime(6)"},
}
rStatsHistoryTbl, err := tk.Exec(`desc mysql.stats_meta_history`)
Expand Down

0 comments on commit 8b9a945

Please sign in to comment.