|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-16 09:43 UTC] tony2001@php.net
[2006-08-24 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 00:00:02 2025 UTC |
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.