From a7ed6ce441bd2ecdc7e12d9113b695ed3c1da45f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Oct 2005 15:24:46 +0400 Subject: 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. --- sql/sql_select.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_select.h') diff --git a/sql/sql_select.h b/sql/sql_select.h index c7440fe4c3a..fe9bb7d69d3 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -204,6 +204,7 @@ class JOIN :public Sql_alloc //Part, shared with list above, emulate following list List tmp_fields_list1, tmp_fields_list2, tmp_fields_list3; List &fields_list; // hold field list passed to mysql_select + List procedure_fields_list; int error; ORDER *order, *group_list, *proc_param; //hold parameters of mysql_select -- cgit v1.2.1