Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EF8E61337B54 for ; Mon, 1 Nov 2010 10:31:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 98880-07; Mon, 1 Nov 2010 13:31:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by mail.postgresql.org (Postfix) with SMTP id D4D7A133616B; Mon, 1 Nov 2010 10:31:50 -0300 (ADT) Received: from source ([209.85.215.181]) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKTM7BRvbI7LEg1/rB0mHK8EVCAPZWdXg+@postini.com; Mon, 01 Nov 2010 06:31:52 PDT Received: by mail-ey0-f181.google.com with SMTP id 6so1851683eyb.40 for ; Mon, 01 Nov 2010 06:31:50 -0700 (PDT) Received: by 10.213.31.73 with SMTP id x9mr2240813ebc.36.1288618309650; Mon, 01 Nov 2010 06:31:49 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id w20sm4201400eeh.6.2010.11.01.06.31.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Nov 2010 06:31:48 -0700 (PDT) Message-ID: <4CCEC145.3020409@enterprisedb.com> Date: Mon, 01 Nov 2010 15:31:49 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 MIME-Version: 1.0 To: Michael Meskes , Zoltan Boszormenyi CC: PostgreSQL Bugs Subject: ecpg preprocessor regression in 9.0 Content-Type: multipart/mixed; boundary="------------000308060405090905070407" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/3 X-Sequence-Number: 28583 This is a multi-part message in MIME format. --------------000308060405090905070407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This used to work in the PostgreSQL 8.4 ecpg preprocessor: EXEC SQL EXECUTE mystmt USING 1.23; but in 9.0 it throws an error: floattest.pgc:39: ERROR: variable "1" is not declared Attached is the full test case, drop it in src/interfaces/ecpg/test/preproc and compile. I bisected the cause to this commit: commit b2bddc2ff22f0c3d54671e43c67a2563deed7908 Author: Michael Meskes Date: Thu Apr 1 08:41:01 2010 +0000 Applied Zoltan's patch to make ecpg spit out warnings if a local variable hides a global one with the same name. I don't immediately see why that's causing it, but it doesn't seem intentional. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com --------------000308060405090905070407 Content-Type: text/plain; name="floattest.pgc" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="floattest.pgc" #include #include EXEC SQL include ../regression; int main (void) { ECPGdebug (1, stderr); EXEC SQL BEGIN DECLARE SECTION; float f = 4.56; const char *stmt2 = "INSERT INTO floattest VALUES (?);"; EXEC SQL END DECLARE SECTION; EXEC SQL connect to REGRESSDB1; if (sqlca.sqlcode) { printf ("connect error = %ld\n", sqlca.sqlcode); exit (sqlca.sqlcode); } EXEC SQL create table floattest (f float); if (sqlca.sqlcode) { printf ("create error = %ld\n", sqlca.sqlcode); exit (sqlca.sqlcode); } EXEC SQL PREPARE mystmt FROM :stmt2; if (sqlca.sqlcode) { printf ("prepare error = %ld\n", sqlca.sqlcode); exit (sqlca.sqlcode); } EXEC SQL EXECUTE mystmt USING 1.23; if (sqlca.sqlcode) { printf ("insert error = %ld\n", sqlca.sqlcode); exit (sqlca.sqlcode); } EXEC SQL COMMIT; EXEC SQL disconnect; exit (0); } --------------000308060405090905070407--