X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E89909DD588 for ; Fri, 13 Jan 2006 19:10:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09893-10 for ; Fri, 13 Jan 2006 19:10:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.pzkagis.cz (gis6.netbox.cz [83.240.30.214]) by postgresql.org (Postfix) with ESMTP id 5752D9DC9EA for ; Fri, 13 Jan 2006 19:10:10 -0400 (AST) Received: from soptik.pzkagis.cz (localhost.localdomain [127.0.0.1]) by smtp.pzkagis.cz (8.13.1/8.13.1) with ESMTP id k0DNA5GH017904; Sat, 14 Jan 2006 00:10:05 +0100 Received: (from luf@localhost) by soptik.pzkagis.cz (8.13.1/8.13.1/Submit) id k0DNA51U017903; Sat, 14 Jan 2006 00:10:05 +0100 Date: Sat, 14 Jan 2006 00:10:05 +0100 From: Ludek Finstrle To: "A.j. Langereis" Cc: pgsql-odbc@postgresql.org Subject: patch: Re: Values in the select Message-ID: <20060113231005.GA17850@soptik.pzkagis.cz> References: <001401c60749$bd1ab910$6500a8c0@aarjan2> <20060112143055.GF7886@soptik.pzkagis.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <20060112143055.GF7886@soptik.pzkagis.cz> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on smtp.pzkagis.cz X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.076 required=5 tests=[AWL=0.076] X-Spam-Score: 0.076 X-Spam-Level: X-Archive-Number: 200601/135 X-Sequence-Number: 6950 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > I have written an application that uses Postgresql (8.1.0) trough > > an ODBC (ANSI) connection. I noticed that a query like > > "select 'bar' as foo" does not give the value "bar" in the column > > "foo". This works normally under PGadmin and even on other databases > > via ODBC. Am I overlooking something or might this be a bug? > > I'm able to reproduce the problem here. Stay tuned. I hope I'll fix it > in 08.01.0107 development snapshot. I has good news for you. I found the problem and fix it. psqlODBC 08.01.0107 will contain this patch. I hope I put it on the web during weekend (the date couldn't be final). Patch is attached. Please review and comment Luf --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="psqlodbc-typlen_var_length.diff" diff -c psqlodbc.orig\connection.c psqlodbc\connection.c *** psqlodbc.orig\connection.c Sun Jan 08 12:12:01 2006 --- psqlodbc\connection.c Sat Jan 14 00:09:10 2006 *************** *** 1959,1965 **** * (UNKNOWNS_AS_MAX), and UNKNOWNS_AS_LONGEST won't work because we don't * have data at this point */ ! if(typlen == -1) { switch (ci->drivers.unknown_sizes) { --- 1959,1965 ---- * (UNKNOWNS_AS_MAX), and UNKNOWNS_AS_LONGEST won't work because we don't * have data at this point */ ! if(typlen < 0) { switch (ci->drivers.unknown_sizes) { --zYM0uCDKw75PZbzx--