pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Application crash after error - please help
8+ messages / 3 participants
[nested] [flat]
* Re: Application crash after error - please help
@ 2005-12-02 09:05 Ludek Finstrle <luf@pzkagis.cz>
2005-12-02 10:14 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
2005-12-02 16:51 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
0 siblings, 2 replies; 8+ messages in thread
From: Ludek Finstrle @ 2005-12-02 09:05 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; +Cc: pgsql-odbc
> In klient table I have
> info text,
>
> column.
>
> If I remove this column from klient table, error does not occur.
>
> So it seems that this error occurs if table has text type column.
Hello,
I investigate it a little bit more and I go to the end of my
knolwdge. I hope someone on the list could help.
Description:
You insert data with data at exec. It mean you call:
1) SQLExecDirect with ? as parameters needed (3 of them)
2) SQLParamData
3) SQLPutData (only for text column)
4) SQLParamData - which execute the query but fail and return SQL_ERROR
5) SQLCancel - this is point of the problem. I don't know if it may
destroy Binding Parameters at all
6) SQLExecDirect without parameters needed - but ODBC driver execpt
3 parameters becouse you didn't call SQLFreeStmt (SQL_DROP or
SQL_ - I forget the name which frees only binding params)
ODBC driver doesn't investigate number od parameters from statement.
Maybe this is point of problem?
7) SQLParamData - go throught well
- your application failed. The point of failure isn't exactly in ODBC
driver but it correspond with SQLPutData is needed.
I'm not sure if it's problem of psqlODBC driver. Could someone more
experienced help?
Thanks a lot
Luf
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
2005-12-02 09:05 Re: Application crash after error - please help Ludek Finstrle <luf@pzkagis.cz>
@ 2005-12-02 10:14 ` Andrus <eetasoft@online.ee>
1 sibling, 0 replies; 8+ messages in thread
From: Andrus @ 2005-12-02 10:14 UTC (permalink / raw)
To: pgsql-odbc
> I investigate it a little bit more and I go to the end of my
> knolwdge. I hope someone on the list could help.
>
> Description:
> You insert data with data at exec. It mean you call:
> 1) SQLExecDirect with ? as parameters needed (3 of them)
> 2) SQLParamData
> 3) SQLPutData (only for text column)
> 4) SQLParamData - which execute the query but fail and return SQL_ERROR
> 5) SQLCancel - this is point of the problem. I don't know if it may
> destroy Binding Parameters at all
>
> 6) SQLExecDirect without parameters needed - but ODBC driver execpt
> 3 parameters becouse you didn't call SQLFreeStmt (SQL_DROP or
> SQL_ - I forget the name which frees only binding params)
> ODBC driver doesn't investigate number od parameters from statement.
> Maybe this is point of problem?
> 7) SQLParamData - go throught well
> - your application failed. The point of failure isn't exactly in ODBC
> driver but it correspond with SQLPutData is needed.
Here are steps to reproduce:
1. Unpack www.eetasoft.ee/postgresrepro.zip (5 MB) (link valid at least one
week)
2. Edit sqltest.prg to change password for connection string instead of
aaaa, user name instead of admin and possibly other parameters.
3. Run the main.exe.
Observed result:
Fatal error: exception code C0000005
Expected result:
message Program flow does not reach to this point.
Environment:
1. Postgres 8.1 on Windows XP SP2. cluster locale is Estonian (occurs with
other locales also). Database (sample code uses pre-installed postgres
database) encoding is UTF8
2. Client in Windows XP SP2 (occurs with Win 98 client also), Unicode ODBC
driver vers. 8.1.1. (occurs with ANSI driver also)
3. Client application is created using Microsoft Visual FoxPro 9 SP1beta
(occurs in VFP vers 7 also)
4. Client windows locale is Estonian (occurs with other windows locales
also). You may remove Ü character from sqltest.prg source code to run it in
other locales and encodings.
Notes:
1. Occurs only if SQLParamData returns SQL_ERROR. If not error is returned,
problem does not occur.
2. Occurs only if table contains text type field. If there are only char or
varchars fields, problem does not occur.
> I'm not sure if it's problem of psqlODBC driver. Could someone more
> experienced help?
Visual FoxPro is closed source. Microsoft does not support Postgres ODBC
driver.
Since we have large amout of VFP code, we cannot change to other client at
this moment.
So only hope is it make some changes to ODBC driver code.
I don't have C compiler and enough knowledge to compile odbc driver and
investigate this issue.
Should I add this issue to bug tracker ?
Andrus.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
2005-12-02 09:05 Re: Application crash after error - please help Ludek Finstrle <luf@pzkagis.cz>
@ 2005-12-02 16:51 ` Andrus <eetasoft@online.ee>
1 sibling, 0 replies; 8+ messages in thread
From: Andrus @ 2005-12-02 16:51 UTC (permalink / raw)
To: pgsql-odbc
Ludek,
> Main.exe doesn't use auth info prom sqltest.prg.
I'm sorry. Modified repro code is available in same address
(www.eetasoft.ee/postgresrepro.zip)
This repro contains text type column. Fox mysql it should probably be
replaced also. My co-worker tries to run it in mysql in weekend.
> I don't know if the problem is in ODBC driver. But to fix this problem
> imidiately in your app it's enough
> if you add Calling SQLFreeStmt with SQL_DROP in the code when insert
> fail.
Thank you. This would be a good fix. Unfortunately it it difficult to
implement in VFP.
I don't use ODBC direct calls in my code. In repro code I issue APPEND FROM
APPEND FROM DBF('testk')
This causes VFP to generate ODBC calls automatically. I do'nt know is it
possible to add ODBC SQLFreeStmt direct call after high-level VFP APPEND
FROM command.
More generally: I create form, bind it to Postgres server data. Users edit
this form.
During editing process VFP generates ODBC calls automatically. Trying to
insert duplicate primary by end user or some other odbc error causes my appl
crash shortly after that. My code is not involved in this process.
Theoretically, I can determine odbc handle used by VFP and make direct ODBC
dll calls from my application. I can add my code to editing events to fix
something.
However, I do'nt know the places where to add SQLFreeStmt calls and i'm not
sure how to add such fixes in all situations which may occur during editing
process.
Andrus.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
@ 2005-12-02 17:00 Dave Page <dpage@vale-housing.co.uk>
2005-12-02 17:24 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
0 siblings, 1 reply; 8+ messages in thread
From: Dave Page @ 2005-12-02 17:00 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; pgsql-odbc
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Andrus
> Sent: 02 December 2005 16:51
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Application crash after error - please help
>
> Ludek,
>
> > Main.exe doesn't use auth info prom sqltest.prg.
>
> I'm sorry. Modified repro code is available in same address
> (www.eetasoft.ee/postgresrepro.zip)
> This repro contains text type column. Fox mysql it should probably be
> replaced also. My co-worker tries to run it in mysql in weekend.
>
> > I don't know if the problem is in ODBC driver. But to fix
> this problem
> > imidiately in your app it's enough
> > if you add Calling SQLFreeStmt with SQL_DROP in the code when insert
> > fail.
>
> Thank you. This would be a good fix. Unfortunately it it difficult to
> implement in VFP.
Andrus,
Can I email you an updated dll to test? I think I fixed this, we just
need to test it some more, and confirm it hasn't broken anything else.
Regards, Dave.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
2005-12-02 17:00 Re: Application crash after error - please help Dave Page <dpage@vale-housing.co.uk>
@ 2005-12-02 17:24 ` Andrus <eetasoft@online.ee>
2005-12-02 17:29 ` Re: Application crash after error - please help Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 8+ messages in thread
From: Andrus @ 2005-12-02 17:24 UTC (permalink / raw)
To: pgsql-odbc
> Can I email you an updated dll to test? I think I fixed this, we just
> need to test it some more, and confirm it hasn't broken anything else.
Dave,
thank you.
Yes, you can e-mail it. I can test it with this repro immediately.
Also, I can put it into small production environment starting at Monday.
My email is eetasoft@online.ee
Should I replace simply some dll file in windows XP some directory ?
Will driver use the new file automatically or will XP dll version control
try to give old file for driver ?
Andrus.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
2005-12-02 17:00 Re: Application crash after error - please help Dave Page <dpage@vale-housing.co.uk>
2005-12-02 17:24 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
@ 2005-12-02 17:29 ` Ludek Finstrle <luf@pzkagis.cz>
2005-12-02 18:22 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
0 siblings, 1 reply; 8+ messages in thread
From: Ludek Finstrle @ 2005-12-02 17:29 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; +Cc: pgsql-odbc
> Yes, you can e-mail it. I can test it with this repro immediately.
> Also, I can put it into small production environment starting at Monday.
Please wait few minutes and the new version is on pgFoundry.
> Should I replace simply some dll file in windows XP some directory ?
> Will driver use the new file automatically or will XP dll version control
> try to give old file for driver ?
I only replace psqlodbc[aw].dll files in Win2k.
Luf
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
2005-12-02 17:00 Re: Application crash after error - please help Dave Page <dpage@vale-housing.co.uk>
2005-12-02 17:24 ` Re: Application crash after error - please help Andrus <eetasoft@online.ee>
2005-12-02 17:29 ` Re: Application crash after error - please help Ludek Finstrle <luf@pzkagis.cz>
@ 2005-12-02 18:22 ` Andrus <eetasoft@online.ee>
0 siblings, 0 replies; 8+ messages in thread
From: Andrus @ 2005-12-02 18:22 UTC (permalink / raw)
To: pgsql-odbc
Ludek
> Please wait few minutes and the new version is on pgFoundry.
Thank you. I tested 8.1.103 and my repro does not cause error anymore.
EXCELLENT!
Andrus.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Application crash after error - please help
@ 2005-12-02 20:13 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 8+ messages in thread
From: Dave Page @ 2005-12-02 20:13 UTC (permalink / raw)
To: Andrus <eetasoft@online.ee>; pgsql-odbc
Seems like Luf beat me to it - glad to hear it's working :-)
Regards, Dave
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Andrus
> Sent: 02 December 2005 17:24
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Application crash after error - please help
>
> > Can I email you an updated dll to test? I think I fixed
> this, we just
> > need to test it some more, and confirm it hasn't broken
> anything else.
>
> Dave,
>
> thank you.
>
> Yes, you can e-mail it. I can test it with this repro immediately.
> Also, I can put it into small production environment starting
> at Monday.
>
> My email is eetasoft@online.ee
>
> Should I replace simply some dll file in windows XP some directory ?
> Will driver use the new file automatically or will XP dll
> version control
> try to give old file for driver ?
>
> Andrus.
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2005-12-02 20:13 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-02 09:05 Re: Application crash after error - please help Ludek Finstrle <luf@pzkagis.cz>
2005-12-02 10:14 ` Andrus <eetasoft@online.ee>
2005-12-02 16:51 ` Andrus <eetasoft@online.ee>
2005-12-02 17:00 Re: Application crash after error - please help Dave Page <dpage@vale-housing.co.uk>
2005-12-02 17:24 ` Andrus <eetasoft@online.ee>
2005-12-02 17:29 ` Ludek Finstrle <luf@pzkagis.cz>
2005-12-02 18:22 ` Andrus <eetasoft@online.ee>
2005-12-02 20:13 Re: Application crash after error - please help Dave Page <dpage@vale-housing.co.uk>
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