summaryrefslogtreecommitdiff
path: root/ext/pdo/pdo_stmt.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-06-19 17:05:48 +0100
committerJakub Zelenka <bukka@php.net>2016-06-19 17:05:48 +0100
commite63a8540a60e95aa5bd8e269add1b02afcc1b79b (patch)
treeb83a144eec24cc81adab0b9a778f7a730d8df79e /ext/pdo/pdo_stmt.c
parent7a4cc73641bb3eb878f7184bcbd026ee663cf2a9 (diff)
parent53071e647049f099f7f7a0771ddb63fc2cdd621c (diff)
downloadphp-git-e63a8540a60e95aa5bd8e269add1b02afcc1b79b.tar.gz
Merge branch 'openssl_error_store' into openssl_aead
Diffstat (limited to 'ext/pdo/pdo_stmt.c')
-rw-r--r--ext/pdo/pdo_stmt.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 6019c39aba..c2f3c13399 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -740,9 +740,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
}
if (ce->constructor) {
- fci->function_table = &ce->function_table;
ZVAL_UNDEF(&fci->function_name);
- fci->symbol_table = NULL;
fci->retval = &stmt->fetch.cls.retval;
fci->param_count = 0;
fci->params = NULL;
@@ -752,7 +750,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
fcc->initialized = 1;
fcc->function_handler = ce->constructor;
- fcc->calling_scope = EG(scope);
+ fcc->calling_scope = zend_get_executed_scope();
fcc->called_scope = ce;
return 1;
} else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) {
@@ -1241,7 +1239,6 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all)
return 0;
}
/* fall through */
-
default:
if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS");
@@ -1542,16 +1539,16 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
{
struct pdo_bound_param_data param = {{{0}}};
zend_long param_type = PDO_PARAM_STR;
- zval *parameter;
+ zval *parameter, *driver_params = NULL;
param.paramno = -1;
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len,
- &param.driver_params)) {
+ &driver_params)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name,
&parameter, &param_type, &param.max_value_len,
- &param.driver_params)) {
+ &driver_params)) {
return 0;
}
}
@@ -1565,6 +1562,10 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
return 0;
}
+ if (driver_params) {
+ ZVAL_COPY(&param.driver_params, driver_params);
+ }
+
ZVAL_COPY(&param.parameter, parameter);
if (!really_register_bound_param(&param, stmt, is_param)) {
if (!Z_ISUNDEF(param.parameter)) {
@@ -2215,6 +2216,7 @@ static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_str
lc_method_name = zend_string_alloc(ZSTR_LEN(method_name), 0);
zend_str_tolower_copy(ZSTR_VAL(lc_method_name), ZSTR_VAL(method_name), ZSTR_LEN(method_name));
+
if ((fbc = zend_hash_find_ptr(&object->ce->function_table, lc_method_name)) == NULL) {
pdo_stmt_t *stmt = php_pdo_stmt_fetch_object(object);
/* instance not created by PDO object */
@@ -2239,6 +2241,9 @@ static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_str
out:
zend_string_release(lc_method_name);
+ if (!fbc) {
+ fbc = std_object_handlers.get_method(object_pp, method_name, key);
+ }
return fbc;
}
@@ -2619,6 +2624,7 @@ static union _zend_function *row_method_get(
}
zend_string_release(lc_method_name);
+
return fbc;
}