[PHP-CVS] svn: /php/php-src/trunk/ext/sybase_ct/ php_sybase_ct.c
thekid Mon, 13 Jun 2011 08:43:21 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312115 Log: - Fix compiler warning about long vs. int in printf() # See bug #55009 # Compare to _server_message_handler() a little below, where this # is done the same way Bug: http://bugs.php.net/55009 (Feedback) Error when compile Changed paths: U php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2011-06-13 06:49:56 UTC (rev 312114) +++ php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2011-06-13 08:43:21 UTC (rev 312115) @@ -388,7 +388,7 @@ TSRMLS_FETCH(); if (CS_SEVERITY(errmsg-msgnumber) = SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %d), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %ld), errmsg-msgstring, (long)CS_SEVERITY(errmsg-msgnumber)); } STR_FREE(SybCtG(server_message)); SybCtG(server_message) = estrdup(errmsg-msgstring); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/sybase_ct/ php_sybase_ct.c
thekid Mon, 13 Jun 2011 08:45:21 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312116 Log: - MFH suppression of compiler warning noted in bug #55009 Bug: http://bugs.php.net/55009 (Feedback) Error when compile Changed paths: U php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c 2011-06-13 08:43:21 UTC (rev 312115) +++ php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c 2011-06-13 08:45:21 UTC (rev 312116) @@ -388,7 +388,7 @@ TSRMLS_FETCH(); if (CS_SEVERITY(errmsg-msgnumber) = SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %d), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %ld), errmsg-msgstring, (long)CS_SEVERITY(errmsg-msgnumber)); } STR_FREE(SybCtG(server_message)); SybCtG(server_message) = estrdup(errmsg-msgstring); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/sybase_ct/ php_sybase_ct.c
thekid Mon, 13 Jun 2011 08:45:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312117 Log: - MFH suppression of compiler warning noted in bug #55009 Bug: http://bugs.php.net/55009 (Feedback) Error when compile Changed paths: U php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c 2011-06-13 08:45:21 UTC (rev 312116) +++ php/php-src/branches/PHP_5_4/ext/sybase_ct/php_sybase_ct.c 2011-06-13 08:45:56 UTC (rev 312117) @@ -388,7 +388,7 @@ TSRMLS_FETCH(); if (CS_SEVERITY(errmsg-msgnumber) = SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %d), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %ld), errmsg-msgstring, (long)CS_SEVERITY(errmsg-msgnumber)); } STR_FREE(SybCtG(server_message)); SybCtG(server_message) = estrdup(errmsg-msgstring); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/sybase_ct/ config.m4
thekid Sat, 11 Jun 2011 18:55:15 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312059 Log: - MFH Bugfix for bug #53540 Bug: http://bugs.php.net/53540 (Closed) Correct Sybase 15.0 libraries not found by configure Changed paths: U php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 === --- php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42011-06-11 18:08:13 UTC (rev 312058) +++ php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42011-06-11 18:55:15 UTC (rev 312059) @@ -15,7 +15,7 @@ AC_DEFINE(HAVE_SYBASE_CT,1,[ ]) PHP_NEW_EXTENSION(sybase_ct, php_sybase_ct.c, $ext_shared) PHP_SUBST(SYBASE_CT_SHARED_LIBADD) - + if test $PHP_SYBASE_CT = yes; then SYBASE_CT_INCDIR=/home/sybase/include SYBASE_CT_LIBDIR=/home/sybase/lib @@ -24,17 +24,37 @@ SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib fi + dnl Determine whether we're building 64 or 32 bit... + AC_CHECK_SIZEOF(long int, 4) + AC_MSG_CHECKING([checking if we're on a 64-bit platform]) + if test $ac_cv_sizeof_long_int = 4; then +AC_MSG_RESULT([no]) +PHP_SYBASE_64=no + else +AC_MSG_RESULT([yes]) +PHP_SYBASE_64=yes + fi + + + AC_MSG_CHECKING([Checking for ctpublic.h]) if test -f $SYBASE_CT_INCDIR/ctpublic.h; then +AC_MSG_RESULT([found in $SYBASE_CT_INCDIR]) PHP_ADD_INCLUDE($SYBASE_CT_INCDIR) else AC_MSG_ERROR([ctpublic.h missing!]) fi - + + AC_MSG_CHECKING([Checking Sybase libdir]) + AC_MSG_RESULT([Have $SYBASE_CT_LIBDIR]) + + AC_MSG_CHECKING([Checking for Sybase platform libraries]) + PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct - elif test -f $SYBASE_CT_INCDIR/libsybct64.so; then +AC_MSG_RESULT([FreeTDS: $SYBASE_CT_LIBS]) + elif test -f $SYBASE_CT_LIBDIR/libsybct64.so test $PHP_SYBASE_64 = yes; then PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) @@ -46,6 +66,7 @@ *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # esac SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 +AC_MSG_RESULT([Sybase64: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) @@ -57,13 +78,14 @@ PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - elif test -f $SYBASE_CT_INCDIR/libsybct.so; then + elif test -f $SYBASE_CT_LIBDIR/libsybct.so; then PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl +AC_MSG_RESULT([Sybase32 syb-prefix: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) @@ -82,6 +104,7 @@ PHP_ADD_LIBRARY(intl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl +AC_MSG_RESULT([Sybase32 default: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(tcl, netg_errstr, [ PHP_ADD_LIBRARY(tcl,,SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/sybase_ct/ config.m4
thekid Sat, 11 Jun 2011 18:55:41 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312060 Log: - MFH Bugfix for bug #53540 Bug: http://bugs.php.net/53540 (Closed) Correct Sybase 15.0 libraries not found by configure Changed paths: U php/php-src/branches/PHP_5_4/ext/sybase_ct/config.m4 Modified: php/php-src/branches/PHP_5_4/ext/sybase_ct/config.m4 === --- php/php-src/branches/PHP_5_4/ext/sybase_ct/config.m42011-06-11 18:55:15 UTC (rev 312059) +++ php/php-src/branches/PHP_5_4/ext/sybase_ct/config.m42011-06-11 18:55:41 UTC (rev 312060) @@ -15,7 +15,7 @@ AC_DEFINE(HAVE_SYBASE_CT,1,[ ]) PHP_NEW_EXTENSION(sybase_ct, php_sybase_ct.c, $ext_shared) PHP_SUBST(SYBASE_CT_SHARED_LIBADD) - + if test $PHP_SYBASE_CT = yes; then SYBASE_CT_INCDIR=/home/sybase/include SYBASE_CT_LIBDIR=/home/sybase/lib @@ -24,17 +24,37 @@ SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib fi + dnl Determine whether we're building 64 or 32 bit... + AC_CHECK_SIZEOF(long int, 4) + AC_MSG_CHECKING([checking if we're on a 64-bit platform]) + if test $ac_cv_sizeof_long_int = 4; then +AC_MSG_RESULT([no]) +PHP_SYBASE_64=no + else +AC_MSG_RESULT([yes]) +PHP_SYBASE_64=yes + fi + + + AC_MSG_CHECKING([Checking for ctpublic.h]) if test -f $SYBASE_CT_INCDIR/ctpublic.h; then +AC_MSG_RESULT([found in $SYBASE_CT_INCDIR]) PHP_ADD_INCLUDE($SYBASE_CT_INCDIR) else AC_MSG_ERROR([ctpublic.h missing!]) fi - + + AC_MSG_CHECKING([Checking Sybase libdir]) + AC_MSG_RESULT([Have $SYBASE_CT_LIBDIR]) + + AC_MSG_CHECKING([Checking for Sybase platform libraries]) + PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct - elif test -f $SYBASE_CT_INCDIR/libsybct64.so; then +AC_MSG_RESULT([FreeTDS: $SYBASE_CT_LIBS]) + elif test -f $SYBASE_CT_LIBDIR/libsybct64.so test $PHP_SYBASE_64 = yes; then PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) @@ -46,6 +66,7 @@ *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # esac SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 +AC_MSG_RESULT([Sybase64: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) @@ -57,13 +78,14 @@ PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - elif test -f $SYBASE_CT_INCDIR/libsybct.so; then + elif test -f $SYBASE_CT_LIBDIR/libsybct.so; then PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl +AC_MSG_RESULT([Sybase32 syb-prefix: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) @@ -82,6 +104,7 @@ PHP_ADD_LIBRARY(intl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl +AC_MSG_RESULT([Sybase32 default: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(tcl, netg_errstr, [ PHP_ADD_LIBRARY(tcl,,SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/sybase_ct/ config.m4
thekid Wed, 08 Jun 2011 08:14:49 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311917 Log: - Changed output to be more verbose as to what libraries are used - Changed check for 64-bit vs 32-bit build environment to check sizeof(int) instead of assuming that if libsybct64.so exists, it must be 64-bit # Bug #53540: Correct Sybase 15.0 libraries not found by configure Bug: http://bugs.php.net/53540 (Assigned) Correct Sybase 15.0 libraries not found by configure Changed paths: U php/php-src/trunk/ext/sybase_ct/config.m4 Modified: php/php-src/trunk/ext/sybase_ct/config.m4 === --- php/php-src/trunk/ext/sybase_ct/config.m4 2011-06-08 06:14:40 UTC (rev 311916) +++ php/php-src/trunk/ext/sybase_ct/config.m4 2011-06-08 08:14:49 UTC (rev 311917) @@ -15,7 +15,7 @@ AC_DEFINE(HAVE_SYBASE_CT,1,[ ]) PHP_NEW_EXTENSION(sybase_ct, php_sybase_ct.c, $ext_shared) PHP_SUBST(SYBASE_CT_SHARED_LIBADD) - + if test $PHP_SYBASE_CT = yes; then SYBASE_CT_INCDIR=/home/sybase/include SYBASE_CT_LIBDIR=/home/sybase/lib @@ -24,17 +24,37 @@ SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib fi + dnl Determine whether we're building 64 or 32 bit... + AC_CHECK_SIZEOF(long int, 4) + AC_MSG_CHECKING([checking if we're on a 64-bit platform]) + if test $ac_cv_sizeof_long_int = 4; then +AC_MSG_RESULT([no]) +PHP_SYBASE_64=no + else +AC_MSG_RESULT([yes]) +PHP_SYBASE_64=yes + fi + + + AC_MSG_CHECKING([Checking for ctpublic.h]) if test -f $SYBASE_CT_INCDIR/ctpublic.h; then +AC_MSG_RESULT([found in $SYBASE_CT_INCDIR]) PHP_ADD_INCLUDE($SYBASE_CT_INCDIR) else AC_MSG_ERROR([ctpublic.h missing!]) fi - + + AC_MSG_CHECKING([Checking Sybase libdir]) + AC_MSG_RESULT([Have $SYBASE_CT_LIBDIR]) + + AC_MSG_CHECKING([Checking for Sybase platform libraries]) + PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct - elif test -f $SYBASE_CT_INCDIR/libsybct64.so; then +AC_MSG_RESULT([FreeTDS: $SYBASE_CT_LIBS]) + elif test -f $SYBASE_CT_LIBDIR/libsybct64.so test $PHP_SYBASE_64 = yes; then PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) @@ -46,6 +66,7 @@ *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # esac SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 +AC_MSG_RESULT([Sybase64: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) @@ -57,13 +78,14 @@ PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - elif test -f $SYBASE_CT_INCDIR/libsybct.so; then + elif test -f $SYBASE_CT_LIBDIR/libsybct.so; then PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl +AC_MSG_RESULT([Sybase32 syb-prefix: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) @@ -82,6 +104,7 @@ PHP_ADD_LIBRARY(intl,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl +AC_MSG_RESULT([Sybase32 default: $SYBASE_CT_LIBS]) PHP_CHECK_LIBRARY(tcl, netg_errstr, [ PHP_ADD_LIBRARY(tcl,,SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/sybase_ct/ config.m4
thekid Tue, 31 Aug 2010 12:28:30 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302918 Log: - MFT: Add .so suffix to checks on libsybct[64] bundles # See patch by royanee at yahoo dot com @ bug #45357 Bug: http://bugs.php.net/45357 (Duplicate) sybase-ct fails against sybase-15_0 on 64-bit centos 5 Changed paths: U php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 === --- php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42010-08-31 12:27:29 UTC (rev 302917) +++ php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42010-08-31 12:28:30 UTC (rev 302918) @@ -34,7 +34,7 @@ if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct - elif test -f $SYBASE_CT_INCDIR/libsybct64; then + elif test -f $SYBASE_CT_INCDIR/libsybct64.so; then PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) @@ -57,7 +57,7 @@ PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) - elif test -f $SYBASE_CT_INCDIR/libsybct; then + elif test -f $SYBASE_CT_INCDIR/libsybct.so; then PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/sybase_ct/ config.m4
thekid Wed, 07 Jul 2010 09:47:24 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301035 Log: - Added -DSYB_LP64 to CFLAGS on 64 bit platforms # See http://cpansearch.perl.org/src/MEWP/DBD-Sybase-1.08/Makefile.PL: # # If we are building for a 64 bit platform that also supports 32 bit # (i.e. Solaris 8, HP-UX11, etc) then we need to make some adjustments # [...] Tru64/DEC OSF does NOT use the SYB_LP64 define as it is ALWAYS # in 64 bit mode. # # Fixes bug #50827 Bug: http://bugs.php.net/50827 (Assigned) retcode != CS_END_RESULTS in exec_cmd() Changed paths: U php/php-src/trunk/ext/sybase_ct/config.m4 Modified: php/php-src/trunk/ext/sybase_ct/config.m4 === --- php/php-src/trunk/ext/sybase_ct/config.m4 2010-07-07 08:45:27 UTC (rev 301034) +++ php/php-src/trunk/ext/sybase_ct/config.m4 2010-07-07 09:47:24 UTC (rev 301035) @@ -39,7 +39,12 @@ PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(sybintl64,, SYBASE_CT_SHARED_LIBADD) - + +ac_solid_uname_s=`uname -s 2/dev/null` +case $ac_solid_uname_s in + *OSF*);; # Tru64/DEC OSF does NOT use the SYB_LP64 define + *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # +esac SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/sybase_ct/ config.m4
thekid Wed, 07 Jul 2010 10:15:24 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301036 Log: - MFT: Added -DSYB_LP64 to CFLAGS on 64 bit platforms - MFT: Added checks for 64 bit versions of sybase libraries - MFT: Added checks for sybase libraries prefixed with libsyb Changed paths: U php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m4 === --- php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42010-07-07 09:47:24 UTC (rev 301035) +++ php/php-src/branches/PHP_5_3/ext/sybase_ct/config.m42010-07-07 10:15:24 UTC (rev 301036) @@ -31,9 +31,50 @@ fi PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) - if test -f $SYBASE_CT_INCDIR/tds.h; then + if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct + elif test -f $SYBASE_CT_INCDIR/libsybct64; then +PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl64,, SYBASE_CT_SHARED_LIBADD) + +ac_solid_uname_s=`uname -s 2/dev/null` +case $ac_solid_uname_s in + *OSF*);; # Tru64/DEC OSF does NOT use the SYB_LP64 define + *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # +esac +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 + +PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) + elif test -f $SYBASE_CT_INCDIR/libsybct; then +PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) + +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl + +PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) else PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/sybase_ct/ config.m4
thekid Wed, 07 Jul 2010 10:16:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301037 Log: - MFT: Added -DSYB_LP64 to CFLAGS on 64 bit platforms - MFT: Added checks for 64 bit versions of sybase libraries - MFT: Added checks for sybase libraries prefixed with libsyb Changed paths: U php/php-src/branches/PHP_5_2/ext/sybase_ct/config.m4 Modified: php/php-src/branches/PHP_5_2/ext/sybase_ct/config.m4 === --- php/php-src/branches/PHP_5_2/ext/sybase_ct/config.m42010-07-07 10:15:24 UTC (rev 301036) +++ php/php-src/branches/PHP_5_2/ext/sybase_ct/config.m42010-07-07 10:16:48 UTC (rev 301037) @@ -8,7 +8,7 @@ if test $PHP_SYBASE_CT != no; then - if test $PHP_SYBASE != no test $ext_shared = no; then + if test $PHP_SYBASE test $PHP_SYBASE != no test $ext_shared = no; then AC_MSG_ERROR([You can not use both --with-sybase and --with-sybase-ct in same build!]) fi @@ -31,9 +31,50 @@ fi PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) - if test -f $SYBASE_CT_INCDIR/tds.h; then + if test -f $SYBASE_CT_INCDIR/tds.h || test -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct + elif test -f $SYBASE_CT_INCDIR/libsybct64; then +PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl64,, SYBASE_CT_SHARED_LIBADD) + +ac_solid_uname_s=`uname -s 2/dev/null` +case $ac_solid_uname_s in + *OSF*);; # Tru64/DEC OSF does NOT use the SYB_LP64 define + *) CFLAGS=${CFLAGS} -DSYB_LP64 ;; # +esac +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 + +PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) + elif test -f $SYBASE_CT_INCDIR/libsybct; then +PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) + +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl + +PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) else PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/sybase_ct/ config.m4
thekid Mon, 28 Jun 2010 13:35:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=300806 Log: - Added test for tds_sysdep_public.h and link against -lct only then - Added test for libsybct64 and libsybct # The former is a fix for newer versions of FreeTDS which no longer # provide the tds.h - we need to distinguish in what we link against # between FreeTDS and the official Sybase libraries, and this seems # to do the job. # The latter is the patch from bug #49276 (finally, and sorry) Bug: http://bugs.php.net/49276 (Assigned) Sybase 15 incorrect library name references Changed paths: U php/php-src/trunk/ext/sybase_ct/config.m4 Modified: php/php-src/trunk/ext/sybase_ct/config.m4 === --- php/php-src/trunk/ext/sybase_ct/config.m4 2010-06-28 13:29:21 UTC (rev 300805) +++ php/php-src/trunk/ext/sybase_ct/config.m4 2010-06-28 13:35:06 UTC (rev 300806) @@ -31,9 +31,45 @@ fi PHP_ADD_LIBPATH($SYBASE_CT_LIBDIR, SYBASE_CT_SHARED_LIBADD) - if test -f $SYBASE_CT_INCDIR/tds.h; then + if test -f $SYBASE_CT_INCDIR/tds.h -o -f $SYBASE_CT_INCDIR/tds_sysdep_public.h; then PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lct + else if test -f $SYBASE_CT_INCDIR/libsybct64; then +PHP_ADD_LIBRARY(sybcs64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn64,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl64,, SYBASE_CT_SHARED_LIBADD) + +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs64 -lsybct64 -lsybcomn64 -lsybintl64 + +PHP_CHECK_LIBRARY(sybtcl64, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl64,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck64, insck__getVdate, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck64, bsd_tcp, [PHP_ADD_LIBRARY(insck64,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) + else if test -f $SYBASE_CT_INCDIR/libsybct; then +PHP_ADD_LIBRARY(sybcs,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybct,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybcomn,, SYBASE_CT_SHARED_LIBADD) +PHP_ADD_LIBRARY(sybintl,, SYBASE_CT_SHARED_LIBADD) + +SYBASE_CT_LIBS=-L$SYBASE_CT_LIBDIR -lsybcs -lsybct -lsybcomn -lsybintl + +PHP_CHECK_LIBRARY(sybtcl, netg_errstr, [ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + PHP_ADD_LIBRARY(sybtcl,,SYBASE_CT_SHARED_LIBADD) +],[ + $SYBASE_CT_LIBS +]) + +PHP_CHECK_LIBRARY(insck, insck__getVdate, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) +PHP_CHECK_LIBRARY(insck, bsd_tcp, [PHP_ADD_LIBRARY(insck,, SYBASE_CT_SHARED_LIBADD)],[],[-L$SYBASE_CT_LIBDIR]) else PHP_ADD_LIBRARY(cs,, SYBASE_CT_SHARED_LIBADD) PHP_ADD_LIBRARY(ct,, SYBASE_CT_SHARED_LIBADD) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/sybase_ct/ php_sybase_ct.c
thekid Wed, 16 Jun 2010 09:34:11 + Revision: http://svn.php.net/viewvc?view=revisionrevision=300490 Log: - Fixed segmentation fault when reading rows # Problem surfaces when using FreeTDS, ASE 12.5 and reading text fields # with NULL values. This is essentially a workaround for a bug in Free- # TDS which is not setting the NULL indicators correctly, but provides # a protection against possible segfaults if any other driver ever does # this again:-) Changed paths: U php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2010-06-16 08:58:42 UTC (rev 300489) +++ php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2010-06-16 09:34:11 UTC (rev 300490) @@ -1247,8 +1247,17 @@ } default: { - /* This indicates anything else, return it as string */ - ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + /* This indicates anything else, return it as string +* FreeTDS doesn't correctly set result-indicators[j] correctly +* for NULL fields in some version in conjunction with ASE 12.5 +* but instead sets result-lengths[j] to 0, which would lead to +* a negative memory allocation (and thus a segfault). +*/ + if (result-lengths[j] 1) { + ZVAL_NULL(result-data[i][j]); + } else { + ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + } break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/sybase_ct/ php_sybase_ct.c
thekid Wed, 16 Jun 2010 09:49:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=300491 Log: - MFT: Fixed segmentation fault when reading rows # Problem surfaces when using FreeTDS, ASE 12.5 and reading text fields # with NULL values. This is essentially a workaround for a bug in Free- # TDS which is not setting the NULL indicators correctly, but provides # a protection against possible segfaults if any other driver ever does # this again:-) Changed paths: U php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c 2010-06-16 09:34:11 UTC (rev 300490) +++ php/php-src/branches/PHP_5_3/ext/sybase_ct/php_sybase_ct.c 2010-06-16 09:49:25 UTC (rev 300491) @@ -1248,8 +1248,17 @@ } default: { - /* This indicates anything else, return it as string */ - ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + /* This indicates anything else, return it as string +* FreeTDS doesn't correctly set result-indicators[j] correctly +* for NULL fields in some version in conjunction with ASE 12.5 +* but instead sets result-lengths[j] to 0, which would lead to +* a negative memory allocation (and thus a segfault). +*/ + if (result-lengths[j] 1) { + ZVAL_NULL(result-data[i][j]); + } else { + ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + } break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/sybase_ct/ php_sybase_ct.c
thekid Wed, 16 Jun 2010 09:53:51 + Revision: http://svn.php.net/viewvc?view=revisionrevision=300492 Log: - MFT: Fixed segmentation fault when reading rows # Problem surfaces when using FreeTDS, ASE 12.5 and reading text fields # with NULL values. This is essentially a workaround for a bug in Free- # TDS which is not setting the NULL indicators correctly, but provides # a protection against possible segfaults if any other driver ever does # this again:-) Changed paths: U php/php-src/branches/PHP_5_2/ext/sybase_ct/php_sybase_ct.c Modified: php/php-src/branches/PHP_5_2/ext/sybase_ct/php_sybase_ct.c === --- php/php-src/branches/PHP_5_2/ext/sybase_ct/php_sybase_ct.c 2010-06-16 09:49:25 UTC (rev 300491) +++ php/php-src/branches/PHP_5_2/ext/sybase_ct/php_sybase_ct.c 2010-06-16 09:53:51 UTC (rev 300492) @@ -1204,8 +1204,17 @@ } default: { - /* This indicates anything else, return it as string */ - ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + /* This indicates anything else, return it as string +* FreeTDS doesn't correctly set result-indicators[j] correctly +* for NULL fields in some version in conjunction with ASE 12.5 +* but instead sets result-lengths[j] to 0, which would lead to +* a negative memory allocation (and thus a segfault). +*/ + if (result-lengths[j] 1) { + ZVAL_NULL(result-data[i][j]); + } else { + ZVAL_STRINGL(result-data[i][j], result-tmp_buffer[j], result-lengths[j]- 1, 1); + } break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Mon Nov 10 10:59:45 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Added optional parameter new to sybase_connect # [DOC] If a second call is made to sybase_connect() with the same arguments # no new link will be established, but instead, the link identifier of the # already opened link will be returned. The new parameter modifies this # behavior and makes sybase_connect() always open a new link, even if # sybase_connect() was called before with the same parameters. http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.12r2=1.103.2.5.2.13.2.13diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.12 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.13 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.12 Sun Nov 9 11:39:14 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Mon Nov 10 10:59:44 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.12 2008/11/09 11:39:14 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.13 2008/11/10 10:59:44 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -49,6 +49,7 @@ ZEND_ARG_INFO(0, password) ZEND_ARG_INFO(0, charset) ZEND_ARG_INFO(0, appname) + ZEND_ARG_INFO(0, new) ZEND_END_ARG_INFO() static @@ -753,13 +754,19 @@ { char *user, *passwd, *host, *charset, *appname; char *hashed_details; - int hashed_details_length; - int len; + int hashed_details_length, len; + zend_bool new = 0; sybase_link *sybase_ptr; host= user= passwd= charset= appname= NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, host, len, user, len, passwd, len, charset, len, appname, len) == FAILURE) { - return; + if (persistent) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s!s!s!s!s!, host, len, user, len, passwd, len, charset, len, appname, len) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s!s!s!s!s!b, host, len, user, len, passwd, len, charset, len, appname, len, new) == FAILURE) { + return; + } } hashed_details_length = spprintf( hashed_details, @@ -865,7 +872,7 @@ * if it doesn't, open a new sybase link, add it to the resource list, * and add a pointer to it with hashed_details as the key. */ - if (zend_hash_find(EG(regular_list), hashed_details, hashed_details_length+1, (void **) index_ptr)==SUCCESS) { + if (!new zend_hash_find(EG(regular_list), hashed_details, hashed_details_length+1, (void **) index_ptr)==SUCCESS) { int type, link; void *ptr; @@ -929,7 +936,7 @@ } -/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname]) +/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset [, string appname [, bool new]]) Open Sybase server connection */ PHP_FUNCTION(sybase_connect) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test.inc
thekid Mon Nov 10 11:50:28 2008 UTC Modified files: /php-src/ext/sybase_ct/teststest.inc Log: - MFB: Changed source to read host, user and password from environment # E.g. nmake test TESTS=ext/sybase_ct PHP_SYBASE_HOST=db PHP_SYBASE_USER=sa PHP_SYBASE_PASS=*** http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test.inc?r1=1.7r2=1.8diff_format=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.7 php-src/ext/sybase_ct/tests/test.inc:1.8 --- php-src/ext/sybase_ct/tests/test.inc:1.7Fri Aug 10 13:28:11 2007 +++ php-src/ext/sybase_ct/tests/test.incMon Nov 10 11:50:28 2008 @@ -1,13 +1,13 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.7 2007/08/10 13:28:11 jani Exp $ + * $Id: test.inc,v 1.8 2008/11/10 11:50:28 thekid Exp $ */ // Change if needed - define('HOST', ''); - define('USER', ''); - define('PASSWORD', ''); + define('HOST', getenv('PHP_SYBASE_HOST')); + define('USER', getenv('PHP_SYBASE_USER')); + define('PASSWORD', getenv('PHP_SYBASE_PASS')); define('TEMPDB', 'tempdb'); // {{{ bool sybase_msg_handler(int msgnumber, int severity, int state, int line, string text) @@ -49,11 +49,11 @@ var_dump(sybase_set_message_handler($handler)); } - // {{{ resource sybase_connect_ex(string charset= NULL, string appname= NULL) + // {{{ resource sybase_connect_ex(string charset= NULL, string appname= NULL, bool new= FALSE) // Connect to the sybase server using the defines HOST, USER and PASSWORD - function sybase_connect_ex($charset= NULL, $appname= NULL) { + function sybase_connect_ex($charset= NULL, $appname= NULL, $new= FALSE) { sybase_min_server_severity(11); // Suppress changed database context -if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname))) { +if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname, $new))) { die('Connect to '.USER.'@'.HOST.' failed (using password: '.(PASSWORD ? 'yes' : 'no').')'); } return $db; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug30312-withfree.phpt bug43578.phpt test_close.phpt test_close_default.phpt test_close_notopen.phpt test_connection_caching.phpt test_unbuffered_no_full_fe
thekid Mon Nov 10 11:49:49 2008 UTC Modified files: /php-src/ext/sybase_ct/testsbug30312-withfree.phpt bug43578.phpt test_close.phpt test_close_default.phpt test_close_notopen.phpt test_connection_caching.phpt test_unbuffered_no_full_fetch.phpt Log: - MFB: Initial release http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312-withfree.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312-withfree.phpt diff -u /dev/null php-src/ext/sybase_ct/tests/bug30312-withfree.phpt:1.2 --- /dev/null Mon Nov 10 11:49:49 2008 +++ php-src/ext/sybase_ct/tests/bug30312-withfree.phpt Mon Nov 10 11:49:49 2008 @@ -0,0 +1,34 @@ +--TEST-- +Sybase-CT bug #30312 (sybase_unbuffered_query calls, with free) +--SKIPIF-- +?php require('skipif.inc'); ? +--FILE-- +?php +/* This file is part of PHP test framework for ext/sybase_ct + * + * $Id: bug30312-withfree.phpt,v 1.2 2008/11/10 11:49:49 thekid Exp $ + */ + + require('test.inc'); + error_reporting(error_reporting() !E_NOTICE); // Suppress notices + + $db= sybase_connect_ex(); + + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); + $array= sybase_fetch_row($query); + var_dump($array[0]); + sybase_free_result($query); + + $query= sybase_unbuffered_query('select datepart(mm, getdate()), datepart(dd, getdate())'); + $array= sybase_fetch_row($query); + var_dump($array); + sybase_free_result($query); +? +--EXPECTF-- +int(%d) +array(2) { + [0]= + int(%d) + [1]= + int(%d) +} http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug43578.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/bug43578.phpt diff -u /dev/null php-src/ext/sybase_ct/tests/bug43578.phpt:1.2 --- /dev/null Mon Nov 10 11:49:49 2008 +++ php-src/ext/sybase_ct/tests/bug43578.phpt Mon Nov 10 11:49:49 2008 @@ -0,0 +1,65 @@ +--TEST-- +Sybase-CT bug #43578 (Incurred fault #6 - if returned textfield ist empty) +--SKIPIF-- +?php require('skipif.inc'); ? +--FILE-- +?php +/* This file is part of PHP test framework for ext/sybase_ct + * + * $Id: bug43578.phpt,v 1.2 2008/11/10 11:49:49 thekid Exp $ + */ + + require('test.inc'); + + $db= sybase_connect_ex(); + + // Create a temporary table and fill it with test values + var_dump(sybase_query(' +create table #Resource ( + Resource_ID int, + DC_Rights text null +) + ', $db)); + var_dump(sybase_query('insert into #Resource values (123, NULL)', $db)); + var_dump(sybase_query('insert into #Resource values (124, )', $db)); + + // Select non-existant + var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 122')); + + // Select null + var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 123')); + + // Select empty + var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 124')); + + // Clean up and close connection + var_dump(sybase_query('drop table #Resource', $db)); + sybase_close($db); +? +--EXPECTF-- +bool(true) +bool(true) +bool(true) + Query: select DC_Rights from #Resource where Resource_ID = 122 + Return: resource +array(0) { +} + Query: select DC_Rights from #Resource where Resource_ID = 123 + Return: resource +array(1) { + [0]= + array(1) { +[DC_Rights]= +NULL + } +} + Query: select DC_Rights from #Resource where Resource_ID = 124 + Return: resource +array(1) { + [0]= + array(1) { +[DC_Rights]= +string(1) + } +} +bool(true) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_close.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_close.phpt diff -u /dev/null php-src/ext/sybase_ct/tests/test_close.phpt:1.2 --- /dev/null Mon Nov 10 11:49:49 2008 +++ php-src/ext/sybase_ct/tests/test_close.phpt Mon Nov 10 11:49:49 2008 @@ -0,0 +1,25 @@ +--TEST-- +Sybase-CT close +--SKIPIF-- +?php require('skipif.inc'); ? +--FILE-- +?php +/* This file is part of PHP test framework for ext/sybase_ct + * + * $Id: test_close.phpt,v 1.2 2008/11/10 11:49:49 thekid Exp $ + */ + + require('test.inc'); + + $db= sybase_connect_ex(); + var_dump($db); + sybase_close($db); + var_dump($db); + var_dump(sybase_query('select getdate()', $db)); +? +--EXPECTF-- +resource(%d) of type (sybase-ct link) +resource(%d) of type (Unknown) + +Warning: sybase_query(): %d is not a valid Sybase-Link resource in %s on line %d +bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_close_default.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_close_default.phpt diff -u /dev/null php-src/ext/sybase_ct/tests/test_close_default.phpt:1.2 --- /dev/null Mon Nov 10 11:49:49 2008 +++ php-src/ext/sybase_ct/tests/test_close_default.phpt Mon Nov 10 11:49:49 2008 @@
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS
thekid Mon Nov 10 14:45:31 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS Log: - Removed notes about fixes to sybase_ct that are already announced in PHP 5.2 news http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.372r2=1.2027.2.547.2.965.2.373diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.372 php-src/NEWS:1.2027.2.547.2.965.2.373 --- php-src/NEWS:1.2027.2.547.2.965.2.372 Mon Nov 10 11:03:22 2008 +++ php-src/NEWSMon Nov 10 14:45:30 2008 @@ -27,8 +27,6 @@ - Fixed invalid calls to free when internal fileinfo magic file is used. (Scott) - Synced changes from libmagic 4.26 to bundled libmagic. (Scott) -- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) - - Fixed bug #46421 (SplFileInfo not correctly handling /). (Etienne) - Fixed bug #46331 - (Segfault when using internal fileinfo magic file on big endian systems). (Scott) @@ -71,7 +69,6 @@ - Fixed bug #44575 (parse_ini_file comment # line problems). (Arnaud) - Fixed bug #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS). (Johannes, chx1975 at gmail dot com) -- Fixed bug #30312 (sybase_unbuffered_query calls). (Timm) 02 Sep 2008, PHP 5.3.0 Alpha 2 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS
thekid Mon Nov 10 14:46:50 2008 UTC Modified files: /php-srcNEWS Log: - Reverted my last commit # See http://news.php.net/php.cvs/54140 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2170r2=1.2171diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2170 php-src/NEWS:1.2171 --- php-src/NEWS:1.2170 Mon Nov 10 11:57:10 2008 +++ php-src/NEWSMon Nov 10 14:46:50 2008 @@ -3,8 +3,6 @@ ?? ??? 20??, PHP 6.0 - Unicode support. (Andrei, Dmitry, et al) -- Added optional parameter new to sybase_connect() (Timm) - - Changed dl() to be disabled by default. Enabled only when explicitly registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry) - Changed opendir/dir/scandir to use default context @@ -52,7 +50,4 @@ . stream_resolve_include_path(). (Sara) - Added shm_has_var() function. (Mike) -- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) - - Fixed bug #40325 (Vary: header missing in gzip output handlers). (Mike) -- Fixed bug #30312 (sybase_unbuffered_query calls). (Timm) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug29064.phpt
thekid Mon Nov 10 11:51:13 2008 UTC Modified files: /php-src/ext/sybase_ct/testsbug29064.phpt Log: - Adjusted tests to reality # We select 123456789.12345679, we should have this returned and not # something 123456789.123457 (rounded) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug29064.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/bug29064.phpt diff -u php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 php-src/ext/sybase_ct/tests/bug29064.phpt:1.2 --- php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 Sun Jul 11 16:57:24 2004 +++ php-src/ext/sybase_ct/tests/bug29064.phpt Mon Nov 10 11:51:13 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug29064.phpt,v 1.1 2004/07/11 16:57:24 thekid Exp $ + * $Id: bug29064.phpt,v 1.2 2008/11/10 11:51:13 thekid Exp $ */ require('test.inc'); @@ -112,9 +112,9 @@ [test_tinyint]= int(123) [test_real]= -string(16) 123456789.123457 +string(18) 123456789.12345679 [test_double]= -string(16) 123456789.123457 +string(18) 123456789.12345679 } [1]= array(10) { @@ -135,9 +135,9 @@ [test_tinyint]= int(255) [test_real]= -string(17) -123456789.123457 +string(19) -123456789.12345679 [test_double]= -string(17) -123456789.123457 +string(19) -123456789.12345679 } } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Mon Nov 10 11:49:06 2008 UTC Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFB: Added optional parameter new to sybase_connect() - MFB: Fixed crash in sybase_unbuffered_query() - MFB: Migrated to new parameter parsing API - MFB: Made sybase_fetch_*() functions also read rows with CS_ROW_FAIL - MFB: Adjusted function protos to use resource instead of int # Forgot the bunnies. Sorry. http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.125r2=1.126diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.125 php-src/ext/sybase_ct/php_sybase_ct.c:1.126 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.125 Sun Nov 2 21:10:11 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Mon Nov 10 11:49:06 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.125 2008/11/02 21:10:11 felipe Exp $ */ +/* $Id: php_sybase_ct.c,v 1.126 2008/11/10 11:49:06 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -49,6 +49,7 @@ ZEND_ARG_INFO(0, password) ZEND_ARG_INFO(0, charset) ZEND_ARG_INFO(0, appname) + ZEND_ARG_INFO(0, new) ZEND_END_ARG_INFO() static @@ -273,6 +274,21 @@ #define efree_n(x) { efree(x); x = NULL; } #define efree_if(x) if (x) efree_n(x) +#ifdef PHP_SYBASE_DEBUG +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + fprintf(stderr, _free_sybase_result(%p) called from line #%d\n, result, __LINE__); \ + fflush(stderr); \ + _free_sybase_result(result); \ + result = NULL; \ + } +#else +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + _free_sybase_result(result); \ + result = NULL; \ + } +#endif static void _free_sybase_result(sybase_result *result) { int i, j; @@ -326,7 +342,7 @@ php_sybase_finish_results(result TSRMLS_CC); } - _free_sybase_result(result); + FREE_SYBASE_RESULT(result); } static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) @@ -339,7 +355,6 @@ zval_ptr_dtor(sybase_ptr-callback_name); sybase_ptr-callback_name= NULL; } - zend_hash_apply(EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); /* Non-persistent connections will always be connected or we wouldn't @@ -420,47 +435,55 @@ static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC) { int handled = 0; + zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; + zval **args[5]; - if (callback_name) { - zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; - zval **args[5]; - - MAKE_STD_ZVAL(msgnumber); - ZVAL_LONG(msgnumber, srvmsg-msgnumber); - args[0] = msgnumber; - - MAKE_STD_ZVAL(severity); - ZVAL_LONG(severity, srvmsg-severity); - args[1] = severity; - - MAKE_STD_ZVAL(state); - ZVAL_LONG(state, srvmsg-state); - args[2] = state; - - MAKE_STD_ZVAL(line); - ZVAL_LONG(line, srvmsg-line); - args[3] = line; - - MAKE_STD_ZVAL(text); - ZVAL_STRING(text, srvmsg-text, 1); - args[4] = text; - - if (call_user_function_ex(EG(function_table), NULL, callback_name, retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot call the messagehandler %s, Z_STRVAL_P(callback_name)); - } + /* Border case - empty fcall */ + if (NULL == callback_name) return 0; - if (retval) { - handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); - zval_ptr_dtor(retval); - } + /* Build arguments */ + MAKE_STD_ZVAL(msgnumber); + ZVAL_LONG(msgnumber, srvmsg-msgnumber); + args[0] = msgnumber; + + MAKE_STD_ZVAL(severity); + ZVAL_LONG(severity, srvmsg-severity); + args[1] = severity; + +
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
Hi, Seems like you've adopted the idea from Ilia that HEAD is not for development? You either commit to HEAD first and THEN to branches or you don't commit at all. I merged all the bugfixes and changes to CVS head. As said yesterday, I was focussing on getting the stuff into PHP_5_3 and all bugfixes into PHP_5_2. Remember the bunnies.. Sorry:) - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS
thekid Mon Nov 10 11:03:22 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS Log: - Documented sybase_connect()'s new optional parameter 'new' http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.371r2=1.2027.2.547.2.965.2.372diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.371 php-src/NEWS:1.2027.2.547.2.965.2.372 --- php-src/NEWS:1.2027.2.547.2.965.2.371 Sun Nov 9 11:39:15 2008 +++ php-src/NEWSMon Nov 10 11:03:22 2008 @@ -10,6 +10,7 @@ parameter validation. (Felipe) - Changed openssl info to show the shared library version number. (Scott) +- Added optional parameter new to sybase_connect() (Timm) - Added parse_ini_string() function. (grange at lemonde dot fr, Arnaud) - Added str_getcsv() function. (Sara) - Added ability to send user defined HTTP headers with SOAP request. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug30312.phpt
thekid Mon Nov 10 11:51:35 2008 UTC Modified files: /php-src/ext/sybase_ct/testsbug30312.phpt Log: - MFB: Made this test independent of date format http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312.phpt diff -u php-src/ext/sybase_ct/tests/bug30312.phpt:1.3 php-src/ext/sybase_ct/tests/bug30312.phpt:1.4 --- php-src/ext/sybase_ct/tests/bug30312.phpt:1.3 Fri Aug 10 13:28:11 2007 +++ php-src/ext/sybase_ct/tests/bug30312.phpt Mon Nov 10 11:51:35 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.3 2007/08/10 13:28:11 jani Exp $ + * $Id: bug30312.phpt,v 1.4 2008/11/10 11:51:35 thekid Exp $ */ require('test.inc'); @@ -14,14 +14,14 @@ $db= sybase_connect_ex(); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); ? --EXPECTF-- -string(%d) %s %d %d %d:%d%s -string(%d) %s %d %d %d:%d%s +int(%d) +int(%d) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_msghandler.phpt
thekid Mon Nov 10 11:52:52 2008 UTC Modified files: /php-src/ext/sybase_ct/teststest_msghandler.phpt Log: - MFB: Fixed expected warning messages # Changed during migration to parameter parsing API http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_msghandler.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/sybase_ct/tests/test_msghandler.phpt diff -u php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.3 php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.4 --- php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.3Fri Aug 10 13:28:11 2007 +++ php-src/ext/sybase_ct/tests/test_msghandler.phptMon Nov 10 11:52:52 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler.phpt,v 1.3 2007/08/10 13:28:11 jani Exp $ + * $Id: test_msghandler.phpt,v 1.4 2008/11/10 11:52:52 thekid Exp $ */ require('test.inc'); @@ -26,15 +26,15 @@ ? --EXPECTF-- Nonexistant: -Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %stest.inc on line %d -bool(false) +Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, function 'function_does_not_exist' not found or invalid function name in %stest.inc on line %d +NULL Static method: bool(true) Instance method: bool(true) Lambda function: bool(true) Unset: bool(true) Incorrect type: -Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %stest.inc on line %d -bool(false) +Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, no array or string given in %stest.inc on line %d +NULL Function:bool(true) Query: select getdate(NULL) *** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_appname.phpt
thekid Mon Nov 10 11:52:16 2008 UTC Modified files: /php-src/ext/sybase_ct/teststest_appname.phpt Log: - MFB: Made this test independent of field types in master..sysprocesses # char on ASE 11, varchar on ASE 15 http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_appname.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/sybase_ct/tests/test_appname.phpt diff -u php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 php-src/ext/sybase_ct/tests/test_appname.phpt:1.3 --- php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/test_appname.phpt Mon Nov 10 11:52:16 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_appname.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $ + * $Id: test_appname.phpt,v 1.3 2008/11/10 11:52:16 thekid Exp $ */ require('test.inc'); @@ -35,9 +35,8 @@ ); var_dump( -$r, -compare_string($program_name, $r[0]['program_name']), -compare_string($hostname, $r[0]['hostname']) +compare_string($program_name, $r[0][b'program_name']), +compare_string($hostname, $r[0][b'hostname']) ); sybase_close($db); @@ -52,14 +51,5 @@ where program_name = phpt_test Return: resource -array(1) { - [0]= - array(2) { -[hostname]= -string(10) php.net%s -[program_name]= -string(16) phpt_test%s - } -} bool(true) bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS
thekid Mon Nov 10 11:57:10 2008 UTC Modified files: /php-srcNEWS Log: - Documented changes / fixes to sybase_ct # MFB, all also in PHP_5_3 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2169r2=1.2170diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2169 php-src/NEWS:1.2170 --- php-src/NEWS:1.2169 Sun Nov 2 18:30:31 2008 +++ php-src/NEWSMon Nov 10 11:57:10 2008 @@ -3,6 +3,8 @@ ?? ??? 20??, PHP 6.0 - Unicode support. (Andrei, Dmitry, et al) +- Added optional parameter new to sybase_connect() (Timm) + - Changed dl() to be disabled by default. Enabled only when explicitly registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry) - Changed opendir/dir/scandir to use default context @@ -50,4 +52,7 @@ . stream_resolve_include_path(). (Sara) - Added shm_has_var() function. (Mike) +- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) + - Fixed bug #40325 (Vary: header missing in gzip output handlers). (Mike) +- Fixed bug #30312 (sybase_unbuffered_query calls). (Timm) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test.inc test_connection_caching.phpt
thekid Mon Nov 10 11:00:48 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest.inc test_connection_caching.phpt Log: - Added test for optional parameter new to sybase_connect() http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test.inc?r1=1.4.6.3.2.1r2=1.4.6.3.2.2diff_format=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.4.6.3.2.1 php-src/ext/sybase_ct/tests/test.inc:1.4.6.3.2.2 --- php-src/ext/sybase_ct/tests/test.inc:1.4.6.3.2.1Sat Nov 8 11:47:35 2008 +++ php-src/ext/sybase_ct/tests/test.incMon Nov 10 11:00:48 2008 @@ -1,7 +1,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.4.6.3.2.1 2008/11/08 11:47:35 thekid Exp $ + * $Id: test.inc,v 1.4.6.3.2.2 2008/11/10 11:00:48 thekid Exp $ */ // Change if needed @@ -49,11 +49,11 @@ var_dump(sybase_set_message_handler($handler)); } - // {{{ resource sybase_connect_ex(string charset= NULL, string appname= NULL) + // {{{ resource sybase_connect_ex(string charset= NULL, string appname= NULL, bool new= FALSE) // Connect to the sybase server using the defines HOST, USER and PASSWORD - function sybase_connect_ex($charset= NULL, $appname= NULL) { + function sybase_connect_ex($charset= NULL, $appname= NULL, $new= FALSE) { sybase_min_server_severity(11); // Suppress changed database context -if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname))) { +if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname, $new))) { die('Connect to '.USER.'@'.HOST.' failed (using password: '.(PASSWORD ? 'yes' : 'no').')'); } return $db; http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_connection_caching.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_connection_caching.phpt diff -u php-src/ext/sybase_ct/tests/test_connection_caching.phpt:1.1.2.1 php-src/ext/sybase_ct/tests/test_connection_caching.phpt:1.1.2.2 --- php-src/ext/sybase_ct/tests/test_connection_caching.phpt:1.1.2.1Sun Nov 9 10:57:09 2008 +++ php-src/ext/sybase_ct/tests/test_connection_caching.phptMon Nov 10 11:00:48 2008 @@ -6,18 +6,21 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_connection_caching.phpt,v 1.1.2.1 2008/11/09 10:57:09 thekid Exp $ + * $Id: test_connection_caching.phpt,v 1.1.2.2 2008/11/10 11:00:48 thekid Exp $ */ require('test.inc'); $db1= sybase_connect_ex(); $db2= sybase_connect_ex(); - var_dump($db1, $db2, (string)$db1 == (string)$db2); + $db3= sybase_connect_ex(NULL, NULL, $new= TRUE); + var_dump($db1, $db2, $db3, (string)$db1 == (string)$db2, (string)$db2 == (string)$db3); sybase_close($db1); ? --EXPECTF-- resource(%d) of type (sybase-ct link) resource(%d) of type (sybase-ct link) +resource(%d) of type (sybase-ct link) bool(true) +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_unbuffered_no_full_fetch.phpt
thekid Sun Nov 9 10:29:52 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_unbuffered_no_full_fetch.phpt Log: - Added test for sybase_free_result() without full fetch http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt diff -u php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt:1.1.2.1 php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt:1.1.2.2 --- php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt:1.1.2.1 Sat Nov 8 13:21:01 2008 +++ php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt Sun Nov 9 10:29:52 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_unbuffered_no_full_fetch.phpt,v 1.1.2.1 2008/11/08 13:21:01 thekid Exp $ + * $Id: test_unbuffered_no_full_fetch.phpt,v 1.1.2.2 2008/11/09 10:29:52 thekid Exp $ */ require('test.inc'); @@ -21,6 +21,11 @@ // Fetch #2 - without having fetched all rows from previous query $q= sybase_unbuffered_query('select name from master..systypes', $db); var_dump($q, key(sybase_fetch_assoc($q))); + + // Fetch #3 - free first, without having fetched all rows from previous query + sybase_free_result($q); + $q= sybase_unbuffered_query('select name from master..systypes', $db); + var_dump($q, key(sybase_fetch_assoc($q))); // Close - without having fetched all rows from previous query sybase_close($db); @@ -34,4 +39,6 @@ Notice: sybase_unbuffered_query(): Sybase: Called without first fetching all rows from a previous unbuffered query in %s on line %d resource(%d) of type (sybase-ct result) string(4) name +resource(%d) of type (sybase-ct result) +string(4) name CLOSED -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_connection_caching.phpt
thekid Sun Nov 9 10:57:10 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_connection_caching.phpt Log: - Initial release http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_connection_caching.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_connection_caching.phpt +++ php-src/ext/sybase_ct/tests/test_connection_caching.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
Hi, Kalle, [snip] Shouldn't all these changes to sybase_ct not be in HEAD too? Yes, but I'm focusing on PHP_5_2 and PHP_5_3 for bugfixes and tests at the moment because both are near to a release:) - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
Hi, Could someone w/ sufficient karma commit add these lines to PHP_5_3/NEWS: You have karma for NEWS now :) Committed news entries to PHP_5_2 and PHP_5_3 Thanks again for giving sybase_ct some love :) You're welcome:) - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests bug30312-withfree.phpt
thekid Sun Nov 9 10:26:31 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/testsbug30312-withfree.phpt Log: - Initial release # Tests sybase_unbuffered_query() together with sybase_free_result() http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312-withfree.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/bug30312-withfree.phpt +++ php-src/ext/sybase_ct/tests/bug30312-withfree.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
thekid Sun Nov 9 10:33:53 2008 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - Added note on bugfix for #30312 - Added entry on CS_ROW_FAIL patch fix http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1307r2=1.2027.2.547.2.1308diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1307 php-src/NEWS:1.2027.2.547.2.1308 --- php-src/NEWS:1.2027.2.547.2.1307Fri Nov 7 21:18:45 2008 +++ php-src/NEWSSun Nov 9 10:33:53 2008 @@ -4,6 +4,10 @@ - Fixed bug #46521 (Curl ZTS OpenSSL, error in config.m4 fragment). (jd at cpanel dot net) +- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) + +- Fixed bug #30312 (sybase_unbuffered_query calls). (Timm) + 06 Nov 2008, PHP 5.2.7RC3 - Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants. (Pierre) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS
thekid Sun Nov 9 10:32:36 2008 UTC Modified files: (Branch: PHP_5_3) /php-srcNEWS Log: - Added note on bugfix for #30312 - Added entry on CS_ROW_FAIL patch fix http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.369r2=1.2027.2.547.2.965.2.370diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.369 php-src/NEWS:1.2027.2.547.2.965.2.370 --- php-src/NEWS:1.2027.2.547.2.965.2.369 Thu Nov 6 22:12:12 2008 +++ php-src/NEWSSun Nov 9 10:32:35 2008 @@ -26,6 +26,9 @@ - Fixed invalid calls to free when internal fileinfo magic file is used. (Scott) - Synced changes from libmagic 4.26 to bundled libmagic. (Scott) +- Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm) + +- Fixed bug #30312 (sybase_unbuffered_query calls). (Timm) - Fixed bug #46421 (SplFileInfo not correctly handling /). (Etienne) - Fixed bug #46331 - (Segfault when using internal fileinfo magic file on big endian systems). (Scott) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Sun Nov 9 11:39:14 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed sybase_close() to actually close connections # Broken during parameter parsing refactoring lately, OK in PHP_5_2 http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.11r2=1.103.2.5.2.13.2.12diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.11 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.12 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.11 Sat Nov 8 13:22:14 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun Nov 9 11:39:14 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.11 2008/11/08 13:22:14 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.12 2008/11/09 11:39:14 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -979,8 +979,11 @@ ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, Sybase-Link, le_link, le_plink); - zend_list_delete(Z_RESVAL_P(sybase_link_index)); - if (Z_RESVAL_P(sybase_link_index) == SybCtG(default_link)) { + if (id == -1) { + zend_list_delete(Z_RESVAL_P(sybase_link_index)); + } + if (id != -1 || (sybase_link_index Z_RESVAL_P(sybase_link_index) == SybCtG(default_link))) { + zend_list_delete(SybCtG(default_link)); SybCtG(default_link) = -1; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_close.phpt test_close_default.phpt test_close_notopen.phpt
thekid Sun Nov 9 11:38:18 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_close.phpt test_close_default.phpt test_close_notopen.phpt Log: - Initial release http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_close.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_close.phpt +++ php-src/ext/sybase_ct/tests/test_close.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_close_default.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_close_default.phpt +++ php-src/ext/sybase_ct/tests/test_close_default.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_close_notopen.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_close_notopen.phpt +++ php-src/ext/sybase_ct/tests/test_close_notopen.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_appname.phpt
thekid Sat Nov 8 12:01:10 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_appname.phpt Log: - MFB: Made this test independent of field types in master..sysprocesses # char on ASE 11, varchar on ASE 15 http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_appname.phpt?r1=1.2r2=1.2.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_appname.phpt diff -u php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 php-src/ext/sybase_ct/tests/test_appname.phpt:1.2.4.1 --- php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/test_appname.phpt Sat Nov 8 12:01:10 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_appname.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $ + * $Id: test_appname.phpt,v 1.2.4.1 2008/11/08 12:01:10 thekid Exp $ */ require('test.inc'); @@ -35,7 +35,6 @@ ); var_dump( -$r, compare_string($program_name, $r[0]['program_name']), compare_string($hostname, $r[0]['hostname']) ); @@ -52,14 +51,5 @@ where program_name = phpt_test Return: resource -array(1) { - [0]= - array(2) { -[hostname]= -string(10) php.net%s -[program_name]= -string(16) phpt_test%s - } -} bool(true) bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Sat Nov 8 13:22:14 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed problems with segmentation faults when using unbuffered queries # Double-freeing results caused these http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.10r2=1.103.2.5.2.13.2.11diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.10 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.11 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.10 Sat Nov 8 12:24:52 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Nov 8 13:22:14 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.10 2008/11/08 12:24:52 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.11 2008/11/08 13:22:14 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -273,6 +273,21 @@ #define efree_n(x) { efree(x); x = NULL; } #define efree_if(x) if (x) efree_n(x) +#ifdef PHP_SYBASE_DEBUG +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + fprintf(stderr, _free_sybase_result(%p) called from line #%d\n, result, __LINE__); \ + fflush(stderr); \ + _free_sybase_result(result); \ + result = NULL; \ + } +#else +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + _free_sybase_result(result); \ + result = NULL; \ + } +#endif static void _free_sybase_result(sybase_result *result) { int i, j; @@ -326,7 +341,7 @@ php_sybase_finish_results(result TSRMLS_CC); } - _free_sybase_result(result); + FREE_SYBASE_RESULT(result); } static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) @@ -1166,8 +1181,6 @@ case CS_CANCELED: default: - _free_sybase_result(result); - result = NULL; retcode = CS_FAIL; break; } @@ -1273,7 +1286,7 @@ break; default: - _free_sybase_result(result); + FREE_SYBASE_RESULT(result); result = NULL; retcode = CS_FAIL; /* Just to be sure */ break; @@ -1463,17 +1476,9 @@ INIT_PZVAL(tmp); ZEND_FETCH_RESOURCE(result, sybase_result *, tmp, -1, Sybase result, le_result); - /* Causes the following segfault: - Program received signal SIGSEGV, Segmentation fault. - 0x8144380 in _efree (ptr=0x81fe024, __zend_filename=0x81841a0 php4/ext/sybase_ct/php_sybase_ct.c, - __zend_lineno=946, __zend_orig_filename=0x0, __zend_orig_lineno=0) at php4/Zend/zend_alloc.c:229 - php4/Zend/zend_alloc.c:229:7284:beg:0x8144380 - */ - #if O_TIMM if (result) { php_sybase_finish_results(result TSRMLS_CC); } - #endif zval_ptr_dtor(tmp); zend_list_delete(sybase_ptr-active_result_index); @@ -1628,9 +1633,7 @@ /* Retry deadlocks up until deadlock_retry_count times */ if (sybase_ptr-deadlock SybCtG(deadlock_retry_count) != -1 ++deadlock_count SybCtG(deadlock_retry_count)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Retried deadlock %d times [max: %ld], giving up, deadlock_count- 1, SybCtG(deadlock_retry_count)); - if (result != NULL) { - _free_sybase_result(result); - } + FREE_SYBASE_RESULT(result); break; } @@ -1649,9 +1652,7 @@ * optimization, we could try not to fetch results in known * deadlock conditions, but deadlock is (should be) rare. */ - if (result != NULL) { -
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_appname.phpt
thekid Sat Nov 8 11:46:06 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_appname.phpt Log: - Made this test independent of field types in master..sysprocesses # char on ASE 11, varchar on ASE 15 http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_appname.phpt?r1=1.2r2=1.2.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_appname.phpt diff -u php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 php-src/ext/sybase_ct/tests/test_appname.phpt:1.2.6.1 --- php-src/ext/sybase_ct/tests/test_appname.phpt:1.2 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/test_appname.phpt Sat Nov 8 11:46:06 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_appname.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $ + * $Id: test_appname.phpt,v 1.2.6.1 2008/11/08 11:46:06 thekid Exp $ */ require('test.inc'); @@ -35,7 +35,6 @@ ); var_dump( -$r, compare_string($program_name, $r[0]['program_name']), compare_string($hostname, $r[0]['hostname']) ); @@ -52,14 +51,5 @@ where program_name = phpt_test Return: resource -array(1) { - [0]= - array(2) { -[hostname]= -string(10) php.net%s -[program_name]= -string(16) phpt_test%s - } -} bool(true) bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
Hi, - MFB: Changed while loop in php_sybase_fetch_result_row() to also read rows with retcode == CS_ROW_FAIL. # Reported by Detlef Neumerkel and Frank Irnich of Sybase Thanks for this commit :) Please add the NEWS entry as well. Tried so: $ cvs ci -m '- Added notes in fixes to ext/sybase_ct' NEWS COMMITINFO /repository/php-src NEWS Access denied: insufficient karma (thekid|php-src) Contact [EMAIL PROTECTED] for access to php-src cvs commit: Pre-commit check failed cvs [commit aborted]: correct above errors first! Could someone w/ sufficient karma commit add these lines to PHP_5_3/NEWS: == - Fixed sybase_unbuffered_query() crashes when not reading all results (Timm) - Fixed sybase_fetch_*() functions to also read rows with CS_ROW_FAIL (Timm) == Thanks in advance! - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_msghandler.phpt
thekid Sat Nov 8 11:45:03 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_msghandler.phpt Log: - Fixed expected warning messages # Changed during migration to parameter parsing API http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_msghandler.phpt?r1=1.2.6.1r2=1.2.6.1.2.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_msghandler.phpt diff -u php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2.6.1 php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2.6.1.2.1 --- php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2.6.1Tue May 22 11:33:36 2007 +++ php-src/ext/sybase_ct/tests/test_msghandler.phptSat Nov 8 11:45:03 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler.phpt,v 1.2.6.1 2007/05/22 11:33:36 thekid Exp $ + * $Id: test_msghandler.phpt,v 1.2.6.1.2.1 2008/11/08 11:45:03 thekid Exp $ */ require('test.inc'); @@ -26,15 +26,15 @@ ? --EXPECTF-- Nonexistant: -Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %stest.inc on line %d -bool(false) +Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, function 'function_does_not_exist' not found or invalid function name in %stest.inc on line %d +NULL Static method: bool(true) Instance method: bool(true) Lambda function: bool(true) Unset: bool(true) Incorrect type: -Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %stest.inc on line %d -bool(false) +Warning: sybase_set_message_handler() expects parameter 1 to be a valid callback, no array or string given in %stest.inc on line %d +NULL Function:bool(true) Query: select getdate(NULL) *** Caught Sybase Server Message #%d [Severity %d, state %d] at line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Sat Nov 8 12:24:52 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - QA: Unified error messages in php_sybase_query() http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.9r2=1.103.2.5.2.13.2.10diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.9 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.10 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.9Sat Nov 8 12:05:46 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Nov 8 12:24:52 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.9 2008/11/08 12:05:46 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.10 2008/11/08 12:24:52 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1431,12 +1431,12 @@ } if (!store !buffered) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, cannot use non-storing mode with buffered queries); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Cannot use non-storing mode with buffered queries); store = 1; } if (php_sybase_connection_id(sybase_link_index, id TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: No connection to close); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: No connection); RETURN_FALSE; } @@ -1451,7 +1451,7 @@ if (sybase_ptr-active_result_index) { zval *tmp = NULL; - php_error_docref(NULL TSRMLS_CC, E_NOTICE, called without first fetching all rows from a previous unbuffered query); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Called without first fetching all rows from a previous unbuffered query); if (sybase_ptr-cmd) { ct_cancel(NULL, sybase_ptr-cmd, CS_CANCEL_ALL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests bug30312.phpt
thekid Sat Nov 8 14:24:38 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/testsbug30312.phpt Log: - MFB: Made this test independent of date format http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312.phpt?r1=1.1.4.1r2=1.1.4.2diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312.phpt diff -u php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1 php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.2 --- php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1 Wed Mar 14 11:46:06 2007 +++ php-src/ext/sybase_ct/tests/bug30312.phpt Sat Nov 8 14:24:38 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.1.4.1 2007/03/14 11:46:06 thekid Exp $ + * $Id: bug30312.phpt,v 1.1.4.2 2008/11/08 14:24:38 thekid Exp $ */ require('test.inc'); @@ -14,14 +14,14 @@ $db= sybase_connect_ex(); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); ? --EXPECTF-- -string(%d) %s %d %d %d:%d%s -string(%d) %s %d %d %d:%d%s +int(%d) +int(%d) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests bug29064.phpt
thekid Sat Nov 8 14:24:55 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/testsbug29064.phpt Log: - Adjusted tests to reality # We select 123456789.12345679, we should have this returned and not # something 123456789.123457 (rounded) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug29064.phpt?r1=1.1r2=1.1.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug29064.phpt diff -u php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 php-src/ext/sybase_ct/tests/bug29064.phpt:1.1.6.1 --- php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 Sun Jul 11 16:57:24 2004 +++ php-src/ext/sybase_ct/tests/bug29064.phpt Sat Nov 8 14:24:55 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug29064.phpt,v 1.1 2004/07/11 16:57:24 thekid Exp $ + * $Id: bug29064.phpt,v 1.1.6.1 2008/11/08 14:24:55 thekid Exp $ */ require('test.inc'); @@ -112,9 +112,9 @@ [test_tinyint]= int(123) [test_real]= -string(16) 123456789.123457 +string(18) 123456789.12345679 [test_double]= -string(16) 123456789.123457 +string(18) 123456789.12345679 } [1]= array(10) { @@ -135,9 +135,9 @@ [test_tinyint]= int(255) [test_real]= -string(17) -123456789.123457 +string(19) -123456789.12345679 [test_double]= -string(17) -123456789.123457 +string(19) -123456789.12345679 } } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_unbuffered_no_full_fetch.phpt
thekid Sat Nov 8 14:28:26 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_unbuffered_no_full_fetch.phpt Log: - MFB: Initial release http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt +++ php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test_unbuffered_no_full_fetch.phpt
thekid Sat Nov 8 13:21:01 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest_unbuffered_no_full_fetch.phpt Log: - Initial release http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt?view=markuprev=1.1 Index: php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt +++ php-src/ext/sybase_ct/tests/test_unbuffered_no_full_fetch.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests bug30312.phpt
thekid Sat Nov 8 13:21:30 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/testsbug30312.phpt Log: - Made this test independent of date format http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312.phpt?r1=1.1.4.1r2=1.1.4.1.2.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312.phpt diff -u php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1 php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1.2.1 --- php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1 Wed Mar 14 11:46:06 2007 +++ php-src/ext/sybase_ct/tests/bug30312.phpt Sat Nov 8 13:21:30 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.1.4.1 2007/03/14 11:46:06 thekid Exp $ + * $Id: bug30312.phpt,v 1.1.4.1.2.1 2008/11/08 13:21:30 thekid Exp $ */ require('test.inc'); @@ -14,14 +14,14 @@ $db= sybase_connect_ex(); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); - $query= sybase_unbuffered_query('select getdate()'); + $query= sybase_unbuffered_query('select datepart(yy, getdate())'); $array= sybase_fetch_array($query); var_dump($array[0]); ? --EXPECTF-- -string(%d) %s %d %d %d:%d%s -string(%d) %s %d %d %d:%d%s +int(%d) +int(%d) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests bug29064.phpt
thekid Sat Nov 8 13:32:29 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/testsbug29064.phpt Log: - Adjusted tests to reality # We select 123456789.12345679, we should have this returned and not # something 123456789.123457 (rounded) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug29064.phpt?r1=1.1r2=1.1.8.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug29064.phpt diff -u php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 php-src/ext/sybase_ct/tests/bug29064.phpt:1.1.8.1 --- php-src/ext/sybase_ct/tests/bug29064.phpt:1.1 Sun Jul 11 16:57:24 2004 +++ php-src/ext/sybase_ct/tests/bug29064.phpt Sat Nov 8 13:32:29 2008 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug29064.phpt,v 1.1 2004/07/11 16:57:24 thekid Exp $ + * $Id: bug29064.phpt,v 1.1.8.1 2008/11/08 13:32:29 thekid Exp $ */ require('test.inc'); @@ -112,9 +112,9 @@ [test_tinyint]= int(123) [test_real]= -string(16) 123456789.123457 +string(18) 123456789.12345679 [test_double]= -string(16) 123456789.123457 +string(18) 123456789.12345679 } [1]= array(10) { @@ -135,9 +135,9 @@ [test_tinyint]= int(255) [test_real]= -string(17) -123456789.123457 +string(19) -123456789.12345679 [test_double]= -string(17) -123456789.123457 +string(19) -123456789.12345679 } } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
Hi, If it fixes a crash, please merge to 5.2. Merged. - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
Hi, If it fixes a crash, please merge to 5.2. And also add a NEWS entry. Will do as soon as I'm able to compile PHP_5_2: F:\cygwin\home\Timm Friebe\devel\php\php_5_2nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. \cygwin\bin\flex.exe -i -SZend/flex.skl -Pzend -oZend/zend_language_scan ner.c Zend/zend_language_scanner.l flex: fatal internal error, bad line in skeleton file NMAKE : fatal error U1077: '\cygwin\bin\flex.exe' : return code '0x1' Stop. I wonder if you read you @php.net alias... :) Hrm, I probably missed your e-mail due to the immense ammounts of SPAM I get. - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Sat Nov 8 12:05:46 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Changed while loop in php_sybase_fetch_result_row() to also read rows with retcode == CS_ROW_FAIL. # Reported by Detlef Neumerkel and Frank Irnich of Sybase http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.8r2=1.103.2.5.2.13.2.9diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.8 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.9 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.8Sun Nov 2 21:19:38 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Nov 8 12:05:46 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.8 2008/11/02 21:19:38 felipe Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.9 2008/11/08 12:05:46 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1200,7 +1200,7 @@ } if (numrows!=-1) numrows+= result-num_rows; - while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED) { + while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED || retcode == CS_ROW_FAIL) { result-num_rows++; i= result-store ? result-num_rows- 1 : 0; if (i = result-blocks_initialized*SYBASE_ROWS_BLOCK) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
thekid Sat Nov 8 12:06:08 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFB: Changed while loop in php_sybase_fetch_result_row() to also read rows with retcode == CS_ROW_FAIL. # Reported by Detlef Neumerkel and Frank Irnich of Sybase http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.14r2=1.103.2.5.2.15diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.14 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.15 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.14Mon Dec 31 07:20:13 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Nov 8 12:06:08 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.14 2007/12/31 07:20:13 sebastian Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.15 2008/11/08 12:06:08 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1143,7 +1143,7 @@ } if (numrows!=-1) numrows+= result-num_rows; - while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED) { + while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED || retcode == CS_ROW_FAIL) { result-num_rows++; i= result-store ? result-num_rows- 1 : 0; if (i = result-blocks_initialized*SYBASE_ROWS_BLOCK) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
thekid Sat Nov 8 14:15:09 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFB: Fixed problems with segmentation faults when using unbuffered queries # Double-freeing results caused these http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.15r2=1.103.2.5.2.16diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.15 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.16 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.15Sat Nov 8 12:06:08 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Nov 8 14:15:08 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.15 2008/11/08 12:06:08 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.16 2008/11/08 14:15:08 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -138,6 +138,21 @@ #define efree_n(x) { efree(x); x = NULL; } #define efree_if(x) if (x) efree_n(x) +#ifdef PHP_SYBASE_DEBUG +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + fprintf(stderr, _free_sybase_result(%p) called from line #%d\n, result, __LINE__); \ + fflush(stderr); \ + _free_sybase_result(result); \ + result = NULL; \ + } +#else +#define FREE_SYBASE_RESULT(result) \ + if (result) { \ + _free_sybase_result(result); \ + result = NULL; \ + } +#endif static void _free_sybase_result(sybase_result *result) { int i, j; @@ -191,7 +206,7 @@ php_sybase_finish_results(result TSRMLS_CC); } - _free_sybase_result(result); + FREE_SYBASE_RESULT(result); } static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) @@ -1109,8 +1124,6 @@ case CS_CANCELED: default: - _free_sybase_result(result); - result = NULL; retcode = CS_FAIL; break; } @@ -1216,7 +1229,7 @@ break; default: - _free_sybase_result(result); + FREE_SYBASE_RESULT(result); result = NULL; retcode = CS_FAIL; /* Just to be sure */ break; @@ -1425,17 +1438,9 @@ INIT_PZVAL(tmp); ZEND_FETCH_RESOURCE(result, sybase_result *, tmp, -1, Sybase result, le_result); - /* Causes the following segfault: - Program received signal SIGSEGV, Segmentation fault. - 0x8144380 in _efree (ptr=0x81fe024, __zend_filename=0x81841a0 php4/ext/sybase_ct/php_sybase_ct.c, - __zend_lineno=946, __zend_orig_filename=0x0, __zend_orig_lineno=0) at php4/Zend/zend_alloc.c:229 - php4/Zend/zend_alloc.c:229:7284:beg:0x8144380 - */ - #if O_TIMM if (result) { php_sybase_finish_results(result TSRMLS_CC); } - #endif zval_ptr_dtor(tmp); zend_list_delete(sybase_ptr-active_result_index); @@ -1590,9 +1595,7 @@ /* Retry deadlocks up until deadlock_retry_count times */ if (sybase_ptr-deadlock SybCtG(deadlock_retry_count) != -1 ++deadlock_count SybCtG(deadlock_retry_count)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Retried deadlock %d times [max: %ld], giving up, deadlock_count- 1, SybCtG(deadlock_retry_count)); - if (result != NULL) { - _free_sybase_result(result); - } + FREE_SYBASE_RESULT(result); break; } @@ -1611,9 +1614,7 @@ * optimization, we could try not to fetch results in known * deadlock conditions, but deadlock is (should be) rare. */ - if (result != NULL) { - _free_sybase_result(result); - } +
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct/tests test.inc
thekid Sat Nov 8 11:47:35 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct/teststest.inc Log: - Changed source to read host, user and password from environment # E.g. nmake test TESTS=ext/sybase_ct PHP_SYBASE_HOST=db PHP_SYBASE_USER=sa PHP_SYBASE_PASS=*** http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test.inc?r1=1.4.6.3r2=1.4.6.3.2.1diff_format=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.4.6.3 php-src/ext/sybase_ct/tests/test.inc:1.4.6.3.2.1 --- php-src/ext/sybase_ct/tests/test.inc:1.4.6.3Tue May 22 11:36:55 2007 +++ php-src/ext/sybase_ct/tests/test.incSat Nov 8 11:47:35 2008 @@ -1,13 +1,13 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.4.6.3 2007/05/22 11:36:55 thekid Exp $ + * $Id: test.inc,v 1.4.6.3.2.1 2008/11/08 11:47:35 thekid Exp $ */ // Change if needed - define('HOST', ''); - define('USER', ''); - define('PASSWORD', ''); + define('HOST', getenv('PHP_SYBASE_HOST')); + define('USER', getenv('PHP_SYBASE_USER')); + define('PASSWORD', getenv('PHP_SYBASE_PASS')); define('TEMPDB', 'tempdb'); // {{{ bool sybase_msg_handler(int msgnumber, int severity, int state, int line, string text) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
Hi, What's the point in that Sybase prefix? We don't have Oracle: invalid connection or MySQL: broken query errors and they seem quite pointless to me, taking into account that they come along with the function names, which already contain that sybase_ or mysql_ prefix. Yes, they're stupid and annoying, and I'd remove them if I didn't know that people rely on this like in preg_match('/Sybase: /', $php_errormsg) - so I decided to keep it until now (and to be consistent inside the extension to have it everywhere). What do the both of you think? Drop it and include a note in NEWS? - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Tue Jun 24 16:33:17 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Migrated all zend_get_parameters_ex calls to zend_parse_parameters() - Fixed prototype declarations to use the type resource instead of int - Fixed sybase_close() not to crash when no connection was previously open http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.4r2=1.103.2.5.2.13.2.5diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.4 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.5 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.4Sun Jun 22 10:11:14 2008 +++ php-src/ext/sybase_ct/php_sybase_ct.c Tue Jun 24 16:33:17 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.4 2008/06/22 10:11:14 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.5 2008/06/24 16:33:17 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -204,7 +204,6 @@ zval_ptr_dtor(sybase_ptr-callback_name); sybase_ptr-callback_name= NULL; } - zend_hash_apply(EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC); /* Non-persistent connections will always be connected or we wouldn't @@ -285,47 +284,55 @@ static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC) { int handled = 0; + zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; + zval **args[5]; - if (callback_name) { - zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; - zval **args[5]; - - MAKE_STD_ZVAL(msgnumber); - ZVAL_LONG(msgnumber, srvmsg-msgnumber); - args[0] = msgnumber; - - MAKE_STD_ZVAL(severity); - ZVAL_LONG(severity, srvmsg-severity); - args[1] = severity; - - MAKE_STD_ZVAL(state); - ZVAL_LONG(state, srvmsg-state); - args[2] = state; - - MAKE_STD_ZVAL(line); - ZVAL_LONG(line, srvmsg-line); - args[3] = line; - - MAKE_STD_ZVAL(text); - ZVAL_STRING(text, srvmsg-text, 1); - args[4] = text; - - if (call_user_function_ex(EG(function_table), NULL, callback_name, retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot call the messagehandler %s, Z_STRVAL_P(callback_name)); - } + /* Border case - empty fcall */ + if (NULL == callback_name) return 0; - if (retval) { - handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); - zval_ptr_dtor(retval); - } + /* Build arguments */ + MAKE_STD_ZVAL(msgnumber); + ZVAL_LONG(msgnumber, srvmsg-msgnumber); + args[0] = msgnumber; + + MAKE_STD_ZVAL(severity); + ZVAL_LONG(severity, srvmsg-severity); + args[1] = severity; - zval_ptr_dtor(msgnumber); - zval_ptr_dtor(severity); - zval_ptr_dtor(state); - zval_ptr_dtor(line); - zval_ptr_dtor(text); + MAKE_STD_ZVAL(state); + ZVAL_LONG(state, srvmsg-state); + args[2] = state; + + MAKE_STD_ZVAL(line); + ZVAL_LONG(line, srvmsg-line); + args[3] = line; + + MAKE_STD_ZVAL(text); + ZVAL_STRING(text, srvmsg-text, 1); + args[4] = text; + + if (call_user_function_ex(EG(function_table), NULL, callback_name, retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { + zval expr_copy; + int use_copy; + + zend_make_printable_zval(callback_name, expr_copy, use_copy); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot call the messagehandler %s, Z_STRVAL(expr_copy)); + zval_dtor(expr_copy); } + if (retval) { + handled = ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); + zval_ptr_dtor(retval); + } else { + handled = 0; + } + + zval_ptr_dtor(msgnumber); + zval_ptr_dtor(severity); + zval_ptr_dtor(state); + zval_ptr_dtor(line); + zval_ptr_dtor(text); + return handled; } @@ -600,7 +607,7 @@ int len; sybase_link *sybase_ptr; -host= user= passwd= charset= appname= NULL; + host= user= passwd= charset= appname= NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, host, len, user, len, passwd, len, charset, len, appname, len) == FAILURE) { return; } @@ -790,38 +797,40
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sybase_ct php_sybase_ct.c
thekid Sun Jun 22 10:11:14 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Changed zend_get_parameters_ex - zend_parse_parameters - Simplified source in php_sybase_do_connect() # Part 1, more to follow http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.13.2.3r2=1.103.2.5.2.13.2.4diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.3 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.4 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13.2.3Mon Dec 31 07:17:16 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun Jun 22 10:11:14 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.3 2007/12/31 07:17:16 sebastian Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13.2.4 2008/06/22 10:11:14 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -597,98 +597,23 @@ char *user, *passwd, *host, *charset, *appname; char *hashed_details; int hashed_details_length; + int len; sybase_link *sybase_ptr; - switch(ZEND_NUM_ARGS()) { - case 0: /* defaults */ - host=user=passwd=charset=appname=NULL; - hashed_details_length=6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - strcpy(hashed_details, sybase_); - break; - case 1: { - zval **yyhost; - - if (zend_get_parameters_ex(1, yyhost) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - host = Z_STRVAL_PP(yyhost); - user=passwd=charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s, Z_STRVAL_PP(yyhost)); - } - break; - case 2: { - zval **yyhost, **yyuser; - - if (zend_get_parameters_ex(2, yyhost, yyuser) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd=charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s___, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); - } - break; - case 3: { - zval **yyhost, **yyuser, **yypasswd; - - if (zend_get_parameters_ex(3, yyhost, yyuser, yypasswd) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s__, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); - } - break; - case 4: { - zval **yyhost, **yyuser, **yypasswd, **yycharset; - - if (zend_get_parameters_ex(4, yyhost, yyuser, yypasswd, yycharset) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(yyhost); - convert_to_string_ex(yyuser); - convert_to_string_ex(yypasswd); - convert_to_string_ex(yycharset); - host = Z_STRVAL_PP(yyhost); - user = Z_STRVAL_PP(yyuser); - passwd = Z_STRVAL_PP(yypasswd); - charset = Z_STRVAL_PP(yycharset); - appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s_%s_, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); -
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests bug26407.phpt test_fetch_object.phpt test_msghandler.phpt test_unbuffered_query.phpt
thekid Tue May 22 11:33:36 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/testsbug26407.phpt test_fetch_object.phpt test_msghandler.phpt test_unbuffered_query.phpt Log: - Fixed tests on Windows # The tests expected %s/test.inc in warnings and notices, but of course, # on Windows, the directory separator is a backslash. # Made this work in both worlds by testing for %stest.inc http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug26407.phpt?r1=1.2r2=1.2.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug26407.phpt diff -u php-src/ext/sybase_ct/tests/bug26407.phpt:1.2 php-src/ext/sybase_ct/tests/bug26407.phpt:1.2.4.1 --- php-src/ext/sybase_ct/tests/bug26407.phpt:1.2 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/bug26407.phpt Tue May 22 11:33:36 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug26407.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $ + * $Id: bug26407.phpt,v 1.2.4.1 2007/05/22 11:33:36 thekid Exp $ */ require('test.inc'); @@ -80,7 +80,7 @@ select bar -Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %s/test.inc on line %d +Notice: sybase_query(): Sybase: Unexpected results, cancelling current in %stest.inc on line %d Return: resource array(1) { [0]= http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_fetch_object.phpt?r1=1.1.6.1r2=1.1.6.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_fetch_object.phpt diff -u php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1.6.1 php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1.6.2 --- php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1.6.1 Wed Mar 14 11:44:24 2007 +++ php-src/ext/sybase_ct/tests/test_fetch_object.phpt Tue May 22 11:33:36 2007 @@ -8,7 +8,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fetch_object.phpt,v 1.1.6.1 2007/03/14 11:44:24 thekid Exp $ + * $Id: test_fetch_object.phpt,v 1.1.6.2 2007/05/22 11:33:36 thekid Exp $ */ require('test.inc'); @@ -65,7 +65,7 @@ 'lastchange' = '%s', )) -Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d +Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %stest_fetch_object.php on line %d stdClass::__set_state(array( 'id' = 1, 'caption' = 'Hello', http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_msghandler.phpt?r1=1.2r2=1.2.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_msghandler.phpt diff -u php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2 php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2.6.1 --- php-src/ext/sybase_ct/tests/test_msghandler.phpt:1.2Sun Jan 25 20:04:08 2004 +++ php-src/ext/sybase_ct/tests/test_msghandler.phptTue May 22 11:33:36 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler.phpt,v 1.2 2004/01/25 20:04:08 thekid Exp $ + * $Id: test_msghandler.phpt,v 1.2.6.1 2007/05/22 11:33:36 thekid Exp $ */ require('test.inc'); @@ -26,14 +26,14 @@ ? --EXPECTF-- Nonexistant: -Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %s/test.inc on line %d +Warning: sybase_set_message_handler(): First argumented is expected to be a valid callback, 'function_does_not_exist' was given in %stest.inc on line %d bool(false) Static method: bool(true) Instance method: bool(true) Lambda function: bool(true) Unset: bool(true) Incorrect type: -Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %s/test.inc on line %d +Warning: sybase_set_message_handler(): First argumented is expected to be either NULL, an array or string, integer given in %stest.inc on line %d bool(false) Function:bool(true) Query: select getdate(NULL) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt?r1=1.3r2=1.3.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt diff -u php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.3 php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.3.6.1 --- php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.3 Fri May 21 21:01:21 2004 +++ php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt Tue May 22 11:33:36 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_unbuffered_query.phpt,v 1.3 2004/05/21 21:01:21 thekid Exp $ + * $Id: test_unbuffered_query.phpt,v 1.3.6.1 2007/05/22 11:33:36 thekid Exp $ */ require('test.inc'); @@ -49,7 +49,7 @@ resource(%d) of type (sybase-ct result) resource(%d) of type
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests bug22403.phpt bug27843.phpt bug28354.phpt
thekid Tue May 22 11:35:47 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/testsbug27843.phpt bug22403.phpt bug28354.phpt Log: - Changed hardcoded tempdb database name to a constant # This constant is defined in test.inc and defaults to tempdb # In certain setups, create procedure permissions may not be granted # in tempdb http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug27843.phpt?r1=1.3r2=1.3.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug27843.phpt diff -u php-src/ext/sybase_ct/tests/bug27843.phpt:1.3 php-src/ext/sybase_ct/tests/bug27843.phpt:1.3.4.1 --- php-src/ext/sybase_ct/tests/bug27843.phpt:1.3 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/bug27843.phpt Tue May 22 11:35:47 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug27843.phpt,v 1.3 2005/02/06 12:59:03 thekid Exp $ + * $Id: bug27843.phpt,v 1.3.4.1 2007/05/22 11:35:47 thekid Exp $ */ require('test.inc'); @@ -15,7 +15,7 @@ // Check if stored procedure already exists $sp_name= 'phpt_bug27843'; - var_dump(sybase_select_db('tempdb', $db)); + var_dump(sybase_select_db(TEMPDB, $db)); if (!sybase_select_single($db, 'select object_id('.$sp_name.')')) { echo Stored procedure {$sp_name} not found, creating\n; var_dump(sybase_query(' http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug22403.phpt?r1=1.2r2=1.2.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug22403.phpt diff -u php-src/ext/sybase_ct/tests/bug22403.phpt:1.2 php-src/ext/sybase_ct/tests/bug22403.phpt:1.2.4.1 --- php-src/ext/sybase_ct/tests/bug22403.phpt:1.2 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/bug22403.phpt Tue May 22 11:35:47 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug22403.phpt,v 1.2 2005/02/06 12:59:03 thekid Exp $ + * $Id: bug22403.phpt,v 1.2.4.1 2007/05/22 11:35:47 thekid Exp $ */ require('test.inc'); @@ -17,7 +17,7 @@ // Check if stored procedure already exists $sp_name= 'phpt_bug22403'; - var_dump(sybase_select_db('tempdb', $db)); + var_dump(sybase_select_db(TEMPDB, $db)); if (!sybase_select_single($db, 'select object_id('.$sp_name.')')) { echo Stored procedure {$sp_name} not found, creating\n; var_dump(sybase_query(' @@ -63,7 +63,7 @@ Return: boolean bool(false) Query: exec does_not_exist -*** Caught Sybase Server Message #2812 [Severity 16, state 4] at line 1 +*** Caught Sybase Server Message #2812 [Severity 16, state %d] at line 1 %s Return: boolean bool(false) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug28354.phpt?r1=1.3r2=1.3.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug28354.phpt diff -u php-src/ext/sybase_ct/tests/bug28354.phpt:1.3 php-src/ext/sybase_ct/tests/bug28354.phpt:1.3.4.1 --- php-src/ext/sybase_ct/tests/bug28354.phpt:1.3 Sun Feb 6 12:59:03 2005 +++ php-src/ext/sybase_ct/tests/bug28354.phpt Tue May 22 11:35:47 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug28354.phpt,v 1.3 2005/02/06 12:59:03 thekid Exp $ + * $Id: bug28354.phpt,v 1.3.4.1 2007/05/22 11:35:47 thekid Exp $ */ require('test.inc'); @@ -17,7 +17,7 @@ // Check if stored procedure already exists $sp_name= 'phpt_bug28354'; - var_dump(sybase_select_db('tempdb', $db)); + var_dump(sybase_select_db(TEMPDB, $db)); if (!sybase_select_single($db, 'select object_id('.$sp_name.')')) { echo Stored procedure {$sp_name} not found, creating\n; var_dump(sybase_query(' -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test.inc
thekid Tue May 22 11:36:55 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest.inc Log: - Added constant TEMPDB, defaulting to tempdb # This constant is used by some of the tests and should point # to a database where the user has create proc|table permissions http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test.inc?r1=1.4.6.2r2=1.4.6.3diff_format=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.4.6.2 php-src/ext/sybase_ct/tests/test.inc:1.4.6.3 --- php-src/ext/sybase_ct/tests/test.inc:1.4.6.2Sun Mar 11 12:56:44 2007 +++ php-src/ext/sybase_ct/tests/test.incTue May 22 11:36:55 2007 @@ -1,13 +1,14 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.4.6.2 2007/03/11 12:56:44 tony2001 Exp $ + * $Id: test.inc,v 1.4.6.3 2007/05/22 11:36:55 thekid Exp $ */ // Change if needed define('HOST', ''); define('USER', ''); define('PASSWORD', ''); + define('TEMPDB', 'tempdb'); // {{{ bool sybase_msg_handler(int msgnumber, int severity, int state, int line, string text) // Handles server messages -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_msghandler_handled.phpt
thekid Tue May 22 11:38:57 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_msghandler_handled.phpt Log: - Fixed expectancy in for SQL query select convert(datetime, notadate) This query should return bool(false) and not a resource() because the above is a syntax error # Exact message yielded by SQL server is the following: # Syntax error during explicit conversion of VARCHAR value `notadate` # to a DATETIME field. http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt?r1=1.1.6.1r2=1.1.6.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt diff -u php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1.6.1 php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1.6.2 --- php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1.6.1Wed Mar 14 11:57:45 2007 +++ php-src/ext/sybase_ct/tests/test_msghandler_handled.phptTue May 22 11:38:57 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler_handled.phpt,v 1.1.6.1 2007/03/14 11:57:45 thekid Exp $ + * $Id: test_msghandler_handled.phpt,v 1.1.6.2 2007/05/22 11:38:57 thekid Exp $ */ require('test.inc'); @@ -65,6 +65,5 @@ Warning: sybase_query(): Sybase: Server message: Syntax error during explicit conversion of VARCHAR value 'notadate' to a DATETIME field. (severity 16, procedure N/A) in %s on line %d - Return: resource -array(0) { -} + Return: boolean +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_long.phpt
thekid Tue May 22 12:16:32 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_long.phpt Log: - Changed hardcoded tempdb database name to a constant http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_long.phpt?r1=1.1r2=1.1.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_long.phpt diff -u php-src/ext/sybase_ct/tests/test_long.phpt:1.1 php-src/ext/sybase_ct/tests/test_long.phpt:1.1.6.1 --- php-src/ext/sybase_ct/tests/test_long.phpt:1.1 Sun May 16 20:28:31 2004 +++ php-src/ext/sybase_ct/tests/test_long.phpt Tue May 22 12:16:32 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_long.phpt,v 1.1 2004/05/16 20:28:31 thekid Exp $ + * $Id: test_long.phpt,v 1.1.6.1 2007/05/22 12:16:32 thekid Exp $ */ require('test.inc'); @@ -15,7 +15,7 @@ define('LONG_MIN', -LONG_MAX - 1); $db= sybase_connect_ex(); - var_dump(sybase_select_db('tempdb', $db)); + var_dump(sybase_select_db(TEMPDB, $db)); // Create table and insert some values var_dump(sybase_query('create table test_long (value numeric(20, 0))')); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_fetch_object.phpt test_fields.phpt
thekid Wed Mar 14 11:44:24 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_fields.phpt test_fetch_object.phpt Log: - Changed expected output # Due to var_export() __set_state() changes http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_fields.phpt?r1=1.1r2=1.1.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_fields.phpt diff -u php-src/ext/sybase_ct/tests/test_fields.phpt:1.1 php-src/ext/sybase_ct/tests/test_fields.phpt:1.1.6.1 --- php-src/ext/sybase_ct/tests/test_fields.phpt:1.1Mon Jul 12 20:26:53 2004 +++ php-src/ext/sybase_ct/tests/test_fields.phptWed Mar 14 11:44:24 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fields.phpt,v 1.1 2004/07/12 20:26:53 thekid Exp $ + * $Id: test_fields.phpt,v 1.1.6.1 2007/03/14 11:44:24 thekid Exp $ */ require('test.inc'); @@ -38,39 +38,39 @@ --EXPECTF-- resource(%d) of type (sybase-ct result) int(4) -class stdClass { - %s $name = 'id'; - %s $max_length = 11; - %s $column_source = ''; - %s $numeric = 1; - %s $type = 'int'; -} -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'author'; - %s $max_length = 4; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'lastchange'; - %s $max_length = 29; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'datetime'; -} +stdClass::__set_state(array( + 'name' = 'id', + 'max_length' = 11, + 'column_source' = '', + 'numeric' = 1, + 'type' = 'int', +)) +stdClass::__set_state(array( + 'name' = 'caption', + 'max_length' = 5, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) +stdClass::__set_state(array( + 'name' = 'author', + 'max_length' = 4, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) +stdClass::__set_state(array( + 'name' = 'lastchange', + 'max_length' = 29, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'datetime', +)) bool(true) -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} +stdClass::__set_state(array( + 'name' = 'caption', + 'max_length' = 5, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_fetch_object.phpt?r1=1.1r2=1.1.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_fetch_object.phpt diff -u php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1 php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1.6.1 --- php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1 Sun Jul 11 16:10:03 2004 +++ php-src/ext/sybase_ct/tests/test_fetch_object.phpt Wed Mar 14 11:44:24 2007 @@ -8,7 +8,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fetch_object.phpt,v 1.1 2004/07/11 16:10:03 thekid Exp $ + * $Id: test_fetch_object.phpt,v 1.1.6.1 2007/03/14 11:44:24 thekid Exp $ */ require('test.inc'); @@ -46,29 +46,29 @@ sybase_close($db); ? --EXPECTF-- -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) +article::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) +article::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests bug30312.phpt
thekid Wed Mar 14 11:46:06 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/testsbug30312.phpt Log: - Changed expected output # select getdate() returns something like Mar 14 2007 12:44PM, we # were checking for one additional (nonexistant) whitespace after Mar # which was wrong. Don`t know when and how this changed http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312.phpt?r1=1.1r2=1.1.4.1diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312.phpt diff -u php-src/ext/sybase_ct/tests/bug30312.phpt:1.1 php-src/ext/sybase_ct/tests/bug30312.phpt:1.1.4.1 --- php-src/ext/sybase_ct/tests/bug30312.phpt:1.1 Sun Feb 6 11:58:53 2005 +++ php-src/ext/sybase_ct/tests/bug30312.phpt Wed Mar 14 11:46:06 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.1 2005/02/06 11:58:53 thekid Exp $ + * $Id: bug30312.phpt,v 1.1.4.1 2007/03/14 11:46:06 thekid Exp $ */ require('test.inc'); @@ -23,5 +23,5 @@ var_dump($array[0]); ? --EXPECTF-- -string(%d) %s %d %d %d:%d%s -string(%d) %s %d %d %d:%d%s +string(%d) %s %d %d %d:%d%s +string(%d) %s %d %d %d:%d%s -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
thekid Wed Mar 14 11:48:49 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed segmentation fault in sybase_connect() # This was introduced by changing sprintf - spprintf and resulted # from passing a char* to spprintf() instead of a char** http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.10r2=1.103.2.5.2.11diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.10 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.11 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.10Tue Mar 6 02:07:10 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Wed Mar 14 11:48:49 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.10 2007/03/06 02:07:10 stas Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.11 2007/03/14 11:48:49 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -599,7 +599,7 @@ convert_to_string_ex(yyhost); host = Z_STRVAL_PP(yyhost); user=passwd=charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s, Z_STRVAL_PP(yyhost)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s, Z_STRVAL_PP(yyhost)); } break; case 2: { @@ -613,7 +613,7 @@ host = Z_STRVAL_PP(yyhost); user = Z_STRVAL_PP(yyuser); passwd=charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s___, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s___, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); } break; case 3: { @@ -629,7 +629,7 @@ user = Z_STRVAL_PP(yyuser); passwd = Z_STRVAL_PP(yypasswd); charset=appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s__, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s__, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); } break; case 4: { @@ -647,7 +647,7 @@ passwd = Z_STRVAL_PP(yypasswd); charset = Z_STRVAL_PP(yycharset); appname=NULL; - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s_%s_, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s_%s_, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); } break; case 5: { @@ -666,7 +666,7 @@ passwd = Z_STRVAL_PP(yypasswd); charset = Z_STRVAL_PP(yycharset); appname = Z_STRVAL_PP(yyappname); - hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s_%s_%s, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s_%s_%s, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); } break; default: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct/tests test_msghandler_handled.phpt
thekid Wed Mar 14 11:57:45 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest_msghandler_handled.phpt Log: - Changed message handler also to handle message #11021 - Adjusted expected output # Seems newer Sybase versions yielf different error codes for getdate(NULL) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt?r1=1.1r2=1.1.6.1diff_format=u Index: php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt diff -u php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1 php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1.6.1 --- php-src/ext/sybase_ct/tests/test_msghandler_handled.phpt:1.1Sun Jul 11 16:07:07 2004 +++ php-src/ext/sybase_ct/tests/test_msghandler_handled.phptWed Mar 14 11:57:45 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_msghandler_handled.phpt,v 1.1 2004/07/11 16:07:07 thekid Exp $ + * $Id: test_msghandler_handled.phpt,v 1.1.6.1 2007/03/14 11:57:45 thekid Exp $ */ require('test.inc'); @@ -20,6 +20,7 @@ return; case 174: // The function 'GETDATE' requires 0 arguments. + case 11021: // Function GETDATE invoked with wrong number or type of argument(s) printf(*** Caught '%s'\n, trim($text)); return; } @@ -45,7 +46,7 @@ --EXPECTF-- bool(true) Query: select getdate(NULL) -*** Caught 'The function 'GETDATE' requires 0 arguments.' +*** Caught '%s' Return: boolean bool(false) Query: print Hi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_fetch_object.phpt test_fields.phpt
thekid Wed Mar 14 12:00:35 2007 UTC Modified files: /php-src/ext/sybase_ct/teststest_fields.phpt test_fetch_object.phpt Log: - Changed expected output # Due to var_export() __set_state() changes http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_fields.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_fields.phpt diff -u php-src/ext/sybase_ct/tests/test_fields.phpt:1.1 php-src/ext/sybase_ct/tests/test_fields.phpt:1.2 --- php-src/ext/sybase_ct/tests/test_fields.phpt:1.1Mon Jul 12 20:26:53 2004 +++ php-src/ext/sybase_ct/tests/test_fields.phptWed Mar 14 12:00:35 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fields.phpt,v 1.1 2004/07/12 20:26:53 thekid Exp $ + * $Id: test_fields.phpt,v 1.2 2007/03/14 12:00:35 thekid Exp $ */ require('test.inc'); @@ -38,39 +38,39 @@ --EXPECTF-- resource(%d) of type (sybase-ct result) int(4) -class stdClass { - %s $name = 'id'; - %s $max_length = 11; - %s $column_source = ''; - %s $numeric = 1; - %s $type = 'int'; -} -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'author'; - %s $max_length = 4; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} -class stdClass { - %s $name = 'lastchange'; - %s $max_length = 29; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'datetime'; -} +stdClass::__set_state(array( + 'name' = 'id', + 'max_length' = 11, + 'column_source' = '', + 'numeric' = 1, + 'type' = 'int', +)) +stdClass::__set_state(array( + 'name' = 'caption', + 'max_length' = 5, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) +stdClass::__set_state(array( + 'name' = 'author', + 'max_length' = 4, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) +stdClass::__set_state(array( + 'name' = 'lastchange', + 'max_length' = 29, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'datetime', +)) bool(true) -class stdClass { - %s $name = 'caption'; - %s $max_length = 5; - %s $column_source = ''; - %s $numeric = 0; - %s $type = 'string'; -} +stdClass::__set_state(array( + 'name' = 'caption', + 'max_length' = 5, + 'column_source' = '', + 'numeric' = 0, + 'type' = 'string', +)) http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test_fetch_object.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/test_fetch_object.phpt diff -u php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1 php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.2 --- php-src/ext/sybase_ct/tests/test_fetch_object.phpt:1.1 Sun Jul 11 16:10:03 2004 +++ php-src/ext/sybase_ct/tests/test_fetch_object.phpt Wed Mar 14 12:00:35 2007 @@ -8,7 +8,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_fetch_object.phpt,v 1.1 2004/07/11 16:10:03 thekid Exp $ + * $Id: test_fetch_object.phpt,v 1.2 2007/03/14 12:00:35 thekid Exp $ */ require('test.inc'); @@ -46,29 +46,29 @@ sybase_close($db); ? --EXPECTF-- -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} -class article { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) +article::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) +article::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d -class stdClass { - %s $id = 1; - %s $caption = 'Hello'; - %s $author = 'timm'; - %s $lastchange = '%s'; -} +stdClass::__set_state(array( + 'id' = 1, + 'caption' = 'Hello', + 'author' = 'timm', + 'lastchange' = '%s', +)) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug30312.phpt
thekid Wed Mar 14 12:01:21 2007 UTC Modified files: /php-src/ext/sybase_ct/testsbug30312.phpt Log: - MFB: Changed expected output # select getdate() returns something like Mar 14 2007 12:44PM, we # were checking for one additional (nonexistant) whitespace after Mar # which was wrong. Don`t know when and how this changed http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/bug30312.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/sybase_ct/tests/bug30312.phpt diff -u php-src/ext/sybase_ct/tests/bug30312.phpt:1.1 php-src/ext/sybase_ct/tests/bug30312.phpt:1.2 --- php-src/ext/sybase_ct/tests/bug30312.phpt:1.1 Sun Feb 6 11:58:53 2005 +++ php-src/ext/sybase_ct/tests/bug30312.phpt Wed Mar 14 12:01:21 2007 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug30312.phpt,v 1.1 2005/02/06 11:58:53 thekid Exp $ + * $Id: bug30312.phpt,v 1.2 2007/03/14 12:01:21 thekid Exp $ */ require('test.inc'); @@ -23,5 +23,5 @@ var_dump($array[0]); ? --EXPECTF-- -string(%d) %s %d %d %d:%d%s -string(%d) %s %d %d %d:%d%s +string(%d) %s %d %d %d:%d%s +string(%d) %s %d %d %d:%d%s -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/sybase_ct/tests index.php
On Mon, 2005-02-07 at 14:44 +0100, Marcus Boerger wrote: Hello Timm, include files in the tests should be named .inc or similar This is not an include file, and it's called index.php so that you can simply use the directory as DocumentRoot for an Apache virtual host. because otherwiese make clean will erase them. Huh? Which make clean are you talking about? $ ls -al ext/sybase_ct/tests/index.php -rw-r--r-- 1 thekid thekid 5160 Feb 6 15:08 ext/sybase_ct/tests/index.php $ make clean find . -name \*.lo -o -name \*.o | xargs rm -f find . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf rm -f libphp5.la sapi/cli/php sapi/cgi/php modules/* libs/* $ ls -al ext/sybase_ct/tests/index.php -rw-r--r-- 1 thekid thekid 5160 Feb 6 15:08 ext/sybase_ct/tests/index.php Could you please rename this one? ??? - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug30312.phpt
thekid Sun Feb 6 06:58:54 2005 EDT Added files: /php-src/ext/sybase_ct/testsbug30312.phpt Log: - Initial release # Works perfectly with php-cli http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/bug30312.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/bug30312.phpt +++ php-src/ext/sybase_ct/tests/bug30312.phpt --TEST-- Sybase-CT bug #30312 (sybase_unbuffered_query calls) --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: bug30312.phpt,v 1.1 2005/02/06 11:58:53 thekid Exp $ */ require('test.inc'); error_reporting(error_reporting() !E_NOTICE); // Suppress notices $db= sybase_connect_ex(); $query= sybase_unbuffered_query('select getdate()'); $array= sybase_fetch_array($query); var_dump($array[0]); $query= sybase_unbuffered_query('select getdate()'); $array= sybase_fetch_array($query); var_dump($array[0]); ? --EXPECTF-- string(%d) %s %d %d %d:%d%s string(%d) %s %d %d %d:%d%s -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests index.php
thekid Sun Feb 6 08:35:10 2005 EDT Added files: /php-src/ext/sybase_ct/testsindex.php Log: - Initial release # Used for being able to run .phpt-files in a webserver environment # Incomplete and pretty basic but serves its purpose ATM http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/index.php?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/index.php +++ php-src/ext/sybase_ct/tests/index.php ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: index.php,v 1.1 2005/02/06 13:35:09 thekid Exp $ */ // {{{ class PHPTExpectancy // Abstract base class for expectancies class PHPTExpectancy { var $expected = ''; function PHPTExpectancy($expected) { $this-expected= $expected; } function matches($output) { } } // }}} // {{{ class PHPTRegexExpectancy // Expectancy class for regular expressions class PHPTRegexExpectancy extends PHPTExpectancy { function matches($output) { return preg_match('°^'.strtr(preg_quote(rtrim($this-expected), '°'), array( '%s' = '(.+)', '%d' = '([0-9]+)' )).'°', $output); } } // }}} // {{{ class PHPTTest // Represents a single .phpt-style test class PHPTTest { var $name = '', $description = '', $skipif = '', $code = '', $expectancy = NULL, $output = ''; function fromFile($filename) { $fd= fopen($filename, 'r'); $sections= array(); $current= NULL; while (!feof($fd)) { $line= fgets($fd, 0x); if (1 == sscanf($line, '--%[^-]--', $section)) { $sections[$section]= ''; $current= $section; continue; } $sections[$current].= $line; } fclose($fd); // Create instance from read data and return it $t= new PHPTTest(); { $t-name= substr(realpath($filename), 0, -1); $t-description= rtrim($sections['TEST']); $t-skipif= $sections['SKIPIF']; $t-code= $sections['FILE']; if (isset($sections['EXPECTF'])) { $t-expectancy= new PHPTRegexExpectancy($sections['EXPECTF']); } else { // XXX TBI XXX } } return $t; } function onError($errno, $errstr, $errfile, $errline) { static $names= array( E_NOTICE= 'Notice', E_WARNING = 'Warning' ); printf( \n%s: %s in %s on line %d\n, $names[$errno], $errstr, $this-name, $errline ); } function run() { // Precondition check - will die if test needs to be skipped eval('?'.$this-skipif); set_error_handler(array($this, 'onError')); { error_reporting(E_ALL); ob_start(); eval('?'.$this-code); $this-output= rtrim(ob_get_contents()); ob_end_clean(); } restore_error_handler(); return $this-expectancy-matches($this-output); } } // }}} // {{{ main if (isset($_GET['phpinfo'])) { phpinfo((int)$_GET['phpinfo']); echo 'a href=?Home/a'; exit(); } echo __ html head titlePHPT Test/title style type=text/css body { background-color: #ff; color: #00; font-size: 75%; } body, td, th, h1, h2 { font-family: sans-serif; } h1 { font-size: 150%; } h2 { font-size: 125%; } .header { background: url(?=PHPE9568F34-D428-11d2-A769-00AA001ACF42); background-position: right center; background-repeat: no-repeat; min-height: 70px; background-color: #cc; padding: 4px; padding-right: 120px; border: 1px solid #00; } hr { width: 600px; background-color: #cc; border: 0px; height: 1px; color: #00; } /style /head body __; $test= basename($_SERVER['QUERY_STRING']); if ($test file_exists($test)) { $t= PHPTTest::fromFile($test); echo 'div class=headerh1'.basename($t-name), ': ', $t-description.'/h1/div'; echo 'a href=?Back to test suite/a'; flush(); // Run the test $result= $t-run(); // Evaluate results if ($result) { echo 'h2Passed/h2'; } else { echo 'h2Failed/h2hr/'; echo 'h3Actual output/h3'; echo 'xmp', $t-output, '/xmphr/'; echo 'h3Expectancy/h3'; echo 'xmp', $t-expectancy-expected, '/xmp'; } echo 'hr/'; exit(); } echo 'div class=headerh1Test suite/h1/div'; // phpinfo() links echo 'phpinfo(): '; foreach (array( 1 = 'General', 4 = 'Configuration', 8 = 'Modules' ) as $const = $name) { printf('a
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests index.php
thekid Sun Feb 6 09:06:25 2005 EDT Modified files: /php-src/ext/sybase_ct/testsindex.php Log: - Fixed error handler for situations in which an error was raised in an include file http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/index.php?r1=1.1r2=1.2ty=u Index: php-src/ext/sybase_ct/tests/index.php diff -u php-src/ext/sybase_ct/tests/index.php:1.1 php-src/ext/sybase_ct/tests/index.php:1.2 --- php-src/ext/sybase_ct/tests/index.php:1.1 Sun Feb 6 08:35:09 2005 +++ php-src/ext/sybase_ct/tests/index.php Sun Feb 6 09:06:21 2005 @@ -1,7 +1,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: index.php,v 1.1 2005/02/06 13:35:09 thekid Exp $ + * $Id: index.php,v 1.2 2005/02/06 14:06:21 thekid Exp $ */ // {{{ class PHPTExpectancy @@ -84,7 +84,7 @@ \n%s: %s in %s on line %d\n, $names[$errno], $errstr, -$this-name, +strstr($errfile, 'eval()\'d code') ? $this-name : $errfile, $errline ); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests index.php
thekid Sun Feb 6 09:08:12 2005 EDT Modified files: /php-src/ext/sybase_ct/testsindex.php Log: - Made error handler not output anything if error was not in error_reporting() mask http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/index.php?r1=1.2r2=1.3ty=u Index: php-src/ext/sybase_ct/tests/index.php diff -u php-src/ext/sybase_ct/tests/index.php:1.2 php-src/ext/sybase_ct/tests/index.php:1.3 --- php-src/ext/sybase_ct/tests/index.php:1.2 Sun Feb 6 09:06:21 2005 +++ php-src/ext/sybase_ct/tests/index.php Sun Feb 6 09:08:11 2005 @@ -1,7 +1,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: index.php,v 1.2 2005/02/06 14:06:21 thekid Exp $ + * $Id: index.php,v 1.3 2005/02/06 14:08:11 thekid Exp $ */ // {{{ class PHPTExpectancy @@ -80,6 +80,7 @@ E_WARNING = 'Warning' ); + if (!(error_reporting() $errno)) return; printf( \n%s: %s in %s on line %d\n, $names[$errno], -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Thu Sep 9 15:17:50 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Defaulted ini variable sybct.deadlock_retry_count to 0 # For details on why this was changed, see # http://zend.com/lists/php-dev/200409/msg00108.html http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.100r2=1.101ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.100 php-src/ext/sybase_ct/php_sybase_ct.c:1.101 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.100 Sat Aug 21 13:54:11 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Thu Sep 9 15:17:50 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.100 2004/08/21 17:54:11 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.101 2004/09/09 19:17:50 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -350,7 +350,7 @@ STD_PHP_INI_ENTRY(sybct.min_client_severity, 10, PHP_INI_ALL, OnUpdateLong, min_client_severity, zend_sybase_globals, sybase_globals) STD_PHP_INI_ENTRY(sybct.login_timeout, -1, PHP_INI_ALL, OnUpdateLong, login_timeout, zend_sybase_globals, sybase_globals) STD_PHP_INI_ENTRY(sybct.hostname, NULL, PHP_INI_ALL, OnUpdateString, hostname, zend_sybase_globals, sybase_globals) - STD_PHP_INI_ENTRY_EX(sybct.deadlock_retry_count, -1, PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers) + STD_PHP_INI_ENTRY_EX(sybct.deadlock_retry_count, 0, PHP_INI_ALL, OnUpdateLong, deadlock_retry_count, zend_sybase_globals, sybase_globals, display_link_numbers) PHP_INI_END() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Sat Aug 21 13:54:11 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed packet size setting # Patch by Alex Kiesel http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.99r2=1.100ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.99 php-src/ext/sybase_ct/php_sybase_ct.c:1.100 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.99 Thu Jul 29 15:32:46 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sat Aug 21 13:54:11 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.99 2004/07/29 19:32:46 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.100 2004/08/21 17:54:11 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -190,6 +190,7 @@ } } + ct_cmd_drop(sybase_ptr-cmd); ct_con_drop(sybase_ptr-connection); efree(sybase_ptr); SybCtG(num_links)--; @@ -399,14 +400,6 @@ } } - /* Set the packet size, which is also per context */ - if (cfg_get_long(sybct.packet_size, opt)==SUCCESS) { - CS_INT cs_packet_size = opt; - if (ct_config(sybase_globals-context, CS_SET, CS_PACKETSIZE, cs_packet_size, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update the packet size); - } - } - sybase_globals-num_persistent=0; sybase_globals-callback_name = NULL; } @@ -473,6 +466,7 @@ { CS_LOCALE *tmp_locale; TSRMLS_FETCH(); + long packetsize; /* set a CS_CONNECTION record */ if (ct_con_alloc(SybCtG(context), sybase-connection)!=CS_SUCCEED) { @@ -518,6 +512,12 @@ } } } + } + } + + if (cfg_get_long(sybct.packet_size, packetsize) == SUCCESS) { + if (ct_con_props(sybase-connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)packetsize, CS_UNUSED, NULL) != CS_SUCCEED) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update connection packetsize.); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Thu Jul 29 15:32:46 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed bug #29064 (Exact numeric/decimal/money datatypes lose precision) - Fixed bug #27843 (sybase_query() triggers (spurious?) notices when query is a stored procedure) - Fixed multiple memory leaks with sybase_unbuffered_query() - Changed sybase_query() to ignore store_results = false in buffering mode, it would yield unpredictable results - Fixed sybase_unbuffered_query() when used with store_results = false - Changed sybase_fetch_object() to ignore second argument when passed as NULL - Made sybase_data_seek() error message more verbose - Fixed memory leak in shutdown when not all rows where selected in an unbuffered query http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.98r2=1.99ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.98 php-src/ext/sybase_ct/php_sybase_ct.c:1.99 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.98 Mon Jul 19 03:19:47 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Thu Jul 29 15:32:46 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.98 2004/07/19 07:19:47 andi Exp $ */ +/* $Id: php_sybase_ct.c,v 1.99 2004/07/29 19:32:46 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -118,13 +118,12 @@ return 0; } - static void _free_sybase_result(sybase_result *result) { int i, j; if (result-data) { - for (i=0; i(result-store ? result-num_rows : 0); i++) { + for (i = 0; i (result-store ? result-num_rows : MIN(1, result-num_rows)); i++) { for (j=0; jresult-num_fields; j++) { zval_dtor(result-data[i][j]); } @@ -144,10 +143,21 @@ efree(result); } +/* Forward declaration */ +static int php_sybase_finish_results (sybase_result *result); + static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) { sybase_result *result = (sybase_result *)rsrc-ptr; + /* Check to see if we've read all rows */ + if (result-sybase_ptr result-sybase_ptr-active_result_index) { + if (result-sybase_ptr-cmd) { + ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); + } + php_sybase_finish_results(result); + } + _free_sybase_result(result); } @@ -1042,11 +1052,15 @@ case CS_PARAM_RESULT: case CS_ROW_RESULT: /* Unexpected results, cancel them. */ - case CS_STATUS_RESULT: php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Unexpected results, cancelling current); ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_CURRENT); break; + case CS_STATUS_RESULT: + /* Status result from a stored procedure, cancel it but do not tell user */ + ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_CURRENT); + break; + default: php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Unexpected results, cancelling all); ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); @@ -1087,6 +1101,19 @@ return retcode; } +#define RETURN_DOUBLE_VAL(result, buf, length) \ + if ((length - 1) = EG(precision)) {\ + errno = 0; \ + Z_DVAL(result) = strtod(buf, NULL); \ + if (errno != ERANGE) { \ + Z_TYPE(result) = IS_DOUBLE; \ + } else {\ + ZVAL_STRINGL(result, buf, length- 1, 1); \ + } \ + } else {\ + ZVAL_STRINGL(result, buf, length- 1, 1); \ + } + static int php_sybase_fetch_result_row (sybase_result *result, int numrows) { int i, j; @@ -1107,7 +1134,6 @@ } */ - /* i= result-num_rows++; */ result-num_rows++; i= result-store ? result-num_rows- 1 : 0; if (i = result-blocks_initialized*SYBASE_ROWS_BLOCK) { @@ -1117,27 +1143,48 @@ result-data[i] = (zval *) safe_emalloc(sizeof(zval), result-num_fields, 0); } - for (j=0; jresult-num_fields; j++) { + for (j = 0; j result-num_fields;
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/sybase_ct php_sybase_ct.c
thekid Thu Jul 29 16:05:47 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFH: . Fixed bug #29064 (Exact numeric/decimal/money datatypes lose precision) . Fixed bug #27843 (sybase_query() triggers (spurious?) notices when query is a stored procedure) . Fixed multiple memory leaks with sybase_unbuffered_query() . Changed sybase_query() to ignore store_results = false in buffering mode, it would yield unpredictable results . Fixed sybase_unbuffered_query() when used with store_results = false . Changed sybase_fetch_object() to ignore second argument when passed as NULL . Made sybase_data_seek() error message more verbose . Fixed memory leak in shutdown when not all rows where selected in an unbuffered query # sort of, empty_string - STR_EMPTY_ALLOC patch ommitted http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.97r2=1.97.2.1ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.97 php-src/ext/sybase_ct/php_sybase_ct.c:1.97.2.1 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.97 Sat Jul 10 03:46:08 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Thu Jul 29 16:05:46 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.97 2004/07/10 07:46:08 andi Exp $ */ +/* $Id: php_sybase_ct.c,v 1.97.2.1 2004/07/29 20:05:46 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -118,13 +118,12 @@ return 0; } - static void _free_sybase_result(sybase_result *result) { int i, j; if (result-data) { - for (i=0; i(result-store ? result-num_rows : 0); i++) { + for (i = 0; i (result-store ? result-num_rows : MIN(1, result-num_rows)); i++) { for (j=0; jresult-num_fields; j++) { zval_dtor(result-data[i][j]); } @@ -144,10 +143,21 @@ efree(result); } +/* Forward declaration */ +static int php_sybase_finish_results (sybase_result *result); + static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) { sybase_result *result = (sybase_result *)rsrc-ptr; + /* Check to see if we've read all rows */ + if (result-sybase_ptr result-sybase_ptr-active_result_index) { + if (result-sybase_ptr-cmd) { + ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); + } + php_sybase_finish_results(result); + } + _free_sybase_result(result); } @@ -1042,11 +1052,15 @@ case CS_PARAM_RESULT: case CS_ROW_RESULT: /* Unexpected results, cancel them. */ - case CS_STATUS_RESULT: php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Unexpected results, cancelling current); ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_CURRENT); break; + case CS_STATUS_RESULT: + /* Status result from a stored procedure, cancel it but do not tell user */ + ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_CURRENT); + break; + default: php_error_docref(NULL TSRMLS_CC, E_NOTICE, Sybase: Unexpected results, cancelling all); ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); @@ -1087,6 +1101,19 @@ return retcode; } +#define RETURN_DOUBLE_VAL(result, buf, length) \ + if ((length - 1) = EG(precision)) {\ + errno = 0; \ + Z_DVAL(result) = strtod(buf, NULL); \ + if (errno != ERANGE) { \ + Z_TYPE(result) = IS_DOUBLE; \ + } else {\ + ZVAL_STRINGL(result, buf, length- 1, 1); \ + } \ + } else {\ + ZVAL_STRINGL(result, buf, length- 1, 1); \ + } + static int php_sybase_fetch_result_row (sybase_result *result, int numrows) { int i, j; @@ -1107,7 +1134,6 @@ } */ - /* i= result-num_rows++; */ result-num_rows++; i= result-store ? result-num_rows- 1 : 0; if (i = result-blocks_initialized*SYBASE_ROWS_BLOCK) { @@ -1117,27 +1143,48 @@ result-data[i] = (zval *) safe_emalloc(sizeof(zval), result-num_fields, 0);
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_fields.phpt
thekid Mon Jul 12 16:26:53 2004 EDT Added files: /php-src/ext/sybase_ct/teststest_fields.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/test_fields.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/test_fields.phpt +++ php-src/ext/sybase_ct/tests/test_fields.phpt --TEST-- Sybase-CT sybase_field_* functions --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: test_fields.phpt,v 1.1 2004/07/12 20:26:53 thekid Exp $ */ require('test.inc'); $db= sybase_connect_ex(); // Issue a query $q= sybase_unbuffered_query('select 1 as id, Hello as caption, timm as author, getdate() as lastchange ', $db, FALSE); var_dump($q); var_dump(sybase_num_fields($q)); // Go through each field, dumping it while ($field= sybase_fetch_field($q)) { var_export($field); echo \n; } // Seek to the second field and fetch it var_dump(sybase_field_seek($q, 1)); var_export(sybase_fetch_field($q)); echo \n; sybase_close($db); ? --EXPECTF-- resource(%d) of type (sybase-ct result) int(4) class stdClass { %s $name = 'id'; %s $max_length = 11; %s $column_source = ''; %s $numeric = 1; %s $type = 'int'; } class stdClass { %s $name = 'caption'; %s $max_length = 5; %s $column_source = ''; %s $numeric = 0; %s $type = 'string'; } class stdClass { %s $name = 'author'; %s $max_length = 4; %s $column_source = ''; %s $numeric = 0; %s $type = 'string'; } class stdClass { %s $name = 'lastchange'; %s $max_length = 29; %s $column_source = ''; %s $numeric = 0; %s $type = 'datetime'; } bool(true) class stdClass { %s $name = 'caption'; %s $max_length = 5; %s $column_source = ''; %s $numeric = 0; %s $type = 'string'; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_fetch_object.phpt
thekid Sun Jul 11 12:10:03 2004 EDT Added files: /php-src/ext/sybase_ct/teststest_fetch_object.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/test_fetch_object.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/test_fetch_object.phpt +++ php-src/ext/sybase_ct/tests/test_fetch_object.phpt --TEST-- Sybase-CT sybase_fetch_object --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: test_fetch_object.phpt,v 1.1 2004/07/11 16:10:03 thekid Exp $ */ require('test.inc'); // {{{ class article class article { } // }}} // {{{ resource fetch_object(resource db, [mixed arg= NULL]) // Fetches a resultset and returns it as an object function fetch_object($db, $arg= NULL) { return sybase_fetch_object(sybase_query('select 1 as id, Hello as caption, timm as author, getdate() as lastchange ', $db), $arg); } // }}} $db= sybase_connect_ex(); // Test with stdClass var_export(fetch_object($db)); echo \n; // Test with userland class var_export(fetch_object($db, 'article')); echo \n; // Test with object var_export(fetch_object($db, new article())); echo \n; // Test with non-existant class var_export(fetch_object($db, '***')); echo \n; sybase_close($db); ? --EXPECTF-- class stdClass { %s $id = 1; %s $caption = 'Hello'; %s $author = 'timm'; %s $lastchange = '%s'; } class article { %s $id = 1; %s $caption = 'Hello'; %s $author = 'timm'; %s $lastchange = '%s'; } class article { %s $id = 1; %s $caption = 'Hello'; %s $author = 'timm'; %s $lastchange = '%s'; } Notice: sybase_fetch_object(): Sybase: Class *** has not been declared in %s/test_fetch_object.php on line %d class stdClass { %s $id = 1; %s $caption = 'Hello'; %s $author = 'timm'; %s $lastchange = '%s'; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_types.phpt
thekid Sun Jul 11 12:57:12 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest_types.phpt Log: - Added simple test for float exceeding the float precision # See bug #29064 http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test_types.phpt?r1=1.3r2=1.4ty=u Index: php-src/ext/sybase_ct/tests/test_types.phpt diff -u php-src/ext/sybase_ct/tests/test_types.phpt:1.3 php-src/ext/sybase_ct/tests/test_types.phpt:1.4 --- php-src/ext/sybase_ct/tests/test_types.phpt:1.3 Sun May 16 16:33:44 2004 +++ php-src/ext/sybase_ct/tests/test_types.phpt Sun Jul 11 12:57:12 2004 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_types.phpt,v 1.3 2004/05/16 20:33:44 thekid Exp $ + * $Id: test_types.phpt,v 1.4 2004/07/11 16:57:12 thekid Exp $ */ require('test.inc'); @@ -21,7 +21,8 @@ '.(LONG_MIN - 1).' as integer_min_exceed, '.(LONG_MAX).' as integer_max, '.(LONG_MAX + 1).' as integer_max_exceed, -1.0 as float, +1.0 as float, +12345678901234567890123456789012.123456 as large_float, $22.36 as money, Binford as string, convert(datetime, 2004-01-23) as date, @@ -40,7 +41,8 @@ -%s as integer_min_exceed, %s as integer_max, %s as integer_max_exceed, -1.0 as float, +1.0 as float, +12345678901234567890123456789012.123456 as large_float, $22.36 as money, Binford as string, convert(datetime, 2004-01-23) as date, @@ -65,6 +67,8 @@ float(%s) [float]= float(1) +[large_float]= +string(39) 12345678901234567890123456789012.123456 [money]= float(22.36) [string]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug29064.phpt
thekid Sun Jul 11 12:57:24 2004 EDT Added files: /php-src/ext/sybase_ct/testsbug29064.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/bug29064.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/bug29064.phpt +++ php-src/ext/sybase_ct/tests/bug29064.phpt --TEST-- Sybase-CT bug #29064 (Exact numeric/decimal/money datatypes lose precision) --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: bug29064.phpt,v 1.1 2004/07/11 16:57:24 thekid Exp $ */ require('test.inc'); $db= sybase_connect_ex(); // Create a temporary table and fill it with test values var_dump(sybase_query(' create table #test ( test_decimal decimal(38, 6) null, test_numeric numeric(38, 12) null, test_moneymoney null, test_bigint decimal(38, 0) null, test_int int null, test_smallmoney smallmoney null, test_smallint smallintnull, test_tinyint tinyint null, test_real float null, test_double float null ) ', $db)); var_dump(sybase_query(' insert into #test ( test_decimal, test_numeric, test_money, test_bigint, test_int, test_smallmoney, test_smallint, test_tinyint, test_real, test_double ) values ( 12345678901234567890123456789012.123456, 12345678901234567890123456.123456789012, 123456789012345.1234, 12345678901234567890123456789012345678, 1234567890, 123456.1234, 12345, 123, 123456789.12345679, 123456789.12345679 ) ', $db)); var_dump(sybase_query(' insert into #test ( test_decimal, test_numeric, test_money, test_bigint, test_int, test_smallmoney, test_smallint, test_tinyint, test_real, test_double ) values ( -12345678901234567890123456789012.123456, -12345678901234567890123456.123456789012, -123456789012345.1234, -12345678901234567890123456789012345678, -1234567890, -123456.1234, -12345, 255, -123456789.12345679, -123456789.12345679 ) ', $db)); // Select the data var_dump(sybase_select_ex($db, 'select * from #test')); // Clean up and close connection var_dump(sybase_query('drop table #test', $db)); sybase_close($db); ? --EXPECTF-- bool(true) bool(true) bool(true) Query: select * from #test Return: resource array(2) { [0]= array(10) { [test_decimal]= string(39) 12345678901234567890123456789012.123456 [test_numeric]= string(39) 12345678901234567890123456.123456789012 [test_money]= string(18) 123456789012345.12 [test_bigint]= string(38) 12345678901234567890123456789012345678 [test_int]= int(1234567890) [test_smallmoney]= float(123456.12) [test_smallint]= int(12345) [test_tinyint]= int(123) [test_real]= string(16) 123456789.123457 [test_double]= string(16) 123456789.123457 } [1]= array(10) { [test_decimal]= string(40) -12345678901234567890123456789012.123456 [test_numeric]= string(40) -12345678901234567890123456.123456789012 [test_money]= string(19) -123456789012345.12 [test_bigint]= string(39) -12345678901234567890123456789012345678 [test_int]= int(-1234567890) [test_smallmoney]= float(-123456.12) [test_smallint]= int(-12345) [test_tinyint]= int(255) [test_real]= string(17) -123456789.123457 [test_double]= string(17) -123456789.123457 } } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_query_nostore.phpt
thekid Sun Jul 11 12:57:38 2004 EDT Added files: /php-src/ext/sybase_ct/teststest_query_nostore.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/test_query_nostore.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/test_query_nostore.phpt +++ php-src/ext/sybase_ct/tests/test_query_nostore.phpt --TEST-- Sybase-CT query without storing --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: test_query_nostore.phpt,v 1.1 2004/07/11 16:57:38 thekid Exp $ */ require('test.inc'); $db= sybase_connect_ex(); // Create test table and insert some data var_dump(sybase_query(' create table #test ( id numeric(10, 0) primary key not null, caption varchar(255) not null, author varchar(50) not null, link varchar(255) null, lastchange datetime default getdate() null ) ', $db)); var_dump(sybase_query('insert into #test ( id, caption, author ) values ( 1, Hello, timm ) ', $db)); var_dump(sybase_query('insert into #test ( id, caption, author, link ) values ( 2, World, thekid, http://thekid.de/; ) ', $db)); var_dump(sybase_query('insert into #test ( id, caption, author ) values ( 3, PHP, friebe ) ', $db)); // Fetch data $q= sybase_unbuffered_query('select * from #test order by id', $db, FALSE); var_dump($q); while ($row= sybase_fetch_assoc($q)) { var_dump($row); } // Clean up and close connection var_dump(sybase_query('drop table #test')); sybase_close($db); ? --EXPECTF-- bool(true) bool(true) bool(true) bool(true) resource(%d) of type (sybase-ct result) array(5) { [id]= int(1) [caption]= string(5) Hello [author]= string(4) timm [link]= NULL [lastchange]= string(%d) %s } array(5) { [id]= int(2) [caption]= string(5) World [author]= string(6) thekid [link]= string(17) http://thekid.de/; [lastchange]= string(%d) %s } array(5) { [id]= int(3) [caption]= string(3) PHP [author]= string(6) friebe [link]= NULL [lastchange]= string(%d) %s } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
thekid Fri May 21 15:39:01 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFH: Fixed TSRM build http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.73.2.13r2=1.73.2.14ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.13 php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.14 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.13 Sun May 16 16:36:41 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Fri May 21 15:39:01 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.13 2004/05/16 20:36:41 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.14 2004/05/21 19:39:01 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1133,7 +1133,7 @@ /* This signals we have an integer datatype, but we need to convert to double if we * overflow. */ - convert_scalar_to_number(result-data[i][j]); + convert_scalar_to_number(result-data[i][j] TSRMLS_CC); break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug28354.phpt
thekid Fri May 21 15:45:55 2004 EDT Added files: /php-src/ext/sybase_ct/testsbug28354.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/bug28354.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/bug28354.phpt +++ php-src/ext/sybase_ct/tests/bug28354.phpt --TEST-- Sybase-CT bug #28354 (sybase_free_result crash) --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: bug28354.phpt,v 1.1 2004/05/21 19:45:55 thekid Exp $ */ require('test.inc'); $db= sybase_connect_ex(); sybase_set_message_handler('sybase_msg_handler'); error_reporting(error_reporting() !E_NOTICE); // Suppress notices // Check if stored procedure already exists $sp_name= basename(__FILE__, '.php'); var_dump(sybase_select_db('tempdb', $db)); if (!sybase_select_single($db, 'select object_id('.$sp_name.')')) { echo Stored procedure {$sp_name} not found, creating\n; var_dump(sybase_query(' create proc '.$sp_name.' as begin select @@version end ')); } else { echo Stored procedure {$sp_name} found, using\n; var_dump(TRUE); } $r= sybase_query('exec '.$sp_name, $db); $i= 0; while ($row= sybase_fetch_row($r)) { var_dump($i++, $row[0]); } sybase_free_result($r); sybase_close($db); ? --EXPECTF-- bool(true) Stored procedure %s bool(true) Query: exec %s int(0) string(%s) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Fri May 21 16:29:38 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed bug #28354 http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.95r2=1.96ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.95 php-src/ext/sybase_ct/php_sybase_ct.c:1.96 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.95 Tue May 18 06:53:53 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Fri May 21 16:29:38 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.95 2004/05/18 10:53:53 edink Exp $ */ +/* $Id: php_sybase_ct.c,v 1.96 2004/05/21 20:29:38 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1576,7 +1576,6 @@ php_sybase_query(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } - /* {{{ proto bool sybase_free_result(int result) Free result memory */ PHP_FUNCTION(sybase_free_result) @@ -1595,7 +1594,7 @@ ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, Sybase result, le_result); /* Did we fetch up until the end? */ - if (result-last_retcode != CS_END_DATA) { + if (result-last_retcode != CS_END_DATA result-last_retcode != CS_END_RESULTS) { /* php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cancelling the rest of the results\n); */ ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); php_sybase_finish_results(result); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
thekid Fri May 21 16:30:44 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFH: Fixed bug #28354 http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.73.2.14r2=1.73.2.15ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.14 php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.15 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.14 Fri May 21 15:39:01 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Fri May 21 16:30:44 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.14 2004/05/21 19:39:01 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.15 2004/05/21 20:30:44 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1595,7 +1595,7 @@ ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, Sybase result, le_result); /* Did we fetch up until the end? */ - if (result-last_retcode != CS_END_DATA) { + if (result-last_retcode != CS_END_DATA result-last_retcode != CS_END_RESULTS) { /* php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cancelling the rest of the results\n); */ ct_cancel(NULL, result-sybase_ptr-cmd, CS_CANCEL_ALL); php_sybase_finish_results(result); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests bug28354.phpt
thekid Fri May 21 16:53:01 2004 EDT Modified files: /php-src/ext/sybase_ct/testsbug28354.phpt Log: - Fixed expected return value from var_dump() - Cleaned up SQL statement # This bug has been fixed, but this test should be kept anyways, # just to make sure it does not reappear http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/bug28354.phpt?r1=1.1r2=1.2ty=u Index: php-src/ext/sybase_ct/tests/bug28354.phpt diff -u php-src/ext/sybase_ct/tests/bug28354.phpt:1.1 php-src/ext/sybase_ct/tests/bug28354.phpt:1.2 --- php-src/ext/sybase_ct/tests/bug28354.phpt:1.1 Fri May 21 15:45:55 2004 +++ php-src/ext/sybase_ct/tests/bug28354.phpt Fri May 21 16:53:01 2004 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: bug28354.phpt,v 1.1 2004/05/21 19:45:55 thekid Exp $ + * $Id: bug28354.phpt,v 1.2 2004/05/21 20:53:01 thekid Exp $ */ require('test.inc'); @@ -21,9 +21,7 @@ if (!sybase_select_single($db, 'select object_id('.$sp_name.')')) { echo Stored procedure {$sp_name} not found, creating\n; var_dump(sybase_query(' - create proc '.$sp_name.' - as - begin + create proc '.$sp_name.' as begin select @@version end ')); @@ -44,6 +42,5 @@ bool(true) Stored procedure %s bool(true) - Query: exec %s int(0) -string(%s) +string(%d) %s -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_unbuffered_query.phpt
thekid Fri May 21 16:54:39 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest_unbuffered_query.phpt Log: - Removed currently leaking auto-cancel test - Fixed expected return value from sybase_num_rows() when an invalid resource is passed (returns false instead of NULL) http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt?r1=1.1r2=1.2ty=u Index: php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt diff -u php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.1 php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.2 --- php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.1 Sun Feb 8 19:32:39 2004 +++ php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt Fri May 21 16:54:39 2004 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_unbuffered_query.phpt,v 1.1 2004/02/09 00:32:39 thekid Exp $ + * $Id: test_unbuffered_query.phpt,v 1.2 2004/05/21 20:54:39 thekid Exp $ */ require('test.inc'); @@ -38,15 +38,6 @@ } var_dump($i, $j, $i - $j); - // Test #4: Auto-cancel - $q= sybase_unbuffered_query('select name from master..systypes', $db); - var_dump($q); - sybase_fetch_assoc($q); - $q= sybase_unbuffered_query('select name from master..systypes', $db); - var_dump($q); - sybase_fetch_assoc($q); - sybase_free_result($q); - sybase_close($db); ? --EXPECTF-- @@ -59,12 +50,8 @@ resource(%d) of type (Unknown) Warning: sybase_num_rows(): %d is not a valid Sybase result resource in %s/test_unbuffered_query.php on line %d -NULL +bool(false) resource(%d) of type (sybase-ct result) int(%d) int(%d) int(4) -resource(%d) of type (sybase-ct result) - -Notice: sybase_unbuffered_query(): called without first fetching all rows from a previous unbuffered query in %s/test_unbuffered_query.php on line %d -resource(%d) of type (sybase-ct result) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_unbuffered_query.phpt
thekid Fri May 21 17:01:21 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest_unbuffered_query.phpt Log: - Fixed expected return value from test #2 Invalid resources yield bool(false) in PHP5, NULL in PHP4 http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt?r1=1.2r2=1.3ty=u Index: php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt diff -u php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.2 php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.3 --- php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt:1.2 Fri May 21 16:54:39 2004 +++ php-src/ext/sybase_ct/tests/test_unbuffered_query.phpt Fri May 21 17:01:21 2004 @@ -6,7 +6,7 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_unbuffered_query.phpt,v 1.2 2004/05/21 20:54:39 thekid Exp $ + * $Id: test_unbuffered_query.phpt,v 1.3 2004/05/21 21:01:21 thekid Exp $ */ require('test.inc'); @@ -26,7 +26,7 @@ var_dump($q); // Test #2: after sybase_free_result, this should be an invalid resource - var_dump(sybase_num_rows($q)); + var_dump(FALSE == sybase_num_rows($q)); // Test #3: Seeking $q= sybase_unbuffered_query('select name from master..systypes', $db); @@ -50,7 +50,7 @@ resource(%d) of type (Unknown) Warning: sybase_num_rows(): %d is not a valid Sybase result resource in %s/test_unbuffered_query.php on line %d -bool(false) +bool(true) resource(%d) of type (sybase-ct result) int(%d) int(%d) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_long.phpt
thekid Sun May 16 16:28:31 2004 EDT Added files: /php-src/ext/sybase_ct/teststest_long.phpt Log: - Initial release http://cvs.php.net/co.php/php-src/ext/sybase_ct/tests/test_long.phpt?r=1.1p=1 Index: php-src/ext/sybase_ct/tests/test_long.phpt +++ php-src/ext/sybase_ct/tests/test_long.phpt --TEST-- Sybase-CT select LONG_MAX / LONG_MIN --SKIPIF-- ?php require('skipif.inc'); ? --FILE-- ?php /* This file is part of PHP test framework for ext/sybase_ct * * $Id: test_long.phpt,v 1.1 2004/05/16 20:28:31 thekid Exp $ */ require('test.inc'); define('LONG_MAX', is_int(2147483648) ? 9223372036854775807 : 2147483647); define('LONG_MIN', -LONG_MAX - 1); $db= sybase_connect_ex(); var_dump(sybase_select_db('tempdb', $db)); // Create table and insert some values var_dump(sybase_query('create table test_long (value numeric(20, 0))')); var_dump(sybase_query('insert test_long values ('.(LONG_MAX - 1).')')); var_dump(sybase_query('insert test_long values ('.(LONG_MAX).')')); var_dump(sybase_query('insert test_long values ('.(LONG_MAX + 1).')')); var_dump(sybase_query('insert test_long values ('.(LONG_MIN + 1).')')); var_dump(sybase_query('insert test_long values ('.(LONG_MIN).')')); var_dump(sybase_query('insert test_long values ('.(LONG_MIN - 1).')')); // Select values var_dump(sybase_select_ex($db, 'select value from test_long')); // Drop table var_dump(sybase_query('drop table test_long')); sybase_close($db); ? --EXPECTF-- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) Query: select value from test_long Return: resource array(6) { [0]= array(1) { [value]= int(%s) } [1]= array(1) { [value]= int(%s) } [2]= array(1) { [value]= float(%s) } [3]= array(1) { [value]= int(-%s) } [4]= array(1) { [value]= int(-%s) } [5]= array(1) { [value]= float(-%s) } } bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Sun May 16 16:30:36 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed auto-conversion from long to double when LONG_MAX / LONG_MIN where overflown http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.93r2=1.94ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.93 php-src/ext/sybase_ct/php_sybase_ct.c:1.94 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.93 Fri Apr 16 12:27:13 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun May 16 16:30:35 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.93 2004/04/16 16:27:13 thetaphi Exp $ */ +/* $Id: php_sybase_ct.c,v 1.94 2004/05/16 20:30:35 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1127,15 +1127,14 @@ convert_to_long(result-data[i][j]); break; case 2: - /* We also get numbers that are actually integers here due to the check on -* precision against 9 (ranges are -1E10 to -1E9 and 1E9 to 1E10). As we -* cannot be sure that they fit into MIN_LONG = x = MAX_LONG, we call -* convert_to_double() on them. This is a small performance penalty, but -* ensures that select 2147483648 will be a float and select 2147483647 -* will be become an int. -*/ convert_to_double(result-data[i][j]); break; + case 3: + /* This signals we have an integer datatype, but we need to convert to double if we +* overflow. +*/ + convert_scalar_to_number(result-data[i][j]); + break; } } } @@ -1243,7 +1242,7 @@ case CS_DECIMAL_TYPE: result-datafmt[i].maxlength = result-datafmt[i].precision + 3; /* numeric(10) vs numeric(10, 1) */ - result-numerics[i] = (result-datafmt[i].scale == 0 result-datafmt[i].precision = 9) ? 1 : 2; + result-numerics[i] = (result-datafmt[i].scale == 0) ? 3 : 2; break; default: result-datafmt[i].maxlength++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test_types.phpt
thekid Sun May 16 16:33:45 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest_types.phpt Log: - Fixed test for LONG_MIN / LONG_MAX for 64-bit platforms http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test_types.phpt?r1=1.2r2=1.3ty=u Index: php-src/ext/sybase_ct/tests/test_types.phpt diff -u php-src/ext/sybase_ct/tests/test_types.phpt:1.2 php-src/ext/sybase_ct/tests/test_types.phpt:1.3 --- php-src/ext/sybase_ct/tests/test_types.phpt:1.2 Sat Jan 24 10:18:52 2004 +++ php-src/ext/sybase_ct/tests/test_types.phpt Sun May 16 16:33:44 2004 @@ -6,18 +6,21 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test_types.phpt,v 1.2 2004/01/24 15:18:52 thekid Exp $ + * $Id: test_types.phpt,v 1.3 2004/05/16 20:33:44 thekid Exp $ */ require('test.inc'); + define('LONG_MAX', is_int(2147483648) ? 9223372036854775807 : 2147483647); + define('LONG_MIN', -LONG_MAX - 1); + $db= sybase_connect_ex(); var_dump(sybase_select_ex($db, 'select 1 as integer, --2147483647 as integer_min, --2147483648 as integer_min_exceed, -2147483647 as integer_max, -2147483648 as integer_max_exceed, +'.(LONG_MIN).' as integer_min, +'.(LONG_MIN - 1).' as integer_min_exceed, +'.(LONG_MAX).' as integer_max, +'.(LONG_MAX + 1).' as integer_max_exceed, 1.0 as float, $22.36 as money, Binford as string, @@ -33,10 +36,10 @@ --EXPECTF-- Query: select 1 as integer, --2147483647 as integer_min, --2147483648 as integer_min_exceed, -2147483647 as integer_max, -2147483648 as integer_max_exceed, +-%s as integer_min, +-%s as integer_min_exceed, +%s as integer_max, +%s as integer_max_exceed, 1.0 as float, $22.36 as money, Binford as string, @@ -53,13 +56,13 @@ [integer]= int(1) [integer_min]= -int(-2147483647) +int(-%s) [integer_min_exceed]= -float(-2147483648) +float(-%s) [integer_max]= -int(2147483647) +int(%s) [integer_max_exceed]= -float(2147483648) +float(%s) [float]= float(1) [money]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
thekid Sun May 16 16:36:41 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFH: Fixed auto-conversion from long to double when LONG_MAX / LONG_MIN where overflown http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.73.2.12r2=1.73.2.13ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.12 php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.13 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.12 Fri Apr 16 12:27:57 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun May 16 16:36:41 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.12 2004/04/16 16:27:57 thetaphi Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.13 2004/05/16 20:36:41 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1127,15 +1127,14 @@ convert_to_long(result-data[i][j]); break; case 2: - /* We also get numbers that are actually integers here due to the check on -* precision against 9 (ranges are -1E10 to -1E9 and 1E9 to 1E10). As we -* cannot be sure that they fit into MIN_LONG = x = MAX_LONG, we call -* convert_to_double() on them. This is a small performance penalty, but -* ensures that select 2147483648 will be a float and select 2147483647 -* will be become an int. -*/ convert_to_double(result-data[i][j]); break; + case 3: + /* This signals we have an integer datatype, but we need to convert to double if we +* overflow. +*/ + convert_scalar_to_number(result-data[i][j]); + break; } } } @@ -1243,7 +1242,7 @@ case CS_DECIMAL_TYPE: result-datafmt[i].maxlength = result-datafmt[i].precision + 3; /* numeric(10) vs numeric(10, 1) */ - result-numerics[i] = (result-datafmt[i].scale == 0 result-datafmt[i].precision = 9) ? 1 : 2; + result-numerics[i] = (result-datafmt[i].scale == 0) ? 3 : 2; break; default: result-datafmt[i].maxlength++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
thekid Sun Feb 15 05:37:10 2004 EDT Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - Changed initialization of function arguments to message handler # Hopefully fixes bug #27157 (Compile Failure on Solaris 8), user does # not know how to use patch and therefore couldn't verify this works. http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.90r2=1.91ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.90 php-src/ext/sybase_ct/php_sybase_ct.c:1.91 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.90 Sun Jan 25 15:03:10 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun Feb 15 05:37:09 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.90 2004/01/25 20:03:10 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.91 2004/02/15 10:37:09 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -243,30 +243,43 @@ int handled = 0; if (callback_name) { - zval *retval = NULL; - zval severity, msgnumber, state, line, text; - zval *ptrs[5]= {msgnumber, severity, state, line, text}; - zval **args[5]= {ptrs[0], ptrs[1], ptrs[2], ptrs[3], ptrs[4]}; - - INIT_ZVAL(msgnumber); - INIT_ZVAL(severity); - INIT_ZVAL(state); - INIT_ZVAL(line); - INIT_ZVAL(text); - - ZVAL_LONG(msgnumber, srvmsg-msgnumber); - ZVAL_LONG(severity, srvmsg-severity); - ZVAL_LONG(state, srvmsg-state); - ZVAL_LONG(line, srvmsg-line); - ZVAL_STRING(text, srvmsg-text, 0); + zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; + zval **args[5]; + + MAKE_STD_ZVAL(msgnumber); + ZVAL_LONG(msgnumber, srvmsg-msgnumber); + args[0] = msgnumber; + + MAKE_STD_ZVAL(severity); + ZVAL_LONG(severity, srvmsg-severity); + args[1] = severity; + + MAKE_STD_ZVAL(state); + ZVAL_LONG(state, srvmsg-state); + args[2] = state; + + MAKE_STD_ZVAL(line); + ZVAL_LONG(line, srvmsg-line); + args[3] = line; + + MAKE_STD_ZVAL(text); + ZVAL_STRING(text, srvmsg-text, 1); + args[4] = text; if (call_user_function_ex(EG(function_table), NULL, callback_name, retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot call the messagehandler %s, Z_STRVAL_P(callback_name)); } + if (retval) { handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); zval_ptr_dtor(retval); } + + zval_ptr_dtor(msgnumber); + zval_ptr_dtor(severity); + zval_ptr_dtor(state); + zval_ptr_dtor(line); + zval_ptr_dtor(text); } return handled; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
thekid Sun Feb 15 05:38:58 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Changed initialization of function arguments to message handler # Hopefully fixes bug #27157 (Compile Failure on Solaris 8), user does # not know how to use patch and therefore couldn't verify this works. http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.73.2.9r2=1.73.2.10ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.9 php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.10 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.9 Sun Jan 25 15:14:05 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun Feb 15 05:38:57 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.9 2004/01/25 20:14:05 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.10 2004/02/15 10:38:57 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -243,30 +243,43 @@ int handled = 0; if (callback_name) { - zval *retval = NULL; - zval severity, msgnumber, state, line, text; - zval *ptrs[5]= {msgnumber, severity, state, line, text}; - zval **args[5]= {ptrs[0], ptrs[1], ptrs[2], ptrs[3], ptrs[4]}; - - INIT_ZVAL(msgnumber); - INIT_ZVAL(severity); - INIT_ZVAL(state); - INIT_ZVAL(line); - INIT_ZVAL(text); - - ZVAL_LONG(msgnumber, srvmsg-msgnumber); - ZVAL_LONG(severity, srvmsg-severity); - ZVAL_LONG(state, srvmsg-state); - ZVAL_LONG(line, srvmsg-line); - ZVAL_STRING(text, srvmsg-text, 0); + zval *msgnumber, *severity, *state, *line, *text, *retval = NULL; + zval **args[5]; + + MAKE_STD_ZVAL(msgnumber); + ZVAL_LONG(msgnumber, srvmsg-msgnumber); + args[0] = msgnumber; + + MAKE_STD_ZVAL(severity); + ZVAL_LONG(severity, srvmsg-severity); + args[1] = severity; + + MAKE_STD_ZVAL(state); + ZVAL_LONG(state, srvmsg-state); + args[2] = state; + + MAKE_STD_ZVAL(line); + ZVAL_LONG(line, srvmsg-line); + args[3] = line; + + MAKE_STD_ZVAL(text); + ZVAL_STRING(text, srvmsg-text, 1); + args[4] = text; if (call_user_function_ex(EG(function_table), NULL, callback_name, retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot call the messagehandler %s, Z_STRVAL_P(callback_name)); } + if (retval) { handled= ((Z_TYPE_P(retval) != IS_BOOL) || (Z_BVAL_P(retval) != 0)); zval_ptr_dtor(retval); } + + zval_ptr_dtor(msgnumber); + zval_ptr_dtor(severity); + zval_ptr_dtor(state); + zval_ptr_dtor(line); + zval_ptr_dtor(text); } return handled; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
thekid Sun Feb 15 05:55:56 2004 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Fixed bug #26407 (Result set fetching broken around transactions) http://cvs.php.net/diff.php/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.73.2.10r2=1.73.2.11ty=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.10 php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.11 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.73.2.10 Sun Feb 15 05:38:57 2004 +++ php-src/ext/sybase_ct/php_sybase_ct.c Sun Feb 15 05:55:55 2004 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.10 2004/02/15 10:38:57 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.11 2004/02/15 10:55:55 thekid Exp $ */ #ifdef HAVE_CONFIG_H @@ -1091,8 +1091,8 @@ CS_INT retcode; /* We've already fetched everything */ - if (result-last_retcode == CS_END_DATA) { - return CS_END_DATA; + if (result-last_retcode == CS_END_DATA || result-last_retcode == CS_END_RESULTS) { + return result-last_retcode; } if (numrows!=-1) numrows+= result-num_rows; @@ -1143,7 +1143,6 @@ } result-last_retcode= retcode; - switch (retcode) { case CS_END_DATA: retcode = php_sybase_finish_results(result); @@ -1278,12 +1277,13 @@ result-fields[i].numeric = result-numerics[i]; Z_TYPE(result-fields[i]) = result-types[i]; } - + retcode= php_sybase_fetch_result_row(result, buffered ? 1 : -1); if (retcode == CS_FAIL) { return NULL; } + result-last_retcode = retcode; return result; } @@ -1412,7 +1412,6 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Cannot read results); RETURN_FALSE; } - switch ((int) restype) { case CS_CMD_FAIL: default: @@ -1450,6 +1449,7 @@ /* Check for left-over results */ if (!buffered status != Q_RESULT) { while ((retcode = ct_results(sybase_ptr-cmd, restype))==CS_SUCCEED) { + switch ((int) restype) { case CS_CMD_SUCCEED: case CS_CMD_DONE: @@ -1471,6 +1471,7 @@ RETURN_FALSE; } status = Q_RESULT; + retcode = result-last_retcode; } else { /* Unexpected results, cancel them. */ ct_cancel(NULL, sybase_ptr-cmd, CS_CANCEL_CURRENT); @@ -1488,8 +1489,10 @@ if (status == Q_FAILURE) { ct_cancel(NULL, sybase_ptr-cmd, CS_CANCEL_ALL); } + if (retcode == CS_END_RESULTS) { + break; + } } - switch (retcode) { case CS_END_RESULTS: /* Normal. */ @@ -1513,7 +1516,7 @@ break; } } - + /* Retry deadlocks up until deadlock_retry_count times */ if (sybase_ptr-deadlock SybCtG(deadlock_retry_count) != -1 ++deadlock_count SybCtG(deadlock_retry_count)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Retried deadlock %d times [max: %ld], giving up\n, deadlock_count- 1, SybCtG(deadlock_retry_count)); @@ -1667,7 +1670,7 @@ ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, Sybase result, le_result); /* Unbuffered? */ - if (result-last_retcode != CS_END_DATA) { + if (result-last_retcode != CS_END_DATA result-last_retcode != CS_END_RESULTS) { php_sybase_fetch_result_row(result, 1); } @@ -1704,7 +1707,7 @@ ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, Sybase result, le_result); /* Unbuffered ? Fetch next row */ - if (result-last_retcode != CS_END_DATA) { + if (result-last_retcode != CS_END_DATA result-last_retcode != CS_END_RESULTS) { php_sybase_fetch_result_row(result, 1); } @@ -1817,7
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test.inc
thekid Tue Feb 10 15:39:09 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest.inc Log: - Removed pointless call to error_reporting() http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test.inc?r1=1.3r2=1.4ty=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.3 php-src/ext/sybase_ct/tests/test.inc:1.4 --- php-src/ext/sybase_ct/tests/test.inc:1.3Sun Feb 8 19:14:24 2004 +++ php-src/ext/sybase_ct/tests/test.incTue Feb 10 15:39:08 2004 @@ -1,11 +1,9 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.3 2004/02/09 00:14:24 thekid Exp $ + * $Id: test.inc,v 1.4 2004/02/10 20:39:08 thekid Exp $ */ - error_reporting(E_ALL); - // Change if needed define('HOST', ''); define('USER', ''); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/sybase_ct/tests test.inc
On Mon, 2004-02-09 at 17:02, Marcus Boerger wrote: Hello Timm, you shouldn't set the error severity at all because the test system should already take care about it unless you overwrite it because you are checking some error levels. Can I be sure E_NOTICE is included? The reason I need this is that several test cases of mine include Notice: ... in their EXPECTF section. By setting the error reporting to E_ALL forcibly, I wanted to ensure notices being displayed. Btw.: $ find . -name '*.phpt' -exec grep -H 'error_reporting' {} \;|wc -l 98 - Timm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct/tests test.inc
thekid Sun Feb 8 18:58:47 2004 EDT Modified files: /php-src/ext/sybase_ct/teststest.inc Log: - Made server name and credentials contain something obviously incorrect. - Made charset parameter default to iso_1 (fixed Sybase: Unable to update character set. warnings which were failing all tests when the official Sybase libraries were used - FreeTDS ignores this). http://cvs.php.net/diff.php/php-src/ext/sybase_ct/tests/test.inc?r1=1.1r2=1.2ty=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.1 php-src/ext/sybase_ct/tests/test.inc:1.2 --- php-src/ext/sybase_ct/tests/test.inc:1.1Fri Jan 23 21:18:13 2004 +++ php-src/ext/sybase_ct/tests/test.incSun Feb 8 18:58:46 2004 @@ -1,13 +1,13 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.1 2004/01/24 02:18:13 thekid Exp $ + * $Id: test.inc,v 1.2 2004/02/08 23:58:46 thekid Exp $ */ // Change if needed - define('HOST', 'php3'); - define('USER', 'news'); - define('PASSWORD', 'stuemper'); + define('HOST', ''); + define('USER', ''); + define('PASSWORD', ''); // {{{ bool sybase_msg_handler(int msgnumber, int severity, int state, int line, string text) // Handles server messages @@ -52,7 +52,7 @@ // Connect to the sybase server using the defines HOST, USER and PASSWORD function sybase_connect_ex($charset= NULL, $appname= NULL) { sybase_min_server_severity(11); // Suppress changed database context -if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset, $appname))) { +if (!($db= sybase_connect(HOST, USER, PASSWORD, $charset ? $charset : 'iso_1', $appname))) { die('Connect to '.USER.'@'.HOST.' failed (using password: '.(PASSWORD ? 'yes' : 'no').')'); } return $db; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php