|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2000-07-20 19:15 UTC] sterling at cvs dot php dot net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 10:00:02 2025 UTC | 
I saw this problem mentioned in a mailing list before, but couldn't find a bug report, so here goes. If you do a second (non-persistent) connect to the same database/user/password combo, the returned value gets its type set to IS_LONG instead of IS_RESOURCE, so subsequent queries fail with a 'Supplied argument is not a valid Sybase-Link resource' The return type used to be IS_LONG (and still is in the Sybase dblib code), but the ctlib code was changed to use ZEND_REGISTER_RESOURCE, which sets the type to IS_RESOURCE. The code that fetches a previously used link resource sets the return_value type to IS_LONG. The persistent connect code always calls ZEND_REGISTER_RESOURCE, the non-persistent code only calls it for a new connection. The patch below is in php_sybase_do_connect in php_sybase_ct.c. *** php_sybase_ct.c.orig Thu Jul 20 10:36:22 2000 --- php_sybase_ct.c Thu Jul 20 10:38:16 2000 *************** *** 559,565 **** ptr = zend_list_find(link,&type); /* check if the link is still there */ if (ptr && (type==sybase_globals.le_link || type==sybase_globals.le_plink)) { return_value->value.lval = sybase_globals.default_link = link; ! return_value->type = IS_LONG; efree(hashed_details); return; } else { --- 559,565 ---- ptr = zend_list_find(link,&type); /* check if the link is still there */ if (ptr && (type==sybase_globals.le_link || type==sybase_globals.le_plink)) { return_value->value.lval = sybase_globals.default_link = link; ! return_value->type = IS_RESOURCE; efree(hashed_details); return; } else {