From 3c599b60ab7216257c90e3c737fa02e457d68dc6 Mon Sep 17 00:00:00 2001 From: ymakedaq <996156275@qq.com> Date: Fri, 1 Sep 2023 11:09:51 +0800 Subject: [PATCH] fix(dbm-services): adapt tdbctl init sqls close #954 --- .../dbactuator/pkg/components/mysql/install_mysql.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go index 1a67f53aa4..1105443cee 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/install_mysql.go @@ -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 { @@ -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)