ID:               38470
 Updated by:       [EMAIL PROTECTED]
 Reported By:      info at softmind dot com dot lb
-Status:           Open
+Status:           Feedback
 Bug Type:         ODBC related
 Operating System: Win xp sp2
 PHP Version:      5.1.4
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2006-08-16 09:12:14] info at softmind dot com dot lb

Description:
------------
Database: ASA (Adaptive Server Anywhere) version 6.x

If the column in a table is of type "long varchar" or "tinyint" it is
causing the apache server to go down.

Otherwise it works fine.
As for the "long varchar", the length that is returned is very large,
so I was able to check for the size and if it is greate than 1000000, I
can find out that it is a long varchar, however, with the tiny int, it
returns a length of 3, however, I cannot assume that it is a tinyint,
since it could be a CHAR(3) as well.

Reproduce code:
---------------
// This is a method within an object
// $result is the result id returned from odbc_exec function

function getFields($result){
        $this->object=array(); // clear array
        $max = odbc_num_fields($result); // get column numbers
        for ($i=1; $i<=$max; $i++) {
                $name = odbc_field_name($result,$i);
                $scale = odbc_field_scale($result,$i);
                $size = odbc_field_precision($result,$i);
                // Workaround temporary otherwise, if odbc_field_type is 
called, then
the apache server will crash.
$type =
$size>1000000?'TEXT':$size==3?'TINYINT':odbc_field_type($result,$i);
                        }
}

Expected result:
----------------
To receive in the $type variable TINYINT, LONG VARCHAR, etc...

Actual result:
--------------
Crashing the apache server.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38470&edit=1

Reply via email to