Skip to content

Commit

Permalink
make sure clustered index is enabled for tidb/mysql driver by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dbsid committed Dec 4, 2022
1 parent 12d3420 commit 43d788e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/mysql/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func (db *mysqlDB) createTable(driverName string) error {
s := fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (YCSB_KEY VARCHAR(64) PRIMARY KEY", tableName)
buf.WriteString(s)

if driverName == "tidb" && db.p.GetBool(tidbClusterIndex, true) {
buf.WriteString(" CLUSTERED")
if (driverName == "tidb" || driverName == "mysql") && db.p.GetBool(tidbClusterIndex, true) {
buf.WriteString(" /*T![clustered_index] CLUSTERED */")
}

for i := int64(0); i < fieldCount; i++ {
Expand Down

0 comments on commit 43d788e

Please sign in to comment.