mirror of https://github.com/go-gorm/gorm.git
Change bind var to 24652$ to avoid possible confliction
This commit is contained in:
parent
d7c35d5141
commit
2a041971f9
|
@ -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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
2
scope.go
2
scope.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue