Skip to content

Commit 4d98c51

Browse files
author
Rahul Priyadarshi
committed
Version Change
1 parent 33e9505 commit 4d98c51

File tree

4 files changed

+40
-42
lines changed

4 files changed

+40
-42
lines changed

config.m4

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,27 @@ PHP_ARG_WITH(IBM_DB2, for IBM_DB2 support,
1717
dnl PHP_ARG_ENABLE(IBM_DB2, whether to enable IBM_DB2 support,
1818
dnl Make sure that the comment is aligned:
1919
dnl [ --enable-IBM_DB2 Enable IBM_DB2 support])
20-
2120
if test "$PHP_IBM_DB2" != "no"; then
21+
dnl # checking php 32/64 bit php
22+
AC_MSG_CHECKING(PHP)
23+
if test `php -r 'echo PHP_INT_SIZE;'` == 8; then
24+
machine_bits=64
25+
libDir=lib64
26+
AC_MSG_RESULT(Detected 64-bit PHP)
27+
else
28+
machine_bits=32
29+
libDir=lib32
30+
AC_MSG_RESULT(Detected 32-bit PHP)
31+
fi
32+
AC_MSG_CHECKING(IBM_DB_HOME location)
33+
if test $IBM_DB_HOME ; then
34+
SEARCH_PATH=$IBM_DB_HOME
35+
AC_MSG_RESULT($IBM_DB_HOME)
36+
else
37+
AC_MSG_RESULT(not found)
38+
fi
2239
dnl # --with-IBM_DB2 -> check with-path
23-
SEARCH_PATH="$PHP_IBM_DB2_LIB $PHP_IBM_DB2 $DB2PATH $DB2DIR"
40+
SEARCH_PATH="$PHP_IBM_DB2_LIB $SEARCH_PATH $PHP_IBM_DB2 $DB2PATH $DB2DIR"
2441

2542
AC_MSG_CHECKING(Looking for DB2 CLI libraries)
2643
for i in $SEARCH_PATH ; do
@@ -32,17 +49,9 @@ if test "$PHP_IBM_DB2" != "no"; then
3249
else
3350
AC_MSG_RESULT()
3451
fi
35-
AC_MSG_CHECKING([ in $i/lib64])
36-
if test -r $i/lib64/libdb2.so || test -r $i/lib64/libdb2.a || test -r $i/lib64/libdb400.a || test -r $i/lib64/libdb2.dylib ; then
37-
LIB_DIR="$i/lib64/"
38-
AC_MSG_RESULT(found)
39-
break
40-
else
41-
AC_MSG_RESULT()
42-
fi
43-
AC_MSG_CHECKING([ in $i/lib32])
44-
if test -r $i/lib32/libdb2.so || test -r $i/lib32/libdb2.a || test -r $i/lib32/libdb400.a || test -r $i/lib32/libdb2.dylib ; then
45-
LIB_DIR="$i/lib32/"
52+
AC_MSG_CHECKING([ in $i/$libDir])
53+
if test -r $i/$libDir/libdb2.so || test -r $i/$libDir/libdb2.a || test -r $i/$libDir/libdb400.a || test -r $i/$libDir/libdb2.dylib ; then
54+
LIB_DIR="$i/$libDir/"
4655
AC_MSG_RESULT(found)
4756
break
4857
else
@@ -60,7 +69,11 @@ if test "$PHP_IBM_DB2" != "no"; then
6069

6170
if test -z "$LIB_DIR"; then
6271
AC_MSG_RESULT([not found])
63-
AC_MSG_ERROR([Please reinstall the DB2 CLI distribution])
72+
if test $IBM_DB_HOME ; then
73+
AC_MSG_ERROR([Cannot find DB2 CLI libraries. Check if you have set the IBM_DB_HOME environment variable's value correctly])
74+
else
75+
AC_MSG_ERROR([Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry ibm_db2 module install])
76+
fi
6477
fi
6578

6679
AC_MSG_CHECKING([for DB2 CLI include files in default path])

ibm_db2.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,6 @@ static int _php_db2_get_result_set_info(stmt_handle *stmt_res TSRMLS_DC)
17111711
} else {
17121712
stmt_res->column_info[i].name = (SQLCHAR *)estrdup(tmp_name);
17131713
}
1714-
#ifdef PASE /* i5/OS size changes for "common" converts */
17151714
switch (stmt_res->column_info[i].type) {
17161715
/* BIGINT 9223372036854775807 (2^63-1) string convert */
17171716
case SQL_BIGINT:
@@ -1720,7 +1719,6 @@ static int _php_db2_get_result_set_info(stmt_handle *stmt_res TSRMLS_DC)
17201719
default:
17211720
break;
17221721
}
1723-
#endif /* PASE */
17241722
#ifdef PASE /* i5/OS DBCS may have up to 6 times growth in column alloc size on convert */
17251723
if (stmt_res->s_i5_dbcs_alloc) {
17261724
switch (stmt_res->column_info[i].type) {
@@ -2065,7 +2063,7 @@ static int _php_db2_connect_helper( INTERNAL_FUNCTION_PARAMETERS, conn_handle **
20652063
} else {
20662064
/* Need to check for max pconnections? */
20672065
}
2068-
if (*pconn_res == NULL) {
2066+
if ((*pconn_res == NULL) || (reused == 0)) {
20692067
conn_res = *pconn_res =
20702068
(conn_handle *) (isPersistent ? pecalloc(1, sizeof(conn_handle), 1) : ecalloc(1, sizeof(conn_handle)));
20712069
}
@@ -2172,7 +2170,7 @@ static int _php_db2_connect_helper( INTERNAL_FUNCTION_PARAMETERS, conn_handle **
21722170
(SQLCHAR *)password, (SQLSMALLINT)password_len );
21732171
}
21742172

2175-
if ( rc != SQL_SUCCESS ) {
2173+
if ( rc == SQL_ERROR ) {
21762174
_php_db2_check_sql_errors(conn_res->hdbc, SQL_HANDLE_DBC, rc, 1, NULL, -1, 1 TSRMLS_CC);
21772175
SQLFreeHandle( SQL_HANDLE_DBC, conn_res->hdbc );
21782176
SQLFreeHandle(SQL_HANDLE_ENV, conn_res->henv);
@@ -2613,12 +2611,10 @@ PHP_FUNCTION(db2_bind_param)
26132611
sql_precision = (SQLUINTEGER)precision;
26142612
}
26152613
}
2616-
#ifdef PASE /* i5/OS BIGINT to string too small */
26172614
else if((sql_data_type == SQL_BIGINT) && ((param_type == DB2_PARAM_OUT) || (param_type == DB2_PARAM_INOUT)))
26182615
{
26192616
sql_precision = 20;
26202617
}
2621-
#endif
26222618
/* Add to cache */
26232619
_php_db2_add_param_cache( stmt_res, (SQLUSMALLINT)param_no, varname, varname_len, param_type, sql_data_type, sql_precision, sql_scale, sql_nullable );
26242620
break;
@@ -2638,12 +2634,10 @@ PHP_FUNCTION(db2_bind_param)
26382634
sql_precision = 1048576;
26392635
}
26402636
}
2641-
#ifdef PASE /* i5/OS BIGINT to string too small */
26422637
else if((sql_data_type == SQL_BIGINT) && ((param_type == DB2_PARAM_OUT) || (param_type == DB2_PARAM_INOUT)))
26432638
{
26442639
sql_precision = 20;
26452640
}
2646-
#endif
26472641
_php_db2_add_param_cache( stmt_res, (SQLUSMALLINT)param_no, varname, varname_len, param_type, sql_data_type, sql_precision, sql_scale, sql_nullable );
26482642
break;
26492643

@@ -3660,19 +3654,14 @@ static int _php_db2_bind_data( stmt_handle *stmt_res, param_node *curr, zval **b
36603654
MAKE_STD_ZVAL(curr->value);
36613655

36623656
switch ( curr->data_type ) {
3663-
#ifndef PASE /* i5/OS int not big enough */
3664-
case SQL_BIGINT:
3665-
#endif
36663657
case SQL_SMALLINT:
36673658
case SQL_INTEGER:
36683659
case SQL_REAL:
36693660
case SQL_FLOAT:
36703661
case SQL_DOUBLE:
36713662
break;
36723663

3673-
#ifdef PASE /* i5/OS int not big enough */
36743664
case SQL_BIGINT:
3675-
#endif
36763665
case SQL_CHAR:
36773666
case SQL_VARCHAR:
36783667
case SQL_WCHAR:

package.xml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,29 @@ Cloudscape, and Apache Derby databases.
1616
<email>[email protected]</email>
1717
<active>yes</active>
1818
</lead>
19-
<lead>
20-
<name>Ambrish Bhargava</name>
21-
<user>ambrish</user>
22-
<email>[email protected]</email>
23-
<active>yes</active>
24-
</lead>
2519
<lead>
2620
<name>IBM OpenDev</name>
2721
<user>kfbombar</user>
2822
<email>[email protected]</email>
2923
<active>yes</active>
3024
</lead>
31-
<date>2012-03-12</date>
32-
<time>12:10:00</time>
25+
<date>2012-08-10</date>
26+
<time>12:50:00</time>
3327
<version>
34-
<release>1.9.3</release>
35-
<api>1.9.3</api>
28+
<release>1.9.4</release>
29+
<api>1.9.4</api>
3630
</version>
3731
<stability>
3832
<release>stable</release>
3933
<api>stable</api>
4034
</stability>
4135
<license>Apache License 2.0</license>
4236
<notes>
43-
Fixed: Garbage value for VARCHAR type OUT variable of stored-procedure
44-
Fixed: Compilation error with php-5.4.x
45-
i5/OS: Remove compile errors during IBM i compiles due to chaining support
46-
i5/OS: Allow use of V6+ (SQL_ATTR_INFO_ACCTSTR, SQL_ATTR_INFO_APPLNAME, SQL_ATTR_INFO_PROGRAMID, SQL_ATTR_INFO_USERID, SQL_ATTR_INFO_WRKSTNNAME connection attributes)
37+
Fixed: DB2 PHP driver does not work as expected with values in BIGINT column
38+
Added: test case test_bigint.phpt for BIGINT datatype
39+
Fixed: Persistent connections takes up to 1 hour to reconnect on db2 TSA HA failover
40+
FIxed: Fixed: Allow trial license to connect ZOS/i5
41+
Added a environment variable IBM_DB_HOME to make the installation process easy and config script will automatically detect the architecure for which PHP is built and accordingly use the libraries under lib32/lib64.
4742
</notes>
4843
<contents>
4944
<dir name="/">
@@ -279,6 +274,7 @@ Cloudscape, and Apache Derby databases.
279274
<file baseinstalldir="ibm_db2" name="test_check_rollback.phpt" role="test" />
280275
<file baseinstalldir="ibm_db2" name="test_connect_deallocator.phpt" role="test" />
281276
<file baseinstalldir="ibm_db2" name="test_execute_many.phpt" role="test" />
277+
<file baseinstalldir="ibm_db2" name="test_bigint.phpt" role="test" />
282278
</dir> <!-- //tests -->
283279
<file baseinstalldir="ibm_db2" name="config.m4" role="src" />
284280
<file baseinstalldir="ibm_db2" name="config.w32" role="src" />

php_ibm_db2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$Id$
2424
*/
2525

26-
#define PHP_IBM_DB2_VERSION "1.9.3"
26+
#define PHP_IBM_DB2_VERSION "1.9.4"
2727

2828
#ifndef PHP_IBM_DB2_H
2929
#define PHP_IBM_DB2_H

0 commit comments

Comments
 (0)