~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/item/ident.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/current_session.h>
24
24
#include <drizzled/item/ident.h>
25
25
 
 
26
#include <cstdio>
 
27
 
26
28
using namespace std;
27
29
 
28
30
namespace drizzled
82
84
const char *Item_ident::full_name() const
83
85
{
84
86
  char *tmp;
 
87
        size_t tmp_len;
85
88
  if (!table_name || !field_name)
86
89
    return field_name ? field_name : name ? name : "tmp_field";
87
90
  if (db_name && db_name[0])
88
91
  {
89
 
    tmp=(char*) memory::sql_alloc((uint32_t) strlen(db_name)+(uint32_t) strlen(table_name)+
90
 
                          (uint32_t) strlen(field_name)+3);
91
 
    sprintf(tmp,"%s.%s.%s",db_name,table_name,field_name);
 
92
    tmp_len= strlen(db_name)+strlen(table_name)+strlen(field_name)+3;
 
93
    tmp= (char*) memory::sql_alloc(tmp_len);
 
94
    snprintf(tmp, tmp_len, "%s.%s.%s",db_name,table_name,field_name);
92
95
  }
93
96
  else
94
97
  {
95
98
    if (table_name[0])
96
99
    {
97
 
      tmp= (char*) memory::sql_alloc((uint32_t) strlen(table_name) +
98
 
                             (uint32_t) strlen(field_name) + 2);
99
 
      sprintf(tmp, "%s.%s", table_name, field_name);
 
100
      tmp_len=strlen(table_name)+strlen(field_name)+2;
 
101
      tmp= (char*) memory::sql_alloc(tmp_len);
 
102
      snprintf(tmp, tmp_len, "%s.%s", table_name, field_name);
100
103
    }
101
104
    else
102
105
      tmp= (char*) field_name;
188
191
  tmp_field->charsetnr= field->charset()->number;
189
192
  tmp_field->length=field->field_length;
190
193
  tmp_field->type=field->type();
191
 
  tmp_field->flags= field->table->maybe_null ?
 
194
  tmp_field->flags= field->getTable()->maybe_null ?
192
195
    (field->flags & ~NOT_NULL_FLAG) : field->flags;
193
196
  tmp_field->decimals= field->decimals();
194
197
}