#39759 [Fbk->Opn]: Can't use stored procedures from PDO on Windows

From: Date: Wed, 06 Dec 2006 20:05:41 +0000
Subject: #39759 [Fbk->Opn]: Can't use stored procedures from PDO on Windows
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106032@lists.php.net to get a copy of this message
 ID:               39759
 User updated by:  mike at we11er dot co dot uk
 Reported By:      mike at we11er dot co dot uk
-Status:           Feedback
+Status:           Open
 Bug Type:         PDO related
 Operating System: Windows XP
 PHP Version:      5.2.0
 New Comment:

Well, I tried with the latest snapshot and still no luck. What are
buffered queries anyway? I still think that nextRowset needs to be
implemented and this whole thing can go away.


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

[2006-12-06 18:45:19] iliaa@php.net

The change is only about a day old, you need to download the 
latest win32 snapshot from http://snaps.php.net/

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

[2006-12-06 18:40:49] mike at we11er dot co dot uk

FYI I'm using everything from PHP 5.2.0 which I downloaded just a
couple of days ago.

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

[2006-12-06 18:38:28] mike at we11er dot co dot uk

Well it would seem buffered queries aren't on for some reason, but if I
use

$this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, TRUE);

I still get errors.

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

[2006-12-06 18:10:21] iliaa@php.net

Latest version enabled buffered queries by default so your 
code will work.

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

[2006-12-06 18:03:45] mike at we11er dot co dot uk

I'm sorry to reopen again, but I think the "optional feature not
implemented" is just wrong. That would imply that stored procedures are
an optional feature. If so, then that is unnacceptable.

I have some code to reproduce the error:

<?php

/*

CREATE PROCEDURE Test()
BEGIN
  SELECT 0;
  SELECT 1;
END

*/

class DBWriter extends PDO
{
	public function __construct()
	{
	    try
	    {
	    	parent::__construct("mysql:host=localhost;dbname=test","user",
"password");

	    	$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	    }
	    catch (PDOException $e) {
  			throw new Exception("Failed to connect: " . $e->getMessage());
		}
	}
}

$db = new DBWriter();

$stmt = $db->prepare("CALL Test()");
$stmt->execute();
$stmt->fetchAll();

// run the query again and we get an error "Cannot execute queries
while other unbuffered queries are active."
// but we can't fetch all results from the previous query because
nextRowset isn't defined
$stmt->execute();


?>

I just want the status of this to be elevated - I think "feature
request" is just plain wrong. I want to hear an official opinion on
this...

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/39759

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


Thread (20 messages)

« previous php.bugs (#106032) next »