summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-12-03 13:08:25 +0200
committerunknown <monty@hundin.mysql.fi>2002-12-03 13:08:25 +0200
commit80b143c111fc3df20e3fe2dcfe4880c30b001498 (patch)
tree4cad7c11d248679cf59fce6e92c37d2d7dc6e486 /sql/field_conv.cc
parent4f221e351df6c05fdeb95d0b328cf155204195cd (diff)
downloadmariadb-git-80b143c111fc3df20e3fe2dcfe4880c30b001498.tar.gz
Change of internal key_field=NULL handling to avoid error messages.
Optimized SELECT DISTINCT ... ORDER BY ... LIMIT Fixed reference to uninitalized variable mysql-test/r/distinct.result: Updated results for new tests mysql-test/r/func_math.result: Fixed test of RND() mysql-test/r/innodb.result: Updated results for new tests mysql-test/r/null.result: Updated results for new tests mysql-test/t/distinct.test: New distinct test mysql-test/t/func_math.test: Fixed test of RND() mysql-test/t/innodb.test: Test for bugs mysql-test/t/null.test: TEst for bugs sql/field.h: Change of NULL handling to avoid error messages sql/field_conv.cc: Change of NULL handling to avoid error messages sql/item.cc: Change of NULL handling to avoid error messages sql/item.h: Change of NULL handling to avoid error messages sql/item_cmpfunc.cc: Change of NULL handling to avoid error messages sql/item_func.cc: Change of NULL handling to avoid error messages sql/item_func.h: Cleaned up RND() handling sql/item_timefunc.cc: Change of NULL handling to avoid error messages sql/item_timefunc.h: Change of NULL handling to avoid error messages sql/opt_range.cc: Fixed bug in <=> NULL sql/password.c: Indentation cleanup sql/sql_base.cc: Change of NULL handling to avoid error messages sql/sql_class.cc: Fixed reference to uninitalized variable sql/sql_handler.cc: Change of NULL handling to avoid error messages sql/sql_select.cc: Change of NULL handling to avoid error messages Optimized SELECT DISTINCT ... ORDER BY ... LIMIT sql/sql_select.h: Change of NULL handling to avoid error messages sql/unireg.cc: Change of NULL handling to avoid error messages
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 53b26920c14..ffc93f3e871 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)))
{
}