diff options
author | monty@hundin.mysql.fi <> | 2002-10-14 17:04:12 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2002-10-14 17:04:12 +0300 |
commit | 68963e91b2e7195d82dea2f83a8525f9a69b72f5 (patch) | |
tree | 52bab9dcb504eb7603d26f7b3c33ec0945d8f248 /sql/table.cc | |
parent | 00e86fb5ccc46d4801514a7aae3cf636fc2a391b (diff) | |
download | mariadb-git-68963e91b2e7195d82dea2f83a8525f9a69b72f5.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.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 7 |
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 |