Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f027jSL55524 for ; Tue, 2 Jan 2001 02:45:29 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id CAA15402; Tue, 2 Jan 2001 02:44:58 -0500 (EST) From: Bruce Momjian Message-Id: <200101020744.CAA15402@candle.pha.pa.us> Subject: Re: wrong values in ODBC parameters? In-Reply-To: "from Johann Zuschlag at Dec 28, 2000 01:17:48 pm" To: Johann Zuschlag Date: Tue, 2 Jan 2001 02:44:58 -0500 (EST) CC: "Pgsql-interfaces@postgresql.org" X-Mailer: ELM [version 2.4ME+ PL77 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200101/3 X-Sequence-Number: 610 Try 7.1 beta1 and see if the bug has been fixed already. [ Charset ISO-8859-1 unsupported, converting... ] > Hi, > > now my initial problem: > > I'm using a commercial application which is crashing while trying to > insert sets into tables (using psqlodbc.dll). > > I did some tracing: > > It crashes in module convert.c / copy_statement_with_parameters > in function: > > convert_special_chars(char *si, char *dst, int used) > > The access violation appears at: > > if (si[i] == '\r' && i+1 < strlen(si) && si[i+1] == '\n') > > si = 0x00000001 > used = -103 > > It seems that it runs into an access violation, since 'si' has > been assigned a wrong value. Also 'used = -103' doesn't > seem to be healthy value. 'dst' seems to be alright. > > convert_special_chars was called in > copy_statement_with_parameters: > > convert_special_chars(buf, &new_statement[npos], used); > > 'buf' seems to be the same like 'buffer': > > So 'used' and 'buffer' where assigned at (in copy_statement_with_parameters): > > /* Assign correct buffers based on data at exec param or not */ > if ( stmt->parameters[param_number].data_at_exec) { > used = stmt->parameters[param_number].EXEC_used ? *stmt->parameters[param_number].EXEC_used : SQL_NTS; > buffer = stmt->parameters[param_number].EXEC_buffer; > } > else { > used = stmt->parameters[param_number].used ? *stmt->parameters[param_number].used : SQL_NTS; > buffer = stmt->parameters[param_number].buffer; > } > > Well, here my knowledge ends. Something seems to be wrong with the ODBC parameters > supplied by my application, but: > > Same application works flawless with MS-SQL-ODBC and ORACLE-ODBC. > > So IMHO there must be a problem in psqlodbc.dll. Even though I admit that the buggy > call might be accepted in MS-ODBC due to another bug. :-) > > Could somebody point me in the correct direction? Any hints? Patches? > I really would like to use Postgres for my app. > > regards > > Johann > > > > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026