diff options
author | konstantin@oak.local <> | 2003-12-19 20:52:13 +0300 |
---|---|---|
committer | konstantin@oak.local <> | 2003-12-19 20:52:13 +0300 |
commit | d37da004f6ffb32d170ce4cb9d93ba166de5b6b0 (patch) | |
tree | a4c72a1d62170f1e5637ed34fd09ada369f1c764 /sql/sql_delete.cc | |
parent | c49773237d2bb807e10ffb66c321f87a20f1e1c6 (diff) | |
download | mariadb-git-d37da004f6ffb32d170ce4cb9d93ba166de5b6b0.tar.gz |
THD::lex now points to THD::main_lex like in 5.0
All tests pass (client_test included)
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 4ab0cfa20c1..72d92d83e57 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -38,18 +38,18 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, bool transactional_table, log_delayed, safe_update, const_cond; ha_rows deleted; TABLE_LIST *delete_table_list= (TABLE_LIST*) - thd->lex.select_lex.table_list.first; + thd->lex->select_lex.table_list.first; DBUG_ENTER("mysql_delete"); if ((open_and_lock_tables(thd, table_list))) DBUG_RETURN(-1); - 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); thd->proc_info="init"; table->map=1; if (setup_conds(thd, delete_table_list, &conds) || - setup_ftfuncs(&thd->lex.select_lex)) + setup_ftfuncs(&thd->lex->select_lex)) DBUG_RETURN(-1); if (find_real_table_in_list(table_list->next, table_list->db, table_list->real_name)) @@ -66,8 +66,8 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, DBUG_RETURN(1); } - if (thd->lex.duplicates == DUP_IGNORE) - thd->lex.select_lex.no_error= 1; + if (thd->lex->duplicates == DUP_IGNORE) + thd->lex->select_lex.no_error= 1; /* Test if the user wants to delete all rows */ if (!using_limit && const_cond && (!conds || conds->val_int()) && @@ -96,7 +96,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, if ((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); send_ok(thd,0L); DBUG_RETURN(0); // Nothing to delete } @@ -108,7 +108,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, if (safe_update && !using_limit) { delete select; - free_underlaid_joins(thd, &thd->lex.select_lex); + free_underlaid_joins(thd, &thd->lex->select_lex); send_error(thd,ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE); DBUG_RETURN(1); } @@ -130,8 +130,8 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL)); - if (thd->lex.select_lex.setup_ref_array(thd, 0) || - setup_order(thd, thd->lex.select_lex.ref_pointer_array, &tables, + if (thd->lex->select_lex.setup_ref_array(thd, 0) || + setup_order(thd, thd->lex->select_lex.ref_pointer_array, &tables, fields, all_fields, order) || !(sortorder=make_unireg_sortorder(order, &length)) || (table->sort.found_records = filesort(thd, table, sortorder, length, @@ -140,7 +140,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, == HA_POS_ERROR) { delete select; - free_underlaid_joins(thd, &thd->lex.select_lex); + free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(-1); // This will force out message } /* @@ -153,7 +153,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, init_read_record(&info,thd,table,select,1,1); deleted=0L; - init_ftfuncs(thd, &thd->lex.select_lex, 1); + init_ftfuncs(thd, &thd->lex->select_lex, 1); thd->proc_info="updating"; while (!(error=info.read_record(&info)) && !thd->killed && !thd->net.report_error) @@ -233,7 +233,7 @@ cleanup: thd->lock=0; } delete select; - free_underlaid_joins(thd, &thd->lex.select_lex); + free_underlaid_joins(thd, &thd->lex->select_lex); if (error >= 0 || thd->net.report_error) send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN: 0); else @@ -323,7 +323,7 @@ multi_delete::initialize_tables(JOIN *join) table->file->ref_length, MEM_STRIP_BUF_SIZE); } - init_ftfuncs(thd, thd->lex.current_select, 1); + init_ftfuncs(thd, thd->lex->current_select, 1); DBUG_RETURN(thd->is_fatal_error != 0); } |