ID: 20738
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Feedback
+Status: Open
Bug Type: MSSQL related
Operating System: Win2000, IIS-CGI
PHP Version: 4.3.0RC2
New Comment:
Hi,
Just change the user id's and database in the scripts to match your
mssql database and run the scripts. The script is self contained
otherwise. I was only able to duplicate the problem with ADOdb and PEAR
DB. Straight mssql_* works fine. So a one-liner is a bit difficult.
Regards, John
Previous Comments:
------------------------------------------------------------------------
[2002-11-30 20:53:04] [EMAIL PROTECTED]
any chance you can cut your test script down to just a single line or
two to prove this?
------------------------------------------------------------------------
[2002-11-30 12:38:29] [EMAIL PROTECTED]
When doing testing with ADOdb and PEAR DB, the following scripts crash
PHP (when the delete statement is executed) with an illegal memory
reference at 0xffffffff. I tried to duplicate the problem with native
mssql functions, but could not.
While tracing through in ADOdb, I found that the crash occurs during
the PHP return statement, and not within mssql code. Perhaps some form
of subtle stack/data corruption.
Thanks, John Lim
Other useful info
=================
MSSQL 2000 (MSDE)
PEAR DB from PHP 4.23
ADOdb 2.50
SCRIPT
======
<?php
error_reporting(E_ALL);
ini_set('mssql.datetimeconvert',0);
function tmssql()
{
print "<h3>mssql</h3>";
$db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No
Connection');
mssql_select_db('northwind',$db);
$rs = mssql_query('select getdate() as date',$db);
$o = mssql_fetch_row($rs);
print_r($o);
mssql_free_result($rs);
print "<p>Delete</p>"; flush();
$rs2 = mssql_query('delete from adoxyz',$db);
$p = mssql_num_rows($rs2);
mssql_free_result($rs2);
}
function tpear()
{
include_once('DB.php');
print "<h3>PEAR</h3>";
$username = 'adodb';
$password = 'natsoft';
$hostname = 'JAGUAR\vsdotnet';
$databasename = 'northwind';
$dsn = "mssql://$username:$password@$hostname/$databasename";
$conn = &DB::connect($dsn);
print "date=".$conn->GetOne('select getdate()')."<br>";
@$conn->query('create table tester (id integer)');
print "<p>Delete</p>"; flush();
$rs = $conn->query('delete from tester');
/*** CRASH IN QUERY ABOVE ****/
print "date=".$conn->GetOne('select getdate()')."<br>";
}
function tadodb()
{
include_once('../adodb.inc.php');
print "<h3>ADOdb</h3>";
$conn = NewADOConnection('mssql');
$conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
// $conn->debug=1;
print "date=".$conn->GetOne('select getdate()')."<br>";
$conn->Execute('create table tester (id integer)');
print "<p>Delete</p>"; flush();
$rs = $conn->Execute('delete from tester');
/*** CRASH IN EXECUTE ABOVE ****/
print "date=".$conn->GetOne('select getdate()')."<br>";
}
?>
<a href=tmssql.php?do=tmssql>Test mssql</a>
<a href=tmssql.php?do=tpear>Test pear</a>
<a href=tmssql.php?do=tadodb>Test adodb</a>
<?php
if (!empty($_GET['do'])) {
$do = $_GET['do'];
$do();
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20738&edit=1