Commit 858eef45 authored by unknown's avatar unknown
Browse files

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/usr/home/ram/work/5.0.b12956


mysql-test/r/ps.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
parents 025d8c14 490a1e28
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ set @precision=10000000000;
select rand(), 
cast(rand(10)*@precision as unsigned integer) from t1;
rand()	cast(rand(10)*@precision as unsigned integer)
-	6570515219
-	6570515220
-	1282061302
-	6698761160
-	9647622201
@@ -348,23 +348,23 @@ prepare stmt from
set @var=1;
execute stmt using @var;
rand()	cast(rand(10)*@precision as unsigned integer)	cast(rand(?)*@precision as unsigned integer)
-	6570515219	-
-	6570515220	-
-	1282061302	-
-	6698761160	-
-	9647622201	-
set @var=2;
execute stmt using @var;
rand()	cast(rand(10)*@precision as unsigned integer)	cast(rand(?)*@precision as unsigned integer)
-	6570515219	6555866465
-	1282061302	1223466192
-	6698761160	6449731873
-	6570515220	6555866465
-	1282061302	1223466193
-	6698761160	6449731874
-	9647622201	8578261098
set @var=3;
execute stmt using @var;
rand()	cast(rand(10)*@precision as unsigned integer)	cast(rand(?)*@precision as unsigned integer)
-	6570515219	9057697559
-	6570515220	9057697560
-	1282061302	3730790581
-	6698761160	1480860534
-	6698761160	1480860535
-	9647622201	6211931236
drop table t1;
deallocate prepare stmt;
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ while ($1)
  SET @rnd= RAND();
  SET @id = CAST(@rnd * @rnd_max AS UNSIGNED);
  SET @id_rev= @rnd_max - @id;
  SET @grp= CAST(128.0 * @rnd AS UNSIGNED); 
  SET @grp= CAST(127.0 * @rnd AS UNSIGNED); 
  INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); 
  dec $1;
}
+2 −2
Original line number Diff line number Diff line
@@ -3953,7 +3953,7 @@ longlong Field_float::val_int(void)
  else
#endif
    memcpy_fixed((byte*) &j,ptr,sizeof(j));
  return ((longlong) j);
  return (longlong) rint(j);
}


@@ -4241,7 +4241,7 @@ longlong Field_double::val_int(void)
  else
#endif
    doubleget(j,ptr);
  return ((longlong) j);
  return (longlong) rint(j);
}


+2 −2
Original line number Diff line number Diff line
@@ -2459,7 +2459,7 @@ longlong Item_param::val_int()
{ 
  switch (state) {
  case REAL_VALUE:
    return (longlong) (value.real + (value.real > 0 ? 0.5 : -0.5));
    return (longlong) rint(value.real);
  case INT_VALUE:
    return value.integer;
  case DECIMAL_VALUE:
@@ -5441,7 +5441,7 @@ void Item_cache_real::store(Item *item)
longlong Item_cache_real::val_int()
{
  DBUG_ASSERT(fixed == 1);
  return (longlong) (value+(value > 0 ? 0.5 : -0.5));
  return (longlong) rint(value);
}


+2 −2
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ struct Hybrid_type_traits
  { val->real/= ulonglong2double(u); }

  virtual longlong val_int(Hybrid_type *val, bool unsigned_flag) const
  { return (longlong) val->real; }
  { return (longlong) rint(val->real); }
  virtual double val_real(Hybrid_type *val) const { return val->real; }
  virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const;
  virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const;
@@ -1354,7 +1354,7 @@ class Item_float :public Item_num
    {
      return LONGLONG_MAX;
    }
    return (longlong) (value+(value > 0 ? 0.5 : -0.5));
    return (longlong) rint(value);
  }
  String *val_str(String*);
  my_decimal *val_decimal(my_decimal *);
Loading