From:             [EMAIL PROTECTED]
Operating system: Win2000, IIS-CGI
PHP version:      4.3.0RC2
PHP Bug Type:     MSSQL related
Bug description:  MSSQL Crashes in PEAR DB and ADOdb

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 bug report at http://bugs.php.net/?id=20738&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20738&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20738&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20738&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20738&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20738&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20738&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20738&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20738&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20738&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20738&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20738&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20738&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20738&r=isapi

Reply via email to