[freetds] FreeTDS 0.61 broken with Sybase

Alex Kiesel alex.kiesel at document-root.de
Fri Jun 27 05:04:31 EDT 2003


On Thu, 2003-06-26 at 23:45, Lowden, James K wrote:

> Let me see if I understand. I'm not a ct-lib programmer; I just read the
> docs and follow along.  
> 
> 1.	The command is executed and the result set empty.  The query might
> have been as simple as "select 1 where 0=1".  

Unluckily it's not as easy :) This query returns an empty resultset.
* With FreeTDS 0.61 PHP returns a boolean instead of a sybase result
  resource => unusable
* With yesterdays FreeTDS-current, a valid result resource is returned
  just as it should be :) It seems, this error has been fixed since
  then.

The problem however still exists when using stored procedures.

> 2. 	ct_results() is called, it gives restype 4047 (CS_CMD_SUCCEED).  It
> should return CS_ROW_RESULT.  
>   2a.	ct_res_info() should be called and should yield the number of
> columns.
>   2b.	ct_fetch should be called, and should return no rows.  
> 3. 	Instead, 2a & 2b do *not* happen.  

2a & 2b happen together, prerequisite, however, is that one receives one
of CS_COMPUTE_RESULT, CS_CURSOR_RESULT, CS_PARAM_RESULT, CS_ROW_RESULT
or CS_STATUS_RESULT.

Btw: ct_res_info called with CS_ROW_COUNT does never give the number of
rows, it's always -1 or 0.

> 4.	The next call to ct_results() returns a surprise to PHP, and bad
> things start to happen.  

Yes, this is caused by the fact that PHP only expects one resultset. 

Greets,
Alex




More information about the FreeTDS mailing list