Skip to content

Commit 313a79e

Browse files
authored
Merge pull request #262 from dbsid/enable-clustered-index-for-both-mysql-tidb-driver
make sure clustered index is enabled for tidb/mysql driver by default
2 parents 12d3420 + 43d788e commit 313a79e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/mysql/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ func (db *mysqlDB) createTable(driverName string) error {
165165
s := fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (YCSB_KEY VARCHAR(64) PRIMARY KEY", tableName)
166166
buf.WriteString(s)
167167

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

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

0 commit comments

Comments
 (0)