summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-06-24 10:53:21 +0500
committerunknown <hf@deer.(none)>2003-06-24 10:53:21 +0500
commit3148d6f2a55211d02f63e4dc3a45f1d19ba536cd (patch)
tree31d4acfcfe7089167f37ea80cf5d57bc207f9240 /sql/field_conv.cc
parent83dc6b10db135f2448e5fa6218bb9b780f734c17 (diff)
downloadmariadb-git-3148d6f2a55211d02f63e4dc3a45f1d19ba536cd.tar.gz
Another bugfix for #615
Looks a bit nicer than previous one mysql-test/r/insert.result: Test results added mysql-test/t/insert.test: testcase for the bug added sql/field.h: Field::set_default fixed sql/field_conv.cc: Now we can just replace field->reset() with field->set_default() here
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index a32a635ac05..ce67455881b 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -118,10 +118,9 @@ set_field_to_null(Field *field)
field->reset();
return 0;
}
- field->reset();
+ field->set_default();
if (current_thd->count_cuted_fields)
{
- field->set_default();
current_thd->cuted_fields++; // Increment error counter
return 0;
}
@@ -171,12 +170,11 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
((Field_timestamp*) field)->set_time();
return 0; // Ok to set time to NULL
}
- field->reset();
+ field->set_default();
if (field == field->table->next_number_field)
return 0; // field is set in handler.cc
if (current_thd->count_cuted_fields)
{
- field->set_default();
current_thd->cuted_fields++; // Increment error counter
return 0;
}