1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge of mysql-5.1-bugteam into mysql-trunk-merge.

This commit is contained in:
Davi Arnaut
2010-06-10 22:30:49 -03:00
61 changed files with 1018 additions and 913 deletions

View File

@@ -1330,7 +1330,7 @@ static int mysql_test_update(Prepared_statement *stmt,
if (mysql_prepare_update(thd, table_list, &select->where,
select->order_list.elements,
(ORDER *) select->order_list.first))
select->order_list.first))
goto error;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -1845,11 +1845,10 @@ error:
static int mysql_insert_select_prepare_tester(THD *thd)
{
SELECT_LEX *first_select= &thd->lex->select_lex;
TABLE_LIST *second_table= ((TABLE_LIST*)first_select->table_list.first)->
next_local;
TABLE_LIST *second_table= first_select->table_list.first->next_local;
/* Skip first table, which is the table we are inserting in */
first_select->table_list.first= (uchar *) second_table;
first_select->table_list.first= second_table;
thd->lex->select_lex.context.table_list=
thd->lex->select_lex.context.first_name_resolution_table= second_table;
@@ -1886,7 +1885,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt,
return 1;
/* store it, because mysql_insert_select_prepare_tester change it */
first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first;
first_local_table= lex->select_lex.table_list.first;
DBUG_ASSERT(first_local_table != 0);
res=
@@ -1894,7 +1893,7 @@ static bool mysql_test_insert_select(Prepared_statement *stmt,
&mysql_insert_select_prepare_tester,
OPTION_SETUP_TABLES_DONE);
/* revert changes made by mysql_insert_select_prepare_tester */
lex->select_lex.table_list.first= (uchar*) first_local_table;
lex->select_lex.table_list.first= first_local_table;
return res;
}
@@ -2404,10 +2403,10 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
DBUG_ASSERT(sl->join == 0);
ORDER *order;
/* Fix GROUP list */
for (order= (ORDER *)sl->group_list.first; order; order= order->next)
for (order= sl->group_list.first; order; order= order->next)
order->item= &order->item_ptr;
/* Fix ORDER list */
for (order= (ORDER *)sl->order_list.first; order; order= order->next)
for (order= sl->order_list.first; order; order= order->next)
order->item= &order->item_ptr;
/* clear the no_error flag for INSERT/UPDATE IGNORE */
@@ -2451,7 +2450,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
(multi-delete). We do a full clean up, although at the moment all we
need to clean in the tables of MULTI-DELETE list is 'table' member.
*/
for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxiliary_table_list.first;
for (TABLE_LIST *tables= lex->auxiliary_table_list.first;
tables;
tables= tables->next_global)
{