Fixed FOR UPDATE for each dialects #290
This commit is contained in:
parent
e89f74daa0
commit
693501fd60
|
@ -509,6 +509,10 @@ func (db *mssql) CreateTableSql(table *core.Table, tableName, storeEngine, chars
|
|||
return sql
|
||||
}
|
||||
|
||||
func (db *mssql) ForUpdateSql(query string) string {
|
||||
return query
|
||||
}
|
||||
|
||||
func (db *mssql) Filters() []core.Filter {
|
||||
return []core.Filter{&core.IdFilter{}, &core.QuoteFilter{}}
|
||||
}
|
||||
|
|
|
@ -250,6 +250,10 @@ func (db *sqlite3) DropIndexSql(tableName string, index *core.Index) string {
|
|||
return fmt.Sprintf("DROP INDEX %v", quote(idxName))
|
||||
}
|
||||
|
||||
func (db *sqlite3) ForUpdateSql(query string) string {
|
||||
return query
|
||||
}
|
||||
|
||||
/*func (db *sqlite3) ColumnCheckSql(tableName, colName string) (string, []interface{}) {
|
||||
args := []interface{}{tableName}
|
||||
sql := "SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`" + colName + "`%') or (sql like '%[" + colName + "]%'))"
|
||||
|
|
|
@ -1283,7 +1283,7 @@ func (statement *Statement) genSelectSql(columnStr string) (a string) {
|
|||
}
|
||||
}
|
||||
if statement.IsForUpdate {
|
||||
a += " FOR UPDATE"
|
||||
a = statement.Engine.dialect.ForUpdateSql(a)
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue