~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/result.cc

  • Committer: Mark Atwood
  • Date: 2011-12-30 22:59:59 UTC
  • mfrom: (2478.1.3 drizzle-build)
  • Revision ID: me@mark.atwood.name-20111230225959-m3wdvqiymv3a4q2w
mergeĀ lp:~brianaker/drizzle/yacc-merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 * @brief Result definitions
41
41
 */
42
42
 
43
 
#include <libdrizzle-1.0/common.h>
 
43
#include <libdrizzle/common.h>
44
44
 
45
45
/*
46
46
 * Common definitions
56
56
 
57
57
  if (result == NULL)
58
58
  {
59
 
    result= new drizzle_result_st;
 
59
    result= new (std::nothrow) drizzle_result_st;
60
60
    if (result == NULL)
61
61
    {
62
 
      drizzle_set_error(con->drizzle, "drizzle_result_create", "malloc");
 
62
      drizzle_set_error(con->drizzle, __func__, "Failed to allocate.");
63
63
      return NULL;
64
64
    }
65
65
 
66
 
    memset(result, 0, sizeof(drizzle_result_st));
67
66
    result->options|= DRIZZLE_RESULT_ALLOCATED;
68
67
  }
69
68
  else
355
354
      if (row_list == NULL)
356
355
      {
357
356
        drizzle_row_free(result, row);
358
 
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer",
359
 
                          "realloc");
 
357
        drizzle_set_error(result->con->drizzle, __func__, "Failed to realloc row_list.");
360
358
        return DRIZZLE_RETURN_MEMORY;
361
359
      }
362
360
 
366
364
      if (field_sizes_list == NULL)
367
365
      {
368
366
        drizzle_row_free(result, row);
369
 
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer",
370
 
                          "realloc");
 
367
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer", "Failed to realloc field list.");
371
368
        return DRIZZLE_RETURN_MEMORY;
372
369
      }
373
370