diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-02-22 16:58:56 +0000 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2010-02-22 16:58:56 +0000 |
commit | dad7b3c55e2f4da0d3b03e561bea20153b03a720 (patch) | |
tree | f05f0f42b9c1d3478e2f9d5adc66deed7585176d /sql/field_conv.cc | |
parent | 7d8bed112c7ddb59b134102f36999dedce370823 (diff) | |
download | mariadb-git-dad7b3c55e2f4da0d3b03e561bea20153b03a720.tar.gz |
revert 48525
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 0bffde9671a..3574534722e 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -122,18 +122,13 @@ set_field_to_null(Field *field) return 0; } field->reset(); - switch (field->table->in_use->count_cuted_fields) { - case CHECK_FIELD_WARN: + if (field->table->in_use->count_cuted_fields == CHECK_FIELD_WARN) + { field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1); - /* fall through */ - case CHECK_FIELD_IGNORE: return 0; - case CHECK_FIELD_ERROR_FOR_NULL: - if (!field->table->in_use->no_errors) - my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); - return -1; } - DBUG_ASSERT(0); // impossible + if (!field->table->in_use->no_errors) + my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); return -1; } @@ -183,18 +178,13 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions) field->table->auto_increment_field_not_null= FALSE; return 0; // field is set in fill_record() } - switch (field->table->in_use->count_cuted_fields) { - case CHECK_FIELD_WARN: + if (field->table->in_use->count_cuted_fields == CHECK_FIELD_WARN) + { field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_NULL_ERROR, 1); - /* fall through */ - case CHECK_FIELD_IGNORE: return 0; - case CHECK_FIELD_ERROR_FOR_NULL: - if (!field->table->in_use->no_errors) - my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); - return -1; } - DBUG_ASSERT(0); // impossible + if (!field->table->in_use->no_errors) + my_error(ER_BAD_NULL_ERROR, MYF(0), field->field_name); return -1; } |