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_init(name, strlen(name), 0); in rewrite_name_to_position()
72 if (strncmp(name, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1)) { 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 (ZSTR_LEN(stmt->columns[i].name) == ZSTR_LEN(param->name) && in really_register_bound_param()
301 … strncmp(ZSTR_VAL(stmt->columns[i].name), ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1) == 0) { in really_register_bound_param()
302 param->paramno = i; in really_register_bound_param()
309 if (param->paramno == -1) { in really_register_bound_param()
313 …id not find column name '%s' in the defined columns; it will not be bound", ZSTR_VAL(param->name)); in really_register_bound_param()
319 if (param->name) { in really_register_bound_param()
320 if (is_param && ZSTR_VAL(param->name)[0] != ':') { in really_register_bound_param()
321 zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0); in really_register_bound_param()
323 memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1); in really_register_bound_param()
324 param->name = temp; in really_register_bound_param()
326 param->name = zend_string_init(ZSTR_VAL(param->name), ZSTR_LEN(param->name), 0); in really_register_bound_param()
330 if (is_param && !rewrite_name_to_position(stmt, param)) { in really_register_bound_param()
331 if (param->name) { in really_register_bound_param()
332 zend_string_release_ex(param->name, 0); in really_register_bound_param()
333 param->name = NULL; in really_register_bound_param()
343 if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_NORMALIZE)) { in really_register_bound_param()
345 if (param->name) { in really_register_bound_param()
346 zend_string_release_ex(param->name, 0); in really_register_bound_param()
347 param->name = NULL; in really_register_bound_param()
356 if (param->paramno >= 0) { in really_register_bound_param()
357 zend_hash_index_del(hash, param->paramno); in really_register_bound_param()
361 if (param->name) { in really_register_bound_param()
362 pparam = zend_hash_update_mem(hash, param->name, param, sizeof(struct pdo_bound_param_data)); in really_register_bound_param()
364 …pparam = zend_hash_index_update_mem(hash, param->paramno, param, sizeof(struct pdo_bound_param_dat… in really_register_bound_param()
379 ZVAL_UNDEF(¶m->parameter); in really_register_bound_param()
402 struct pdo_bound_param_data param; in PHP_METHOD() local
414 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
418 param.name = key; in PHP_METHOD()
419 param.paramno = -1; in PHP_METHOD()
423 param.paramno = num_index; in PHP_METHOD()
426 param.param_type = PDO_PARAM_STR; in PHP_METHOD()
427 ZVAL_COPY(¶m.parameter, tmp); in PHP_METHOD()
429 if (!really_register_bound_param(¶m, stmt, 1)) { in PHP_METHOD()
430 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
431 zval_ptr_dtor(¶m.parameter); in PHP_METHOD()
662 struct pdo_bound_param_data *param; in do_fetch_common() local
664 ZEND_HASH_FOREACH_PTR(stmt->bound_columns, param) { in do_fetch_common()
665 if (param->paramno >= 0) { in do_fetch_common()
666 if (!Z_ISREF(param->parameter)) { in do_fetch_common()
671 zval_ptr_dtor(Z_REFVAL(param->parameter)); in do_fetch_common()
674 fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)¶m->param_type); in do_fetch_common()
1477 struct pdo_bound_param_data param; in register_bound_param() local
1481 memset(¶m, 0, sizeof(param)); in register_bound_param()
1484 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in register_bound_param()
1488 Z_PARAM_LONG(param.max_value_len) in register_bound_param()
1494 param.param_type = (int) param_type; in register_bound_param()
1496 if (param.name) { in register_bound_param()
1497 if (ZSTR_LEN(param.name) == 0) { in register_bound_param()
1501 param.paramno = -1; in register_bound_param()
1502 } else if (param.paramno > 0) { in register_bound_param()
1503 --param.paramno; /* make it zero-based internally */ in register_bound_param()
1510 ZVAL_COPY(¶m.driver_params, driver_params); in register_bound_param()
1513 ZVAL_COPY(¶m.parameter, parameter); in register_bound_param()
1514 if (!really_register_bound_param(¶m, stmt, is_param)) { in register_bound_param()
1515 if (!Z_ISUNDEF(param.parameter)) { in register_bound_param()
1516 zval_ptr_dtor(&(param.parameter)); in register_bound_param()
1528 struct pdo_bound_param_data param; in PHP_METHOD() local
1532 memset(¶m, 0, sizeof(param)); in PHP_METHOD()
1535 Z_PARAM_STR_OR_LONG(param.name, param.paramno) in PHP_METHOD()
1542 param.param_type = (int) param_type; in PHP_METHOD()
1544 if (param.name) { in PHP_METHOD()
1545 if (ZSTR_LEN(param.name) == 0) { in PHP_METHOD()
1549 param.paramno = -1; in PHP_METHOD()
1550 } else if (param.paramno > 0) { in PHP_METHOD()
1551 --param.paramno; /* make it zero-based internally */ in PHP_METHOD()
1557 ZVAL_COPY(¶m.parameter, parameter); in PHP_METHOD()
1558 if (!really_register_bound_param(¶m, stmt, TRUE)) { in PHP_METHOD()
1559 if (!Z_ISUNDEF(param.parameter)) { in PHP_METHOD()
1560 zval_ptr_dtor(&(param.parameter)); in PHP_METHOD()
1561 ZVAL_UNDEF(¶m.parameter); in PHP_METHOD()
2026 struct pdo_bound_param_data *param; in PHP_METHOD() local
2056 ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) { in PHP_METHOD()
2069 …param->paramno, param->name ? ZSTR_LEN(param->name) : 0, param->name ? (int) ZSTR_LEN(param->name)… in PHP_METHOD()
2070 param->name ? ZSTR_VAL(param->name) : "", in PHP_METHOD()
2071 param->is_param, in PHP_METHOD()
2072 param->param_type); in PHP_METHOD()