[PECL-CVS] [pecl-database-ibm_db2] master: Make sure trusted context options don't trigger on IBM i
[email protected] (Calvin Buckley)
| Newsgroups | php.pecl.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Calvin Buckley (NattyNarwhal)
Date: 2025-12-04T14:54:22-04:00
Commit: https://github.com/php/pecl-database-ibm_db2/commit/56d3b9dce838019305c5492ffc5054638df51dc8
Raw diff: https://github.com/php/pecl-database-ibm_db2/commit/56d3b9dce838019305c5492ffc5054638df51dc8.diff
Make sure trusted context options don't trigger on IBM i
It doesn't have these, and trying to do this will cause a function
sequence error. Should fix GH-65.
Changed paths:
M ibm_db2.c
Diff:
diff --git a/ibm_db2.c b/ibm_db2.c
index f83bf8b..7130a04 100644
--- a/ibm_db2.c
+++ b/ibm_db2.c
@@ -1310,6 +1310,7 @@ static void _php_db2_assign_options( void *handle, int type, char *opt_key, zval
} else {
php_error_docref(NULL, E_WARNING, "ROWCOUNT statement attribute can only be set on statement resources");
}
+#ifndef PASE /* i5/OS no support yet */
} else if (!STRCASECMP(opt_key, "trustedcontext")) {
if (type == SQL_HANDLE_DBC ) { /* Checking for connection resource */
if(((conn_handle*)handle)->handle_active == 0) { /* Checking for live connection */
@@ -1385,6 +1386,7 @@ static void _php_db2_assign_options( void *handle, int type, char *opt_key, zval
} else {
php_error_docref(NULL, E_WARNING, "TRUSTED PASSWORD attribute can only be set on connection resources");
}
+#endif
} else if (!STRCASECMP(opt_key, "query_timeout")) {
if (type == SQL_HANDLE_STMT) {
rc = SQLSetStmtAttr((SQLHSTMT)((stmt_handle*)handle)->hstmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)(uintptr_t)option_num, SQL_IS_UINTEGER );