1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
unknown
2002-10-14 17:04:12 +03:00
parent 61632073ac
commit a86c172f58
6 changed files with 79 additions and 5 deletions

View File

@ -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