~maria-captains/maria/mysql-6.0-backup

« back to all changes in this revision

Viewing changes to storage/csv/ha_tina.cc

  • Committer: Thava Alagu
  • Date: 2010-03-11 19:18:17 UTC
  • mfrom: (3719.14.62 mysql-6.0-codebase)
  • Revision ID: thavamuni.alagu@sun.com-20100311191817-5nigmq884xo9fuut
Merge from mysql-6.0-codebase

Show diffs side-by-side

added added

removed removed

Lines of Context:
784
784
 
785
785
    if (read_all || bitmap_is_set(table->read_set, (*field)->field_index))
786
786
    {
 
787
      bool is_enum= ((*field)->real_type() ==  MYSQL_TYPE_ENUM);
 
788
      /*
 
789
        Here CHECK_FIELD_WARN checks that all values in the csv file are valid
 
790
        which is normally the case, if they were written  by
 
791
        INSERT -> ha_tina::write_row. '0' values on ENUM fields are considered
 
792
        invalid by Field_enum::store() but it can store them on INSERT anyway.
 
793
        Thus, for enums we silence the warning, as it doesn't really mean
 
794
        an invalid value.
 
795
      */
787
796
      if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(),
788
 
                          CHECK_FIELD_WARN))
789
 
        goto err;
 
797
                          is_enum ? CHECK_FIELD_IGNORE : CHECK_FIELD_WARN))
 
798
      {
 
799
        if (!is_enum)
 
800
          goto err;
 
801
      }
790
802
      if ((*field)->flags & BLOB_FLAG)
791
803
      {
792
804
        Field_blob *blob= *(Field_blob**) field;