Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCjK8-0003rk-6L for pgsql-interfaces@arkaria.postgresql.org; Mon, 31 Aug 2020 12:54:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kCjK4-0005pm-Mk for pgsql-interfaces@arkaria.postgresql.org; Mon, 31 Aug 2020 12:54:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCjK4-0005pf-EH for pgsql-interfaces@lists.postgresql.org; Mon, 31 Aug 2020 12:54:08 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kCjK1-0000mn-Ge for pgsql-interfaces@postgresql.org; Mon, 31 Aug 2020 12:54:07 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id c17so69087ybe.0 for ; Mon, 31 Aug 2020 05:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/0fPnOQirArPBA2lInzwrabViWkrKJvJ40NlUBa9Vt8=; b=KsH+vicgrqlr20UpxsbdWqehspwy4vIdlTOP3ZDgLngQ35MexrYSFncJaFGgpvBB2T WnazilgEg4HHHTQzzsSZVfymU2Xp1T201yuj3kgg5QfeI652z3dodDvy3DUyl4jM2yQ4 D4vyBDsAW/kluFI101FPIEZ1HPpLhdPRA1X8ylDaFBp7p/Uymf3jihA7LXa2n8j6UFeW UY9kszeBfD7mJrbDawFKB8jJr88pENr7JhMTh79Bkr7y8YgxZntyaQhljOEtgUPFkmYA LafNmQhIExbUyttl9AG2Q+UYXKP2fPDuaHDvHnBNhSi/syPEmFe0r9WeFnvS57RQEafh YHWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/0fPnOQirArPBA2lInzwrabViWkrKJvJ40NlUBa9Vt8=; b=Ll5jB9932L9/dRedanbEGE+MEbsu0SUSLJkA/Xld6XB9C/2pK63SxPkPS8DOdwr1Id djV66o2ia9apEqmj4BVnAMj0LoawBi06lXrn8qlJ04nwTpuKH4pq5J8w5GOBvjlIuUKU 4nTJ9o24QGrNOFaP92NtJLiXSf+MbqStSbjrOEHtDJ9zBkN20XlOC/+9KBpt2/p3OOOb LlnFKJufijAJSG/P//V6eTXW+CiKbJMGjbde2RwBDYvcmyZ+LqrFFnn5SwhrRNhNJneY E6vd0q0dMtkDU1hs8lkw03DCIAdL07Ld1VDZfbkDbnLKRJTqGUN38UWAu1cOLqVZBIyD Hsgg== X-Gm-Message-State: AOAM530oRlA96nLzcPK/e6OBwrCH5eMONQaGUiZOVZX8gVoy0xRta36W GryFwM4+17LaPKoaWxT+gyOPFziOBZkvdSvACIW2ZxBaO/UROA== X-Google-Smtp-Source: ABdhPJy/GAOHLdyAXUSZMUS24Cq3rl8NvIZbto2StdasxvNSIqCG8IAXVM+3Nlqfilx0kTUg/5nXHkn+l1eZwXQh+Eg= X-Received: by 2002:a25:c4c4:: with SMTP id u187mr1872139ybf.454.1598878442918; Mon, 31 Aug 2020 05:54:02 -0700 (PDT) MIME-Version: 1.0 From: Ashutosh Sharma Date: Mon, 31 Aug 2020 18:23:51 +0530 Message-ID: Subject: ecpg: the comments inside the declare section are not outputted correctly. To: pgsql-interfaces@postgresql.org Content-Type: multipart/alternative; boundary="000000000000a116e805ae2be580" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000a116e805ae2be580 Content-Type: text/plain; charset="UTF-8" Hi All, While working on some other issue, I noticed that the comments inside the declare section are not outputted correctly. Have a look at the below example and its output. void main(void) { exec sql begin declare section; int v1 = 100; /* First Layer */ #ifdef MACRO1 /* Second Layer */ #ifdef MACRO2 int testVar = 2; #endif #endif exec sql end declare section; return 1; } *Output:* void main(void) { /* exec sql begin declare section */ /* First Layer *//* Second Layer */ #line 4 "test.pgc" int v1 = 100 ; #ifdef MACRO1 #ifdef MACRO2 #line 9 "test.pgc" int testVar = 2 ; #endif #endif /* exec sql end declare section */ #line 12 "test.pgc" return 1; } If you see the output, the comments present inside the input file got shifted to the wrong place in the output file. This doesn't happen if such comments are present outside the declare section. I know this is not a severe issue but certainly something that would be nice correcting. Thanks, -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com --000000000000a116e805ae2be580 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi All,

While working on some other issue, I notice= d that the comments inside the declare section are not outputted correctly.= Have a look at the below example and its output.

void main(void){
exec sql begin declare section;
=C2=A0 =C2=A0 int v1 =3D 100;
/= * First Layer */
#ifdef MACRO1
/* Second Layer */
#ifdef MACRO2=C2=A0 =C2=A0int testVar =3D 2;
#endif
#endif
exec sql end declar= e section;

=C2=A0 =C2=A0 return 1;
}

Output:=

void main(void)
{
/* exec sql begin declare section */
/* First Layer *//* Second Layer */
#line 4 "test.pgc"
=C2= =A0int v1 =3D 100 ;

#ifdef MACRO1

#ifdef MACRO2

#line = 9 "test.pgc"
=C2=A0int testVar =3D 2 ;

#endif
=C2=A0= #endif
/* exec sql end declare section */
#line 12 "test.pgc&quo= t;


=C2=A0 =C2=A0 return 1;
}

If you see the output, th= e comments present inside the input file got shifted to the wrong place in = the output file. This doesn't happen if such comments are present outsi= de the declare section.

I know this is not a severe issue but certai= nly something that would be nice correcting.

Thanks,

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com
--000000000000a116e805ae2be580--