mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
skip resolving field in table list if table list is not accessable due to groupping (BUG#4814)
mysql-test/r/func_gconcat.result: fix of test queries mysql-test/r/subselect.result: resolving fields of grouped outer SELECT mysql-test/t/func_gconcat.test: fix of test queries mysql-test/t/subselect.test: resolving fields of grouped outer SELECT sql/item.cc: skip resolving field in table list if table list is not accessable due to groupping layout fixed sql/item_subselect.cc: detection of place of subquery sql/item_subselect.h: detection of place of subquery sql/mysql_priv.h: enum_parsing_place made global type sql/sql_lex.cc: enum_parsing_place made global type sql/sql_lex.h: enum_parsing_place made global type sql/sql_yacc.yy: enum_parsing_place made global type
This commit is contained in:
@ -1920,3 +1920,25 @@ aid bid
|
||||
1 1
|
||||
2 1
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (howmanyvalues bigint, avalue int);
|
||||
INSERT INTO t1 VALUES (1, 1),(2, 1),(2, 2),(3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(4, 4);
|
||||
SELECT howmanyvalues, count(*) from t1 group by howmanyvalues;
|
||||
howmanyvalues count(*)
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues;
|
||||
howmanyvalues mycount
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues);
|
||||
SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues;
|
||||
howmanyvalues mycount
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user