List:Internals« Previous MessageNext Message »
From:eugene Date:June 22 2005 12:48am
Subject:bk commit into 5.0 tree (evgen:1.1976)
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.1976 05/06/22 04:48:25 evgen@stripped +4 -0
  Merge epotemkin@stripped:/home/bk/mysql-5.0
  into  moonbone.local:/work/mysql-5.0-bug-11298

  mysql-test/t/view.test
    1.74 05/06/22 04:48:23 evgen@stripped +0 -0
    SCCS merged

  mysql-test/r/view.result
    1.85 05/06/22 04:48:23 evgen@stripped +0 -0
    SCCS merged

  sql/item.h
    1.143 05/06/22 04:45:41 evgen@stripped +0 -0
    Auto merged

  sql/item.cc
    1.139 05/06/22 04:45:41 evgen@stripped +0 -0
    Auto merged

# 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/mysql-5.0-bug-11298/RESYNC

--- 1.138/sql/item.cc	2005-06-21 21:44:13 +04:00
+++ 1.139/sql/item.cc	2005-06-22 04:45:41 +04:00
@@ -4361,6 +4361,28 @@
   return val;
 }
 
+int Item_ref::save_in_field(Field *to, bool no_conversions)
+{
+  int res;
+  if(result_field){
+    if (result_field->is_null())
+    {
+      null_value= 1;
+      return set_field_to_null_with_conversions(to, no_conversions);
+    }
+    else
+    {
+      to->set_notnull();
+      field_conv(to, result_field);
+      null_value= 0;
+    }
+    return 0;
+  }
+  res= (*ref)->save_in_field(to, no_conversions);
+  null_value= (*ref)->null_value;
+  return res;
+}
+
 
 void Item_ref_null_helper::print(String *str)
 {

--- 1.142/sql/item.h	2005-06-21 21:44:13 +04:00
+++ 1.143/sql/item.h	2005-06-22 04:45:41 +04:00
@@ -1345,8 +1345,7 @@
   bool send(Protocol *prot, String *tmp);
   void make_field(Send_field *field)	{ (*ref)->make_field(field); }
   bool fix_fields(THD *, struct st_table_list *, Item **);
-  int save_in_field(Field *field, bool no_conversions)
-  { return (*ref)->save_in_field(field, no_conversions); }
+  int save_in_field(Field *field, bool no_conversions);
   void save_org_in_field(Field *field)	{ (*ref)->save_org_in_field(field); }
   enum Item_result result_type () const { return (*ref)->result_type(); }
   enum_field_types field_type() const   { return (*ref)->field_type(); }

--- 1.84/mysql-test/r/view.result	2005-06-21 21:44:13 +04:00
+++ 1.85/mysql-test/r/view.result	2005-06-22 04:48:23 +04:00
@@ -1757,6 +1757,20 @@
 cast(1 as decimal)
 1.00
 drop view v1;
+create table t1(f1 int);
+create table t2(f2 int);
+insert into t1 values(1),(2),(3);
+insert into t2 values(1),(2),(3);
+create view v1 as select * from t1,t2 where f1=f2;
+create table t3 (f1 int, f2 int);
+insert into t3 select * from v1 order by 1;
+select * from t3;
+f1	f2
+1	1
+2	2
+3	3
+drop view v1;
+drop table t1,t2,t3;
 create view v1 as select '\\','\\shazam';
 select * from v1;
 \	\shazam

--- 1.73/mysql-test/t/view.test	2005-06-21 21:44:13 +04:00
+++ 1.74/mysql-test/t/view.test	2005-06-22 04:48:23 +04:00
@@ -1599,6 +1599,19 @@
 create view v1 as select cast(1 as decimal);
 select * from v1;
 drop view v1;
+#
+# Bug#11298 insert into select from VIEW produces incorrect result when 
+#           using ORDER BY
+create table t1(f1 int);
+create table t2(f2 int);
+insert into t1 values(1),(2),(3);
+insert into t2 values(1),(2),(3);
+create view v1 as select * from t1,t2 where f1=f2;
+create table t3 (f1 int, f2 int);
+insert into t3 select * from v1 order by 1;
+select * from t3;
+drop view v1;
+drop table t1,t2,t3;
 
 #
 # Generation unique names for columns, and correct names check (BUG#7448)
Thread
bk commit into 5.0 tree (evgen:1.1976)eugene21 Jun