Bug #17173 Updated: "case" causes AV

From: Date: Sun, 09 Jun 2002 15:48:02 +0000
Subject: Bug #17173 Updated: "case" causes AV
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9936@lists.php.net to get a copy of this message
 ID:               17173
 Updated by:       phanto@php.net
 Reported By:      mbretter@inode.at
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         COM related
 Operating System: Windows 2000 SP2
 PHP Version:      4.1.2
 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.




Previous Comments:
------------------------------------------------------------------------

[2002-05-30 19:40:08] phanto@php.net

please can you verify this with a recent cvs snapshot

------------------------------------------------------------------------

[2002-05-30 08:55:44] phanto@php.net

what is the correspondent value and datatype in the db that causes the
crash ?
checking for empty will always result in TRUE because 'value' is not an
actual property but only an overloaded action that calls com_propget()
so empty() doesn't see it as property (i assume strftime() never gets
called in your script).

------------------------------------------------------------------------

[2002-05-13 09:44:31] mbretter@jawa.at

The AV still exists, 
I tried the latest Snapshot from snaps.php.net

------------------------------------------------------------------------

[2002-05-13 04:38:32] mfischer@php.net

There have been a few changes to the COM extension since the 4.1.2
release. Please try a new version or even a snapshot from
http://bugs.php.net/?id=17173&edit=1

------------------------------------------------------------------------

[2002-05-13 03:51:06] mbretter@inode.at

This script let php crash.
The Problem is the case-statement in the convert_field_crash-function,
but with an If-statement this crash doesen't occur.

<?php

define('adDBTimeStamp', 135);

$conn = new COM( "ADODB.Connection" );

$rs = new COM( "ADODB.Recordset" );
$conn->Provider = 'SQLOLEDB';
$conn->Open( "Server=wincubix;Uid=oebb;Pwd=oebb;Database=cubix" );
@$rs->Open( "SELECT * FROM news ", $conn);

echo '<table>';
while (!$rs->EOF) {
	echo '<tr>';
    for ($i=0; $i < $rs->Fields->Count(); $i++) {
   		echo '<td>';
		echo convert_field_crash($rs->Fields[$i]);
   		echo '</td>';
    }
	echo '</tr>';
    $rs->MoveNext();
}
echo '</table>';

$rs->Close;
$conn->Close;

$rs->Release();
$rs = null;

$conn->Release();
$conn = null;

function convert_field($field) {
	if ($field->type == adDBTimeStamp) {
		if (empty($field->Value)) return '';
		return strftime('%Y-%m-%d %T', $field->value);
	} else {
		return $field->Value;
	}
}

function convert_field_crash($field) {
	// case verursacht AV
	switch($field->type) {
		case adDBTimeStamp:
			return strftime('%Y-%m-%d %T', $field->value);
			break;
		default:
			return $field->Value;
	}
}

?>

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=17173&edit=1



Thread (17 messages)

« previous php.bugs (#9936) next »