|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-06-15 20:16 UTC] arif at dreamfactory dot com
Description:
------------
When creating a new instance of PDO (for PDO_IBM) using any options parameter I get segmentation fault but this works perfectly on php5.6.
The test script provided gives me segmentation fault when using php 7.0.7 but works fine using php 5.6.
However, if I remove the options parameter then it works in php 7.0.7. I get segmentation fault for using any options not just the ones shown in this code.
Test script:
---------------
$ibm = new PDO("ibm:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=192.168.1.11;DATABASE=TEST;", "user", "password", [
PDO::ATTR_CASE => PDO::CASE_NATURAL,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
]);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
See a workaround: ( pdo_ibm 1.3.5 ) ibm_driver.c: 980 #if PHP_MAJOR_VERSION >= 7 981 if (Z_TYPE_P(data) == IS_STRING) { 982 #else 983 if (Z_TYPE_PP(data) == IS_STRING) { 984 #endif 985 option_str = Z_STRVAL_PP(data); // <--- this line 986 } else { 987 #if PHP_MAJOR_VERSION >= 7 988 option_num = Z_LVAL_P(data); 989 #else 990 option_num = Z_LVAL_PP(data); 991 #endif 992 } FIX: 981 #if PHP_MAJOR_VERSION >= 7 982 if (Z_TYPE_P(data) == IS_STRING) { 983 #else 984 if (Z_TYPE_PP(data) == IS_STRING) { 985 #endif 986 //------------- fix --------------- 987 #if PHP_MAJOR_VERSION >= 7 988 option_str = Z_STRVAL_P(data); 989 #else 990 option_str = Z_STRVAL_PP(data); 991 #endif //------------- end fix --------------- 992 } else { 993 #if PHP_MAJOR_VERSION >= 7 994 option_num = Z_LVAL_P(data); 995 #else 996 option_num = Z_LVAL_PP(data); 997 #endif 998 }