[Maria-developers] Please review MDEV-10236 Where expression with NOT function gives incorrect result
Hi, Alexander! On Jun 22, Alexander Barkov wrote:
Hi Serg.
Please review a patch for MDEV-10236.
Thanks.
commit bb3afc8aea61bc090a1119be0a1dad32d9dc8feb Author: Alexander Barkov <bar@mariadb.org> Date: Wed Jun 22 16:30:15 2016 +0400
MDEV-10236 Where expression with NOT function gives incorrect result
Could you be more verbose in the comment please? I don't understand what was causing the bug or what you have fixed.
diff --git a/sql/item.h b/sql/item.h index bef57c4..93da398 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5050,7 +5050,7 @@ class Item_cache: public Item_basic_constant bool basic_const_item() const { return MY_TEST(example && example->basic_const_item()); } virtual void clear() { null_value= TRUE; value_cached= FALSE; } - bool is_null() { return null_value; } + bool is_null() { return !has_value(); } virtual bool is_expensive() { if (value_cached)
Regards, Sergei Chief Architect MariaDB and security@mariadb.org
Hi Sergei, On 06/26/2016 11:24 PM, Sergei Golubchik wrote:
Hi, Alexander!
On Jun 22, Alexander Barkov wrote:
Hi Serg.
Please review a patch for MDEV-10236.
Thanks.
commit bb3afc8aea61bc090a1119be0a1dad32d9dc8feb Author: Alexander Barkov <bar@mariadb.org> Date: Wed Jun 22 16:30:15 2016 +0400
MDEV-10236 Where expression with NOT function gives incorrect result
Could you be more verbose in the comment please? I don't understand what was causing the bug or what you have fixed.
Sure. This is a version with a better comment.
diff --git a/sql/item.h b/sql/item.h index bef57c4..93da398 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5050,7 +5050,7 @@ class Item_cache: public Item_basic_constant bool basic_const_item() const { return MY_TEST(example && example->basic_const_item()); } virtual void clear() { null_value= TRUE; value_cached= FALSE; } - bool is_null() { return null_value; } + bool is_null() { return !has_value(); } virtual bool is_expensive() { if (value_cached)
Regards, Sergei Chief Architect MariaDB and security@mariadb.org
Hi, Alexander! On Jun 27, Alexander Barkov wrote:
commit 1509b44ed12320cc037520cc6eeeca2a0a17fc65 Author: Alexander Barkov <bar@mariadb.org> Date: Mon Jun 27 11:45:40 2016 +0400
MDEV-10236 Where expression with NOT function gives incorrect result Item_cache::is_null() erroneously returned null_value in non-cached state. Now Item_cache::is_null() uses has_value(), which caches the value if necessarily, similar to what other value methods do (e.g. val_int, val_real, etc).
Always leave an empty line between the commit "subject" (the first line) and commit comment "body" (everything else). For example, if you'd used "git commit" and EDITOR=vim, it would've highlighted the second line red, because the second line must be empty. Github also splits the comment into the "subject" and a "body". Best to follow this convention. After that ok to push, thanks! Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (2)
-
Alexander Barkov
-
Sergei Golubchik