diff options
author | monty@mashka.mysql.fi <> | 2002-12-05 19:38:42 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-12-05 19:38:42 +0200 |
commit | 859b68847666823baa328c5c7f3da96787807bb3 (patch) | |
tree | 56f9dc35fe3c9e6c4f341e577ff3db68855d9e81 /sql/field_conv.cc | |
parent | 564487d7c00098e8a37c8e675197414667685452 (diff) | |
parent | 496a0e1630f9dc4047fb5244cb87ee5ca03b409e (diff) | |
download | mariadb-git-859b68847666823baa328c5c7f3da96787807bb3.tar.gz |
Merge with 4.0.6
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index ab71f324732..409c22d61d4 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -122,8 +122,26 @@ set_field_to_null(Field *field) } +/* + Set field to NULL or TIMESTAMP or to next auto_increment number + + SYNOPSIS + set_field_to_null_with_conversions() + field Field to update + no_conversion Set to 1 if we should return 1 if field can't + take null values. + If set to 0 we will do store the 'default value' + if the field is a special field. If not we will + give an error. + + RETURN VALUES + 0 Field could take 0 or an automatic conversion was used + 1 Field could not take NULL and no conversion was used. + If no_conversion was not set, an error message is printed +*/ + bool -set_field_to_null_with_conversions(Field *field) +set_field_to_null_with_conversions(Field *field, bool no_conversions) { if (field->real_maybe_null()) { @@ -131,6 +149,8 @@ set_field_to_null_with_conversions(Field *field) field->reset(); return 0; } + if (no_conversions) + return 1; /* Check if this is a special type, which will get a special walue @@ -156,8 +176,6 @@ set_field_to_null_with_conversions(Field *field) } - - static void do_skip(Copy_field *copy __attribute__((unused))) { } |