[freetds] TDS and ldap

Lowden, James K LowdenJK at bernstein.com
Thu Apr 15 09:39:58 EDT 2004


> From: Nicolas Goy [mailto:goyman at goyman.com]
> Sent: April 15, 2004 3:49 AM
> To: FreeTDS Development Group
> Subject: Re: [freetds] TDS and ldap
> 
> > A TDSDUMP log would probably prove that right or wrong.  
> > 
> 
> You will find it at the end.

Good, thanks.  As Frediano says, there are two rows and only one is being read:

$ grep -E 'marker|state' ldap.txt |sed -ne'/^Creating/,/_END/p'
Creating prepared statement
09:30:50.462611 processing result tokens.  marker is  e7(TDS5_DYNAMIC)
09:30:50.462743 processing result tokens.  marker is  ee(RESULT)
09:30:50.464307 processing result tokens.  marker is  fd(DONE)
09:30:50.464493 tds_process_end() state set to TDS_IDLE
09:30:50.464575 tds_process_result_tokens() state is COMPLETED
09:30:50.476567 processing result tokens.  marker is  e7(TDS5_DYNAMIC)
09:30:50.476699 processing result tokens.  marker is  ee(RESULT)
09:30:50.478231 processing result tokens.  marker is  ae(CONTROL)
09:30:50.478316 tds_process_default_tokens() marker is ae(CONTROL)
09:30:50.478478 processing result tokens.  marker is  d1(ROW)
09:30:50.478775 processing row tokens.  marker is  d1(ROW)

		[That's row 1]

Creating prepared statement
tds_submit_query(): state is PENDING
Server operation with results pending.".  Connection state is now 1.

	[libtds correctly detects the application error]

09:30:50.483521 tds_process_default_tokens() marker is d1(ROW)

		[That's row 2]

09:30:50.485400 tds_process_default_tokens() marker is ff(DONEINPROC)
09:30:50.485672 tds_process_default_tokens() marker is fe(DONEPROC)
09:30:50.485857 tds_process_end() state set to TDS_IDLE

	[Now the proc is done and the session ready for Query #2]

09:30:50.495299 tds_process_end() state set to TDS_IDLE
09:30:50.505170 processing result tokens.  marker is  e7(TDS5_DYNAMIC)
09:30:50.505414 processing result tokens.  marker is  fd(DONE)
09:30:50.505612 tds_process_end() state set to TDS_IDLE
SQL engine state: 24000

> 1> select * from ldap_oc_mappings
> 2> go
> id      name    keytbl  keycol  create_proc     delete_proc 
> expect_return
> 1       organizationalUnit      orgunit id      NULL    NULL    0
> 2       inetOrgPerson   contacts        id      NULL    NULL    0

The rule with all TDS servers is that all results must be read from the server (or cancelled) before a new query is initiated.  It is possible to get around that with cursors, I think, but it's hardly ever worth it.  

It sounds like an interesting project.  Hope this helps.  

Regards, 

--jkl

-----------------------------------------
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.
If you, as the intended recipient of this message, the purpose of which is to inform and update our clients, prospects and consultants of developments relating to our services and products, would not like to receive further e-mail correspondence from the sender, please "reply" to the sender indicating your wishes.  In the U.S.: 1345 Avenue of the Americas, New York, NY 10105.





More information about the FreeTDS mailing list