Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95421 invoked by uid 1010); 24 Mar 2005 11:49:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 94996 invoked from network); 24 Mar 2005 11:49:15 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 24 Mar 2005 11:49:15 -0000 X-Host-Fingerprint: 81.169.182.136 h59705.serverkompetenz.net Linux 2.4/2.6 Received: from ([81.169.182.136:49809] helo=strato.aixcept.de) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 79/A1-02157-F19A2424 for ; Thu, 24 Mar 2005 06:48:49 -0500 Received: from [192.168.1.3] (dsl-082-083-252-238.arcor-ip.net [82.83.252.238]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 1081F35C1B7; Thu, 24 Mar 2005 12:32:50 +0100 (CET) Date: Thu, 24 Mar 2005 12:28:18 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <448680213.20050324122818@marcus-boerger.de> To: "Thies C.Arntzen" Cc: internals@lists.php.net In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] pdo: cannot send NULL values thru bound parameters. From: mail@marcus-boerger.de (Marcus Boerger) Hello Thies, may i kindly ask you to provide a test case as a .inc file in pdo/tests. I'll then look into the details? Thursday, March 24, 2005, 12:19:02 PM, you wrote: > as we convert "incoming" zvals to strings in pdo_stmt.c "no matter what"... > $stmt = $this->prepareStatement('insert into bla (name) values (:name)'); > $name = NULL; > var_dump($name); // $name is NULL > $stmt->bindParam(':name', $name); > var_dump($name); // $name is an empty string > am i overlooking something obvious? > attached patch "fixes" it for me (NULL is a valid "value" for a string)... > re, tc > Index: pdo_stmt.c > =================================================================== > RCS file: /repository/php-src/ext/pdo/pdo_stmt.c,v > retrieving revision 1.94 > diff -u -w -r1.94 pdo_stmt.c > --- pdo_stmt.c 21 Mar 2005 00:29:06 -0000 1.94 > +++ pdo_stmt.c 24 Mar 2005 11:13:31 -0000 > @@ -253,7 +253,7 @@ > } > } > - if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && > param->max_value_len <= 0) { > + if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && > param->max_value_len <= 0 && ! ZVAL_IS_NULL(param->parameter)) { > convert_to_string(param->parameter); > } -- Best regards, Marcus mailto:mail@marcus-boerger.de