Loading mysql-test/r/func_group.result +37 −0 Original line number Diff line number Diff line Loading @@ -1416,4 +1416,41 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; AVG(a) CAST(AVG(a) AS DECIMAL) 15 15 DROP TABLE t1; CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) 1 DROP TABLE derived1; DROP TABLE D; End of 5.0 tests mysql-test/suite/ndb/t/disabled.def +0 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,5 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open mysql-test/t/func_group.test +40 −0 Original line number Diff line number Diff line Loading @@ -933,5 +933,45 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; DROP TABLE t1; # # Bug #37348: Crash in or immediately after JOIN::make_sum_func_list # CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; DROP TABLE derived1; DROP TABLE D; ### --echo End of 5.0 tests sql/item.cc +1 −0 Original line number Diff line number Diff line Loading @@ -1338,6 +1338,7 @@ class Item_aggregate_ref : public Item_ref else Item_ident::print(str, query_type); } virtual Ref_Type ref_type() { return AGGREGATE_REF; } }; Loading sql/item.h +1 −1 Original line number Diff line number Diff line Loading @@ -2126,7 +2126,7 @@ class Item_ref :public Item_ident protected: void set_properties(); public: enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF }; enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF, AGGREGATE_REF }; Field *result_field; /* Save result here */ Item **ref; Item_ref(Name_resolution_context *context_arg, Loading Loading
mysql-test/r/func_group.result +37 −0 Original line number Diff line number Diff line Loading @@ -1416,4 +1416,41 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; AVG(a) CAST(AVG(a) AS DECIMAL) 15 15 DROP TABLE t1; CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) 1 DROP TABLE derived1; DROP TABLE D; End of 5.0 tests
mysql-test/suite/ndb/t/disabled.def +0 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,5 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
mysql-test/t/func_group.test +40 −0 Original line number Diff line number Diff line Loading @@ -933,5 +933,45 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; DROP TABLE t1; # # Bug #37348: Crash in or immediately after JOIN::make_sum_func_list # CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; DROP TABLE derived1; DROP TABLE D; ### --echo End of 5.0 tests
sql/item.cc +1 −0 Original line number Diff line number Diff line Loading @@ -1338,6 +1338,7 @@ class Item_aggregate_ref : public Item_ref else Item_ident::print(str, query_type); } virtual Ref_Type ref_type() { return AGGREGATE_REF; } }; Loading
sql/item.h +1 −1 Original line number Diff line number Diff line Loading @@ -2126,7 +2126,7 @@ class Item_ref :public Item_ident protected: void set_properties(); public: enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF }; enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF, AGGREGATE_REF }; Field *result_field; /* Save result here */ Item **ref; Item_ref(Name_resolution_context *context_arg, Loading