Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial environment allocation returns a success with unexpected info (and unexpectedly, no info) #7

Open
NattyNarwhal opened this issue Aug 26, 2020 · 3 comments

Comments

@NattyNarwhal
Copy link

Odd situation with a Python script; was able to determine what was happening, but not the why.

It looks like the initial environment allocation is succeeding, but returning SUCCESS_WITH_INFO, which isn't documented as a possibility, and is treated as a failure anyways. Interestingly, when it does try to get the error message and break, it says it has no data found!

With a trace (TRACE=ws) from the Tony libdb400 so you can understand what's going on w/o recompiling with additional printf:

SQLSetEnvAttr.3949481.1598452980.1.tbeg +++success+++
SQLSetEnvAttr.3949481.1598452980.1.walk printf_stack (fffffffffffd020)
SQLSetEnvAttr.3949481.1598452980.1.walk dump_SQLSetEnvAttr (28b3cc 1800a3108 271bffffd288 fffffffffffd288 0)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLSetEnvAttr (100000000 271ba1260610 fffffffffffd288 0)
SQLSetEnvAttr.3949481.1598452980.1.walk custom_SQLSetEnvCCSID (11526b7e4 4b800000007)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLAllocHandle (104b8ffffd380 0 fffffffffffd35c)
SQLSetEnvAttr.3949481.1598452980.1.walk custom_SQLOverrideCCSID400 (4b815206bf0)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLOverrideCCSID400 (4b81568da00)
SQLSetEnvAttr.3949481.1598452980.1.walk _python_ibm_db_connect_helper.isra.17 (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyCFunction_FastCallDict (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyCFunction_FastCallKeywords (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyFunction_FastCall (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLSetEnvAttr.3949481.1598452980.1.walk fast_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalCodeEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalCode (?)
SQLSetEnvAttr.3949481.1598452980.1.walk run_mod (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_FileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_SimpleFileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_AnyFileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk Py_Main (?)
SQLSetEnvAttr.3949481.1598452980.1.walk main (?)
SQLSetEnvAttr.3949481.1598452980.1.retn SQLRETURN sqlrc 0x0 (0) SQL_SUCCESS
SQLSetEnvAttr.3949481.1598452980.1.parm SQLHENV hEnv 0x1 (1)
SQLSetEnvAttr.3949481.1598452980.1.parm SQLINTEGER fAttribute 0x271b (10011)
SQLSetEnvAttr.3949481.1598452980.1.parm SQLPOINTER pParam 0xfffffffffffd288 (-11640)
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd288 : 000004b8000000070fffffffffffd35c >...............\<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd298 : 00000001800115d00900000015228b28 >.............".(<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd2a8 : 09001000a29f50a00000000000000000 >......P.........<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd2b8 : 000004b8002e9a3000000000000004b8 >.......0........<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd2c8 : 00000001800a3d08090000001520ead0 >......=...... ..<
SQLSetEnvAttr.3949481.1598452980.1.parm SQLINTEGER cbParam 0x0 (0)
SQLSetEnvAttr.3949481.1598452980.1.tend +++success+++

SQLSetEnvAttr.3949481.1598452980.1.tbeg +++success+++
SQLSetEnvAttr.3949481.1598452980.1.walk printf_stack (fffffffffffd020)
SQLSetEnvAttr.3949481.1598452980.1.walk dump_SQLSetEnvAttr (28b3cc 1800a3108 2730ffffd234 fffffffffffd234 0)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLSetEnvAttr (100000000 2730a1260610 fffffffffffd234 0)
SQLSetEnvAttr.3949481.1598452980.1.walk custom_SQLSetEnvCCSID (11526b7e4 4b800000007)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLAllocHandle (104b8ffffd380 0 fffffffffffd35c)
SQLSetEnvAttr.3949481.1598452980.1.walk custom_SQLOverrideCCSID400 (4b815206bf0)
SQLSetEnvAttr.3949481.1598452980.1.walk SQLOverrideCCSID400 (4b81568da00)
SQLSetEnvAttr.3949481.1598452980.1.walk _python_ibm_db_connect_helper.isra.17 (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyCFunction_FastCallDict (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyCFunction_FastCallKeywords (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyFunction_FastCall (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLSetEnvAttr.3949481.1598452980.1.walk fast_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk call_function (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalCodeEx (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyEval_EvalCode (?)
SQLSetEnvAttr.3949481.1598452980.1.walk run_mod (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_FileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_SimpleFileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk PyRun_AnyFileExFlags (?)
SQLSetEnvAttr.3949481.1598452980.1.walk Py_Main (?)
SQLSetEnvAttr.3949481.1598452980.1.walk main (?)
SQLSetEnvAttr.3949481.1598452980.1.retn SQLRETURN sqlrc 0x0 (0) SQL_SUCCESS
SQLSetEnvAttr.3949481.1598452980.1.parm SQLHENV hEnv 0x1 (1)
SQLSetEnvAttr.3949481.1598452980.1.parm SQLINTEGER fAttribute 0x2730 (10032)
SQLSetEnvAttr.3949481.1598452980.1.parm SQLPOINTER pParam 0xfffffffffffd234 (-11724)
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd234 : 0000000100000000000000000fffffff >................<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd244 : ffffd2e00fffffffffffd2500fffffff >...........P....<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd254 : ffffd2e007000000001f590809000000 >..........Y.....<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd264 : 087b0e3409001000a12606100fffffff >.{.4.....&......<
SQLSetEnvAttr.3949481.1598452980.1.phex  fffffffffffd274 : ffffd40007000000001e14c800000001 >................<
SQLSetEnvAttr.3949481.1598452980.1.parm SQLINTEGER cbParam 0x0 (0)
SQLSetEnvAttr.3949481.1598452980.1.tend +++success+++

SQLAllocHandle.3949481.1598452980.1.tbeg +++success+++
SQLAllocHandle.3949481.1598452980.1.walk printf_stack (fffffffffffd140)
SQLAllocHandle.3949481.1598452980.1.walk dump_SQLAllocHandle (1526b7e4 104b800000007 ffffd35c fffffffffffd35c)
SQLAllocHandle.3949481.1598452980.1.walk SQLAllocHandle (104b8ffffd380 0 fffffffffffd35c)
SQLAllocHandle.3949481.1598452980.1.walk custom_SQLOverrideCCSID400 (4b815206bf0)
SQLAllocHandle.3949481.1598452980.1.walk SQLOverrideCCSID400 (4b81568da00)
SQLAllocHandle.3949481.1598452980.1.walk _python_ibm_db_connect_helper.isra.17 (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyCFunction_FastCallDict (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyCFunction_FastCallKeywords (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyFunction_FastCall (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLAllocHandle.3949481.1598452980.1.walk fast_function (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalCodeEx (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalCode (?)
SQLAllocHandle.3949481.1598452980.1.walk run_mod (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_FileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_SimpleFileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_AnyFileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk Py_Main (?)
SQLAllocHandle.3949481.1598452980.1.walk main (?)
SQLAllocHandle.3949481.1598452980.1.retn SQLRETURN sqlrc 0x0 (0) SQL_SUCCESS
SQLAllocHandle.3949481.1598452980.1.parm SQLSMALLINT htype 0x1 (1)
SQLAllocHandle.3949481.1598452980.1.parm SQLINTEGER ihnd 0x0 (0)
SQLAllocHandle.3949481.1598452980.1.parm SQLINTEGER* ohnd 0xfffffffffffd35c (-11428)
SQLAllocHandle.3949481.1598452980.1.phex  fffffffffffd35c : 00000001090000001568d5b00fffffff >.........h......<
SQLAllocHandle.3949481.1598452980.1.phex  fffffffffffd36c : ffffd3700fffffffffffd40000000000 >...p............<
SQLAllocHandle.3949481.1598452980.1.phex  fffffffffffd37c : 0000000009000000087dc1c808001000 >.........}......<
SQLAllocHandle.3949481.1598452980.1.phex  fffffffffffd38c : a005e6000fffffffffffd40000000000 >................<
SQLAllocHandle.3949481.1598452980.1.phex  fffffffffffd39c : 00000000000004b815206bf009001000 >......... k.....<
SQLAllocHandle.3949481.1598452980.1.tend +++success+++

SQLAllocHandle.3949481.1598452980.1.tbeg +++success+++
SQLAllocHandle.3949481.1598452980.1.walk printf_stack (fffffffffffd260)
SQLAllocHandle.3949481.1598452980.1.walk dump_SQLAllocHandle (115206bf0 10000a29d0b70 2e6700 7000000002e6700)
SQLAllocHandle.3949481.1598452980.1.walk SQLAllocHandle (104b81568da00 a29f50a0 7000000002e6700)
SQLAllocHandle.3949481.1598452980.1.walk _python_ibm_db_connect_helper.isra.17 (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyCFunction_FastCallDict (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyCFunction_FastCallKeywords (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyFunction_FastCall (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLAllocHandle.3949481.1598452980.1.walk fast_function (?)
SQLAllocHandle.3949481.1598452980.1.walk call_function (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLAllocHandle.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalCodeEx (?)
SQLAllocHandle.3949481.1598452980.1.walk PyEval_EvalCode (?)
SQLAllocHandle.3949481.1598452980.1.walk run_mod (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_FileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_SimpleFileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk PyRun_AnyFileExFlags (?)
SQLAllocHandle.3949481.1598452980.1.walk Py_Main (?)
SQLAllocHandle.3949481.1598452980.1.walk main (?)
SQLAllocHandle.3949481.1598452980.1.retn SQLRETURN sqlrc 0x1 (1) SQL_SUCCESS_WITH_INFO
SQLAllocHandle.3949481.1598452980.1.parm SQLSMALLINT htype 0x1 (1)
SQLAllocHandle.3949481.1598452980.1.parm SQLINTEGER ihnd 0x0 (0)
SQLAllocHandle.3949481.1598452980.1.parm SQLINTEGER* ohnd 0x7000000002e6700 (3041024)
SQLAllocHandle.3949481.1598452980.1.phex  7000000002e6700 : 00000001000000000000000000000000 >................<
SQLAllocHandle.3949481.1598452980.1.phex  7000000002e6710 : 09001000a29c42e0ffffffff42010000 >......B.....B...<
SQLAllocHandle.3949481.1598452980.1.phex  7000000002e6720 : 00001000000000000000000000000000 >................<
SQLAllocHandle.3949481.1598452980.1.phex  7000000002e6730 : 00000000000000000000000000000000 >................<
SQLAllocHandle.3949481.1598452980.1.phex  7000000002e6740 : 00000001800a3a90fffffffffffffffc >......:.........<
SQLAllocHandle.3949481.1598452980.1.tend +++success+++

SQLGetDiagRec.3949481.1598452980.1.tbeg +++success+++
SQLGetDiagRec.3949481.1598452980.1.walk printf_stack (fffffffffffd250)
SQLGetDiagRec.3949481.1598452980.1.walk dump_SQLGetDiagRec (64ffffd400 1000100000000 115206bf0 1ffffffffdea0 fffffffffffdea0 fffffffffffdea8 fffffffffffdc70 201ffffffffdeac)
SQLGetDiagRec.3949481.1598452980.1.walk SQLGetDiagRec (104b81568da00 1a29f50a0 10000002e6700 fffffffffffdea0 fffffffffffdea8 fffffffffffdc70 201ffffffffde78 fffffffffffdeac)
SQLGetDiagRec.3949481.1598452980.1.walk _python_ibm_db_connect_helper.isra.17 (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyCFunction_FastCallDict (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyCFunction_FastCallKeywords (?)
SQLGetDiagRec.3949481.1598452980.1.walk call_function (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyFunction_FastCall (?)
SQLGetDiagRec.3949481.1598452980.1.walk call_function (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLGetDiagRec.3949481.1598452980.1.walk fast_function (?)
SQLGetDiagRec.3949481.1598452980.1.walk call_function (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyEval_EvalFrameDefault (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyEval_EvalFrameEx (?)
SQLGetDiagRec.3949481.1598452980.1.walk _PyEval_EvalCodeWithName (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyEval_EvalCodeEx (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyEval_EvalCode (?)
SQLGetDiagRec.3949481.1598452980.1.walk run_mod (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyRun_FileExFlags (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyRun_SimpleFileExFlags (?)
SQLGetDiagRec.3949481.1598452980.1.walk PyRun_AnyFileExFlags (?)
SQLGetDiagRec.3949481.1598452980.1.walk Py_Main (?)
SQLGetDiagRec.3949481.1598452980.1.walk main (?)
SQLGetDiagRec.3949481.1598452980.1.retn SQLRETURN sqlrc 0x64 (100) SQL_NO_DATA_FOUND
SQLGetDiagRec.3949481.1598452980.1.parm SQLSMALLINT hType 0x1 (1)
SQLGetDiagRec.3949481.1598452980.1.parm SQLINTEGER hndl 0x1 (1)
SQLGetDiagRec.3949481.1598452980.1.parm SQLSMALLINT rcdNum 0x1 (1)
SQLGetDiagRec.3949481.1598452980.1.parm SQLCHAR* SQLstate 0xfffffffffffdea0 (-8544)
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdea0 : f0f0f0f0f02284e000000000ffffde10 >....."..........<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdeb0 : 000000000000000009001000a29d0b70 >...............p<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdec0 : 09001000a298a4e809001000a29fc404 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffded0 : 000000000000830400000001800115d0 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdee0 : 000000018004de980000000000000004 >................<
SQLGetDiagRec.3949481.1598452980.1.parm SQLINTEGER* SQLcode 0xfffffffffffdea8 (-8536)
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdea8 : 00000000ffffde100000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdeb8 : 09001000a29d0b7009001000a298a4e8 >.......p........<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdec8 : 09001000a29fc4040000000000008304 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffded8 : 00000001800115d0000000018004de98 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdee8 : 000000000000000407000000001f5908 >..............Y.<
SQLGetDiagRec.3949481.1598452980.1.parm SQLCHAR* msgText 0xfffffffffffdc70 (-9104)
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdc70 : 00000000000000000000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdc80 : 00000000000000000000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdc90 : 00000000000000000000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdca0 : 00000000000000000000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdcb0 : 00000000000000000000000000000000 >................<
SQLGetDiagRec.3949481.1598452980.1.parm SQLSMALLINT bLength 0x201 (513)
SQLGetDiagRec.3949481.1598452980.1.parm SQLSMALLINT* SLength 0xfffffffffffdeac (-8532)
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdeac : ffffde10000000000000000009001000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdebc : a29d0b7009001000a298a4e809001000 >...p............<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdecc : a29fc404000000000000830400000001 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdedc : 800115d0000000018004de9800000000 >................<
SQLGetDiagRec.3949481.1598452980.1.phex  fffffffffffdeec : 0000000407000000001f590807000000 >..........Y.....<
SQLGetDiagRec.3949481.1598452980.1.tend +++success+++

Traceback (most recent call last):
  File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_dbi.py", line 655, in _connect_helper
    conn = conn_func(database, user, password, options)
SystemError: <built-in function connect> returned NULL without setting an error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/www/pyutils/phplogreader.py", line 51, in <module>
    conn = dbi.connect(database='*LOCAL', user='', password='')
  File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_dbi.py", line 667, in connect
    return _connect_helper(ibm_db.connect, dsn, user, password, host, database, conn_options)
  File "/QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db_dbi.py", line 659, in _connect_helper
    raise _get_exception(inst)
ibm_db_dbi.Error: ibm_db_dbi::Error: SystemError('<built-in function connect> returned NULL without setting an error',)

python3-ibm_db-2.0.5.12-0.ppc64 is installed, which seems to be the latest version.

(Oh, and if it helps, changing from blank user/pass to filled in creds didn't help, but that's irrelevant since it doesn't even get to connecting)

@kadler
Copy link
Owner

kadler commented Sep 22, 2021

Looking at the code, SQLAllocHandle returns SQL_SUCCESS_WITH_INFO for SQL_HANDLE_ENV when handles have been allocated and we're running in PASE.

Of course, wouldn't that mean that any time you allocated more than one connection object in ibm_db, you'd get this? (since each connection allocations an environment, connection, and statement handle)

@NattyNarwhal
Copy link
Author

....I forgot the context of the original issue, but that sounds about right. In fact, the env handle seems to be a singleton w/ CLI on i completely. In the PHP drivers, we do actually handle this (IIRC, we don't free/allocate more/ignore warnings about env handle allocation).

@kadler
Copy link
Owner

kadler commented Sep 22, 2021

Nowadays IBM i CLI also has an attribute to enable ref-counted ENV handles to prevent getting the error on SQLFreeHandle. I haven't implemented it here yet, though.

Either way, I guess another #ifdef __PASE__ is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants