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

« back to all changes in this revision

Viewing changes to drizzled/field/str.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:
73
73
int
74
74
Field_str::report_if_important_data(const char *field_ptr, const char *end)
75
75
{
76
 
  if ((field_ptr < end) && table->in_use->count_cuted_fields)
 
76
  if ((field_ptr < end) && getTable()->in_use->count_cuted_fields)
77
77
  {
78
 
    if (test_if_important_data(field_charset, field_ptr, end))
79
 
    {
80
 
      if (table->in_use->abort_on_warning)
81
 
        set_warning(DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
82
 
      else
83
 
        set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
84
 
    }
85
 
    else /* If we lost only spaces then produce a NOTE, not a WARNING */
86
 
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_WARN_DATA_TRUNCATED, 1);
 
78
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
 
79
 
87
80
    return 2;
88
81
  }
89
82
  return 0;
144
137
  length= internal::my_gcvt(nr, internal::MY_GCVT_ARG_DOUBLE, local_char_length, buff, &error);
145
138
  if (error)
146
139
  {
147
 
    if (table->in_use->abort_on_warning)
 
140
    if (getTable()->in_use->abort_on_warning)
148
141
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
149
142
    else
150
143
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
201
194
    *t++= '.';
202
195
  }
203
196
  *t= '\0';
204
 
  push_warning_printf(field->table->in_use,
205
 
                      field->table->in_use->abort_on_warning ?
 
197
  push_warning_printf(field->getTable()->in_use,
 
198
                      field->getTable()->in_use->abort_on_warning ?
206
199
                      DRIZZLE_ERROR::WARN_LEVEL_ERROR :
207
200
                      DRIZZLE_ERROR::WARN_LEVEL_WARN,
208
201
                      ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
209
202
                      ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
210
203
                      "string", tmp, field->field_name,
211
 
                      (uint32_t) field->table->in_use->row_count);
 
204
                      (uint32_t) field->getTable()->in_use->row_count);
212
205
  return true;
213
206
}
214
207