array_init(return_value);
if (dbh->query_stmt) {
- add_next_index_string(return_value, dbh->query_stmt->error_code, 1);
+ add_next_index_ascii_string(return_value, dbh->query_stmt->error_code, 1);
} else {
- add_next_index_string(return_value, dbh->error_code, 1);
+ add_next_index_ascii_string(return_value, dbh->error_code, 1);
}
if (dbh->methods->fetch_err) {
const zend_function_entry *funcs;
zend_function func;
zend_internal_function *ifunc = (zend_internal_function*)&func;
- int namelen;
char *lc_name;
if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) {
zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, NULL, dbh->is_persistent, 0);
while (funcs->fname) {
+ int namelen = strlen(funcs->fname)+1;
+
ifunc->type = ZEND_INTERNAL_FUNCTION;
ifunc->handler = funcs->handler;
- pdo_zstr_sval(ifunc->function_name) = (char*)funcs->fname;
+ ifunc->function_name.u = malloc(UBYTES(namelen));
+ u_charsToUChars(funcs->fname, ifunc->function_name.u, namelen);
ifunc->scope = dbh->ce;
ifunc->prototype = NULL;
if (funcs->arg_info) {
} else {
ifunc->fn_flags = ZEND_ACC_PUBLIC;
}
- namelen = strlen(funcs->fname);
lc_name = emalloc(namelen+1);
zend_str_tolower_copy(lc_name, funcs->fname, namelen);
- zend_hash_add(dbh->cls_methods[kind], lc_name, namelen+1, &func, sizeof(func), NULL);
+ zend_ascii_hash_add(dbh->cls_methods[kind], lc_name, namelen+1, &func, sizeof(zend_function), NULL);
efree(lc_name);
funcs++;
}
}
out:
- if (std_object_handlers.get_method) {
+ if (!fbc && std_object_handlers.get_method) {
fbc = std_object_handlers.get_method(object_pp, method_name, method_len TSRMLS_CC);
}
/* no break */
case 2:
stmt->fetch.cls.ctor_args = ctor_args; /* we're not going to free these */
- if (Z_TYPE_P(arg2) != IS_STRING) {
+ if (Z_TYPE_P(arg2) != IS_STRING && Z_TYPE_P(arg2) != IS_UNICODE) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)" TSRMLS_CC);
error = 1;
break;
} else {
- stmt->fetch.cls.ce = zend_fetch_class(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ stmt->fetch.cls.ce = zend_u_fetch_class(Z_TYPE_P(arg2), Z_UNIVAL_P(arg2), Z_UNILEN_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
if (!stmt->fetch.cls.ce) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class" TSRMLS_CC);
error = 1;
static union _zend_function *row_get_ctor(zval *object TSRMLS_DC)
{
static zend_internal_function ctor = {0};
+ int namelen = sizeof("__construct");
ctor.type = ZEND_INTERNAL_FUNCTION;
- pdo_zstr_sval(ctor.function_name) = "__construct";
+ ctor.function_name.u = malloc(UBYTES(namelen));
+ u_charsToUChars("__construct", ctor.function_name.u, namelen);
ctor.scope = pdo_row_ce;
ctor.handler = ZEND_FN(dbstmt_constructor);