diff --git a/dialect_common.go b/dialect_common.go index 1554151c..8f7021a8 100644 --- a/dialect_common.go +++ b/dialect_common.go @@ -31,7 +31,7 @@ func (s *commonDialect) SetDB(db SQLCommon) { } func (commonDialect) BindVar(i int) string { - return "$$" // ? + return "$$$" // ? } func (commonDialect) Quote(key string) string { diff --git a/dialects/mssql/mssql.go b/dialects/mssql/mssql.go index f9087495..c5995762 100644 --- a/dialects/mssql/mssql.go +++ b/dialects/mssql/mssql.go @@ -50,7 +50,7 @@ func (s *mssql) SetDB(db gorm.SQLCommon) { } func (mssql) BindVar(i int) string { - return "$$" // ? + return "$$$" // ? } func (mssql) Quote(key string) string { diff --git a/scope.go b/scope.go index 29cb01b2..9a237998 100644 --- a/scope.go +++ b/scope.go @@ -340,7 +340,7 @@ func (scope *Scope) CombinedConditionSql() string { // Raw set raw sql func (scope *Scope) Raw(sql string) *Scope { - scope.SQL = strings.Replace(sql, "$$", "?", -1) + scope.SQL = strings.Replace(sql, "$$$", "?", -1) return scope } diff --git a/test_all.sh b/test_all.sh index 7e752051..80b319bf 100755 --- a/test_all.sh +++ b/test_all.sh @@ -1,4 +1,4 @@ -dialects=("postgres" "mysql" "sqlite" "mssql") +dialects=("postgres" "mysql" "mssql" "sqlite") for dialect in "${dialects[@]}" ; do GORM_DIALECT=${dialect} go test