Change bind var to 24652$ to avoid possible confliction

This commit is contained in:
Jinzhu 2017-04-18 16:13:02 +08:00
parent d7c35d5141
commit 2a041971f9
4 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ func (s *commonDialect) SetDB(db SQLCommon) {
} }
func (commonDialect) BindVar(i int) string { func (commonDialect) BindVar(i int) string {
return "$$" // ? return "$$$" // ?
} }
func (commonDialect) Quote(key string) string { func (commonDialect) Quote(key string) string {

View File

@ -50,7 +50,7 @@ func (s *mssql) SetDB(db gorm.SQLCommon) {
} }
func (mssql) BindVar(i int) string { func (mssql) BindVar(i int) string {
return "$$" // ? return "$$$" // ?
} }
func (mssql) Quote(key string) string { func (mssql) Quote(key string) string {

View File

@ -340,7 +340,7 @@ func (scope *Scope) CombinedConditionSql() string {
// Raw set raw sql // Raw set raw sql
func (scope *Scope) Raw(sql string) *Scope { func (scope *Scope) Raw(sql string) *Scope {
scope.SQL = strings.Replace(sql, "$$", "?", -1) scope.SQL = strings.Replace(sql, "$$$", "?", -1)
return scope return scope
} }

View File

@ -1,4 +1,4 @@
dialects=("postgres" "mysql" "sqlite" "mssql") dialects=("postgres" "mysql" "mssql" "sqlite")
for dialect in "${dialects[@]}" ; do for dialect in "${dialects[@]}" ; do
GORM_DIALECT=${dialect} go test GORM_DIALECT=${dialect} go test