Commit 1bf6de2c authored by unknown's avatar unknown

fixed bug #745

(resolving fields of reduced subselect)


mysql-test/r/subselect.result:
  test of bug #745
mysql-test/t/subselect.test:
  test of bug #745
sql/sql_union.cc:
  to get chance of outer resolved_fields resolve fields of result table as usual fileds
parent 6a854da7
......@@ -1172,3 +1172,6 @@ a b
test test
test1 test1
drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
......@@ -763,3 +763,5 @@ CREATE TABLE `t1` (
INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1');
SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1);
drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
......@@ -344,7 +344,8 @@ int st_select_lex_unit::exec()
if (select_limit_cnt == HA_POS_ERROR)
thd->options&= ~OPTION_FOUND_ROWS;
fake_select->ftfunc_list= &empty_list;
fake_select->table_list.link_in_list((byte *)&result_table_list,
(byte **)&result_table_list.next);
res= mysql_select(thd, &ref_pointer_array, &result_table_list,
0, item_list, NULL,
global_parameters->order_list.elements,
......
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