~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/result.cc

  • Committer: Brian Aker
  • Date: 2011-11-26 23:14:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2465.
  • Revision ID: brian@tangent.org-20111126231459-pa9i3arizevf0vlr
Remove con from being passed object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 * Common definitions
47
47
 */
48
48
 
49
 
drizzle_result_st *drizzle_result_create(drizzle_con_st *con)
50
 
{
51
 
  return drizzle_result_create_with(con, NULL);
52
 
}
53
 
 
54
 
drizzle_result_st *drizzle_result_create_with(drizzle_con_st *con,
55
 
                                              drizzle_result_st *result)
 
49
drizzle_result_st *drizzle_result_create(drizzle_con_st *con,
 
50
                                         drizzle_result_st *result)
56
51
{
57
52
  if (result == NULL)
58
53
  {
115
110
}
116
111
 
117
112
drizzle_result_st *drizzle_result_clone(drizzle_con_st *con,
118
 
                                        drizzle_result_st *source)
 
113
                                        drizzle_result_st *result,
 
114
                                        drizzle_result_st *from)
119
115
{
120
 
  drizzle_result_st *result= drizzle_result_create(con);
 
116
  result= drizzle_result_create(con, result);
121
117
  if (result == NULL)
122
118
  {
123
119
    return NULL;
124
120
  }
125
121
 
126
 
  result->options= source->options;
 
122
  result->options= from->options;
127
123
 
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;
 
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;
136
132
 
137
133
  return result;
138
134
}
140
136
void drizzle_result_free(drizzle_result_st *result)
141
137
{
142
138
  drizzle_column_st *column;
 
139
  uint64_t x;
143
140
 
144
141
  if (result == NULL)
145
142
  {
155
152
 
156
153
  if (result->options & DRIZZLE_RESULT_BUFFER_ROW)
157
154
  {
158
 
    for (size_t x= 0; x < result->row_count; x++)
159
 
    {
160
 
      drizzle_row_free(result, result->row_list->at(x));
161
 
    }
 
155
    for (x= 0; x < result->row_count; x++)
 
156
      drizzle_row_free(result, result->row_list->at(static_cast<size_t>(x)));
162
157
 
163
158
    delete result->row_list;
164
159
    delete result->field_sizes_list;
323
318
 
324
319
  if (drizzle_state_none(con))
325
320
  {
326
 
    con->result= drizzle_result_create_with(con, result);
 
321
    con->result= drizzle_result_create(con, result);
327
322
    if (con->result == NULL)
328
323
    {
329
324
      *ret_ptr= DRIZZLE_RETURN_MEMORY;