Skip to content

Commit

Permalink
Merge pull request #262 from dbsid/enable-clustered-index-for-both-my…
Browse files Browse the repository at this point in the history
…sql-tidb-driver

make sure clustered index is enabled for tidb/mysql driver by default
  • Loading branch information
zyguan authored Dec 5, 2022
2 parents 12d3420 + 43d788e commit 313a79e
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 313a79e

Please sign in to comment.