bug with addname
This commit is contained in:
parent
3a7d947480
commit
9f61d483ae
2
obj.go
2
obj.go
@ -266,7 +266,7 @@ func setObjSubTypeId(objId int64, objSubTypeID64 int64) error {
|
||||
|
||||
func objAddName(objID64 int64, name string) error {
|
||||
stmt, err := db.Prepare(`INSERT INTO obj_name (obj_id, name, priority)
|
||||
SELECT ? obj_id, ? name, (SELECT MAX(priority) + 1 FROM obj_name WHERE obj_id = ?) priority FROM DUAL;`)
|
||||
SELECT ? obj_id, ? name, COALESCE(SELECT MAX(priority) + 1 FROM obj_name WHERE obj_id = ?), 0) priority FROM DUAL;`)
|
||||
|
||||
_, err = stmt.Exec(objID64, name, objID64)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user