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 C128C9DCB3E for ; Fri, 9 Dec 2005 18:51:46 -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 79106-02 for ; Fri, 9 Dec 2005 18:51:48 -0400 (AST) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id BCE2B9DCAB6 for ; Fri, 9 Dec 2005 18:51:44 -0400 (AST) Received: from localhost (av.hub.org [200.46.204.144]) by pgfoundry.org (Postfix) with ESMTP id 449841125038; Fri, 9 Dec 2005 22:51:48 +0000 (GMT) Received: from pgfoundry.org ([200.46.204.130]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80380-03; Fri, 9 Dec 2005 18:51:46 -0400 (AST) Received: by pgfoundry.org (Postfix, from userid 80) id 49C391125030; Fri, 9 Dec 2005 22:51:46 +0000 (GMT) To: noreply@pgfoundry.org From: Subject: =?UTF-8?Q?[_psqlodbc-Bugs-1000477_]_Long_parameters_are_not_parsed_from_initialization_string_and_unitialized_options?= Content-type: text/plain; charset=UTF-8 Message-Id: <20051209225146.49C391125030@pgfoundry.org> Date: Fri, 9 Dec 2005 22:51:46 +0000 (GMT) X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-0.848 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.042, NO_REAL_NAME=0.55, SUBJECT_EXCESS_QP=0] X-Spam-Score: -0.848 X-Spam-Level: X-Archive-Number: 200512/126 X-Sequence-Number: 6605 Bugs item #1000477, was opened at 2005-12-09 14:39 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125 Category: None Group: None >Status: Closed Resolution: Accepted Priority: 3 Submitted By: Nobody (None) Assigned to: Ludek Finstrle (luf) Summary: Long parameters are not parsed from initialization string and unitialized options Initial Comment: SQLConfigDataSource( NULL,ODBC_CONFIG_DSN, "PostgreSQL Unicode", "DSN=Example\0SERVER=localhost\0DATABASE=template1\0Username=postgres\0UseServerSidePrepare=1\0TextAsLongVarchar=1\0ByteaAsLongVarBinary=1\0\0") This creates new DSN but options such as ByteaAsLongVarBinary and TextAsLongVarchar are set to -1 instead of 1. Thats because ParseAttributes function in SETUP.C file accepts only keys smaller then 15 characters: #define MAXKEYLEN (15+1) /* Max keyword length */ char aszKey[MAXKEYLEN]; There are some options much longer than 15 chars an they are not parsed. In general uninitialized options shouldn't be saved in registry (ODBC.INI) but CC_conninfo_init initializes some options to -1 and they are never updated to proper default values: // connection.c CC_conninfo_init(ConnInfo *conninfo) { memset(conninfo, 0, sizeof(ConnInfo)); conninfo->disallow_premature = -1; //!! conninfo->allow_keyset = -1; // !! conninfo->lf_conversion = -1; // !! conninfo->true_is_minus1 = -1; // !! conninfo->int8_as = -101; conninfo->bytea_as_longvarbinary = -1; //!! conninfo->use_server_side_prepare = -1; //!! memcpy(&(conninfo->drivers), &globals, sizeof(globals)); } ---------------------------------------------------------------------- >Comment By: Dave Page (dpage) Date: 2005-12-09 22:51 Message: Thanks, patch applied. ---------------------------------------------------------------------- Comment By: Ludek Finstrle (luf) Date: 2005-12-09 22:19 Message: Please try new development snapshot. Problems may disappear with 8.01.0104. If you are using ODBC on linux try attached patch. ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000477&group_id=1000125