From:             
Operating system: windows server 2003 R2
PHP version:      5.3.10
Package:          ODBC related
Bug Type:         Bug
Bug description:NULL valued anonymous column causes segfault in odbc_fetch_array

Description:
------------
odbc_fetch_array segfaults when the result consists of one-column anonymous
NULL-valued tuple

our environment:
OS: windows server 2003 R2, apache 2.2 + mod_fcgid + PHP5.3.10
(reproducible with 5.3.6)
DB: SQL Server 2005
odbc driver: SQL Server Native Client 10.0

tried also with postgres, it seems to me that postgres amends the result
with generated name of that column ('sum' in this case)

Test script:
---------------
$conn = odbc_connect(
  "Driver={SQL Server Native Client 10.0};Server=<some microsoft sql
server>;Database=<any db name>;Trusted_Connection=yes"
, ''
, ''
);

$res = odbc_exec(
  $conn
, 'SELECT SUM(1)
  FROM information_schema.tables
  WHERE 3 = 2'
);

$row = odbc_fetch_array($res);
odbc_free_result($res);
odbc_close($conn);
var_dump($row);

Expected result:
----------------
array(1) {[0]=> NULL}

or E_WARNING

Actual result:
--------------
segfault, apache log says:

[warn] [client x.x.x.x] (OS 109)The pipe has been ended.  : mod_fcgid: get
overlap result error
[error] [client x.x.x.x] Premature end of script headers: foo.php
[info] mod_fcgid: process
C:/Webserver/Apache2.2/php-5.3.10/php-cgi.exe(4420) exit(communication
error), return code -1073741819

eventlog says:
Faulting application php-cgi.exe, version 5.3.10.0, faulting module
php5.dll, version 5.3.10.0, fault address 0x000858df.

PHP itself does not produce any sort of output

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61387&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61387&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61387&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61387&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61387&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61387&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61387&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61387&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61387&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61387&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61387&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61387&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61387&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61387&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61387&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61387&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61387&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61387&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61387&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61387&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61387&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61387&r=mysqlcfg

Reply via email to