summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorhf@deer.(none) <>2003-06-20 18:52:40 +0500
committerhf@deer.(none) <>2003-06-20 18:52:40 +0500
commiteb901ea4611b5d682376fb5f885e229d499bdcc0 (patch)
treeda58a5e83fad43ca16d5673500cff6b3716a6391 /sql/field_conv.cc
parent10c81fb52d88436aaebfc2fb8a0952b7f59ce50f (diff)
downloadmariadb-git-eb901ea4611b5d682376fb5f885e229d499bdcc0.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?
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;
}