ID:               48117
 Updated by:       [email protected]
 Reported By:      mucahitkahveci at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQL related
 Operating System: Windows XP SP2
-PHP Version:      5.2CVS-2009-04-29 (snap)
+PHP Version:      5.2.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




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

[2009-04-29 22:10:42] mucahitkahveci at gmail dot com

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 this bug report at http://bugs.php.net/?id=48117&edit=1

Reply via email to