new_object->m = mysqlnd_conn_get_methods();
data = new_object->data;
- if (FAIL == mysqlnd_error_info_init(&data->error_info_impl, persistent)) {
- new_object->m->dtor(new_object);
- DBG_RETURN(NULL);
- }
+ mysqlnd_error_info_init(&data->error_info_impl, persistent);
data->error_info = &data->error_info_impl;
data->options = &(data->options_impl);
MYSQLND_STMT_DATA * stmt = NULL;
DBG_ENTER("mysqlnd_object_factory::get_prepared_statement");
- do {
- ret->m = mysqlnd_stmt_get_methods();
+ ret->m = mysqlnd_stmt_get_methods();
- stmt = ret->data = mnd_ecalloc(1, sizeof(MYSQLND_STMT_DATA));
- DBG_INF_FMT("stmt=%p", stmt);
+ stmt = ret->data = mnd_ecalloc(1, sizeof(MYSQLND_STMT_DATA));
+ DBG_INF_FMT("stmt=%p", stmt);
- if (FAIL == mysqlnd_error_info_init(&stmt->error_info_impl, 0)) {
- break;
- }
- stmt->error_info = &stmt->error_info_impl;
-
- mysqlnd_upsert_status_init(&stmt->upsert_status_impl);
- stmt->upsert_status = &(stmt->upsert_status_impl);
- stmt->state = MYSQLND_STMT_INITTED;
- stmt->execute_cmd_buffer.length = 4096;
- stmt->execute_cmd_buffer.buffer = mnd_emalloc(stmt->execute_cmd_buffer.length);
- if (!stmt->execute_cmd_buffer.buffer) {
- break;
- }
+ mysqlnd_error_info_init(&stmt->error_info_impl, 0);
+ stmt->error_info = &stmt->error_info_impl;
- stmt->prefetch_rows = MYSQLND_DEFAULT_PREFETCH_ROWS;
+ mysqlnd_upsert_status_init(&stmt->upsert_status_impl);
+ stmt->upsert_status = &(stmt->upsert_status_impl);
+ stmt->state = MYSQLND_STMT_INITTED;
+ stmt->execute_cmd_buffer.length = 4096;
+ stmt->execute_cmd_buffer.buffer = mnd_emalloc(stmt->execute_cmd_buffer.length);
+ stmt->prefetch_rows = MYSQLND_DEFAULT_PREFETCH_ROWS;
- /*
- Mark that we reference the connection, thus it won't be
- be destructed till there is open statements. The last statement
- or normal query result will close it then.
- */
- stmt->conn = conn->m->get_reference(conn);
+ /*
+ Mark that we reference the connection, thus it won't be
+ be destructed till there is open statements. The last statement
+ or normal query result will close it then.
+ */
+ stmt->conn = conn->m->get_reference(conn);
- DBG_RETURN(ret);
- } while (0);
-
- SET_OOM_ERROR(conn->error_info);
- if (ret) {
- ret->m->dtor(ret, TRUE);
- ret = NULL;
- }
- DBG_RETURN(NULL);
+ DBG_RETURN(ret);
}
/* }}} */
if (flags & MYSQLND_STORE_NO_COPY) {
result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result, result->field_count, flags & MYSQLND_STORE_PS);
- if (!result->stored_data) {
- SET_OOM_ERROR(conn->error_info);
- DBG_RETURN(NULL);
- }
row_buffers = &result->stored_data->row_buffers;
} else if (flags & MYSQLND_STORE_COPY) {
result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_c_init(result, result->field_count, flags & MYSQLND_STORE_PS);
- if (!result->stored_data) {
- SET_OOM_ERROR(conn->error_info);
- DBG_RETURN(NULL);
- }
row_buffers = &result->stored_data->row_buffers;
}
ret = result->m.store_result_fetch_data(conn, result, result->meta, row_buffers, flags & MYSQLND_STORE_PS);
ret = pool->get_chunk(pool, alloc_size);
memset(ret, 0, alloc_size);
- if (FAIL == mysqlnd_error_info_init(&ret->error_info, 0)) {
- DBG_RETURN(NULL);
- }
+ mysqlnd_error_info_init(&ret->error_info, /* persistent */ 0);
ret->lengths = pool->get_chunk(pool, field_count * sizeof(size_t));
memset(ret->lengths, 0, field_count * sizeof(size_t));
ret = pool->get_chunk(pool, alloc_size);
memset(ret, 0, alloc_size);
- if (FAIL == mysqlnd_error_info_init(&ret->error_info, 0)) {
- DBG_RETURN(NULL);
- }
+ mysqlnd_error_info_init(&ret->error_info, /* persistent */ 0);
ret->lengths = pool->get_chunk(pool, field_count * sizeof(size_t));
memset(ret->lengths, 0, field_count * sizeof(size_t));