Commit 500d6b85 authored by unknown's avatar unknown
Browse files

Fix for bug#17826 'type_decimal' fails with ps-protocol

 removed unnecessary calculation of cache value 
 otherwise Join::preapre tries to calculate 
 undefined values(filed values)


mysql-test/r/type_decimal.result:
  Fix for bug#17826 'type_decimal' fails with ps-protocol
   test case, this test case reproduce the same bug but without PS protocol
mysql-test/t/type_decimal.test:
  Fix for bug#17826 'type_decimal' fails with ps-protocol
   test case, this test case reproduce the same bug but without PS protocol
parent a91d0afd
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -772,3 +772,10 @@ productid zlevelprice
003trans	39.98
004trans	31.18
drop table t1, t2;
create table t1 (f1 decimal(5));
insert into t1 values (40);
flush tables;
select f1 from t1 where f1 in (select f1 from t1);
f1
40
drop table t1;
+8 −0
Original line number Diff line number Diff line
@@ -377,3 +377,11 @@ insert INTO t2 SELECT * FROM t1;
select * from t2; 
drop table t1, t2;

#
# Bug #17826 'type_decimal' fails with ps-protocol
#
create table t1 (f1 decimal(5));
insert into t1 values (40);
flush tables;
select f1 from t1 where f1 in (select f1 from t1);
drop table t1;
+0 −6
Original line number Diff line number Diff line
@@ -698,12 +698,6 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
    return 1;

  cache->setup(args[0]);
  /*
    If it is preparation PS only then we do not know values of parameters =>
    cant't get there values and do not need that values.
  */
  if (!thd->stmt_arena->is_stmt_prepare())
    cache->store(args[0]);
  if (cache->cols() == 1)
  {
    if ((used_tables_cache= args[0]->used_tables()))