Closed kadler closed 6 years ago
Original comment by Teemu Halmela (Bitbucket: teemu_, GitHub: Unknown).
Yes things seem to work again. And indeed there is CCSID="1208" in our fastcgi config, at least on one machine.
Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).
Not SQLConnect per say ...
This is a problem with SQLOverrideCCSID400. I suspect your fastcgi.conf has SetEnv="CCSID=1208". I have new version works php web fastcgi.conf (Zend Server).
YIPS Super Driver - 1.1.3-sg6 - test driver - php web fix (Halmela)
more ...
PASE libdb400.a will be replaced by db2sock in future. Until replaced a db2sock hack in SQLAllocHandle and SQLAllocEnv should work with php and fastcgi.conf SetEnv="CCSID=1208".
Original comment by Teemu Halmela (Bitbucket: teemu_, GitHub: Unknown).
I did some investigation and it seems that this function in PaseCliAsync_gen.c is the culprit.
SQLRETURN SQLConnect( SQLHDBC hdbc, SQLCHAR * szDSN, SQLSMALLINT cbDSN, SQLCHAR * szUID, SQLSMALLINT cbUID, SQLCHAR * szAuthStr, SQLSMALLINT cbAuthStr )
{
SQLRETURN sqlrc = SQL_SUCCESS;
int myccsid = init_CCSID400(0);
init_table_lock(hdbc, 0);
switch(myccsid) {
case 1208: /* UTF-8 */
case 1200: /* UTF-16 */
sqlrc = ILE_SQLConnect( hdbc, szDSN, cbDSN, szUID, cbUID, szAuthStr, cbAuthStr );
break;
default:
sqlrc = libdb400_SQLConnect( hdbc, szDSN, cbDSN, szUID, cbUID, szAuthStr, cbAuthStr );
break;
}
if (init_cli_trace()) {
dump_SQLConnect(sqlrc, hdbc, szDSN, cbDSN, szUID, cbUID, szAuthStr, cbAuthStr );
}
init_table_unlock(hdbc, 0);
return sqlrc;
}
When running through my server it goes to the ILE_SQLConnect route and that doesn't work correctly. If I comment out the switch and only leave libdb400_SQLConnect things start to work again.
Why does it go to the ILE function when the ccsid comes back as UTF-*?
Original report by Teemu Halmela (Bitbucket: teemu_, GitHub: Unknown).
I seem to have some weird problems when using db2sock libdb400.a and trying to connect to database using PHP db_connect.
This script fails when it is called through a running web server.
Error it gives is this, https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/codes/src/tpc/n950.html
It works correctly if running straight from the command line
It also works through the web server when I change libdb400.a back to the original.
Are you able to reproduce this problem?