summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-10-14 17:04:12 +0300
committerunknown <monty@hundin.mysql.fi>2002-10-14 17:04:12 +0300
commita86c172f582570dbc19554e85691c34869def66f (patch)
tree52bab9dcb504eb7603d26f7b3c33ec0945d8f248 /sql/table.cc
parent61632073ac9473e00d5e0c88078880d3af575828 (diff)
downloadmariadb-git-a86c172f582570dbc19554e85691c34869def66f.tar.gz
Fixed a bug in key optimizing handling where the expression
WHERE column_name = key_column_name was calculated as true for NULL values. Docs/manual.texi: Changelog mysql-test/r/distinct.result: Updated results caused by bug fix. mysql-test/r/null_key.result: New tests mysql-test/t/null_key.test: New tests sql/sql_select.cc: Additional change for previous changeset for using BLOB in GROUP BY
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 4f71dacfa1d..e0f5edbf262 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -455,6 +455,13 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
field->field_length=key_part->length;
}
}
+ /*
+ If the field can be NULL, don't optimize away the test
+ key_part_column = expression from the WHERE clause
+ as we need to test for NULL = NULL.
+ */
+ if (field->real_maybe_null())
+ key_part->key_part_flag|= HA_PART_KEY;
}
else
{ // Error: shorten key