Skip to content

Commit

Permalink
add debug log
Browse files Browse the repository at this point in the history
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
  • Loading branch information
ystaticy committed May 24, 2024
1 parent 9fa525f commit 1a740ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/util/dbutil/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,16 @@ func GetKeyspaceNameFromTiDB(db *sql.DB) (string, error) {
return "", nil
}

getConfigTableSQL := "select TABLE_NAME from INFORMATION_SCHEMA . TABLES where TABLE_SCHEMA ='INFORMATION_SCHEMA' and TABLE_NAME ='CLUSTER_CONFIG'"
rows, err := db.Query(getConfigTableSQL)

if !rows.Next() {
return "", nil
}

sql := "select * from INFORMATION_SCHEMA.CLUSTER_CONFIG where TYPE='tidb'"
log.Info("GetKeyspaceNameFromTiDB", zap.String("sql", sql))
rows, err := db.Query(sql)
rows, err = db.Query(sql)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 1a740ef

Please sign in to comment.