mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0 mysql-test/t/having.test: Auto merged mysql-test/r/having.result: Manual merge sql/sql_lex.cc: Manual merge sql/sql_lex.h: Manual merge sql/sql_prepare.cc: Manual merge sql/sql_select.cc: Manual merge
This commit is contained in:
@ -1862,6 +1862,96 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
|
||||
{
|
||||
/* Statement map deletes statement on erase */
|
||||
thd->stmt_map.erase(stmt);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
mysql_log.write(thd, COM_STMT_PREPARE, "[%lu] %s", stmt->id, packet);
|
||||
@ -1955,11 +2045,14 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
|
||||
}
|
||||
else
|
||||
{
|
||||
query_str= lex->prepared_stmt_code.str;
|
||||
*query_len= lex->prepared_stmt_code.length;
|
||||
}
|
||||
end:
|
||||
return query_str;
|
||||
stmt->setup_set_params();
|
||||
SELECT_LEX *sl= stmt->lex->all_selects_list;
|
||||
for (; sl; sl= sl->next_select_in_list())
|
||||
{
|
||||
/*
|
||||
during query optimisation.
|
||||
*/
|
||||
sl->prep_where= sl->where;
|
||||
}
|
||||
|
||||
|
||||
@ -2066,14 +2159,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)
|
||||
|
Reference in New Issue
Block a user