diff options
author | unknown <knielsen@knielsen-hq.org> | 2010-04-28 14:52:24 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2010-04-28 14:52:24 +0200 |
commit | b1e00b6be81c80b09d11085d77d86978e26df988 (patch) | |
tree | bb1fdd7363fbf2580572ac9a56dbd4c933cc4c0d /storage/csv | |
parent | 1f683a7270e63abfadce20c6f51370621ff065e1 (diff) | |
parent | c9cfd2df5f2f58c2cdf716999ebea252c307333f (diff) | |
download | mariadb-git-b1e00b6be81c80b09d11085d77d86978e26df988.tar.gz |
Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
Diffstat (limited to 'storage/csv')
-rw-r--r-- | storage/csv/ha_tina.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 3fda2239b34..8a30467f16c 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -679,9 +679,21 @@ int ha_tina::find_current_row(uchar *buf) if (read_all || bitmap_is_set(table->read_set, (*field)->field_index)) { + bool is_enum= ((*field)->real_type() == MYSQL_TYPE_ENUM); + /* + Here CHECK_FIELD_WARN checks that all values in the csv file are valid + which is normally the case, if they were written by + INSERT -> ha_tina::write_row. '0' values on ENUM fields are considered + invalid by Field_enum::store() but it can store them on INSERT anyway. + Thus, for enums we silence the warning, as it doesn't really mean + an invalid value. + */ if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(), - CHECK_FIELD_WARN)) - goto err; + is_enum ? CHECK_FIELD_IGNORE : CHECK_FIELD_WARN)) + { + if (!is_enum) + goto err; + } if ((*field)->flags & BLOB_FLAG) { Field_blob *blob= *(Field_blob**) field; |