Commit cf484bb1 authored by gshchepa/uchum@host.loc's avatar gshchepa/uchum@host.loc

Merge host.loc:/home/uchum/work/PP/5.0-opt-34620

into  host.loc:/home/uchum/work/5.1-opt
parents b8a47c98 c5110674
......@@ -434,3 +434,12 @@ SELECT @x;
@x
99
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1);
SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a;
ROW(a, 1) IN (SELECT SUM(b), 1)
1
SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a;
ROW(a, 1) IN (SELECT SUM(b), 3)
0
DROP TABLE t1;
......@@ -224,3 +224,16 @@ SET @x:= (SELECT h FROM t1 WHERE (a,b,c,d,e,f,g)=(1,2,3,4,5,6,7));
SELECT @x;
DROP TABLE t1;
#
# Bug #34620: item_row.cc:50: Item_row::illegal_method_call(const char*):
# Assertion `0' failed
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1);
SELECT ROW(a, 1) IN (SELECT SUM(b), 1) FROM t1 GROUP BY a;
SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a;
DROP TABLE t1;
......@@ -2157,6 +2157,35 @@ public:
Item_field *filed_for_view_update()
{ return (*ref)->filed_for_view_update(); }
virtual Ref_Type ref_type() { return REF; }
// Row emulation: forwarding of ROW-related calls to ref
uint cols()
{
return ref && result_type() == ROW_RESULT ? (*ref)->cols() : 1;
}
Item* element_index(uint i)
{
return ref && result_type() == ROW_RESULT ? (*ref)->element_index(i) : this;
}
Item** addr(uint i)
{
return ref && result_type() == ROW_RESULT ? (*ref)->addr(i) : 0;
}
bool check_cols(uint c)
{
return ref && result_type() == ROW_RESULT ? (*ref)->check_cols(c)
: Item::check_cols(c);
}
bool null_inside()
{
return ref && result_type() == ROW_RESULT ? (*ref)->null_inside() : 0;
}
void bring_value()
{
if (ref && result_type() == ROW_RESULT)
(*ref)->bring_value();
}
};
......
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