Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dbm-services): adapt tdbctl init sqls #956

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ func (i *InstallMySQLComp) InitDefaultPrivAndSchema() (err error) {
// 拼接tdbctl session级命令,初始化session设置tc_admin=0
if strings.Contains(i.Params.Pkg, "tdbctl") {
initSQLs = append(initSQLs, "set tc_admin = 0;")
initSQLs = append(initSQLs, staticembed.SpiderInitSQL)
}

if bsql, err = staticembed.DefaultSysSchemaSQL.ReadFile(staticembed.DefaultSysSchemaSQLFileName); err != nil {
Expand All @@ -725,6 +724,10 @@ func (i *InstallMySQLComp) InitDefaultPrivAndSchema() (err error) {
if len(initSQLs) < 2 {
return fmt.Errorf("初始化sql为空%v", initSQLs)
}
if strings.Contains(i.Params.Pkg, "tdbctl") {
initSQLs = append(initSQLs, staticembed.SpiderInitSQL)
}

// 调用 mysql-monitor 里的主从复制延迟检查心跳表, infodba_schema.master_slave_heartbeat
initSQLs = append(initSQLs, masterslaveheartbeat.DropTableSQL, masterslaveheartbeat.CreateTableSQL)

Expand Down