Skip to content

Commit 7ff28e0

Browse files
committed
compile warning on PASE (exposes possible binding issue?)
1 parent 562977e commit 7ff28e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ibm_db2.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4998,9 +4998,20 @@ static int _php_db2_bind_data( stmt_handle *stmt_res, param_node *curr, zval **b
49984998
case IS_NULL:
49994999
Z_LVAL_P(curr->value) = SQL_NULL_DATA;
50005000
ZEND_Z_TYPE_P(curr->value) = IS_NULL;
5001+
#ifdef PASE
5002+
/*
5003+
* XXX: not quite right on PHP 7+ because int32* into zend_long (word size)
5004+
* but might not matter if it's just a null bind
5005+
*/
5006+
rc = SQLBindParameter(stmt_res->hstmt, curr->param_num,
5007+
curr->param_type, SQL_C_DEFAULT, curr->data_type, curr->param_size,
5008+
curr->scale, &(curr->value), 0, (SQLINTEGER *)&((curr->value)->value.lval));
5009+
#else
5010+
/* SQLLEN is actually correct here since zend_long is word size */
50015011
rc = SQLBindParameter(stmt_res->hstmt, curr->param_num,
50025012
curr->param_type, SQL_C_DEFAULT, curr->data_type, curr->param_size,
50035013
curr->scale, &(curr->value), 0, (SQLLEN *)&((curr->value)->value.lval));
5014+
#endif
50045015
if ( rc == SQL_ERROR ) {
50055016
_php_db2_check_sql_errors(stmt_res->hstmt, SQL_HANDLE_STMT, rc, 1, NULL, -1, 1);
50065017
}

0 commit comments

Comments
 (0)