~stewart/drizzle/remove-unused-row-type-in-table-message

« back to all changes in this revision

Viewing changes to drizzled/field/str.cc

  • Committer: Brian Aker
  • Date: 2010-06-22 19:48:34 UTC
  • Revision ID: brian@gaz-20100622194834-xrx8ujqxj22m60kq
Merge in changes to call error on bad data input.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
{
76
76
  if ((field_ptr < end) && table->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;