[go-nuts] Re: How could I do bulk insert with "INSERT INTO xxx(..) VALUE(?,?,?),(?,?,?),(?,?,?) ON DUPLICATE KEY UPDATE xxx=?,xxx=?;"

2016-11-28 Thread mworks092
Ok, I got the answer. First I prepared the VALUES(?,?) by putting the (?,?,?) together. Second, using vals of type []interface{} I can append every member of the DataAccessObject to vals like: vals = append(vals, np.Port). Finally all things have been done with normal stmt, err := db.Prepare(),

[go-nuts] How could I do bulk insert with "INSERT INTO xxx(..) VALUE(?,?,?),(?,?,?),(?,?,?) ON DUPLICATE KEY UPDATE xxx=?,xxx=?;"

2016-11-28 Thread mworks092
Hi everyone! I met a problem in my project where I want to do INSERT ON DUPLICATE KEY UPDATE with around 3,000 records once. It seems like golang didn't support bulk insert . I was confused if it will lead MySQL inject risk if I just do put the sql pieces together, it will looks like: stmt

[go-nuts] Re: src/log/log.go: What makes it expensive in this code of log.go?

2016-09-06 Thread mworks092
Yes I closed the issue on github. How about discuss about it here 在 2016年9月7日星期三 UTC+8上午5:33:50,Benjamin Measures写道: > > Link to the discussion moved from github: issue #17003 > > -- You received this message because you are subscribed to the Google G

[go-nuts] src/log/log.go: What makes it expensive in this code of log.go?

2016-09-06 Thread mworks092
Hey, It's commented "release lock while getting caller info - it's expensive" in source code of /src/log/log.go line:150. I'm confused with what makes it expensive if we didn't unlock the l.mu ? Does goroutines have context ? func (l *Logger) Output(calldepth int, s string) error { now :=