[freetds] request to implement dbmorecmds for dblib

Lowden, James K LowdenJK at bernstein.com
Thu May 1 11:22:13 EDT 2003

> From: Bill Stewart [mailto:bstewart at verio.net]
> Sent: April 30, 2003 3:51 PM
> Let me know what else I might do to get dbmorecmds moving forward.


Your test is no good, yaar.  You have (abbreviated):

        while (dbmorecmds(dbproc)) {

but both vendors say dbmorecmds() "should be called after dbnextrow returns
NO_MORE_ROWS. If you know that the current command does not return any rows,
you can call dbmorecmds after dbresults returns SUCCEED."  

I wrote our dbmorecmd() conformant to that description.  If the above code
runs when linked with either vendor's library, let me know and maybe we can
establish empirically what they're doing.  Else you need a loop more like:

	if( dbresults(dbproc) == SUCCEED ) {
		do {
			while( dbnextrow(dbproc) != NO_MORE_ROWS.);
		} while( dbmorecmds(dbproc) == SUCCEED )

Recommend you grab a more recent snapshot and modify the test.  It will be
in tomorrow's snapshot as src/dblib/unittests/dbmorecmds.c.  

BTW, the query "select count(*) from #dblib0024 order by i" won't run on a
Microsoft server because 'i' isn't in the select list.  Apart from that,
it's a bit odd, ordering one row.  Were you trying to induce some particular

Using current CVS, 3 other dblib unit test also fail, complaining about
pending results.  So there may be protocol or state management issues
lurking, too.  I don't know yet.  



The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above.  If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.

More information about the FreeTDS mailing list