List:Commits« Previous MessageNext Message »
From:kgeorge Date:January 24 2007 1:58pm
Subject:bk commit into 5.1 tree (gkodinov:1.2395)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kgeorge. When kgeorge 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@stripped, 2007-01-24 15:57:58+02:00, gkodinov@stripped +3 -0
  Merge bk-internal:/home/bk/mysql-5.1-opt
  into  macbook.gmz:/Users/kgeorge/mysql/work/merge-5.1-opt
  MERGE: 1.2392.1.2

  mysql-test/r/view.result@stripped, 2007-01-24 15:57:45+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.194.1.1

  mysql-test/t/view.test@stripped, 2007-01-24 15:57:46+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.175.1.1

  sql/item_func.cc@stripped, 2007-01-24 15:57:46+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.345.1.1

# 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:	gkodinov
# Host:	macbook.gmz
# Root:	/Users/kgeorge/mysql/work/merge-5.1-opt/RESYNC

--- 1.346/sql/item_func.cc	2007-01-23 11:56:50 +02:00
+++ 1.347/sql/item_func.cc	2007-01-24 15:57:46 +02:00
@@ -2042,6 +2042,18 @@ my_decimal *Item_func_round::decimal_op(
 }
 
 
+void Item_func_rand::seed_random(Item *arg)
+{
+  /*
+    TODO: do not do reinit 'rand' for every execute of PS/SP if
+    args[0] is a constant.
+  */
+  uint32 tmp= (uint32) arg->val_int();
+  randominit(rand, (uint32) (tmp*0x10001L+55555555L),
+             (uint32) (tmp*0x10000001L));
+}
+
+
 bool Item_func_rand::fix_fields(THD *thd,Item **ref)
 {
   if (Item_real_func::fix_fields(thd, ref))
@@ -2049,11 +2061,6 @@ bool Item_func_rand::fix_fields(THD *thd
   used_tables_cache|= RAND_TABLE_BIT;
   if (arg_count)
   {					// Only use argument once in query
-    if (!args[0]->const_during_execution())
-    {
-      my_error(ER_WRONG_ARGUMENTS, MYF(0), "RAND");
-      return TRUE;
-    }
     /*
       Allocate rand structure once: we must use thd->stmt_arena
       to create rand in proper mem_root if it's a prepared statement or
@@ -2065,20 +2072,9 @@ bool Item_func_rand::fix_fields(THD *thd
     if (!rand && !(rand= (struct rand_struct*)
                    thd->stmt_arena->alloc(sizeof(*rand))))
       return TRUE;
-    /*
-      PARAM_ITEM is returned if we're in statement prepare and consequently
-      no placeholder value is set yet.
-    */
-    if (args[0]->type() != PARAM_ITEM)
-    {
-      /*
-        TODO: do not do reinit 'rand' for every execute of PS/SP if
-        args[0] is a constant.
-      */
-      uint32 tmp= (uint32) args[0]->val_int();
-      randominit(rand, (uint32) (tmp*0x10001L+55555555L),
-                 (uint32) (tmp*0x10000001L));
-    }
+
+    if (args[0]->const_item())
+      seed_random (args[0]);
   }
   else
   {
@@ -2108,6 +2104,8 @@ void Item_func_rand::update_used_tables(
 double Item_func_rand::val_real()
 {
   DBUG_ASSERT(fixed == 1);
+  if (arg_count && !args[0]->const_item())
+    seed_random (args[0]);
   return my_rnd(rand);
 }
 

--- 1.196/mysql-test/r/view.result	2007-01-24 15:55:01 +02:00
+++ 1.197/mysql-test/r/view.result	2007-01-24 15:57:45 +02:00
@@ -2060,17 +2060,6 @@ CALL p1();
 DROP PROCEDURE p1;
 DROP VIEW v1;
 DROP TABLE t1;
-create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
-create view v1 as select * from t1;
-desc v1;
-Field	Type	Null	Key	Default	Extra
-f1	tinyint(1)	YES		NULL	
-f2	char(1)	YES		NULL	
-f3	varchar(1)	YES		NULL	
-f4	geometry	YES		NULL	
-f5	datetime	YES		NULL	
-drop view v1;
-drop table t1;
 create table t1(f1 datetime);
 insert into t1 values('2005.01.01 12:0:0');
 create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1;

--- 1.176/mysql-test/t/view.test	2007-01-23 12:34:34 +02:00
+++ 1.177/mysql-test/t/view.test	2007-01-24 15:57:46 +02:00
@@ -1879,15 +1879,6 @@ DROP VIEW v1;
 DROP TABLE t1;
 
 #
-# Bug #11335 View redefines column types
-#
-create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
-create view v1 as select * from t1;
-desc v1;
-drop view v1;
-drop table t1;
-
-#
 # Bug #11760 Typo in Item_func_add_time::print() results in NULLs returned
 #             subtime() in view
 create table t1(f1 datetime);
Thread
bk commit into 5.1 tree (gkodinov:1.2395)kgeorge24 Jan