Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1D4351337C3B for ; Thu, 17 Mar 2011 19:13:29 -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 99150-01 for ; Thu, 17 Mar 2011 22:13:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.csc.lt (mail.csc.lt [193.138.191.5]) by mail.postgresql.org (Postfix) with ESMTP id 041601337C35 for ; Thu, 17 Mar 2011 19:13:20 -0300 (ADT) Received: (qmail 32689 invoked by uid 210); 17 Mar 2011 22:13:17 -0000 Received: from mail.nsoft.lt by mail (envelope-from , uid 201) with qmail-scanner-2.05st (clamdscan: 0.97/12849. spamassassin: 3.2.1. perlscan: 2.05st. Clear:RC:1(77.240.249.53):. Processed in 0.010897 secs); 17 Mar 2011 22:13:17 -0000 Received: from mail.nsoft.lt (77.240.249.53) by mail.csc.lt with SMTP; 17 Mar 2011 22:13:17 -0000 Received: from [192.168.16.113] (unknown [77.240.249.53]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.nsoft.lt (Postfix) with ESMTPS id 885958E073 for ; Fri, 18 Mar 2011 00:13:15 +0200 (EET) Message-ID: <4D82877B.9050108@nsoft.lt> Date: Fri, 18 Mar 2011 00:13:15 +0200 From: Julius Tuskenis Organization: UAB nSoft User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; lt-LT; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: odbc 9.0.200 on delphi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/13 X-Sequence-Number: 10604 Hello, postgresql ODBC community This is my first post so firstly I'd like to thank you for the ODBC driver. We have several products using it (programming with Delphi 2006 using ADO components (dbGo)). We are now upgrading Postgresql server to v9, so we had to change odbc driver from 8.03.04.00 to 9.00.02.00. We observed some interesting behavior - sometimes the query is executed, but now rows are returned although we have no such problems executing queries using pgAdmin. The problem occurs when the string parameter size is left as is (-1 in Delphi ) and value of 5 characters is passed. If I pass more or less character string - everything works as expected. Is the number 5 somehow "magical" in pqsql ODBC ?... Steps to reproduce: 1. Create a function CREATE OR REPLACE FUNCTION _test(prm_1 character varying) RETURNS integer AS 'select 0' LANGUAGE sql VOLATILE COST 100; 2. Create a test Delphi program that would have a ADOConnection, ADOQuery, DataSource and DBGrid. Set the connection parameters, link the objects. 3. Add SQL to ADOQuery: select _test(:prm_test ) as kuku; 4. Add button to the project with code in OnClick event procedure TForm1.Button1Click(Sender: TObject); begin ADOConnection1.Connected := false; ADOQuery1.Parameters[0].Value := '12345'; ADOQuery1.Open; Caption := IntToStr(ADOQuery1.RecordCount); end; 5. Execute the program, hit the button, observe the query returning empty field in DBGrid, Caption becomes '0'; System info: Server Version string PostgreSQL 9.0.3 on i486-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-10) 4.4.5, 32-bit Client WinXP SP3 ODBC version 9.00.02.00 (Using PostgreSQL Unicode driver) I understand It's two systems (odbc and delphi) that are tested, but I don't know how to test ODBC only... Please advice what should I do about it. Odbc v8.03.04.00 does not act like this. Some more notices: 1. If I change OnClict event to procedure TForm1.Button1Click(Sender: TObject); begin ADOConnection1.Connected := false; ADOQuery1.Parameters[0].Value := '12345'; ADOQuery1.Open; ADOQuery1.Close; ADOQuery1.Open; Caption := IntToStr(ADOQuery1.RecordCount); end; Everything works as expected. 2. If I use query without parameters ( select _test('12345' ) as kuku;) - everything is OK. 3. If I set parameter size of at least 6 result is ok. I don't know what else to check. If there is a person who is willing to fix the problem I'd be more than pleased to help. Don't hesitate to ask for some logs or what ever information you find useful. I can provide Delphi source for the test application if needed. -- Julius Tuskenis Programavimo skyriaus vadovas UAB nSoft mob. +37068233050