Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32745 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84113 invoked by uid 1010); 13 Oct 2007 14:25:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84098 invoked from network); 13 Oct 2007 14:25:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2007 14:25:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=martin@divbyzero.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=martin@divbyzero.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain divbyzero.net from 80.237.234.119 cause and error) X-PHP-List-Original-Sender: martin@divbyzero.net X-Host-Fingerprint: 80.237.234.119 mx.bauer-kirch.de Linux 2.4/2.6 Received: from [80.237.234.119] ([80.237.234.119:57964] helo=mx.bauer-kirch.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/06-30986-675D0174 for ; Sat, 13 Oct 2007 10:25:59 -0400 Received: by mx.bauer-kirch.de with ESMTP id 1IghwA-00084g-HF for ; Sat, 13 Oct 2007 16:25:54 +0200 Message-ID: <4710D56E.1010602@divbyzero.net> Date: Sat, 13 Oct 2007 16:25:50 +0200 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: multipart/mixed; boundary="------------060701010403070903030406" Subject: Patch for bug #42322 From: martin@divbyzero.net (Martin Jansen) --------------060701010403070903030406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Attached is a patch and a corresponding test case for bug #42322 against the PHP_5_3 branch. (Antony suggested I don't supply PDO patches against HEAD.) - Martin --------------060701010403070903030406 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="42322.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="42322.patch" Index: ext/pdo_mysql/mysql_statement.c =================================================================== RCS file: /repository/php-src/ext/pdo_mysql/mysql_statement.c,v retrieving revision 1.48.2.14.2.6 diff -u -u -r1.48.2.14.2.6 mysql_statement.c --- ext/pdo_mysql/mysql_statement.c 17 May 2007 15:12:23 -0000 1.48.2.14.2.6 +++ ext/pdo_mysql/mysql_statement.c 13 Oct 2007 14:21:41 -0000 @@ -413,7 +413,6 @@ #endif if (!S->result) { - strcpy(stmt->error_code, "HY000"); return 0; } if ((S->current_data = mysql_fetch_row(S->result)) == NULL) { Index: ext/pdo_mysql/tests/bug_42322.phpt =================================================================== RCS file: ext/pdo_mysql/tests/bug_42322.phpt diff -N ext/pdo_mysql/tests/bug_42322.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ext/pdo_mysql/tests/bug_42322.phpt 13 Oct 2007 14:21:41 -0000 @@ -0,0 +1,24 @@ +--TEST-- +PDO MySQL Bug #42322 (fetch() throws exception on INSERT statements) +--SKIPIF-- + +--FILE-- +exec('CREATE TABLE test (id INT)'); + +$stm = $db->prepare("INSERT INTO test VALUES (NULL)"); +$stm->execute(); + +var_dump($stm->fetch()); +?> +--EXPECT-- +bool(false) --------------060701010403070903030406--