Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayZxn-0003LN-Od for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2016 07:14:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ayZxm-0008Nr-LX for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2016 07:14:14 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ayZxm-0008Nk-1K for pgsql-hackers@postgreSQL.org; Fri, 06 May 2016 07:14:14 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayZxi-00031I-8W for pgsql-hackers@postgreSQL.org; Fri, 06 May 2016 07:14:11 +0000 Received: from cri.ensmp.fr (152.200.219.88.rev.sfr.net [88.219.200.152]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u467E3CU027411 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 May 2016 09:14:04 +0200 Date: Fri, 6 May 2016 09:14:01 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Tom Lane cc: PostgreSQL Developers Subject: Re: Poorly-thought-out handling of double variables in pgbench In-Reply-To: <15599.1462484702@sss.pgh.pa.us> Message-ID: References: <9188.1462475559@sss.pgh.pa.us> <15599.1462484702@sss.pgh.pa.us> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-801026041-1462518842=:30701" X-Miltered: at jiboia.ensmp.fr with ID 572C443B.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 572C443B.000 from 152.200.219.88.rev.sfr.net/152.200.219.88.rev.sfr.net/88.219.200.152/cri.ensmp.fr/ X-Pg-Spam-Score: -4.0 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-801026041-1462518842=:30701 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Hello Tom, >>> That's probably a bigger change than we want to be putting in right now, >>> though I'm a bit tempted to go try it. > >> I definitely agree that the text variable solution is pretty ugly, but it >> was the minimum change solution, and I do not have much time available. > > Well, I felt like doing some minor hacking, so I went and adjusted the > code to work this way. I'm pretty happy with the result, what do you > think? This is a definite improvement. I like the lazyness between string & numeric forms, and for sorting, that is what was needed doing to have something clean. Applied on head, it works for me. While testing the patch I found a minor preexisting (mine...) bug: when string-scanning doubles, whether the whole string is consumed or not is not checked. This means that -D x=0one is interpreted as double 0. I came up with the attached check, but maybe there is a cleaner way to do that. -- Fabien. --8323329-801026041-1462518842=:30701 Content-Type: TEXT/x-diff; name=pgbench-scan-double.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-scan-double.patch ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jDQppbmRleCBhNDg0MTY1Li45NjczNjQw IDEwMDY0NA0KLS0tIGEvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KKysr IGIvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KQEAgLTkyOCw4ICs5Mjgs MTAgQEAgbWFrZVZhcmlhYmxlTnVtZXJpYyhWYXJpYWJsZSAqdmFyKQ0KIAll bHNlIC8qIHR5cGUgc2hvdWxkIGJlIGRvdWJsZSAqLw0KIAl7DQogCQlkb3Vi bGUgZHY7DQorCQlpbnQgY29uc3VtZWQ7DQogDQotCQlpZiAoc3NjYW5mKHZh ci0+dmFsdWUsICIlbGYiLCAmZHYpICE9IDEpDQorCQlpZiAoc3NjYW5mKHZh ci0+dmFsdWUsICIlbGYlbiIsICZkdiwgJmNvbnN1bWVkKSAhPSAxIHx8DQor CQkJY29uc3VtZWQgIT0gc3RybGVuKHZhci0+dmFsdWUpKQ0KIAkJew0KIAkJ CWZwcmludGYoc3RkZXJyLA0KIAkJCQkJIm1hbGZvcm1lZCB2YXJpYWJsZSBc IiVzXCIgdmFsdWU6IFwiJXNcIlxuIiwNCg== --8323329-801026041-1462518842=:30701 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --8323329-801026041-1462518842=:30701--