From 9cc553a27840add306b72c2dfe5911e2adc59895 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 00:29:02 +0300 Subject: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Additional fix for bug#22331. Now Item_field prints its value in the case of the const field. mysql-test/r/varbinary.result: Corrected test case after fix for bug#22331. mysql-test/r/union.result: Corrected test case after fix for bug#22331. mysql-test/r/subselect.result: Corrected test case after fix for bug#22331. mysql-test/r/func_test.result: Corrected test case after fix for bug#22331. mysql-test/r/having.result: Corrected test case after fix for bug#22331. mysql-test/r/func_regexp.result: Corrected test case after fix for bug#22331. mysql-test/r/func_str.result: Corrected test case after fix for bug#22331. mysql-test/r/func_default.result: Corrected test case after fix for bug#22331. mysql-test/r/explain.result: Corrected test case after fix for bug#22331. sql/sql_union.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Cleanup of the SELECT_LEX::order_list list. sql/item.h: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class. sql/item.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class. --- sql/sql_union.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 16df0059217..1ec724a6338 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -621,6 +621,12 @@ bool st_select_lex_unit::cleanup() join->tables= 0; } error|= fake_select_lex->cleanup(); + if (fake_select_lex->order_list.elements) + { + ORDER *ord; + for (ord= (ORDER*)fake_select_lex->order_list.first; ord; ord= ord->next) + (*ord->item)->cleanup(); + } } DBUG_RETURN(error); -- cgit v1.2.1