php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38470 Bug when calling odbc_field_type on tinyint and long varchar.
Submitted: 2006-08-16 09:12 UTC Modified: 2006-08-24 01:00 UTC
From: info at softmind dot com dot lb Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5.1.4 OS: Win xp sp2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 - 8 = ?
Subscribe to this entry?

 
 [2006-08-16 09:12 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-16 09:43 UTC] tony2001@php.net
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.


 [2006-08-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC