46
46
* Common definitions
49
drizzle_result_st *drizzle_result_create(drizzle_con_st *con,
50
drizzle_result_st *result)
49
drizzle_result_st *drizzle_result_create(drizzle_con_st *con)
51
return drizzle_result_create_with(con, NULL);
54
drizzle_result_st *drizzle_result_create_with(drizzle_con_st *con,
55
drizzle_result_st *result)
52
57
if (result == NULL)
112
117
drizzle_result_st *drizzle_result_clone(drizzle_con_st *con,
113
drizzle_result_st *result,
114
drizzle_result_st *from)
118
drizzle_result_st *source)
116
result= drizzle_result_create(con, result);
120
drizzle_result_st *result= drizzle_result_create(con);
117
121
if (result == NULL)
122
result->options= from->options;
126
result->options= source->options;
124
drizzle_result_set_info(result, from->info);
125
result->error_code= from->error_code;
126
drizzle_result_set_sqlstate(result, from->sqlstate);
127
result->warning_count= from->warning_count;
128
result->insert_id= from->insert_id;
129
result->affected_rows= from->affected_rows;
130
result->column_count= from->column_count;
131
result->row_count= from->row_count;
128
drizzle_result_set_info(result, source->info);
129
result->error_code= source->error_code;
130
drizzle_result_set_sqlstate(result, source->sqlstate);
131
result->warning_count= source->warning_count;
132
result->insert_id= source->insert_id;
133
result->affected_rows= source->affected_rows;
134
result->column_count= source->column_count;
135
result->row_count= source->row_count;
153
156
if (result->options & DRIZZLE_RESULT_BUFFER_ROW)
155
for (x= 0; x < result->row_count; x++)
156
drizzle_row_free(result, result->row_list->at(static_cast<size_t>(x)));
158
for (size_t x= 0; x < result->row_count; x++)
160
drizzle_row_free(result, result->row_list->at(x));
158
163
delete result->row_list;
159
164
delete result->field_sizes_list;
319
324
if (drizzle_state_none(con))
321
con->result= drizzle_result_create(con, result);
326
con->result= drizzle_result_create_with(con, result);
322
327
if (con->result == NULL)
324
329
*ret_ptr= DRIZZLE_RETURN_MEMORY;