[Maria-developers] Probably in a bug in simple_pred()
![](https://secure.gravatar.com/avatar/68ff00c1752bf8aede68a05f77ebd28b.jpg?s=120&d=mm&r=g)
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? Thanks.
![](https://secure.gravatar.com/avatar/68ff00c1752bf8aede68a05f77ebd28b.jpg?s=120&d=mm&r=g)
Hi Sergey, did you have a chance to have a look into this? Thanks. On 05/26/2015 09:39 AM, Alexander Barkov wrote:
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?
Thanks.
![](https://secure.gravatar.com/avatar/68ff00c1752bf8aede68a05f77ebd28b.jpg?s=120&d=mm&r=g)
Hi Sergey, Will you have time to have a look into this please? Thanks. On 05/28/2015 10:19 PM, Alexander Barkov wrote:
Hi Sergey,
did you have a chance to have a look into this?
Thanks.
On 05/26/2015 09:39 AM, Alexander Barkov wrote:
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?
Thanks.
![](https://secure.gravatar.com/avatar/c7422c379fec4aa4d99a8a137bf10594.jpg?s=120&d=mm&r=g)
Yes, will look. On Thu, Jun 04, 2015 at 02:05:11PM +0400, Alexander Barkov wrote:
Hi Sergey,
Will you have time to have a look into this please?
Thanks.
On 05/28/2015 10:19 PM, Alexander Barkov wrote:
Hi Sergey,
did you have a chance to have a look into this?
Thanks.
On 05/26/2015 09:39 AM, Alexander Barkov wrote:
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?
Thanks.
-- BR Sergei -- Sergei Petrunia, Software Developer MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog
participants (2)
-
Alexander Barkov
-
Sergey Petrunia