[pecl-database-pdo_ibm] fixup-20260903: this must be done after the INI is registered

From: Date: Thu, 03 Sep 2026 17:46:01 +0000
Subject: [pecl-database-pdo_ibm] fixup-20260903: this must be done after the INI is registered
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-28674@lists.php.net to get a copy of this message
Author: Calvin Buckley (NattyNarwhal) Date: 2026-09-03T13:45:05-03:00 Commit: https://github.com/php/pecl-database-pdo_ibm/commit/d913378ec9f57b212b21bffd4c7c36d7dfa8093d Raw diff: https://github.com/php/pecl-database-pdo_ibm/commit/d913378ec9f57b212b21bffd4c7c36d7dfa8093d.diff this must be done after the INI is registered Changed paths: M pdo_ibm.c Diff: diff --git a/pdo_ibm.c b/pdo_ibm.c index 9c327e0..0581106 100644 --- a/pdo_ibm.c +++ b/pdo_ibm.c @@ -90,25 +90,6 @@ PHP_INI_BEGIN() PHP_INI_END() #endif /* PASE */ - -#ifdef PASE /* prior any CLI routine override ascii ccsid */ -/* {{{ php_pdo_ibm_init_globals - */ -static void php_pdo_ibm_init_globals(zend_pdo_ibm_globals *pdo_ibm_globals) -{ - if (PDO_IBM_G(i5_override_ccsid)) { - /* This routine should be called by the application prior - * to any other CLI routine to override the ascii ccsid - * being retrieved from the Qp2RunPase() routine. If this - * routine is called after any CLI routine is called in - * the process it will have no effect. - */ - SQLOverrideCCSID400(PDO_IBM_G(i5_override_ccsid)); - } -} -/* }}} */ -#endif /* PASE */ - /* PDO_IBM used both SQL_ and I5_ as prefixes for constants */ #if PHP_VERSION_ID >= 80500 #define REGISTER_PDO_IBM_CLASS_CONST_LONG_DEPRECATED_ALIAS_85(base_name, value) \ @@ -128,7 +109,6 @@ PHP_MINIT_FUNCTION(pdo_ibm) { #ifdef PASE /* Only PASE has INI entries right now. */ - ZEND_INIT_MODULE_GLOBALS(pdo_ibm, php_pdo_ibm_init_globals, NULL); REGISTER_INI_ENTRIES(); #endif @@ -161,14 +141,27 @@ PHP_MINIT_FUNCTION(pdo_ibm) REGISTER_PDO_IBM_CLASS_CONST_LONG_DEPRECATED_ALIAS_85("ATTR_INFO_APPLNAME", (long) PDO_SQL_ATTR_INFO_APPLNAME); REGISTER_PDO_IBM_CLASS_CONST_LONG_DEPRECATED_ALIAS_85("ATTR_INFO_WRKSTNNAME", (long) PDO_SQL_ATTR_INFO_WRKSTNNAME); + int res = FALSE; #if PHP_VERSION_ID >= 80400 pdo_ibm_ce = register_class_Pdo_Ibm(pdo_dbh_ce); pdo_ibm_ce->create_object = pdo_dbh_new; - return php_pdo_register_driver_specific_ce(&pdo_ibm_driver, pdo_ibm_ce); + res = php_pdo_register_driver_specific_ce(&pdo_ibm_driver, pdo_ibm_ce); #else - return TRUE; + res = TRUE; #endif + if (res && PDO_IBM_G(i5_override_ccsid)) { + /* This routine should be called by the application prior + * to any other CLI routine to override the ascii ccsid + * being retrieved from the Qp2RunPase() routine. If this + * routine is called after any CLI routine is called in + * the process it will have no effect. + * + * XXX: What about ibm_db2 setting this too? + */ + SQLOverrideCCSID400(PDO_IBM_G(i5_override_ccsid)); + } + return res; } /* }}} */

« previous php.pecl.cvs (#28674) next »