mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 15:30:25 +08:00
fix: 导出数据库时获取表结构失败
原因是表名为 group, 应在表名前后添加 `` 符号
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user