MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:eugene Date:November 14 2005 6:52pm
Subject:bk commit into 5.0 tree (evgen:1.1974) BUG#14850
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1974 05/11/14 21:52:39 evgen@stripped +3 -0
  Fix bug #14850 Item_ref's null_value wasn't updated
  
  Item_ref's null_value wasn't updated in save_org_in_field() causing reported
  error.

  mysql-test/t/view.test
    1.123 05/11/14 21:52:04 evgen@stripped +10 -0
     Test case for bug #14850 Item_ref's null_value wasn't updated

  mysql-test/r/view.result
    1.133 05/11/14 21:51:49 evgen@stripped +8 -0
    Test case for bug #14850 Item_ref's null_value wasn't updated

  sql/item.h
    1.180 05/11/14 21:51:09 evgen@stripped +5 -1
    Fix bug #14850 Item_ref's null_value wasn't updated
    Make save_org_in_field() update Item_ref's null_value.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	evgen
# Host:	moonbone.local
# Root:	/work/14850-bug-5.0-mysql

--- 1.179/sql/item.h	2005-11-03 13:55:07 +03:00
+++ 1.180/sql/item.h	2005-11-14 21:51:09 +03:00
@@ -1603,7 +1603,11 @@
   void make_field(Send_field *field);
   bool fix_fields(THD *, Item **);
   int save_in_field(Field *field, bool no_conversions);
-  void save_org_in_field(Field *field)	{ (*ref)->save_org_in_field(field); }
+  void save_org_in_field(Field *field)
+  {
+    (*ref)->save_org_in_field(field);
+    null_value= (*ref)->null_value;
+  }
   enum Item_result result_type () const { return (*ref)->result_type(); }
   enum_field_types field_type() const   { return (*ref)->field_type(); }
   Field *get_tmp_table_field()

--- 1.132/mysql-test/r/view.result	2005-11-10 22:24:51 +03:00
+++ 1.133/mysql-test/r/view.result	2005-11-14 21:51:49 +03:00
@@ -2385,3 +2385,11 @@
 View	Create View
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `v1` AS select 1 AS `1`
 drop view v1;
+create table t1(f1 int, f2 int);
+insert into t1 values (null, 10), (null,2);
+create view v1 as select * from t1;
+select f1, sum(f2) from v1 group by f1;
+f1	sum(f2)
+NULL	12
+drop view v1;
+drop table t1;

--- 1.122/mysql-test/t/view.test	2005-11-10 22:24:51 +03:00
+++ 1.123/mysql-test/t/view.test	2005-11-14 21:52:04 +03:00
@@ -2253,3 +2253,13 @@
 create definer = current_user sql security invoker view v1 as select 1;
 show create view v1;
 drop view v1;
+
+#
+# Bug #14850 Item_ref's values wasn't updated
+#
+create table t1(f1 int, f2 int);
+insert into t1 values (null, 10), (null,2);
+create view v1 as select * from t1;
+select f1, sum(f2) from v1 group by f1;
+drop view v1;
+drop table t1;
Thread
bk commit into 5.0 tree (evgen:1.1974) BUG#14850eugene14 Nov