mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix [-Wundef] warning in PDO MySQL extension
This commit is contained in:
parent
db7dc2fa2f
commit
c932cc841a
4 changed files with 24 additions and 24 deletions
|
@ -100,7 +100,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
|
|||
}
|
||||
}
|
||||
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (!S->stmt && S->current_data) {
|
||||
mnd_free(S->current_data);
|
||||
}
|
||||
|
@ -339,13 +339,13 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
|
|||
{
|
||||
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
|
||||
pdo_mysql_db_handle *H = S->H;
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
zend_long row_count;
|
||||
#endif
|
||||
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
|
||||
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
|
||||
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (!H->emulate_prepare) {
|
||||
if (!mysqlnd_stmt_more_results(S->stmt)) {
|
||||
PDO_DBG_RETURN(0);
|
||||
|
@ -416,7 +416,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
|
|||
/* No more results */
|
||||
PDO_DBG_RETURN(0);
|
||||
}
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (mysql_next_result(H->server) == FAIL) {
|
||||
pdo_mysql_error_stmt(stmt);
|
||||
PDO_DBG_RETURN(0);
|
||||
|
@ -491,7 +491,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
|||
parameter = Z_REFVAL(param->parameter);
|
||||
}
|
||||
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_NULL || (Z_TYPE_P(parameter) == IS_NULL)) {
|
||||
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_NULL);
|
||||
PDO_DBG_RETURN(1);
|
||||
|
@ -537,7 +537,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
|||
;
|
||||
}
|
||||
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
/* Is it really correct to check the zval's type? - But well, that's what the old code below does, too */
|
||||
PDO_DBG_INF_FMT("param->parameter->type=%d", Z_TYPE(param->parameter));
|
||||
if (!Z_ISREF(param->parameter)) {
|
||||
|
@ -614,7 +614,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
|||
static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */
|
||||
{
|
||||
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
zend_bool fetched_anything;
|
||||
|
||||
PDO_DBG_ENTER("pdo_mysql_stmt_fetch");
|
||||
|
@ -653,14 +653,14 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori
|
|||
strcpy(stmt->error_code, "HY000");
|
||||
PDO_DBG_RETURN(0);
|
||||
}
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (!S->stmt && S->current_data) {
|
||||
mnd_free(S->current_data);
|
||||
}
|
||||
#endif /* PDO_USE_MYSQLND */
|
||||
|
||||
if ((S->current_data = mysql_fetch_row(S->result)) == NULL) {
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (S->result->unbuf && !S->result->unbuf->eof_reached && mysql_errno(S->H->server)) {
|
||||
#else
|
||||
if (!S->result->eof && mysql_errno(S->H->server)) {
|
||||
|
@ -743,7 +743,7 @@ static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, size_
|
|||
/* error invalid column */
|
||||
PDO_DBG_RETURN(0);
|
||||
}
|
||||
#if PDO_USE_MYSQLND
|
||||
#ifdef PDO_USE_MYSQLND
|
||||
if (S->stmt) {
|
||||
Z_TRY_ADDREF(S->stmt->data->result_bind[colno].zv);
|
||||
*ptr = (char*)&S->stmt->data->result_bind[colno].zv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue