diff options
author | unknown <evgen@moonbone.local> | 2005-10-28 15:24:46 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-10-28 15:24:46 +0400 |
commit | a7ed6ce441bd2ecdc7e12d9113b695ed3c1da45f (patch) | |
tree | 5a24308e4f52d570dc3e75bf25970ca572505cf8 /mysql-test/t/analyse.test | |
parent | 5e8515d9f2ccada3e19b109196fb5654e7c9db92 (diff) | |
download | mariadb-git-a7ed6ce441bd2ecdc7e12d9113b695ed3c1da45f.tar.gz |
Fix bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
Procedure analyse() redefines select's fields_list. setup_copy_fields() assumes
that fields_list is a part of all_fields_list. Because select have only
3 columns and analyse() redefines it to have 10 columns, int overrun in
setup_copy_fields() occurs and server goes to almost infinite loop.
Because fields_list used not only to send data ad fields types, it's wrong
to allow procedure redefine it. This patch separates select's fileds_list
and procedure's one. Now if procedure is present, copy of fields_list is
created in procedure_fields_list and it is used for sending data and fields.
mysql-test/t/analyse.test:
Test case for bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
mysql-test/r/analyse.result:
Test case for bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
sql/sql_select.h:
Fix bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
To JOIN Added separate fields_list for procedure.
sql/sql_select.cc:
Fix bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
SELECT's fields_list and procedure's fields_list made split. If procedure is defined
then procedure's fields_list is used to send fields and data.
Diffstat (limited to 'mysql-test/t/analyse.test')
-rw-r--r-- | mysql-test/t/analyse.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index e38e43381bc..dfca8f575a4 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -57,4 +57,29 @@ insert into t1 values (100000); select * from t1 procedure analyse (1,1); drop table t1; +# +# Bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server +# +create table t1 (product varchar(32), country_id int not null, year int, + profit int); +insert into t1 values ( 'Computer', 2,2000, 1200), + ( 'TV', 1, 1999, 150), + ( 'Calculator', 1, 1999,50), + ( 'Computer', 1, 1999,1500), + ( 'Computer', 1, 2000,1500), + ( 'TV', 1, 2000, 150), + ( 'TV', 2, 2000, 100), + ( 'TV', 2, 2000, 100), + ( 'Calculator', 1, 2000,75), + ( 'Calculator', 2, 2000,75), + ( 'TV', 1, 1999, 100), + ( 'Computer', 1, 1999,1200), + ( 'Computer', 2, 2000,1500), + ( 'Calculator', 2, 2000,75), + ( 'Phone', 3, 2003,10) + ; +create table t2 (country_id int primary key, country char(20) not null); +insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); +select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); +drop table t1,t2; # End of 4.1 tests |