[ psqlodbc-Bugs-1000641 ] odbc can't execute next statement after execute a bad function

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1000641 ] odbc can't execute next statement after execute a bad function
Date: 2006-05-14 09:33:26
Message-ID: 20060514093326.975C486C541@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Bugs item #1000641, was opened at 2006-05-10 02:51
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000641&group_id=1000125

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: odbc can't execute next statement after execute a bad function

Initial Comment:
server :8.1.1
odbc :psqlodbc 8.02.00.02
test tool: odbcte32.exe

after I execute a bad function
select bad_func()

I can't execute any statement , ODBC 's errmsg is "the cursor is open"

there is odbcte32 's log as below:
--------------------------------------------------------------
dbc: szSqlState = "01004", *pfNativeError = 215, *pcbErrorMsg = 27
MessageText = "the ConnStrOut is too small"
Full Connect:

Full Connect(Default)

Env. Attr. SQL_ATTR_ODBC_VERSION set to SQL_OV_ODBC3

Successfully connected to DSN 'PostgreSQL Unicode'.
SQLExecDirect:
In: hstmt = 0x00C00394, szSqlStr = "select bad_func()",
cbSqlStr = -3
Return: SQL_ERROR=-1

Errors All:
: szSqlState = "42P01", *pfNativeError = 7, *pcbErrorMsg = 73
szErrorMsg = "ERROR: relation "notable" does not exist;
Error while executing the query"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"

SQLExecDirect:
In: hstmt = 0x00C00394, szSqlStr = "select * from account",
cbSqlStr = -3
Return: SQL_ERROR=-1

Errors All:
: szSqlState = "HY010", *pfNativeError = 3, *pcbErrorMsg = 19
szErrorMsg = "The cursor is open."
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
desc: szSqlState = "IM001", *pfNativeError = 0, *pcbErrorMsg = 70
MessageText = "[Microsoft][ODBC Driver Manager] Driver does not support this function"
--------------------------------------------------------------------------

----------------------------------------------------------------------

Comment By: Hiroshi Inoue (hinoue)
Date: 2006-05-10 09:46

Message:
Please call SQLCloseCursor() after the *select* call.

regards,
Hiroshi Inoue

----------------------------------------------------------------------

Comment By: tony chen (trainee12)
Date: 2006-05-10 03:09

Message:
it 's mylog:
----------------------------------------------------------
[-455501]calling getDSNdefaults
[-455501]CC_connect: entering...
[-455501]sslmode=disable
[-455501]original_CC_connect: entering...
[-455501]original_CC_connect: DSN = 'PostgreSQL Unicode', server = '192.168.1.201', port = '5432', database = 'hotel', username = 'hotel', password='xxxxx'
[-455501]connecting to the server socket...
[-455501]connection to the server socket succeeded.
[-455501]sizeof startup packet = 96
[-455501]sent the authentication block.
[-455501]sent the authentication block successfully.
[-455501]gonna do authentication
[-455501]read 13, global_socket_buffersize=4096
[-455501]auth got 'R'
[-455501]areq = 5
[-455501]in AUTH_REQ_MD5
[-455501]CONN ERROR: func=original_CC_connect, desc='', errnum=112, errmsg='A password is required for this connection.'
[-455501]dconn_DoDialog: ci = 12900f4
[-455501]checking libpq library
[-455501]hmodule=63100000
[-455501]libpq_exist=1
[-455501]CC_connect: entering...
[-455501]sslmode=disable
[-455501]original_CC_connect: entering...
[-455501]gonna do authentication
[-455501]in 'R' password_req=hotel
[-455501]in AUTH_REQ_MD5
[-455501]read 269, global_socket_buffersize=4096
[-455501]auth got 'R'
[-455501]areq = 0
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]Got the PostgreSQL version string: '8.1.1'
[-455501]Extracted PostgreSQL version number: '8.1'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'S'
[-455501]auth got 'K'
[-455501]auth got 'Z'
[-455501]CC_send_settings: entering...
[-455501]PGAPI_AllocStmt: entering...
[-455501]**** PGAPI_AllocStmt: hdbc = 1290078, stmt = 1390c94
[-455501]CC_add_statement: self=1290078, stmt=1390c94
[-455501]PGAPI_FreeStmt: entering...hstmt=1390c94, fOption=1
[-455501]QResult: enter DESTRUCTOR
[-455501]SC_init_Result(1390c94)[-455501]SC_Destructor: self=1390c94, self->result=0, self->hdbc=1290078
[-455501]APD_free_params: ENTER, self=20516240
[-455501]IPD_free_params: ENTER, self=1390dd0
[-455501]PDATA_free_params: ENTER, self=1390e38
[-455501]SC_Destructor: EXIT
[-455501]CC_lookup_lo: entering...
[-455501]send_query(): conn=1290078, query='select oid, typbasetype from pg_type where typname = 'lo''
[-455501]send_query: done sending query
[-455501]in QR_Constructor
[-455501]exit QR_Constructor
[-455501]read 77, global_socket_buffersize=4096
[-455501]send_query: got id = 'T'
[-455501]QR_fetch_tuples: cursor = '', self->cursor=0
[-455501]num_fields = 2
[-455501]READING ATTTYPMOD
[-455501]CI_read_fields: fieldname='oid', adtid=26, adtsize=4, atttypmod=-1 (rel,att)=(1247,65534)
[-455501]READING ATTTYPMOD
[-455501]CI_read_fields: fieldname='typbasetype', adtid=26, adtsize=4, atttypmod=-1 (rel,att)=(1247,19)
[-455501]QR_fetch_tuples: past CI_read_fields: num_fields = 2
[-455501]MALLOC: tuple_size = 100, size = 1600
[-455501]QR_next_tuple: inTuples = true, falling through: fcount = 0, fetch_number = 0
[-455501]end of tuple list -- setting inUse to false: this = 13a0800 SELECT
[-455501]_QR_next_tuple: 'C' fetch_total = 0 & this_fetch = 0
[-455501]QR_next_tuple: backend_rows < CACHE_SIZE: brows = 0, cache_size = 0
[-455501]QR_next_tuple: reached eof now
[-455501]_QR_next_tuple: 'C': DONE (fcount == 0)
[-455501]send_query: got id = 'Z'
[-455501]QResult: enter DESTRUCTOR
[-455501]QResult: in QR_close_result
[-455501]QResult: free memory in, fcount=0
[-455501]QResult: free memory out
[-455501]QResult: enter DESTRUCTOR
[-455501]QResult: exit close_result
[-455501]QResult: exit DESTRUCTOR
[-455501]Got the large object oid: -999
[-455501]CC_lookup_characterset: entering...
[-455501]CC_connect: returning...
[-455501]szConnStrOut = '(NULL)' len=160,0
[-455501]PGAPI_DriverConnect: returning 0
[-455501]CONN ERROR: func=SQLDriverConnectW, desc='', errnum=215, errmsg='the ConnStrOut is too small'
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=2 rec=1
[-455501]**** PGAPI_ConnectError: hdbc=1290078 <0>
[-455501]enter CC_get_error
[-455501]enter CC_create_errormsg
[-455501]msg = 'the ConnStrOut is too small'
[-455501]exit CC_create_errormsg
[-455501]exit CC_get_error
[-455501]CC_get_error: status = 215, msg = #the ConnStrOut is too small#
[-455501] szSqlState = '01004',len=27, szError='(null)'
[-455501]PGAPI_GetDiagRec exiting 1
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=2 rec=1
[-455501]**** PGAPI_ConnectError: hdbc=1290078 <29>
[-455501]enter CC_get_error
[-455501]exit CC_get_error
[-455501]CC_get_error: status = 215, msg = #the ConnStrOut is too small#
[-455501] szSqlState = '(null)',len=27, szError='the ConnStrOut is too small'
[-455501]PGAPI_GetDiagRec exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(2,1290078) Rec=1 Id=8 info=(6de8a4,256)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]PGAPI_GetDiagField exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(2,1290078) Rec=1 Id=9 info=(6de8a4,256)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]PGAPI_GetDiagField exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(2,1290078) Rec=1 Id=10 info=(6de8a4,256)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]PGAPI_GetDiagField exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(2,1290078) Rec=1 Id=11 info=(6de8a4,256)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]PGAPI_GetDiagField exiting 0
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=2 rec=2
[-455501]**** PGAPI_ConnectError: hdbc=1290078 <0>
[-455501]PGAPI_GetDiagRec exiting 100
[-455501][SQLGetFunctions][-455501][SQLGetInfoW(30)][-455501]PGAPI_GetInfo: entering...fInfoType=23
[-455501]PGAPI_GetInfo: p='<NULL>', len=2, value=2, cbMax=2
[-455501][SQLGetInfoW(30)][-455501]PGAPI_GetInfo: entering...fInfoType=24
[-455501]PGAPI_GetInfo: p='<NULL>', len=2, value=2, cbMax=2
[-455501][[SQLAllocHandle]][-455501]PGAPI_AllocStmt: entering...
[-455501]**** PGAPI_AllocStmt: hdbc = 1290078, stmt = 1390c94
[-455501]CC_add_statement: self=1290078, stmt=1390c94
[-455501][SQLGetStmtAttrW][-455501]PGAPI_GetStmtAttr Handle=1390c94 10010
[-455501][SQLGetStmtAttrW][-455501]PGAPI_GetStmtAttr Handle=1390c94 10011
[-455501][SQLGetStmtAttrW][-455501]PGAPI_GetStmtAttr Handle=1390c94 10012
[-455501][SQLGetStmtAttrW][-455501]PGAPI_GetStmtAttr Handle=1390c94 10013
[-455501][SQLExecDirectW][-455501]PGAPI_ExecDirect: entering...1
[-455501]SC_recycle_statement: self= 1390c94
[-455501]**** PGAPI_ExecDirect: hstmt=1390c94, statement='select bad_func()'
[-455501]PGAPI_ExecDirect: calling PGAPI_Execute...
[-455501]PGAPI_Execute: entering...1
[-455501]PGAPI_Execute: clear errors...
[-455501]PGAPI_NumParams: entering...
[-455501]SC_recycle_statement: self= 1390c94
[-455501]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=17, stmt='select bad_func()'
[-455501] stmt_with_params = 'select bad_func()'
[-455501] Sending SELECT statement on stmt=1390c94, cursor_name='SQL_CUR01390C94' qflag=0,1
[-455501]send_query(): conn=1290078, query='select bad_func()'
[-455501]send_query: done sending query
[-455501]in QR_Constructor
[-455501]exit QR_Constructor
[-455501]read 228, global_socket_buffersize=4096
[-455501]send_query: got id = 'T'
[-455501]QR_fetch_tuples: cursor = '', self->cursor=0
[-455501]num_fields = 1
[-455501]READING ATTTYPMOD
[-455501]CI_read_fields: fieldname='bad_func', adtid=23, adtsize=4, atttypmod=-1 (rel,att)=(0,0)
[-455501]QR_fetch_tuples: past CI_read_fields: num_fields = 1
[-455501]MALLOC: tuple_size = 100, size = 800
[-455501]QR_next_tuple: inTuples = true, falling through: fcount = 0, fetch_number = 0
[-455501]next_tuple: 'E' - SERROR
[-455501]next_tuple: 'E' - C42P01
[-455501]next_tuple: 'E' - Mrelation "notable" does not exist
[-455501]next_tuple: 'E' - WSQL statement "update notable set nokey=1"
PL/pgSQL function "bad_func" line 3 at SQL statement
[-455501]next_tuple: 'E' - Fnamespace.c
[-455501]next_tuple: 'E' - L200
[-455501]next_tuple: 'E' - RRangeVarGetRelid
[-455501]ERROR from backend in next_tuple: 'ERROR: relation "notable" does not exist'
[-455501]CONN ERROR: func=CC_send_query, desc='', errnum=109, errmsg='ERROR: relation "notable" does not exist'
[-455501] done sending the query:
[-455501]SC_set_Result(1390c94, 13a0870)[-455501]QResult: enter DESTRUCTOR
[-455501]STATEMENT ERROR: func=SC_execute, desc='(null)', errnum=7, errmsg='Error while executing the query'
[-455501]CONN ERROR: func=SC_execute, desc='(null)', errnum=109, errmsg='ERROR: relation "notable" does not exist'
[-455501]PGAPI_ExecDirect: returned -1 from PGAPI_Execute
[-455501][[SQLGetDiagFieldW]] Handle=(3,1390c94) Rec=1 Id=4 info=(6dfa3c,12)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]ER_ReturnError: status = 7, msg = #ERROR: relation "notable" does not exist;
Error while executing the query#
[-455501] szSqlState = '42P01',len=73, szError='(null)'
[-455501]PGAPI_GetDiagField exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(3,1390c94) Rec=2 Id=4 info=(6dfa3c,12)
[-455501]PGAPI_GetDiagField entering rec=2[-455501]ER_ReturnError: status = 7, msg = #ERROR: relation "notable" does not exist;
Error while executing the query#
[-455501]PGAPI_GetDiagField exiting 100
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=3 rec=1
[-455501]ER_ReturnError: status = 7, msg = #ERROR: relation "notable" does not exist;
Error while executing the query#
[-455501] szSqlState = '42P01',len=73, szError='ERROR: relation "notable" does not exist;
Error while executing the query'
[-455501]PGAPI_GetDiagRec exiting 0
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=3 rec=2
[-455501]ER_ReturnError: status = 7, msg = #ERROR: relation "notable" does not exist;
Error while executing the query#
[-455501]PGAPI_GetDiagRec exiting 100
[-455501][SQLExecDirectW][-455501]STATEMENT ERROR: func=SQLExecDirectW, desc='', errnum=3, errmsg='The cursor is open.'
[-455501]CONN ERROR: func=SQLExecDirectW, desc='', errnum=0, errmsg='(NULL)'
[-455501][[SQLGetDiagFieldW]] Handle=(3,1390c94) Rec=1 Id=4 info=(6dfa3c,12)
[-455501]PGAPI_GetDiagField entering rec=1[-455501]ER_ReturnError: status = 3, msg = #The cursor is open.#
[-455501] szSqlState = 'HY010',len=19, szError='(null)'
[-455501]PGAPI_GetDiagField exiting 0
[-455501][[SQLGetDiagFieldW]] Handle=(3,1390c94) Rec=2 Id=4 info=(6dfa3c,12)
[-455501]PGAPI_GetDiagField entering rec=2[-455501]ER_ReturnError: status = 3, msg = #The cursor is open.#
[-455501]PGAPI_GetDiagField exiting 100
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=3 rec=1
[-455501]ER_ReturnError: status = 3, msg = #The cursor is open.#
[-455501] szSqlState = 'HY010',len=19, szError='The cursor is open.'
[-455501]PGAPI_GetDiagRec exiting 0
[-455501][SQLGetDiagRecW][-455501]PGAPI_GetDiagRec entering type=3 rec=2
[-455501]ER_ReturnError: status = 3, msg = #The cursor is open.#
[-455501]PGAPI_GetDiagRec exiting 100
[-455501][SQLCancel][-455501]PGAPI_Cancel: entering...
[-455501][[SQLFreeHandle]][-455501]PGAPI_FreeStmt: entering...hstmt=1390c94, fOption=1
[-455501]QResult: enter DESTRUCTOR
[-455501]QResult: in QR_close_result
[-455501]QResult: free memory in, fcount=0
[-455501]QResult: free memory out
[-455501]QResult: enter DESTRUCTOR
[-455501]QResult: exit close_result
[-455501]QResult: exit DESTRUCTOR
[-455501]SC_init_Result(1390c94)[-455501]SC_Destructor: self=1390c94, self->result=0, self->hdbc=1290078
[-455501]APD_free_params: ENTER, self=20516240
[-455501]IPD_free_params: ENTER, self=1390dd0
[-455501]PDATA_free_params: ENTER, self=1390e38
[-455501]SC_Destructor: EXIT
[-455501][SQLDisconnect][-455501]PGAPI_Disconnect: entering...

----------------------------------------------------------------------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000641&group_id=1000125

Browse pgsql-odbc by date

  From Date Subject
Next Message noreply 2006-05-14 09:34:13 [ psqlodbc-Bugs-1000644 ] codepage issue
Previous Message noreply 2006-05-14 09:30:52 [ psqlodbc-Bugs-1000626 ] Follow-up to 1000625