mirror of
https://github.com/php/pecl-database-ibm_db2.git
synced 2026-03-23 23:02:16 +01:00
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.
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user