Bug #62593 Updated pdo_pgsql driver to convert boolean values to pg native format in emulation mode

This commit is contained in:
Will Fitch 2012-09-20 12:32:53 -04:00 committed by David Soria Parra
parent 2f1c4064f8
commit 7ea4f73ad4

View File

@ -362,8 +362,19 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
}
break;
}
} else {
#endif
if (param->is_param) {
/* We need to manually convert to a pg native boolean value */
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL) {
SEPARATE_ZVAL_IF_NOT_REF(&param->parameter);
param->param_type = PDO_PARAM_STR;
ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1);
}
}
#if HAVE_PQPREPARE
}
#endif
#endif
return 1;
}