~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/row.cc

  • Committer: Mark Atwood
  • Date: 2011-11-20 08:50:16 UTC
  • mfrom: (2461.1.2 drizzle-build)
  • Revision ID: me@mark.atwood.name-20111120085016-2o4no5btx18x2gws
mergeĀ lp:~brianaker/drizzle/libdrizzle-refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                                 drizzle_return_t *ret_ptr)
70
70
{
71
71
  size_t total;
72
 
  drizzle_field_t field;
73
72
  drizzle_row_t row;
74
73
 
 
74
  if (result == NULL)
 
75
  {
 
76
    return drizzle_row_t();
 
77
  }
 
78
 
 
79
  drizzle_return_t unused;
 
80
  if (ret_ptr == NULL)
 
81
  {
 
82
    ret_ptr= &unused;
 
83
  }
 
84
 
75
85
  if (result->row == NULL)
76
86
  {
77
87
    if (drizzle_row_read(result, ret_ptr) == 0 || *ret_ptr != DRIZZLE_RETURN_OK)
 
88
    {
78
89
      return NULL;
79
 
 
80
 
    result->row= new drizzle_row_t_type[result->column_count *2];
 
90
    }
 
91
 
 
92
    result->row= new (std::nothrow) drizzle_row_t_type[result->column_count *2];
 
93
 
 
94
    if (result->row == NULL)
 
95
    {
 
96
      *ret_ptr= DRIZZLE_RETURN_MEMORY;
 
97
      return drizzle_row_t();
 
98
    }
81
99
    result->field_sizes= reinterpret_cast<size_t *>(result->row + result->column_count);
82
100
  }
83
101
 
84
102
  while (1)
85
103
  {
86
 
    field= drizzle_field_buffer(result, &total, ret_ptr);
 
104
    drizzle_field_t field= drizzle_field_buffer(result, &total, ret_ptr);
87
105
    if (*ret_ptr == DRIZZLE_RETURN_ROW_END)
 
106
    {
88
107
      break;
 
108
    }
 
109
 
89
110
    if (*ret_ptr != DRIZZLE_RETURN_OK)
90
111
    {
91
112
      if (*ret_ptr != DRIZZLE_RETURN_IO_WAIT)