Experiment: removing LOCK IN SHARE MODE

This commit is contained in:
Shlomi Noach 2018-02-11 15:54:51 +02:00
parent 4390c854ca
commit 19e00e5ddc

View File

@ -214,18 +214,14 @@ func BuildRangeInsertQuery(databaseName, originalTableName, ghostTableName strin
return "", explodedArgs, err
}
explodedArgs = append(explodedArgs, rangeExplodedArgs...)
transactionalClause := ""
if transactionalTable {
transactionalClause = "lock in share mode"
}
result = fmt.Sprintf(`
insert /* gh-ost %s.%s */ ignore into %s.%s (%s)
(select %s from %s.%s force index (%s)
where (%s and %s) %s
where (%s and %s)
)
`, databaseName, originalTableName, databaseName, ghostTableName, mappedSharedColumnsListing,
sharedColumnsListing, databaseName, originalTableName, uniqueKey,
rangeStartComparison, rangeEndComparison, transactionalClause)
rangeStartComparison, rangeEndComparison)
return result, explodedArgs, nil
}