summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-06-20 18:52:40 +0500
committerunknown <hf@deer.(none)>2003-06-20 18:52:40 +0500
commit83dc6b10db135f2448e5fa6218bb9b780f734c17 (patch)
treeda58a5e83fad43ca16d5673500cff6b3716a6391 /sql/field_conv.cc
parent332334e837331cecb5344e3cbd2c91dc3d0cbca9 (diff)
downloadmariadb-git-83dc6b10db135f2448e5fa6218bb9b780f734c17.tar.gz
Proposed fix for #615
So now for the CREATE TABLE foo (id integer NOT NULL default 9) INSERT INTO foo VALUES (NULL); we get an error INSERT INTO foo VALUES (1), (NULL), (2); we get one warning and second record is set to 9 Is that what we want? sql/field_conv.cc: field->set_default() calls added
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 42272dd616f..a32a635ac05 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -121,6 +121,7 @@ set_field_to_null(Field *field)
field->reset();
if (current_thd->count_cuted_fields)
{
+ field->set_default();
current_thd->cuted_fields++; // Increment error counter
return 0;
}
@@ -175,6 +176,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
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;
}