summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2006-02-09 13:35:59 +0300
committerunknown <konstantin@mysql.com>2006-02-09 13:35:59 +0300
commitd7becbc2c8af24dd236ecdbb511a6a88745b9117 (patch)
tree5cb0dfc9bfbaf2c7fe5b62e6e2c4eb3240c19f9a /sql/sql_prepare.cc
parent1b09a63e0785c549c9b801c74255d21f6c4934df (diff)
parent5ffc2dc202e49607b91851f3e44f60f49f175294 (diff)
downloadmariadb-git-d7becbc2c8af24dd236ecdbb511a6a88745b9117.tar.gz
Merge mysql.com:/home/kostja/mysql/mysql-5.0-root
into mysql.com:/home/kostja/mysql/mysql-5.1-merge BitKeeper/deleted/.del-ndb_load.result: Delete: mysql-test/r/ndb_load.result BitKeeper/deleted/.del-ndb_load.test: Delete: mysql-test/t/ndb_load.test extra/perror.c: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/ndb_blob.result: Auto merged mysql-test/r/sp-code.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/fulltext.test: Auto merged mysql-test/t/sp-destruct.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/view.test: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/item_func.cc: Auto merged sql/opt_range.cc: Auto merged sql/sp.cc: Auto merged sql/sp.h: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp: Auto merged storage/ndb/src/kernel/main.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.hpp: Auto merged storage/ndb/src/ndbapi/NdbBlob.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged storage/ndb/tools/delete_all.cpp: Auto merged mysql-test/t/disabled.def: Manual merge.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index cb080ba68e0..010c1250756 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2075,14 +2075,19 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
sl->exclude_from_table_unique_test= FALSE;
/*
- Copy WHERE clause pointers to avoid damaging they by optimisation
+ Copy WHERE, HAVING clause pointers to avoid damaging them by optimisation
*/
- if (sl->prep_where)
- {
- sl->where= sl->prep_where->copy_andor_structure(thd);
- sl->where->cleanup();
- }
- DBUG_ASSERT(sl->join == 0);
+ if (sl->prep_where)
+ {
+ sl->where= sl->prep_where->copy_andor_structure(thd);
+ sl->where->cleanup();
+ }
+ if (sl->prep_having)
+ {
+ sl->having= sl->prep_having->copy_andor_structure(thd);
+ sl->having->cleanup();
+ }
+ DBUG_ASSERT(sl->join == 0);
ORDER *order;
/* Fix GROUP list */
for (order= (ORDER *)sl->group_list.first; order; order= order->next)