ID:               37286
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vldi at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PDO related
 Operating System: Suse 10
 PHP Version:      5CVS-2006-05-02 (snap)
 New Comment:

No, this is the very same problem.


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

[2006-05-02 22:04:41] vldi at yahoo dot com

I am sure that is NOT the same problem. Im the bug 37285        which you
probably refer to the problem is with the error handling on a bad input
(the wrong sql). Here the problem is about the prerape statement failing
on the perceivably correct SQL, taken from the PDO documentation.
Please, reconsider. I apologise if I am mistaken, anyhow.

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

[2006-05-02 21:48:49] [EMAIL PROTECTED]

There is absolutely no need to report the same problem twice.

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

[2006-05-02 21:42:53] vldi at yahoo dot com

Description:
------------
An example used at the page http://www.php.net/manual/en/ref.pdo.php at
the section "Example 9. Calling a stored procedure with an output
parameter" quietly fails at prepare statement. connection established
correctly because the procedure gets properly created. My configure is:
'./configure' '--prefix=/usr/local/php5' '--with-openssl'
'--with-kerberos' '--with-zlib' '--with-bz2' '--enable-calendar'
'--with-curl' '--with-curlwrappers' '--enable-exif' '--enable-ftp'
'--with-gettext' '--with-ldap' '--with-ldap-sasl'
'--with-mssql=/usr/local/freetds' '--with-mysql' '--with-mysql-sock'
'--with-mysqli' '--with-unixODBC=/usr' '--with-pdo-mysql'
'--with-pdo-odbc=unixODBC,/usr' '--enable-sockets' '--enable-sysvmsg'
'--enable-sysvsem' '--enable-sysvshm' '--with-xsl' '--with-pear'
'--disable-cgi' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-config-file-path=/etc/php.ini' '--enable-debug'

Reproduce code:
---------------
<html><body><?php
        $dbuser='user1';
        $dbpassword='';
        $dsn =
"DRIVER=FreeTDS;SERVERNAME=server1;DATABASE=testdb;UID=$dbuser;";
        try {
                $dbh = new PDO('odbc:'.$dsn, $dbuser, $dbpassword );
                $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                $dbh->exec("
                        create procedure dbo.pdotest @param_out varchar(10) = 
'' output
                        as set @param_out = 'the_string'
                ");
                $stmt = $dbh->prepare("CALL dbo.pdotest(?)");
                print "<p>"; var_dump( $stmt ); print "</p>";
                $stmt->bindParam(1, $return_value, PDO::PARAM_STR, 4000);
                $stmt->execute();
                print "<p>procedure returned $return_value</p>\n";
        } catch ( PDOException $e ) {
                print "<p>Failed: ".$e->getMessage()."</p></body></html>";
                die();
        }
?></body></html>

Expected result:
----------------
either returned value of failure message, but graceful script
completion.

Actual result:
--------------
script aborting with html

<html><body><p>bool(false)
</p><br />
<b>Fatal error</b>:  Call to a member function bindParam() on a
non-object in <b>/srv/www/htdocs/ChangeMgmt/pdotest.php</b> on line
<b>14</b><br />


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


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

Reply via email to