From:             edwin at rabbito dot org
Operating system: Windows
PHP version:      5CVS-2004-08-09 (dev)
PHP Bug Type:     COM related
Bug description:  com_dotnet crashes when trying to strlen 

Description:
------------
When trying to retrieve a date field from an Access 97 database, the
actual data returned is different from PHP4 (PHP 4 returns a timestamp,
whereas PHP 5 returns a date, ie) 02/04/04 instead of a timestamp). By
calling the code (as attached) in PHP5, PHP does not return error
gracefully, but crashes.

(seems to be something that is not yet fixed in bug#29392)

Reproduce code:
---------------
   $security="C:\access97.mdw";
   $user="access";
   $password="access";
   $dsn="Driver={Microsoft Access Driver (*.mdb)};
DBQ=$database;SystemDB=$security;Uid=$user;Pwd=$password";

   $db = new COM("ADODB.Connection");
   $db->open($dsn);

   $query="SELECT DateField1 FROM [Table1];";
   $rs = $db->execute($query);
   if (!$rs->EOF()) {
     echo strlen($rs->Fields(0)->Value);
   }


Expected result:
----------------
Either an error should be returned due to invalid type
($rs->Fields(0)->Value in date type), or the actual length the the date
string.

Actual result:
--------------
PHP crashed

-- 
Edit bug report at http://bugs.php.net/?id=29583&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29583&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29583&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29583&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29583&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29583&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29583&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29583&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29583&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29583&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29583&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29583&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29583&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29583&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29583&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29583&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29583&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29583&r=float

Reply via email to