Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46975 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1624 invoked from network); 10 Feb 2010 16:43:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2010 16:43:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.213 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.219.213 mail-ew0-f213.google.com Received: from [209.85.219.213] ([209.85.219.213:44036] helo=mail-ew0-f213.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/60-19537-732E27B4 for ; Wed, 10 Feb 2010 11:43:35 -0500 Received: by ewy5 with SMTP id 5so200594ewy.12 for ; Wed, 10 Feb 2010 08:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ehA+zMUYi2u3azMx+8ATnCootbLAi/ivwSEOcnPRE5o=; b=eT9nO5Q/lDdThgiS1zoA8k0jUwzR4fCnGPSFl0MicYpLMLMPwjLzerjpY/Y1SREkYQ dU3ZilcAJe+tgV7q6xq+KXZ8BzE3cK4/z1ap1YtCfwWQKaBjThYup5zlLKXt9B2fz5np 0s2+tHZ+2Lc9dszvaxnF/EJhLa+aLN26ssqWc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CRdgM7mkHcf7RuBSsppZkZqS79erhO7Ws2dlOhthO4xOhgoQNMbdTvw1DwhZk5c5aO urhoGcYzHrm+eU77hq2YUIhWWy2f2W2ZEsrSp70dCjz6TOBkOyiesssoRXf/lHldyu3c WZ7r03tYLOvZhI2HJqFfgjPsCYnDcvC4cGPYA= MIME-Version: 1.0 Received: by 10.216.178.70 with SMTP id e48mr314780wem.0.1265820211812; Wed, 10 Feb 2010 08:43:31 -0800 (PST) In-Reply-To: References: <1265723806.2988.193.camel@guybrush> <1265729924.2988.408.camel@guybrush> Date: Wed, 10 Feb 2010 17:43:31 +0100 Message-ID: To: Sokolov Evgeniy Cc: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PATCH for bug #47199 From: pierre.php@gmail.com (Pierre Joye) Can you attach the patch instead of copying it in your post? Simply name it mypatch.txt (.txt is important for the list). 2010/2/10 Sokolov Evgeniy : > Thank you very much. This patch is passed, also as other patches from > this extension. It's time for choose next bug :) > > > > Index: ext/pgsql/tests/bug47199.phpt > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pgsql/tests/bug47199.phpt =A0 =A0 =A0 (revision 0) > +++ ext/pgsql/tests/bug47199.phpt =A0 =A0 =A0 (revision 0) > @@ -0,0 +1,23 @@ > +--TEST-- > +Bug #47199 =A0pg_delete fails on NULL > +--SKIPIF-- > + +require_once('skipif.inc'); > +?> > +--FILE-- > + + > +require_once('config.inc'); > + > +$dbh =3D @pg_connect($conn_str); > +$tbl_name =3D 'test_47199'; > +@pg_query("DROP TABLE $tbl_name"); > +pg_query("CREATE TABLE $tbl_name (null_field INT, not_null_field INT)"); > +print(pg_delete($dbh, $tbl_name, array('null_field' =3D> NULL, > 'not_null_field' =3D> 2),PGSQL_DML_STRING)); > +@pg_query("DROP TABLE $tbl_name"); > +pg_close($dbh); > +echo PHP_EOL."Done".PHP_EOL; > +?> > +--EXPECTF-- > +DELETE FROM %s WHERE null_field IS NULL AND not_null_field=3D2; > +Done > Index: ext/pgsql/pgsql.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- ext/pgsql/pgsql.c =A0 (revision 294790) > +++ ext/pgsql/pgsql.c =A0 (working copy) > @@ -5523,7 +5523,7 @@ > =A0} > =A0/* }}} */ > > -static inline int build_assignment_string(smart_str *querystr, > HashTable *ht, const char *pad, int pad_len TSRMLS_DC) > +static inline int build_assignment_string(smart_str *querystr, > HashTable *ht, int where_cond, const char *pad, int pad_len TSRMLS_DC) > =A0{ > =A0 =A0 =A0 HashPosition pos; > =A0 =A0 =A0 uint fld_len; > @@ -5542,8 +5542,13 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 smart_str_appendl(querystr, fld, fld_len - 1)= ; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 smart_str_appendc(querystr, '=3D'); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (where_cond && Z_TYPE_PP(val) =3D=3D IS_= STRING && > !strcmp(Z_STRVAL_PP(val), "NULL")) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 smart_str_appends(querystr,= " IS "); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 smart_str_appendc(querystr,= '=3D'); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch(Z_TYPE_PP(val)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 case IS_STRING: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 smart_str_app= endl(querystr, > Z_STRVAL_PP(val), Z_STRLEN_PP(val)); > @@ -5604,12 +5609,12 @@ > =A0 =A0 =A0 smart_str_appends(&querystr, table); > =A0 =A0 =A0 smart_str_appends(&querystr, " SET "); > > - =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(var_array= ), ",", 1 > TSRMLS_CC)) > + =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(var_array= ), 0, > ",", 1 TSRMLS_CC)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto cleanup; > > =A0 =A0 =A0 smart_str_appends(&querystr, " WHERE "); > > - =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), " AND > ", sizeof(" AND ")-1 TSRMLS_CC)) > + =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), 1, " > AND ", sizeof(" AND ")-1 TSRMLS_CC)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto cleanup; > > =A0 =A0 =A0 smart_str_appendc(&querystr, ';'); > @@ -5705,7 +5710,7 @@ > =A0 =A0 =A0 smart_str_appends(&querystr, table); > =A0 =A0 =A0 smart_str_appends(&querystr, " WHERE "); > > - =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), " AND > ", sizeof(" AND ")-1 TSRMLS_CC)) > + =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), 1, " > AND ", sizeof(" AND ")-1 TSRMLS_CC)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto cleanup; > > =A0 =A0 =A0 smart_str_appendc(&querystr, ';'); > @@ -5841,7 +5846,7 @@ > =A0 =A0 =A0 smart_str_appends(&querystr, table); > =A0 =A0 =A0 smart_str_appends(&querystr, " WHERE "); > > - =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), " AND > ", sizeof(" AND ")-1 TSRMLS_CC)) > + =A0 =A0 =A0 if (build_assignment_string(&querystr, Z_ARRVAL_P(ids_array= ), 1, " > AND ", sizeof(" AND ")-1 TSRMLS_CC)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto cleanup; > > =A0 =A0 =A0 smart_str_appendc(&querystr, ';'); > > > > > 2010/2/9 Johannes Schl=FCter : >> Hi, >> >> On Tue, 2010-02-09 at 20:11 +0500, Sokolov Evgeniy wrote: >>> > did you really run this test and was it successful? - doesn't looklik= e >>> > for me. >>> I just run "php tests/27_bug47199.phpt" and check the result output. >>> Is this correct way? >> >> The easy way to run it using the test Framework is by executing >> >> =A0 make test TESTS=3Dtests/27_bug47199.phpt >> >> from your build directory which will prepare some environment things and >> then run run-tests.php from PHP's source directory which has the >> implementation of our test system, you can also run it directly to have >> more ocntrol. See README.TESTING in the php-src root folder and >> http://qa.php.net/write-test.php for more details on the test system. >> >> If you run your test it will tell you it failed as you're tests EXPECTF >> section has to look something like this: >> >> --EXPECTF-- >> DELETE FROM %s WHERE null_field IS NULL AND not_null_field=3D2; >> Done >> >> Mind the %s place holder there! >> >>> > And please also add a link to the patch to the bug report >>> Can it be link on pastebin.org? For example http://pastebin.org/88880 >> >> I don't know how persistent these pastebins are, >> http://news.php.net/php.internals/46965 might be an alternative link >> though :-) >> >> johannes > > > best regards > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org