#48117 [NEW]: while executing a query php crashes and apache does not reply
From: mucahitkahveci at gmail dot com
Operating system: Windows XP SP2
PHP version: 5.2CVS-2009-04-29 (snap)
PHP Bug Type: MySQL related
Bug description: while executing a query php crashes and apache does not reply
Description:
------------
when i try to execute a statement in mysql apache crashed. it did always
work but does nothing.
The reason i found was i trien the query that couses this in mysql and it
gaves an error like this:
ERROR 1364(HY000):Field 'status' does not have a default value
but php crashes when it executes this query.
Reproduce code:
---------------
php version:5.2.2
mysql version: 5.0.41
apache version:1.3.37
i have table in like:
CREATE TABLE hu_properties (
prop_id int(10) unsigned NOT NULL auto_increment,
property varchar(255) default NULL,
user_id int(10) NOT NULL,
generate_date datetime NOT NULL,
generated int(10) NOT NULL,
regenerate_date datetime default NULL,
status bigint(20) unsigned NOT NULL default NULL,
PRIMARY KEY (prop_id),
UNIQUE KEY property (property)
) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=utf8;
php code:
$PDO = new PDO( $dsn, 'username', 'password' );
$insertStmt='INSERT INTO hu_properties (property, user_id, generate_date,
generated) VALUES (?, ?, NOW(), 1)';
$sth=PDO->prepare($insertStmt);
$result=$sth->execute(array('crazy', 1));
if($result) {
echo 'OK';
} else {
print_r($PDO->errorInfo());
}
Expected result:
----------------
expected to give an error if the $result returns FALSE
Actual result:
--------------
apache server crashed (i think waiting reponse from php becouse mysql
server works fine at this time)
--
Edit bug report at http://bugs.php.net/?id=48117&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48117&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48117&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48117&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48117&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48117&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48117&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48117&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48117&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48117&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48117&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48117&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48117&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48117&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48117&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48117&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48117&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48117&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48117&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48117&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48117&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48117&r=mysqlcfg
Thread (2 messages)
- mucahitkahveci at gmail dot com