Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81150 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49715 invoked from network); 26 Jan 2015 02:42:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2015 02:42:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:56342] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/30-46238-DA9A5C45 for ; Sun, 25 Jan 2015 21:42:54 -0500 Received: by mail-la0-f53.google.com with SMTP id gq15so5552566lab.12 for ; Sun, 25 Jan 2015 18:42:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=XaK1WOAa3x+bN5wCI+3DEERELBOIZt6kKVMHbE7FdWo=; b=gcMCnsuQuHN8Dldfucq9RFp7+4r0g19lTSf4gQVOiTics0nBXWN7fiqZrECtT2h7cG AEjM/6X6il5mG1JwtTrKNRX3JbdnK9nDv0D24bWZjRBDVs4yPT8fuFDRsUSWaGXvg3nR UR722cwLtE71dgxt2pkfsCjCJkfvqDKsBgDW+UqDwvE7fw3n3EymPIJkeO/c0b/u9+uy Me+4vlF3ayeh+na97/CW5jp6xfOZjmoJyLBo4hxlLO848noEmzHkP6Hu3g76lRExFMY/ 7HWxqstix1X7D7J+Dx8/cCr+RVNRAj9SzOavEiwV3B3CJpYBZxxmvqvgaKslnZbharSn tR/w== X-Gm-Message-State: ALoCoQkRO1x8rqGnWv3qpKZmaYhFJcUGPUHPzvbW42a6XCCagrFz4eFynjvWGIzIwV7iiBNkJWBtKRp07zyIcQbLKBpZQtX0YEq1XmkdMjn/iAyh3oiv2LdsKrWQfeeGGKkU8znS+Yz1Dq2VjewU6T9bQY4hYqChRQ== X-Received: by 10.112.198.233 with SMTP id jf9mr19241623lbc.9.1422240169774; Sun, 25 Jan 2015 18:42:49 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPSA id tw3sm2372879lbb.16.2015.01.25.18.42.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 25 Jan 2015 18:42:48 -0800 (PST) Received: by mail-lb0-f177.google.com with SMTP id p9so5525029lbv.8 for ; Sun, 25 Jan 2015 18:42:48 -0800 (PST) X-Received: by 10.112.132.2 with SMTP id oq2mr18866722lbb.11.1422240168038; Sun, 25 Jan 2015 18:42:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Sun, 25 Jan 2015 18:42:27 -0800 (PST) In-Reply-To: <54C58DAE.2010402@gmail.com> References: <54C58DAE.2010402@gmail.com> Date: Mon, 26 Jan 2015 10:42:27 +0800 Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] PDO & size_t From: laruence@php.net (Xinchen Hui) Hey: On Mon, Jan 26, 2015 at 8:43 AM, Stanislav Malyshev wrote: > Hi! > > With recent moving of string lengths to size_t, it looks like PDO APIs > weren't updated. I.e.: > > typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, > char **ptr, zend_ulong *len, int *caller_frees); > > This looks like len should be size_t, and in fact fetch_value() in > pdo_stmt.c sends size_t parameter there, but since I'm not very familiar > with PDO internals, I'd like to double check - is it an omission and > will anything break if I change it to size_t? I think it is okey, of course you should change all related apis in pdo_* drivers thanks > > There are also other things, like: > > const char *driver_name; > zend_ulong driver_name_len; > > typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, > zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options); > > typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, > zend_long sql_len); > > typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, > int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type > paramtype); > > As you can see, sometimes length is an int, sometimes zend_long, > sometimes zend_ulong. This looks like it needs some cleanup. > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Xinchen Hui @Laruence http://www.laruence.com/