Skip to content

Commit 140aefd

Browse files
committed
fetch system naming mode at runtime (PASE)
This is similar to what PDO_IBM does. The benefit is for applications like the Toolkit for generating queries at runtime, when they get a resource passed in (since they didn't construct it and don't know). Note that like PDO_IBM, other options are possible, but not yet implemented. Comments are made for the possibility though. Does not affect LUW.
1 parent aa8e825 commit 140aefd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ibm_db2.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7357,6 +7357,22 @@ PHP_FUNCTION(db2_get_option)
73577357
_php_db2_check_sql_errors((SQLHDBC)conn_res->hdbc, SQL_HANDLE_DBC, rc, 1, NULL, -1, 1);
73587358
RETURN_FALSE;
73597359
}
7360+
#ifdef PASE
7361+
} else if(!STRCASECMP(option, "i5_naming")) {
7362+
rc = SQLGetConnectAttr((SQLHDBC)conn_res->hdbc, SQL_ATTR_DBC_SYS_NAMING, (SQLPOINTER)&val, 0, &val_len);
7363+
if ( rc == SQL_ERROR ) {
7364+
_php_db2_check_sql_errors((SQLHDBC)conn_res->hdbc, SQL_HANDLE_DBC, rc, 1, NULL, -1, 1);
7365+
RETURN_FALSE;
7366+
}
7367+
if(val == SQL_TRUE) {
7368+
RETURN_TRUE;
7369+
} else {
7370+
RETURN_FALSE;
7371+
}
7372+
/* TODO: case PDO_I5_ATTR_COMMIT: */
7373+
/* TODO: case PDO_I5_ATTR_JOB_SORT: */
7374+
/* prob no libl/curlib, since they're accessible by SQL */
7375+
#endif
73607376
#ifndef PASE /* i5/OS no support yet */
73617377
} else if(!STRCASECMP(option, "trustedcontext")) {
73627378
rc = SQLGetConnectAttr((SQLHDBC)conn_res->hdbc, SQL_ATTR_USE_TRUSTED_CONTEXT, (SQLPOINTER)&val, 0, &val_len);

0 commit comments

Comments
 (0)