← Back to team overview

maria-developers team mailing list archive

Probably in a bug in simple_pred()


Hi Sergey,

I probably found a bug in simple_pred() in opt_sum.cc.

In this piece of code:

  case 3:
    /* field BETWEEN const AND const */
    item= func_item->arguments()[0]->real_item();
    if (item->type() == Item::FIELD_ITEM)
      args[0]= item;
      for (int i= 1 ; i <= 2; i++)
        item= func_item->arguments()[i]->real_item();
        if (!item->const_item())
          return 0;
        args[i]= item;
        if (check_item1_shorter_item2(args[0], args[1]))

Should't it be

if (check_item1_shorter_item2(args[0], args[i]))


          return 0;

If this is a bug, can you please help to make an SQL scrip which would
be affected by this bug?


Follow ups