Commit e6a4c0ba authored by unknown's avatar unknown

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

into  host.loc:/home/uchum/work/5.0-opt-34763
parents dad47218 d05c8d38
......@@ -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;
......@@ -1990,6 +1990,35 @@ class Item_ref :public Item_ident
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