summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-09-08 23:11:15 +0200
committerunknown <serg@serg.mylan>2005-09-08 23:11:15 +0200
commit60dd90d1c8aeccc324f7fec1ae61aed4e57bfaca (patch)
tree11a0d1bf2df1fd833c6054932a138ac841e8f60f
parent75f2a27b142a182ea5c4c426f178717532fe9e80 (diff)
parent46ea38514ab1330f9e975c916bad5af117d2b8c6 (diff)
downloadmariadb-git-60dd90d1c8aeccc324f7fec1ae61aed4e57bfaca.tar.gz
Merge serg@bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1 sql/item_cmpfunc.h: Auto merged
-rw-r--r--mysql-test/r/group_by.result9
-rw-r--r--mysql-test/t/group_by.test10
-rw-r--r--sql/item_cmpfunc.h2
3 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 8287a042d60..4ad28091164 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -764,3 +764,12 @@ select date(left(f1+0,8)) from t1 group by 1;
date(left(f1+0,8))
2005-06-06
drop table t1;
+create table t1(f1 varchar(5) key);
+insert into t1 values (1),(2);
+select sql_buffer_result max(f1) is null from t1;
+max(f1) is null
+0
+select sql_buffer_result max(f1)+1 from t1;
+max(f1)+1
+3
+drop table t1;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 815da66c717..f14fab2d30e 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -600,4 +600,14 @@ insert into t1 values('2005-06-06');
select date(left(f1+0,8)) from t1 group by 1;
drop table t1;
+#
+# BUG#12695: Item_func_isnull::update_used_tables
+# did not update const_item_cache
+#
+create table t1(f1 varchar(5) key);
+insert into t1 values (1),(2);
+select sql_buffer_result max(f1) is null from t1;
+select sql_buffer_result max(f1)+1 from t1;
+drop table t1;
+
# End of 4.1 tests
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 03ab9c5b34d..741ae90108a 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -826,7 +826,7 @@ public:
else
{
args[0]->update_used_tables();
- if (!(used_tables_cache=args[0]->used_tables()))
+ if ((const_item_cache= !(used_tables_cache= args[0]->used_tables())))
{
/* Remember if the value is always NULL or never NULL */
cached_value= (longlong) args[0]->is_null();