[PHP-DEV] Re: PHP 4.0 Bug #6840 Updated: echo and print stops outputting after getting an NULL (from an oci8 query) From: Anders Biström (anders <email protected>)
Date: 09/25/00

Bug Database wrote:
>
> ID: 6840
> Updated by: stas
> Reported By: anders <email protected>
> Status: Feedback
> Bug Type: *Function Specific
> Assigned To:
> Comments:
>
> Is this reproduceable without Oracle involved? If yes, please provide
> short reproducing script...

        Acctally the problem stopped after getting the NLS_* settings correcly
(was missing)
        for Oracle, so it seems to be more an Oci8 problem. In other words,
        not knowing the php source, it seems that without correct NLS_*
        envirment settings an oci8 query that fails sets returning strings
(null)
        to something that ?destroys? the output buffer that echo, print uses.
        Later turned out also printf is affected.
        I would still consider it a bug though.
        
        So, the example in the bug-report that I sent does reproduce it if
        NLS_* environment is missing.
        

> Previous Comments:
> ---------------------------------------------------------------------------
>
> [2000-09-21 20:59:05] anders <email protected>
> /*
>
> After searching for an error for hours I came to the conclusion it is in
>
> echo *and* print, but not in printf. Also, a flush(); will help somewhat after
>
> the problematic echo line > echo(sprintf(", %s(%s) = %s(%s)", ...); flush();
>
> allthough everything after the 4th %s will be gone., 4th being most likely
>
> a string being null */
>
> /* Form here OK all way to: */
>
> include("forms/header"); // HTML head & title & meta & body tags
>
> OCIInternalDebug(1);
>
> $conn = OCIPLogon(SQL_USER, SQL_PASS, SQL_HOST);
>
> $sql_str = "select * from kaupungit";
>
> if (!$conn) {
>
> echo "Error connection, exiting";
>
> exit;
>
> }
>
>
>
> $result = OCIParse($conn, $sql_str);
>
> echo_d("<!-- sql_str: $sql_str, q: $result -->n");
>
> $success = OCIExecute($result, OCI_COMMIT_ON_SUCCESS);
>
> // $success = 1;
>
> if ($success) {
>
> // $numrows = OCIFetchStatement($result, &$row);
>
>
>
> // OCIFetchInto($result,&$row,OCI_ASSOC+OCI_RETURN_NULLS);
>
> OCIFetchInto($result,&$row);
>
> // OCIFetch($result);
>
>
>
> $err = OCIError($result);
>
> if (is_array($err))
>
> echo($err['code']."=".$err['message']."<br>n");
>
>
>
> echo("YEAH(type=".gettype($row));
>
>
>
> if (isset($numrows))
>
> echo(", rows=$numrows");
>
>
>
> if (is_array($row)) {
>
> while (list($key, $val) = each($row)) {
>
> /* here.. line below stops all output, was tried with sprintf and without */
>
> echo(sprintf(", %s(%s) = %s(%s)",
>
> gettype($key), $key,
>
> gettype($val), $val)); /* Specificly the value of $val breaks echo */
>
> if (is_array($val)) {
>
> echo("(".count($val).")");
>
> echo("[".$val[0]."]");
>
> while (list($key2, $val2) = each($val)) {
>
> echo("<br>--&gt;$key2=$val2");
>
> }
>
> }
>
> }
>
> }
>
> echo(")<br>n");
>
> } else {
>
> echo("PUKE<br>n");
>
> }
>
> /* !!!! the HTML text included below *will* be displayed */
>
> include("forms/footer");
>
> compiletime options:
>
> ./configure
>
> --with-config-file-path=/etc/httpd
>
> --enable-sigchild
>
> --with-gnu-ld
>
> --enable-yp
>
> --with-swf=/usr/local/lib/swf
>
> --with-snmp
>
> --enable-ftp
>
> --enable-calendar
>
> --with-pgsql=/usr/lib/pgsql
>
> --with-mysql=yes
>
> --enable-safe-mode
>
> --enable-sysvsem
>
> --enable-sysvshm
>
> --enable-track-vars
>
> --enable-magic-quotes
>
> --enable-memory-limit
>
> --enable-debugger
>
> --enable-bcmath
>
> --with-zlib=yes
>
> --with-ttf
>
> --with-ldap=yes
>
> --with-xml
>
> --with-gd=yes
>
> --with-yp
>
> --with-jpeg-dir
>
> --with-tiff-dir
>
> --with-config-file-path=/etc/httpd
>
> --with-apxs=/usr/sbin/apxs
>
> --with-exec-dir=/usr/lib/apache/bin
>
> --enable-bcmath
>
> --enable-dbase
>
> --enable-filepro
>
> --with-mcrypt=/usr/local
>
> --with-oracle
>
> --with-xpm-dir=/usr/X11R6
>
> --with-oci8
>
> --with-curl
>
> --with-imap=yes
>
> --with-mhash
>
> --enable-versioning
>
> --with-t1lib
>
> Oracle 8.0.5 is on a Windows NT machine.
>
> ---------------------------------------------------------------------------
>
> Full Bug description available at: http://bugs.php.net/?id=6840

-- 
/****************************************************/
/* Anders Biström            Gate Five Oy           */
/* Tel: +358 400 227 308     Yliopistonkatu 12 a B  */
/* Fax: +358 2 251 5119      20100 Turku            */
/* Mail: anders <email protected>  Web: www.gatefive.fi   */
/****************************************************/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>