Lines Matching refs:param
44 static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /… in rewrite_name_to_position() argument
60 if (!param->name) { in rewrite_name_to_position()
62 if ((name = zend_hash_index_find_ptr(stmt->bound_param_map, param->paramno)) != NULL) { in rewrite_name_to_position()
63 param->name = zend_string_copy(name); in rewrite_name_to_position()
72 if (!zend_string_equals(name, param->name)) { in rewrite_name_to_position()
76 if (param->paramno >= 0) { in rewrite_name_to_position()
81 param->paramno = position; in rewrite_name_to_position()
96 struct pdo_bound_param_data *param; in dispatch_param_event() local
111 ZEND_HASH_FOREACH_PTR(ht, param) { in dispatch_param_event()
112 if (!stmt->methods->param_hook(stmt, param, event_type)) { in dispatch_param_event()
157 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns() local
159 if ((param = zend_hash_find_ptr(stmt->bound_columns, in pdo_stmt_describe_columns()
161 param->paramno = col; in pdo_stmt_describe_columns()
225 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
228 if (param->stmt->methods->param_hook) { in param_dtor()
229 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
232 if (param->name) { in param_dtor()
233 zend_string_release_ex(param->name, 0); in param_dtor()
236 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
237 zval_ptr_dtor(¶m->parameter); in param_dtor()
238 ZVAL_UNDEF(¶m->parameter); in param_dtor()
240 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
241 zval_ptr_dtor(¶m->driver_params); in param_dtor()
243 efree(param); in param_dtor()
247 static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, bool … in really_register_bound_param() argument
266 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
267 parameter = ¶m->parameter; in really_register_bound_param()
269 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
272 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
276 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
278 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
282 param->stmt = stmt; in really_register_bound_param()
283 param->is_param = is_param; in really_register_bound_param()
285 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
286 Z_ADDREF(param->driver_params); in really_register_bound_param()
289 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
294 if (zend_string_equals(stmt->columns[i].name, param->name)) { in really_register_bound_param()
295 param->paramno = i; in really_register_bound_param()
302 if (param->paramno == -1) { in really_register_bound_param()
306 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
312 if (param->name) { in really_register_bound_param()
313 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
314 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
316 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
317 param->name = temp; in really_register_bound_param()
319 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
323 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
324 if (param->name) { in really_register_bound_param()
325 zend_string_release_ex(param->name, 0); in really_register_bound_param()
326 param->name = NULL; in really_register_bound_param()
336 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE)) { in really_register_bound_param()
338 if (param->name) { in really_register_bound_param()
339 zend_string_release_ex(param->name, 0); in really_register_bound_param()
340 param->name = NULL; in really_register_bound_param()
349 if (param->paramno >= 0) { in really_register_bound_param()
350 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
354 if (param->name) { in really_register_bound_param()
355 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
357 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
372 ZVAL_UNDEF(¶m->parameter); in really_register_bound_param()
395 struct pdo_bound_param_data param; in PHP_METHOD() local
407 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
411 param.name = key; in PHP_METHOD()
412 param.paramno = -1; in PHP_METHOD()
416 param.paramno = num_index; in PHP_METHOD()
419 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
420 ZVAL_COPY(¶m.parameter, tmp); in PHP_METHOD()
422 if (!really_register_bound_param(¶m, stmt, 1)) { in PHP_METHOD()
423 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
424 zval_ptr_dtor(¶m.parameter); in PHP_METHOD()
587 struct pdo_bound_param_data *param; in do_fetch_common() local
589 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
590 if (param->paramno >= 0) { in do_fetch_common()
591 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
596 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
599 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, ¶m->param_type); in do_fetch_common()
1400 struct pdo_bound_param_data param; in register_bound_param() local
1404 memset(¶m, 0, sizeof(param)); in register_bound_param()
1407 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in register_bound_param()
1411 Z_PARAM_LONG(param.max_value_len) in register_bound_param()
1417 param.param_type = (int) param_type; in register_bound_param()
1419 if (param.name) { in register_bound_param()
1420 if (ZSTR_LEN(param.name) == 0) { in register_bound_param()
1424 param.paramno = -1; in register_bound_param()
1425 } else if (param.paramno > 0) { in register_bound_param()
1426 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1433 ZVAL_COPY(¶m.driver_params, driver_params); in register_bound_param()
1436 ZVAL_COPY(¶m.parameter, parameter); in register_bound_param()
1437 if (!really_register_bound_param(¶m, stmt, is_param)) { in register_bound_param()
1438 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1439 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1451 struct pdo_bound_param_data param; in PHP_METHOD() local
1455 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
1458 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in PHP_METHOD()
1465 param.param_type = (int) param_type; in PHP_METHOD()
1467 if (param.name) { in PHP_METHOD()
1468 if (ZSTR_LEN(param.name) == 0) { in PHP_METHOD()
1472 param.paramno = -1; in PHP_METHOD()
1473 } else if (param.paramno > 0) { in PHP_METHOD()
1474 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1480 ZVAL_COPY(¶m.parameter, parameter); in PHP_METHOD()
1481 if (!really_register_bound_param(¶m, stmt, TRUE)) { in PHP_METHOD()
1482 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1483 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1484 ZVAL_UNDEF(¶m.parameter); in PHP_METHOD()
1945 struct pdo_bound_param_data *param; in PHP_METHOD() local
1975 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
1988 …param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
1989 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
1990 param->is_param, in PHP_METHOD()
1991 param->param_type); in PHP_METHOD()