From:             [EMAIL PROTECTED]
Operating system: Windows XP / Firebird 1.0
PHP version:      4.2.3
PHP Bug Type:     InterBase related
Bug description:  Numeric type returns invalid result using 
ibase_fetch_row/ibase_fetch_object

Numeric type returns invalid result using
ibase_fetch_row/ibase_fetch_object (Windows NT).

Numbers stored as an InterBase/Firebird numeric/decimal datatype beyond
the bounds of the PHP integer type (> 2147483647), do not return a float
type but cause an overflow 

Example:
2303511415 (decimal 10,0) returns -1991455881

PHP/Firebird example script:
$sql = "create table temp (large_number numeric(10,0))";
$result = ibase_query($sql,connection()); 
if (!$result) {
  exit;
}

$sql = "INSERT INTO temp VALUES (2303511415)";
$result = ibase_query($sql,connection()); 
if (!$result) {
  exit;
}

$sql = "SELECT large_number FROM temp WHERE large_number = 2303511415";
$result = ibase_query($sql,connection()); 
if (!$result) {
  exit;
}

while ($row = ibase_fetch_row($result)) {
   print($row[0]); 
}
-- 
Edit bug report at http://bugs.php.net/?id=20641&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20641&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20641&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20641&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20641&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20641&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20641&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20641&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20641&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20641&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20641&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20641&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20641&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20641&r=isapi

Reply via email to