1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-14 01:41:01 +00:00

fix unquoted identifier that may be misleading in postgres

Signed-off-by: Penghui Liao <liaoishere@gmail.com>
This commit is contained in:
Penghui Liao
2018-05-04 16:15:50 +08:00
parent c9b6e4f825
commit 0dff771707
3 changed files with 8 additions and 3 deletions

View File

@ -536,6 +536,8 @@ func (d *dbBase) InsertOrUpdate(q dbQuerier, mi *modelInfo, ind reflect.Value, a
updates := make([]string, len(names))
var conflitValue interface{}
for i, v := range names {
// identifier in database may not be case-sensitive, so quote it
v = fmt.Sprintf("%s%s%s", Q, v, Q)
marks[i] = "?"
valueStr := argsMap[strings.ToLower(v)]
if v == args0 {