pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedBug in clear_error in SQLExecute?
3+ messages / 3 participants
[nested] [flat]
* Bug in clear_error in SQLExecute?
@ 2004-01-09 21:27 Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 3+ messages in thread
From: Ludek Finstrle @ 2004-01-09 21:27 UTC (permalink / raw)
To: pgsql-odbc
Hello,
I think I found a bug in SQLExecute. IMHO SC_clean_error should be
called there only sometimes as you can see from my patch created
againist fresh CVS snapshot.
Without this patch application fail becouse error is produced in Fetch
instead of in Execute.
Commments are welcome
Luf
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Bug in clear_error in SQLExecute?
@ 2004-01-10 13:22 Hiroshi Inoue <inoue@tpf.co.jp>
parent: Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 3+ messages in thread
From: Hiroshi Inoue @ 2004-01-10 13:22 UTC (permalink / raw)
To: 'Ludek Finstrle' <luf@pzkagis.cz>; +Cc: pgsql-odbc
> -----Original Message-----
> Ludek Finstrle
>
> Hello,
>
> I think I found a bug in SQLExecute. IMHO SC_clean_error should be
> called there only sometimes as you can see from my patch created
> againist fresh CVS snapshot.
>
> Without this patch application fail becouse error is produced in Fetch
> instead of in Execute.
Could you explain the examples ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Bug in clear_error in SQLExecute?
@ 2004-01-10 14:12 'Ludek Finstrle' <luf@pzkagis.cz>
parent: Hiroshi Inoue <inoue@tpf.co.jp>
0 siblings, 0 replies; 3+ messages in thread
From: 'Ludek Finstrle' @ 2004-01-10 14:12 UTC (permalink / raw)
To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: 'Ludek Finstrle' <luf@pzkagis.cz>; pgsql-odbc
> Hiroshi Inoue
>
> > Ludek Finstrle
> >
> > I think I found a bug in SQLExecute. IMHO SC_clean_error should be
> > called there only sometimes as you can see from my patch created
> > againist fresh CVS snapshot.
> >
> > Without this patch application fail becouse error is produced in Fetch
> > instead of in Execute.
>
> Could you explain the examples ?
I can. I attach part of mylog output where the problem is described.
I try explain it in english and I hope you can understand.
Application call select on non-exists table. It's allocate stmt then
it prepare stmt. Then it call NumResultCols. Error raise in this
function but it return SQL_SUCCESS (I think this is right) and set
stmt status to STMT_PREMATURE. Then it call Execute. There is
clean_error so it return SQL_SUCCES and I think this is wrong>.
After it app call Fetch and it fail.
Application doesn't expect failure in Fetch after success execute.
I don't have source for app because it's commercial one. So I can't
change it's behaviour. I tried create table but app fails later.
When I patch psqlodbc it's doing what I expect. But I'm not sure
if it's good for all situations. I don't see so far.
The opposite one situation which I think about is execute twice or
more times with different binding parameters. So I add test status
to STMT_FINISHED. As I said I'm not sure if it's correct.
Best regards
Luf
Attachments:
mylog_clean_error.log (text/plain, 3.7K) download
[1080][[SQLAllocHandle]][1080]PGAPI_AllocStmt: entering...
[1080]**** PGAPI_AllocStmt: hdbc = 22773424, stmt = 22850256
[1080]CC_add_statement: self=22773424, stmt=22850256
[1080][[SQLGetStmtAttr]] Handle=22850256 10010
[1080]PGAPI_GetStmtAttr Handle=22850256 10010
[1080][[SQLGetStmtAttr]] Handle=22850256 10011
[1080]PGAPI_GetStmtAttr Handle=22850256 10011
[1080][[SQLGetStmtAttr]] Handle=22850256 10012
[1080]PGAPI_GetStmtAttr Handle=22850256 10012
[1080][[SQLGetStmtAttr]] Handle=22850256 10013
[1080]PGAPI_GetStmtAttr Handle=22850256 10013
[1080][SQLPrepare][1080]PGAPI_Prepare: entering...
[1080]**** PGAPI_Prepare: STMT_ALLOCATED, copy
[1080][SQLNumResultCols][1080]PGAPI_NumResultCols: entering...
[1080]SC_pre_execute: status = 1
[1080] preprocess: status = READY
[1080]PGAPI_Execute: entering...
[1080]PGAPI_Execute: clear errors...
[1080]recycle statement: self= 22850256
[1080]APD_free_params: ENTER, self=22850508
[1080]IPD_free_params: ENTER, self=22850572
[1080]IPD_free_params: EXIT
[1080]PDATA_free_params: ENTER, self=22850680
[1080]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=105, stmt='select table_name,column_name,join_table,code_column,text_column,index_column,index_value from mscodelist'
[1080] stmt_with_params = 'declare SQL_CUR015CAAD0 cursor for select table_name,column_name,join_table,code_column,text_column,index_column,index_value from mscodelist'
[1080] about to begin a transaction on statement = 22850256
[1080] Sending SELECT statement on stmt=22850256, cursor_name='SQL_CUR015CAAD0'
[1080]send_query(): conn=22773424, query='declare SQL_CUR015CAAD0 cursor for select table_name,column_name,join_table,code_column,text_column,index_column,index_value from mscodelist'
[1080]send_query: done sending query
[1080]in QR_Constructor
[1080]exit QR_Constructor
[1080]read 54, global_socket_buffersize=4096
[1080]send_query: got id = 'C'
[1080]send_query: ok - 'C' - BEGIN
[1080]send_query: setting cmdbuffer = 'BEGIN'
[1080]send_query: got id = 'E'
[1080]send_query: 'E' - ERROR: Relation 'mscodelist' does not exist
[1080]read 1, global_socket_buffersize=4096
[1080]send_query: got id = 'Z'
[1080] done sending the query:
[1080]send_query(): conn=22773424, query='ROLLBACK'
[1080]send_query: done sending query
[1080]in QR_Constructor
[1080]exit QR_Constructor
[1080]read 11, global_socket_buffersize=4096
[1080]send_query: got id = 'C'
[1080]send_query: ok - 'C' - ROLLBACK
[1080]send_query: setting cmdbuffer = 'ROLLBACK'
[1080]send_query: returning res = 22849808
[1080]send_query: got id = 'Z'
[1080]CC_abort: sending ABORT!
[1080]QResult: in DESTRUCTOR
[1080]QResult: free memory in, fcount=0
[1080]QResult: free memory out
[1080]QResult: exit DESTRUCTOR
[1080]STATEMENT ERROR: func=SC_execute, desc='', errnum=7, errmsg='Error while executing the query'
[1080]CONN ERROR: func=SC_execute, desc='', errnum=110, errmsg='ERROR: Relation 'mscodelist' does not exist'
[1080] preprocess: after status = FINISHED, so set PREMATURE
[1080]PGAPI_NumResultCols: result = 22850000, status = 2, numcols = 0
[1080][SQLExecute][1080]PGAPI_Execute: entering...
[1080]PGAPI_Execute: premature statement but return SQL_SUCCESS
[1080][[SQLFetch]][1080]PGAPI_ExtendedFetch: stmt=22850256
[1080]STATEMENT ERROR: func=PGAPI_ExtendedFetch, desc='', errnum=15, errmsg='Bindings were not allocated properly.'
[1080]CONN ERROR: func=PGAPI_ExtendedFetch, desc='', errnum=110, errmsg='ERROR: Relation 'mscodelist' does not exist'
[1080][SQLDisconnect][1080]PGAPI_Disconnect: entering...
[1080]PGAPI_Disconnect: about to CC_cleanup
[1080]in CC_Cleanup, self=22773424
[1080]after CC_abort
[1080]SOCK_Destructor
[1080]after SOCK destructor
[1080]SC_Destructor: self=22818240, self->result=0, self->hdbc=0
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-01-10 14:12 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-09 21:27 Bug in clear_error in SQLExecute? Ludek Finstrle <luf@pzkagis.cz>
2004-01-10 13:22 ` Hiroshi Inoue <inoue@tpf.co.jp>
2004-01-10 14:12 ` 'Ludek Finstrle' <luf@pzkagis.cz>
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