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)
parent 7ae10acb
...@@ -772,3 +772,10 @@ productid zlevelprice ...@@ -772,3 +772,10 @@ productid zlevelprice
003trans 39.98 003trans 39.98
004trans 31.18 004trans 31.18
drop table t1, t2; 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;
...@@ -377,3 +377,11 @@ insert INTO t2 SELECT * FROM t1; ...@@ -377,3 +377,11 @@ insert INTO t2 SELECT * FROM t1;
select * from t2; select * from t2;
drop table t1, 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;
...@@ -698,12 +698,6 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref) ...@@ -698,12 +698,6 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
return 1; return 1;
cache->setup(args[0]); 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 (cache->cols() == 1)
{ {
if ((used_tables_cache= args[0]->used_tables())) if ((used_tables_cache= args[0]->used_tables()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment