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()
230 struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)Z_PTR_P(el); in param_dtor() local
233 if (param->stmt->methods->param_hook) { in param_dtor()
234 param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE); in param_dtor()
237 if (param->name) { in param_dtor()
238 zend_string_release_ex(param->name, 0); in param_dtor()
241 if (!Z_ISUNDEF(param->parameter)) { in param_dtor()
242 zval_ptr_dtor(¶m->parameter); in param_dtor()
243 ZVAL_UNDEF(¶m->parameter); in param_dtor()
245 if (!Z_ISUNDEF(param->driver_params)) { in param_dtor()
246 zval_ptr_dtor(¶m->driver_params); in param_dtor()
248 efree(param); in param_dtor()
252 static bool really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, bool … in really_register_bound_param() argument
271 if (!Z_ISREF(param->parameter)) { in really_register_bound_param()
272 parameter = ¶m->parameter; in really_register_bound_param()
274 parameter = Z_REFVAL(param->parameter); in really_register_bound_param()
277 …if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && !Z_ISNULL_P… in really_register_bound_param()
281 …} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE … in really_register_bound_param()
283 } else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) { in really_register_bound_param()
287 param->stmt = stmt; in really_register_bound_param()
288 param->is_param = is_param; in really_register_bound_param()
290 if (Z_REFCOUNTED(param->driver_params)) { in really_register_bound_param()
291 Z_ADDREF(param->driver_params); in really_register_bound_param()
294 if (!is_param && param->name && stmt->columns) { in really_register_bound_param()
299 if (zend_string_equals(stmt->columns[i].name, param->name)) { in really_register_bound_param()
300 param->paramno = i; in really_register_bound_param()
307 if (param->paramno == -1) { in really_register_bound_param()
311 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
317 if (param->name) { in really_register_bound_param()
318 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
319 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
321 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
322 param->name = temp; in really_register_bound_param()
324 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
328 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
329 if (param->name) { in really_register_bound_param()
330 zend_string_release_ex(param->name, 0); in really_register_bound_param()
331 param->name = NULL; in really_register_bound_param()
341 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE)) { in really_register_bound_param()
343 if (param->name) { in really_register_bound_param()
344 zend_string_release_ex(param->name, 0); in really_register_bound_param()
345 param->name = NULL; in really_register_bound_param()
354 if (param->paramno >= 0) { in really_register_bound_param()
355 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
359 if (param->name) { in really_register_bound_param()
360 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
362 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
377 ZVAL_UNDEF(¶m->parameter); in really_register_bound_param()
400 struct pdo_bound_param_data param; in PHP_METHOD() local
412 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
416 param.name = key; in PHP_METHOD()
417 param.paramno = -1; in PHP_METHOD()
421 param.paramno = num_index; in PHP_METHOD()
424 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
425 ZVAL_COPY(¶m.parameter, tmp); in PHP_METHOD()
427 if (!really_register_bound_param(¶m, stmt, 1)) { in PHP_METHOD()
428 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
429 zval_ptr_dtor(¶m.parameter); in PHP_METHOD()
592 struct pdo_bound_param_data *param; in do_fetch_common() local
594 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
595 if (param->paramno >= 0) { in do_fetch_common()
596 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
601 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
604 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, ¶m->param_type); in do_fetch_common()
1405 struct pdo_bound_param_data param; in register_bound_param() local
1409 memset(¶m, 0, sizeof(param)); in register_bound_param()
1412 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in register_bound_param()
1416 Z_PARAM_LONG(param.max_value_len) in register_bound_param()
1422 param.param_type = (int) param_type; in register_bound_param()
1424 if (param.name) { in register_bound_param()
1425 if (ZSTR_LEN(param.name) == 0) { in register_bound_param()
1429 param.paramno = -1; in register_bound_param()
1430 } else if (param.paramno > 0) { in register_bound_param()
1431 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1438 ZVAL_COPY(¶m.driver_params, driver_params); in register_bound_param()
1441 ZVAL_COPY(¶m.parameter, parameter); in register_bound_param()
1442 if (!really_register_bound_param(¶m, stmt, is_param)) { in register_bound_param()
1443 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1444 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1456 struct pdo_bound_param_data param; in PHP_METHOD() local
1460 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
1463 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in PHP_METHOD()
1470 param.param_type = (int) param_type; in PHP_METHOD()
1472 if (param.name) { in PHP_METHOD()
1473 if (ZSTR_LEN(param.name) == 0) { in PHP_METHOD()
1477 param.paramno = -1; in PHP_METHOD()
1478 } else if (param.paramno > 0) { in PHP_METHOD()
1479 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1485 ZVAL_COPY(¶m.parameter, parameter); in PHP_METHOD()
1486 if (!really_register_bound_param(¶m, stmt, TRUE)) { in PHP_METHOD()
1487 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1488 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1489 ZVAL_UNDEF(¶m.parameter); in PHP_METHOD()
1950 struct pdo_bound_param_data *param; in PHP_METHOD() local
1980 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
1993 …param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
1994 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
1995 param->is_param, in PHP_METHOD()
1996 param->param_type); in PHP_METHOD()