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 1jlw5G-0002J9-Ro for pgsql-general@arkaria.postgresql.org; Thu, 18 Jun 2020 15:04:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jlw5F-0007fH-HV for pgsql-general@arkaria.postgresql.org; Thu, 18 Jun 2020 15:04:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlw5F-0007db-9i for pgsql-general@lists.postgresql.org; Thu, 18 Jun 2020 15:04:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlw5D-0008Tq-5V for pgsql-general@lists.postgresql.org; Thu, 18 Jun 2020 15:04:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05IF418O1549534; Thu, 18 Jun 2020 11:04:01 -0400 From: Tom Lane To: Matthias Apitz cc: pgsql-general@lists.postgresql.org Subject: Re: ESQL/C no indicator variables ./. error -213 In-reply-to: <20200618071355.GA31656@sh4-5.1blu.de> References: <20200617170221.GA30377@sh4-5.1blu.de> <1451504.1592415593@sss.pgh.pa.us> <20200618071355.GA31656@sh4-5.1blu.de> Comments: In-reply-to Matthias Apitz message dated "Thu, 18 Jun 2020 09:13:55 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1549532.1592492641.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 18 Jun 2020 11:04:01 -0400 Message-ID: <1549533.1592492641@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthias Apitz writes: > El d=C3=ADa Mittwoch, Juni 17, 2020 a las 01:39:53 -0400, Tom Lane escri= bi=C3=B3: >> Could you provide a self-contained test case for this? It's hard to >> guess at what the problem might be. > attached is a simple ESQL/C code; > ... > [6485] [18.06.2020 08:26:38:436]: ecpg_execute on line 36: query: select= tstchar25 , tstint from dbctest where tstint =3D 1; with 0 parameter(s) o= n connection sisis > [6485] [18.06.2020 08:26:38:437]: ecpg_execute on line 36: using PQexec > [6485] [18.06.2020 08:26:38:437]: ecpg_process_output on line 36: correc= tly got 1 tuples with 2 fields > [6485] [18.06.2020 08:26:38:437]: ecpg_get_data on line 36: RESULT: off= set: 80; array: no > [6485] [18.06.2020 08:26:38:437]: raising sqlcode -213 on line 36: null = value without indicator on line 36 > [6485] [18.06.2020 08:26:38:438]: ecpg_finish: connection sisis closed Hmm. Trying this here, I get $ ./embedded hostvariable 'tstint' before SELECT tstchar25, tstint INTO :tstchar25, :ts= tint FROM dbctest: 99 hostvariable 'tstint' after SELECT tstchar25, tstint INTO :tstchar25, :ts= tint FROM dbctest with -213: 1 ... [1549069]: ecpg_execute on line 38: query: select tstchar25 , tstint from = dbctes t where tstint =3D 1; with 0 parameter(s) on connection sisis [1549069]: ecpg_execute on line 38: using PQexec [1549069]: ecpg_process_output on line 38: correctly got 1 tuples with 2 f= ields [1549069]: ecpg_get_data on line 38: RESULT: off= set: 8 0; array: no [1549069]: ecpg_get_data on line 38: RESULT: 1 offset: 4; array: no [1549069]: ecpg_finish: connection sisis closed which looks like the right thing. I don't pay much attention to ECPG development, but it seems like you must be hitting a bug that's been fixed. Are your ecpg and libecpg up to date? regards, tom lane