mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
THD::lex now points to THD::main_lex like in 5.0
All tests pass (client_test included)
This commit is contained in:
@@ -68,7 +68,7 @@ int mysql_update(THD *thd,
|
||||
SQL_SELECT *select;
|
||||
READ_RECORD info;
|
||||
TABLE_LIST *update_table_list= ((TABLE_LIST*)
|
||||
thd->lex.select_lex.table_list.first);
|
||||
thd->lex->select_lex.table_list.first);
|
||||
TABLE_LIST tables;
|
||||
List<Item> all_fields;
|
||||
DBUG_ENTER("mysql_update");
|
||||
@@ -79,7 +79,7 @@ int mysql_update(THD *thd,
|
||||
if ((open_and_lock_tables(thd, table_list)))
|
||||
DBUG_RETURN(-1);
|
||||
thd->proc_info="init";
|
||||
fix_tables_pointers(thd->lex.all_selects_list);
|
||||
fix_tables_pointers(thd->lex->all_selects_list);
|
||||
table= table_list->table;
|
||||
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
|
||||
|
||||
@@ -97,10 +97,10 @@ int mysql_update(THD *thd,
|
||||
|
||||
if (setup_tables(update_table_list) ||
|
||||
setup_conds(thd,update_table_list,&conds) ||
|
||||
thd->lex.select_lex.setup_ref_array(thd, order_num) ||
|
||||
setup_order(thd, thd->lex.select_lex.ref_pointer_array,
|
||||
thd->lex->select_lex.setup_ref_array(thd, order_num) ||
|
||||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
|
||||
&tables, all_fields, all_fields, order) ||
|
||||
setup_ftfuncs(&thd->lex.select_lex))
|
||||
setup_ftfuncs(&thd->lex->select_lex))
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
|
||||
/* Check that we are not using table that we are updating in a sub select */
|
||||
@@ -144,7 +144,7 @@ int mysql_update(THD *thd,
|
||||
#endif
|
||||
if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0))
|
||||
{
|
||||
free_underlaid_joins(thd, &thd->lex.select_lex);
|
||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ int mysql_update(THD *thd,
|
||||
(select && select->check_quick(thd, safe_update, limit)) || !limit)
|
||||
{
|
||||
delete select;
|
||||
free_underlaid_joins(thd, &thd->lex.select_lex);
|
||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||
if (error)
|
||||
{
|
||||
DBUG_RETURN(-1); // Error in where
|
||||
@@ -174,7 +174,7 @@ int mysql_update(THD *thd,
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
init_ftfuncs(thd, &thd->lex.select_lex, 1);
|
||||
init_ftfuncs(thd, &thd->lex->select_lex, 1);
|
||||
/* Check if we are modifying a key that we are used to search with */
|
||||
if (select && select->quick)
|
||||
used_key_is_modified= (!select->quick->unique_key_range() &&
|
||||
@@ -375,7 +375,7 @@ int mysql_update(THD *thd,
|
||||
}
|
||||
|
||||
delete select;
|
||||
free_underlaid_joins(thd, &thd->lex.select_lex);
|
||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||
if (error >= 0)
|
||||
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); /* purecov: inspected */
|
||||
else
|
||||
@@ -394,7 +394,7 @@ int mysql_update(THD *thd,
|
||||
|
||||
err:
|
||||
delete select;
|
||||
free_underlaid_joins(thd, &thd->lex.select_lex);
|
||||
free_underlaid_joins(thd, &thd->lex->select_lex);
|
||||
if (table->key_read)
|
||||
{
|
||||
table->key_read=0;
|
||||
@@ -431,7 +431,7 @@ int mysql_multi_update(THD *thd,
|
||||
#endif
|
||||
if ((res=open_and_lock_tables(thd,table_list)))
|
||||
DBUG_RETURN(res);
|
||||
fix_tables_pointers(thd->lex.all_selects_list);
|
||||
fix_tables_pointers(thd->lex->all_selects_list);
|
||||
|
||||
select_lex->select_limit= HA_POS_ERROR;
|
||||
if (setup_fields(thd, 0, table_list, *fields, 1, 0, 0))
|
||||
|
||||
Reference in New Issue
Block a user