Skip to content

Commit

Permalink
Bug #62593 Updated pdo_pgsql driver to convert boolean values to pg n…
Browse files Browse the repository at this point in the history
…ative format in emulation mode
  • Loading branch information
willfitch authored and dsp committed Oct 30, 2012
1 parent 2f1c406 commit 7ea4f73
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ext/pdo_pgsql/pgsql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7ea4f73

Please sign in to comment.