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()
162 struct pdo_bound_param_data *param; in pdo_stmt_describe_columns() local
164 if ((param = zend_hash_find_ptr(stmt->bound_columns, in pdo_stmt_describe_columns()
166 param->paramno = col; in pdo_stmt_describe_columns()
231 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
234 if (param->stmt->methods->param_hook) { in param_dtor()
235 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
238 if (param->name) { in param_dtor()
239 zend_string_release_ex(param->name, 0); in param_dtor()
242 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
243 zval_ptr_dtor(¶m->parameter); in param_dtor()
244 ZVAL_UNDEF(¶m->parameter); in param_dtor()
246 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
247 zval_ptr_dtor(¶m->driver_params); in param_dtor()
249 efree(param); in param_dtor()
253 static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, bool … in really_register_bound_param() argument
272 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
273 parameter = ¶m->parameter; in really_register_bound_param()
275 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
278 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
282 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
284 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
288 param->stmt = stmt; in really_register_bound_param()
289 param->is_param = is_param; in really_register_bound_param()
291 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
292 Z_ADDREF(param->driver_params); in really_register_bound_param()
295 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
300 if (zend_string_equals(stmt->columns[i].name, param->name)) { in really_register_bound_param()
301 param->paramno = i; in really_register_bound_param()
308 if (param->paramno == -1) { in really_register_bound_param()
312 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
318 if (param->name) { in really_register_bound_param()
319 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
320 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
322 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
323 param->name = temp; in really_register_bound_param()
325 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
329 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
330 if (param->name) { in really_register_bound_param()
331 zend_string_release_ex(param->name, 0); in really_register_bound_param()
332 param->name = NULL; in really_register_bound_param()
342 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE)) { in really_register_bound_param()
344 if (param->name) { in really_register_bound_param()
345 zend_string_release_ex(param->name, 0); in really_register_bound_param()
346 param->name = NULL; in really_register_bound_param()
355 if (param->paramno >= 0) { in really_register_bound_param()
356 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
360 if (param->name) { in really_register_bound_param()
361 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
363 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
378 ZVAL_UNDEF(¶m->parameter); in really_register_bound_param()
401 struct pdo_bound_param_data param; in PHP_METHOD() local
413 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
417 param.name = key; in PHP_METHOD()
418 param.paramno = -1; in PHP_METHOD()
422 param.paramno = num_index; in PHP_METHOD()
425 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
426 ZVAL_COPY(¶m.parameter, tmp); in PHP_METHOD()
428 if (!really_register_bound_param(¶m, stmt, 1)) { in PHP_METHOD()
429 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
430 zval_ptr_dtor(¶m.parameter); in PHP_METHOD()
593 struct pdo_bound_param_data *param; in do_fetch_common() local
595 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
596 if (param->paramno >= 0) { in do_fetch_common()
597 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
602 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
605 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, ¶m->param_type); in do_fetch_common()
1411 struct pdo_bound_param_data param; in register_bound_param() local
1415 memset(¶m, 0, sizeof(param)); in register_bound_param()
1418 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in register_bound_param()
1422 Z_PARAM_LONG(param.max_value_len) in register_bound_param()
1428 param.param_type = (int) param_type; in register_bound_param()
1430 if (param.name) { in register_bound_param()
1431 if (ZSTR_LEN(param.name) == 0) { in register_bound_param()
1435 param.paramno = -1; in register_bound_param()
1436 } else if (param.paramno > 0) { in register_bound_param()
1437 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1444 ZVAL_COPY(¶m.driver_params, driver_params); in register_bound_param()
1447 ZVAL_COPY(¶m.parameter, parameter); in register_bound_param()
1448 if (!really_register_bound_param(¶m, stmt, is_param)) { in register_bound_param()
1449 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1450 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1462 struct pdo_bound_param_data param; in PHP_METHOD() local
1466 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
1469 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in PHP_METHOD()
1476 param.param_type = (int) param_type; in PHP_METHOD()
1478 if (param.name) { in PHP_METHOD()
1479 if (ZSTR_LEN(param.name) == 0) { in PHP_METHOD()
1483 param.paramno = -1; in PHP_METHOD()
1484 } else if (param.paramno > 0) { in PHP_METHOD()
1485 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1491 ZVAL_COPY(¶m.parameter, parameter); in PHP_METHOD()
1492 if (!really_register_bound_param(¶m, stmt, TRUE)) { in PHP_METHOD()
1493 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1494 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1495 ZVAL_UNDEF(¶m.parameter); in PHP_METHOD()
1956 struct pdo_bound_param_data *param; in PHP_METHOD() local
1986 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
1999 …param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
2000 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
2001 param->is_param, in PHP_METHOD()
2002 param->param_type); in PHP_METHOD()