From 56d3b9dce838019305c5492ffc5054638df51dc8 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Thu, 4 Dec 2025 14:54:22 -0400 Subject: [PATCH] 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. --- ibm_db2.c | 2 ++ 1 file changed, 2 insertions(+) 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 );