~linuxjedi/libdrizzle/5.1-docs2

« back to all changes in this revision

Viewing changes to libdrizzle/column.cc

  • Committer: Continuous Integration
  • Date: 2013-01-13 20:18:49 UTC
  • mfrom: (90.1.4 5.1-malloc-replace)
  • Revision ID: ci@drizzle.org-20130113201849-a0to8usgbnbf5sch
Merge lp:~linuxjedi/libdrizzle/5.1-malloc-replace Build: jenkins-Libdrizzle-46

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    return NULL;
57
57
  }
58
58
 
59
 
  column= (drizzle_column_st*)malloc(sizeof(drizzle_column_st));
 
59
  column= new (std::nothrow) drizzle_column_st;
60
60
  if (column == NULL)
61
61
  {
62
62
    drizzle_set_error(result->con, __func__, "Failed to allocate.");
63
63
    return NULL;
64
64
  }
65
65
 
66
 
  column->result = result;
67
 
  column->options= DRIZZLE_COLUMN_UNUSED;
68
 
  /* SET BELOW: column->next */
69
 
  column->prev = NULL;
70
 
  column->catalog[0] = '\0';
71
 
  column->db[0] = '\0';
72
 
  column->table[0] = '\0';
73
 
  column->orig_table[0] = '\0';
74
 
  column->name[0] = '\0';
75
 
  column->orig_name[0] = '\0';
76
 
  column->charset = DRIZZLE_CHARSET_NONE;
77
 
  column->size = 0;
78
 
  column->max_size = 0;
79
 
  column->type= (drizzle_column_type_t)0;
80
 
  column->flags = 0;
81
 
  column->decimals = 0;
82
 
  /* UNSET: column->default_value */
83
 
  column->default_value_size = 0;
84
 
 
85
66
  column->result= result;
86
67
 
87
68
  if (result->column_list)
109
90
  if (column->next)
110
91
    column->next->prev= column->prev;
111
92
 
112
 
  free(column);
 
93
  delete column;
113
94
}
114
95
 
115
96
drizzle_result_st *drizzle_column_drizzle_result(drizzle_column_st *column)
341
322
      return DRIZZLE_RETURN_OK;
342
323
    }
343
324
 
344
 
    result->column_buffer= (drizzle_column_st*)calloc(result->column_count, sizeof(drizzle_column_st));
 
325
    result->column_buffer= new (std::nothrow) drizzle_column_st[result->column_count];
345
326
    if (result->column_buffer == NULL)
346
327
    {
347
328
      drizzle_set_error(result->con, __func__, "Failed to allocate.");