Commit ebc2976f authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fixed bug #745

(resolving fields of reduced subselect)
parent 08f8ab59
...@@ -1172,3 +1172,6 @@ a b ...@@ -1172,3 +1172,6 @@ a b
test test test test
test1 test1 test1 test1
drop table if exists t1; 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` ( ...@@ -763,3 +763,5 @@ CREATE TABLE `t1` (
INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1'); 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); SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1);
drop table if exists t1; 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() ...@@ -344,7 +344,8 @@ int st_select_lex_unit::exec()
if (select_limit_cnt == HA_POS_ERROR) if (select_limit_cnt == HA_POS_ERROR)
thd->options&= ~OPTION_FOUND_ROWS; thd->options&= ~OPTION_FOUND_ROWS;
fake_select->ftfunc_list= &empty_list; 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, res= mysql_select(thd, &ref_pointer_array, &result_table_list,
0, item_list, NULL, 0, item_list, NULL,
global_parameters->order_list.elements, 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