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

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.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:
150
150
                           ~(E_DEC_OVERFLOW | E_DEC_BAD_NUM),
151
151
                           from, length, charset_arg,
152
152
                           &decimal_value)) &&
153
 
      table->in_use->abort_on_warning)
 
153
      getTable()->in_use->abort_on_warning)
154
154
  {
155
155
    /* Because "from" is not NUL-terminated and we use %s in the ER() */
156
156
    String from_as_str;
157
157
    from_as_str.copy(from, length, &my_charset_bin);
158
158
 
159
 
    push_warning_printf(table->in_use, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
 
159
    push_warning_printf(getTable()->in_use, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
160
160
                        ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
161
161
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
162
162
                        "decimal", from_as_str.c_ptr(), field_name,
163
 
                        (uint32_t) table->in_use->row_count);
 
163
                        (uint32_t) getTable()->in_use->row_count);
164
164
 
165
165
    return(err);
166
166
  }
180
180
      String from_as_str;
181
181
      from_as_str.copy(from, length, &my_charset_bin);
182
182
 
183
 
      push_warning_printf(table->in_use, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
183
      push_warning_printf(getTable()->in_use, DRIZZLE_ERROR::WARN_LEVEL_WARN,
184
184
                          ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
185
185
                          ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
186
186
                          "decimal", from_as_str.c_ptr(), field_name,
187
 
                          (uint32_t) table->in_use->row_count);
 
187
                          (uint32_t) getTable()->in_use->row_count);
188
188
      my_decimal_set_zero(&decimal_value);
189
189
 
190
190
      break;
216
216
    if (check_overflow(err))
217
217
      set_value_on_overflow(&decimal_value, decimal_value.sign());
218
218
    /* Only issue a warning if store_value doesn't issue an warning */
219
 
    table->in_use->got_warning= 0;
 
219
    getTable()->in_use->got_warning= 0;
220
220
  }
221
221
  if (store_value(&decimal_value))
222
222
    err= 1;
223
 
  else if (err && !table->in_use->got_warning)
 
223
  else if (err && !getTable()->in_use->got_warning)
224
224
    err= warn_if_overflow(err);
225
225
  return(err);
226
226
}
239
239
    if (check_overflow(err))
240
240
      set_value_on_overflow(&decimal_value, decimal_value.sign());
241
241
    /* Only issue a warning if store_value doesn't issue an warning */
242
 
    table->in_use->got_warning= 0;
 
242
    getTable()->in_use->got_warning= 0;
243
243
  }
244
244
  if (store_value(&decimal_value))
245
245
    err= 1;
246
 
  else if (err && !table->in_use->got_warning)
 
246
  else if (err && not getTable()->in_use->got_warning)
247
247
    err= warn_if_overflow(err);
248
248
  return err;
249
249
}