Lines Matching refs:fetch

725 	zend_class_entry *ce = stmt->fetch.cls.ce;  in do_fetch_class_prepare()
726 zend_fcall_info *fci = &stmt->fetch.cls.fci; in do_fetch_class_prepare()
727 zend_fcall_info_cache *fcc = &stmt->fetch.cls.fcc; in do_fetch_class_prepare()
732 stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; in do_fetch_class_prepare()
738 fci->retval = &stmt->fetch.cls.retval; in do_fetch_class_prepare()
743 zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args); in do_fetch_class_prepare()
748 } else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) { in do_fetch_class_prepare()
784 zend_fcall_info *fci = &stmt->fetch.cls.fci; in do_fetch_func_prepare()
785 zend_fcall_info_cache *fcc = &stmt->fetch.cls.fcc; in do_fetch_func_prepare()
787 if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count)) { in do_fetch_func_prepare()
790 stmt->fetch.func.values = safe_emalloc(sizeof(zval), stmt->column_count, 0); in do_fetch_func_prepare()
799 if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) { in do_fetch_opt_finish()
800 if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) { in do_fetch_opt_finish()
802 zend_fcall_info_args_clear(&stmt->fetch.cls.fci, 1); in do_fetch_opt_finish()
804 efree(stmt->fetch.cls.fci.params); in do_fetch_opt_finish()
806 stmt->fetch.cls.fci.params = NULL; in do_fetch_opt_finish()
809 stmt->fetch.cls.fci.size = 0; in do_fetch_opt_finish()
810 if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args) && free_ctor_agrs) { in do_fetch_opt_finish()
811 zval_ptr_dtor(&stmt->fetch.cls.ctor_args); in do_fetch_opt_finish()
812 ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); in do_fetch_opt_finish()
813 stmt->fetch.cls.fci.param_count = 0; in do_fetch_opt_finish()
815 if (stmt->fetch.func.values) { in do_fetch_opt_finish()
816 efree(stmt->fetch.func.values); in do_fetch_opt_finish()
817 stmt->fetch.func.values = NULL; in do_fetch_opt_finish()
846 if (flags & PDO_FETCH_GROUP && stmt->fetch.column == -1) { in do_fetch()
849 colno = stmt->fetch.column; in do_fetch()
887 if (flags == PDO_FETCH_GROUP && stmt->fetch.column == -1) { in do_fetch()
913 old_ce = stmt->fetch.cls.ce; in do_fetch()
914 ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); in do_fetch()
915 old_arg_count = stmt->fetch.cls.fci.param_count; in do_fetch()
924 stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR; in do_fetch()
926 stmt->fetch.cls.ce = cep; in do_fetch()
933 ce = stmt->fetch.cls.ce; in do_fetch()
942 if (!stmt->fetch.cls.fci.size) { in do_fetch()
949 stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); in do_fetch()
950 stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); in do_fetch()
951 if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { in do_fetch()
955 if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { in do_fetch()
956 zval_ptr_dtor(&stmt->fetch.cls.retval); in do_fetch()
957 ZVAL_UNDEF(&stmt->fetch.cls.retval); in do_fetch()
965 if (Z_ISUNDEF(stmt->fetch.into)) { in do_fetch()
971 ZVAL_COPY(return_value, &stmt->fetch.into); in do_fetch()
979 if (Z_ISUNDEF(stmt->fetch.func.function)) { in do_fetch()
983 if (!stmt->fetch.func.fci.size) { in do_fetch()
998 if (flags == PDO_FETCH_GROUP && how == PDO_FETCH_COLUMN && stmt->fetch.column > 0) { in do_fetch()
1115 ZVAL_COPY_VALUE(&stmt->fetch.func.values[idx], &val); in do_fetch()
1116 ZVAL_COPY_VALUE(&stmt->fetch.cls.fci.params[idx], &stmt->fetch.func.values[idx]); in do_fetch()
1130 stmt->fetch.cls.fci.object = Z_OBJ_P(return_value); in do_fetch()
1131 stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value); in do_fetch()
1132 if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) { in do_fetch()
1136 if (!Z_ISUNDEF(stmt->fetch.cls.retval)) { in do_fetch()
1137 zval_ptr_dtor(&stmt->fetch.cls.retval); in do_fetch()
1143 stmt->fetch.cls.ce = old_ce; in do_fetch()
1144 ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); in do_fetch()
1145 stmt->fetch.cls.fci.param_count = old_arg_count; in do_fetch()
1150 stmt->fetch.func.fci.param_count = idx; in do_fetch()
1151 stmt->fetch.func.fci.retval = &retval; in do_fetch()
1152 if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc) == FAILURE) { in do_fetch()
1164 zval_ptr_dtor(&stmt->fetch.func.values[idx]); in do_fetch()
1247 static PHP_METHOD(PDOStatement, fetch) in PHP_METHOD() argument
1300 old_ce = stmt->fetch.cls.ce; in PHP_METHOD()
1301 ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); in PHP_METHOD()
1302 old_arg_count = stmt->fetch.cls.fci.param_count; in PHP_METHOD()
1308 ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(Z_ARRVAL_P(ctor_args))); in PHP_METHOD()
1310 ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); in PHP_METHOD()
1314 stmt->fetch.cls.ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO); in PHP_METHOD()
1316 if (!stmt->fetch.cls.ce) { in PHP_METHOD()
1321 stmt->fetch.cls.ce = zend_standard_class_def; in PHP_METHOD()
1332 stmt->fetch.cls.ce = old_ce; in PHP_METHOD()
1333 ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); in PHP_METHOD()
1334 stmt->fetch.cls.fci.param_count = old_arg_count; in PHP_METHOD()
1387 old_ce = stmt->fetch.cls.ce; in PHP_METHOD()
1388 ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args); in PHP_METHOD()
1389 old_arg_count = stmt->fetch.cls.fci.param_count; in PHP_METHOD()
1398 stmt->fetch.cls.ce = zend_standard_class_def; in PHP_METHOD()
1412 ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, ctor_args); /* we're not going to free these */ in PHP_METHOD()
1414 ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); in PHP_METHOD()
1421 stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO); in PHP_METHOD()
1422 if (!stmt->fetch.cls.ce) { in PHP_METHOD()
1443 ZVAL_COPY_VALUE(&stmt->fetch.func.function, arg2); in PHP_METHOD()
1455 stmt->fetch.column = how & PDO_FETCH_GROUP ? -1 : 0; in PHP_METHOD()
1459 stmt->fetch.column = Z_LVAL_P(arg2); in PHP_METHOD()
1510 stmt->fetch.cls.ce = old_ce; in PHP_METHOD()
1511 ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args); in PHP_METHOD()
1512 stmt->fetch.cls.fci.param_count = old_arg_count; in PHP_METHOD()
1842 if (!Z_ISUNDEF(stmt->fetch.into)) { in pdo_stmt_setup_fetch_mode()
1843 zval_ptr_dtor(&stmt->fetch.into); in pdo_stmt_setup_fetch_mode()
1844 ZVAL_UNDEF(&stmt->fetch.into); in pdo_stmt_setup_fetch_mode()
1904 stmt->fetch.column = Z_LVAL(args[skip+1]); in pdo_stmt_setup_fetch_mode()
1915 stmt->fetch.cls.ce = NULL; in pdo_stmt_setup_fetch_mode()
1929 stmt->fetch.cls.ce = cep; in pdo_stmt_setup_fetch_mode()
1935 ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); in pdo_stmt_setup_fetch_mode()
1946 ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(Z_ARRVAL(args[skip+2]))); in pdo_stmt_setup_fetch_mode()
1972 ZVAL_COPY(&stmt->fetch.into, &args[skip+1]); in pdo_stmt_setup_fetch_mode()
2155 PHP_ME(PDOStatement, fetch, arginfo_pdostatement_fetch, ZEND_ACC_PUBLIC)
2296 if (!Z_ISUNDEF(stmt->fetch.into) && stmt->default_fetch_type == PDO_FETCH_INTO) { in php_pdo_free_statement()
2297 zval_ptr_dtor(&stmt->fetch.into); in php_pdo_free_statement()
2298 ZVAL_UNDEF(&stmt->fetch.into); in php_pdo_free_statement()