[freetds] FreeTDS 0.61 broken with Sybase

Alex Kiesel alex.kiesel at document-root.de
Thu Jun 26 16:55:23 EDT 2003


On Wed, 2003-06-25 at 23:02, Lowden, James K wrote:
> > From: Alex Kiesel [mailto:alex.kiesel at document-root.de]
> > Sent: June 25, 2003 3:37 PM
> > 
> > I am currently experiencing some trouble with FreeTDS. Since 
> > between the
> > two latest releases (0.60 vs. 0.61.*) the handling of stored 
> > procedures seems to be borked.
> 
> Alex, 
> 
> Is it feasible for you to use a recent snapshot?  We noticed some problems
> with stored procedures that don't return a result set; those have been fixed
> since 0.61.1.    

Again, after testing with PHP5 (out of todays CVS), and todays
freetds-current (0.61.dev.20030626) and looking a little bit into PHP
Sybase handling code, I see the following when selecting an empty
resultset:

* ct_results is called, it gives restype 4047 (TDS_CMD_SUCCEED)
  fetching of any data except for
  ct_res_info(sybase_ptr->cmd, CS_ROW_COUNT, &row_count, ...)
  therefore does not take place. A CS_ROW_RESULT would be necessary even
  if it is an empty resultset.

* because PHP5 doesn't currently (and so in the past) support multiple
  resultsets, it breaks the whole loop and enters the next one which
  just expects an CS_END_DATA. In case of any other type, ct_cancel()
  will be called:
  ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT)

* this happens three times, each time the restype of the result was 4040
  (CS_ROW_RESULT).

Something has changed in the handling of an empty resultset, so in case
of an empty resultset a CS_CMD_SUCCESS, and when receiving 1+ rows
CS_ROW_RESULT is returned.


> I will try to reproduce your sqsh script with our current CVS version.  

Btw: this was a PHP script...

Greets,
Alex





More information about the FreeTDS mailing list