From:             Progman2002 at gmx dot de
Operating system: Linux
PHP version:      5.2.6
PHP Bug Type:     MySQLi related
Bug description:  failed prepare() doesn't fill the $error and $errno fields

Description:
------------
If you create a prepared statement with a DELETE query and tries to create
a second prepared statement with an INSERT query on the same table without
closing the first one the MySQLi::prepare() method failed, but the fields
$error and $errno (and all other related to them) aren't filled with the
error message. This is strange as the prepare() failed but you dont know
why.

The mysql error is shown if I save the second statement into another
variable (like if (!$stmt2 = $db->prepare($sql))) (maybe its related to bug
#44766)

Reproduce code:
---------------
Code is at http://nopaste.php-quake.net/51976

Expected result:
----------------
PHP-Version: 5.2.6-pl7-gentoo
MySQL-Server-Version: 50042
MySQL-Protocol: 10
{Showing a MySQL error which says "Syntax error near WHERE (?,?)" or says
sth. like "unfinished prepare statement before")

Actual result:
--------------
PHP-Version: 5.2.6-pl7-gentoo
MySQL-Server-Version: 50042
MySQL-Protocol: 10
-0-

(so the values are all empty strings or zero)

-- 
Edit bug report at http://bugs.php.net/?id=46144&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46144&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46144&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46144&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46144&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46144&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46144&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46144&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46144&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46144&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46144&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46144&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46144&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46144&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46144&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46144&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46144&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46144&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46144&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46144&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46144&r=mysqlcfg

Reply via email to