Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-02 Thread sagar puneria
Thank you for investigating. On Friday, February 1, 2019 at 3:01:35 PM UTC+5:30, Inada Naoki wrote: > > Hello, I'm one of maintainer of go-sql-driver/mysql. > > When there is only one result set, you don't need NextResultSet(). > See this example. > > https://play.golang.org/p/rhm4Xp6WejB > > Then

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread Lutz Horn
So your example may be unexpected behavior (or bug) of lib/pq. Please file an issue report on lib/pq. Done: https://github.com/lib/pq/issues/828 Lutz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread INADA Naoki
> > That's interesting! > > Does the code of NextResultSet from sql.go shed any light on this? > > https://golang.org/src/database/sql/sql.go?s=76505:76541#L2684 > > Lutz No. I read it multiple times already. I found test for NextResultSet() in lib/pq. https://github.com/lib/pq/blob/0ac245bc3be

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread Lutz Horn
After reading Lutz's sample code. I found lib/pq has different semantics. I'm not sure which is the right semantics, intended by database/sql APIs. That's interesting! Does the code of NextResultSet from sql.go shed any light on this? https://golang.org/src/database/sql/sql.go?s=76505:76541#L

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread Inada Naoki
> > After reading Lutz's sample code. I found lib/pq has different semantics. > I'm not sure which is the right semantics, intended by database/sql APIs. > > https://golang.org/pkg/database/sql/driver/#RowsNextResultSet // NextResultSet advances the driver to the next result set even

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-02-01 Thread Naoki INADA
Hello, I'm one of maintainer of go-sql-driver/mysql. When there is only one result set, you don't need NextResultSet(). See this example. https://play.golang.org/p/rhm4Xp6WejB Then, when you have multi result set, you need to call NextResultSet() once to get 2nd result set. See this example. h

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-01-31 Thread Lutz Horn
Then why this method is not works as expected using github.com/go-sql-driver/mysql for MySQL. It would have helped me if you'd have mentioned MySQL in your question. Your question was incomplete. Please take alook at http://www.catb.org/esr/faqs/smart-questions.html Take a look at this: htt

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-01-31 Thread sagar puneria
Then why this method is not works as expected using github.com/go-sql-driver/mysql for MySQL. Take a look at this: https://play.golang.org/p/tCLKxiXPZ5e On Thursday, January 31, 2019 at 1:37:01 PM UTC+5:30, Lutz Horn wrote: > > Hi, > > > I just want to know in which case NextResultSet > >

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-01-31 Thread sagar puneria
Then why this method is works as expected using github.com/go-sql-driver/mysql for MySQL. Take a look at this: https://play.golang.org/p/tCLKxiXPZ5e On Thursday, January 31, 2019 at 1:37:01 PM UTC+5:30, Lutz Horn wrote: > > Hi, > > > I just want to know in which case NextResultSet > >

Re: [go-nuts] database/sql: NextResultSet API always return false

2019-01-31 Thread Lutz Horn
Hi, I just want to know in which case NextResultSet return true? This method works as expected using github.com/lib/pq for PostgreSQL. Take a lookt at this: https://gist.github.com/lutzhorn/1aa7de538d1edd0b3904799b5bb972fd The outpu

[go-nuts] database/sql: NextResultSet API always return false

2019-01-30 Thread sagar puneria
I just want to know in which case NextResultSet return true? I tried all the cases it is always returning false. If so then what is use case of implementing NextResultSet ? Coul