pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Johann Zuschlag <zuschlag2@online.de>
To: Pgsql-interfaces@postgresql.org <Pgsql-interfaces@postgresql.org>
Subject: wrong values in ODBC parameters?
Date: Thu, 28 Dec 2000 13:17:48 +0100
Message-ID: <E14Bbzi-0007DR-01@mrelay01.kundenserver.de> (raw)
In-Reply-To: <E149D5E-00045j-00@mrelay00.kundenserver.de>

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






view thread (4+ messages)  latest in thread

Message-ID: <E14Bbzi-0007DR-01@mrelay01.kundenserver.de>
Permalink:  ../E14Bbzi-0007DR-01@mrelay01.kundenserver.de/
Also on:    postgresql.org/message-id/E14Bbzi-0007DR-01@mrelay01.kundenserver.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: zuschlag2@online.de
  Subject: Re: wrong values in ODBC parameters?
  In-Reply-To: <E14Bbzi-0007DR-01@mrelay01.kundenserver.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox