X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5B229D1BA6C for ; Sat, 30 Aug 2003 14:19:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 34815-09 for ; Sat, 30 Aug 2003 11:19:29 -0300 (ADT) Received: from www.postgresql.com (unknown [64.117.225.209]) by svr1.postgresql.org (Postfix) with ESMTP id 63EC1D1BA35 for ; Sat, 30 Aug 2003 11:19:09 -0300 (ADT) Received: from mammolo.metodo.net (unknown [195.103.219.20]) by www.postgresql.com (Postfix) with ESMTP id 64A25CF808A for ; Sat, 30 Aug 2003 04:54:07 -0300 (ADT) Received: from mammolo.metodo.net (localhost [127.0.0.1]) by mammolo.metodo.net (Postfix) with SMTP id 47BE6B964D for ; Sat, 30 Aug 2003 09:51:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mammolo.metodo.net (Postfix) with ESMTP id 0F039B9572 for ; Sat, 30 Aug 2003 09:51:00 +0200 (CEST) From: Franco Violi Organization: Metodo Srl To: pgsql-odbc@postgresql.org Subject: Some corrections on psqlodbc driver Date: Sat, 30 Aug 2003 09:39:46 +0200 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308300939.46923.fvioli@metodo.net> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/76 X-Sequence-Number: 3196 I subscribed the gborg site 2 days ago. The reason was that we are openoffice users under linux and we have some problems that make postgres unusable on openoffice/linux. The issue 17455 and 17500 on openoffice.org points to the problem. I debug the latest version of the driver and corrected some ( i think) bugs. One problem was that openoffice send to the driver escape istructions in uppercase and the driver was testing just lowercase. Another problem was that on snprintf You cannot use the same buffer as source and destination, because in this way the result is a null string. Here are the modification I made on convert.c. I am not sure that on Windows the strcasecmp system call exist. By the way: 2785d2784 < char tmpbuf[1024]; // temporary snprintf destination 2838c2837 < if (strcasecmp(key, "d") == 0) --- > if (strcmp(key, "d") == 0) 2842,2843c2841,2842 < prtlen = snprintf(tmpbuf, sizeof(buf), "%s::date ", buf); < CVT_APPEND_DATA(qb, tmpbuf, prtlen); --- > prtlen = snprintf(buf, sizeof(buf), "%s::date ", buf); > CVT_APPEND_DATA(qb, buf, prtlen); 2845c2844 < else if (strcasecmp(key, "t") == 0) --- > else if (strcmp(key, "t") == 0) 2849,2850c2848,2849 < prtlen = snprintf(tmpbuf, sizeof(buf), "%s::time", buf); < CVT_APPEND_DATA(qb, tmpbuf, prtlen); --- > prtlen = snprintf(buf, sizeof(buf), "%s::time", buf); > CVT_APPEND_DATA(qb, buf, prtlen); 2852c2851 < else if (strcasecmp(key, "ts") == 0) --- > else if (strcmp(key, "ts") == 0) 2857c2856 < prtlen = snprintf(tmpbuf, sizeof(buf), "%s::datetime", buf); --- > prtlen = snprintf(buf, sizeof(buf), "%s::datetime", buf); 2859,2860c2858,2859 < prtlen = snprintf(tmpbuf, sizeof(buf), "%s::timestamp", buf); < CVT_APPEND_DATA(qb, tmpbuf, prtlen); --- > prtlen = snprintf(buf, sizeof(buf), "%s::timestamp", buf); > CVT_APPEND_DATA(qb, buf, prtlen); 2862c2861 < else if (strcasecmp(key, "oj") == 0) /* {oj syntax support for 7.1 * servers */ --- > else if (strcmp(key, "oj") == 0) /* {oj syntax support for 7.1 * servers */ 2867c2866 < else if (strcasecmp(key, "fn") == 0) --- > else if (strcmp(key, "fn") == 0)