fix: 导出数据库时获取表结构失败

原因是表名为 group, 应在表名前后添加 `` 符号
This commit is contained in:
wanli
2023-09-04 09:09:56 +08:00
parent b9c6ac8d6d
commit eee6cf7b14

View File

@@ -152,7 +152,8 @@ func (mm *MysqlMetadata) GetTableIndex(tableName string) []Index {
// 获取建表ddl
func (mm *MysqlMetadata) GetCreateTableDdl(tableName string) string {
_, res, _ := mm.di.SelectData(fmt.Sprintf("show create table %s ", tableName))
_, res, err := mm.di.SelectData(fmt.Sprintf("show create table `%s` ", tableName))
biz.ErrIsNilAppendErr(err, "获取表结构失败: %s")
return res[0]["Create Table"].(string)
}