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

Fix bugs in LEFT JOIN and field=NUL

BUILD/FINISH.sh:
  Remove all config.cache files
BUILD/compile-alpha-debug:
  Update
BUILD/compile-ia64-debug-max:
  Update
Docs/manual.texi:
  Added auto_increment example
sql/sql_select.cc:
  Fix bugs in LEFT JOIN and field=NULL
sql/sql_yacc.yy:
  Remove compiler warnings
This commit is contained in:
unknown
2001-10-20 11:04:23 +03:00
parent 02cbb3fa80
commit fef5292a47
6 changed files with 75 additions and 14 deletions

View File

@ -5084,15 +5084,15 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
static bool test_if_ref(Item_field *left_item,Item *right_item)
{
Field *field=left_item->field;
if (!field->table->const_table) // No need to change const test
// No need to change const test. We also have to keep tests on LEFT JOIN
if (!field->table->const_table && !field->table->maybe_null)
{
Item *ref_item=part_of_refkey(field->table,field);
if (ref_item && ref_item->eq(right_item))
{
if (right_item->type() == Item::FIELD_ITEM)
return (field->eq_def(((Item_field *) right_item)->field) &&
!field->table->maybe_null);
if (right_item->const_item())
return (field->eq_def(((Item_field *) right_item)->field));
if (right_item->const_item() && !(right_item->is_null()))
{
// We can remove binary fields and numerical fields except float,
// as float comparison isn't 100 % secure