~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Brian Aker
  • Date: 2008-08-18 22:20:43 UTC
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: brian@tangent.org-20080818222043-et6zf93ogrgx1cz9
Refactoring table.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
  end of dispatch_command().
31
31
*/
32
32
 
33
 
bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
 
33
bool mysql_delete(THD *thd, TableList *table_list, COND *conds,
34
34
                  SQL_LIST *order, ha_rows limit, uint64_t options,
35
35
                  bool reset_auto_increment)
36
36
{
65
65
  /* check ORDER BY even if it can be ignored */
66
66
  if (order && order->elements)
67
67
  {
68
 
    TABLE_LIST   tables;
 
68
    TableList   tables;
69
69
    List<Item>   fields;
70
70
    List<Item>   all_fields;
71
71
 
368
368
    false OK
369
369
    true  error
370
370
*/
371
 
int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
 
371
int mysql_prepare_delete(THD *thd, TableList *table_list, Item **conds)
372
372
{
373
373
  SELECT_LEX *select_lex= &thd->lex->select_lex;
374
374
  
395
395
      setup_conds(thd, table_list, select_lex->leaf_tables, conds))
396
396
    return(true);
397
397
  {
398
 
    TABLE_LIST *duplicate;
 
398
    TableList *duplicate;
399
399
    if ((duplicate= unique_table(thd, table_list, table_list->next_global, 0)))
400
400
    {
401
401
      update_non_unique_table_error(table_list, "DELETE", duplicate);
438
438
int mysql_multi_delete_prepare(THD *thd)
439
439
{
440
440
  LEX *lex= thd->lex;
441
 
  TABLE_LIST *aux_tables= (TABLE_LIST *)lex->auxiliary_table_list.first;
442
 
  TABLE_LIST *target_tbl;
 
441
  TableList *aux_tables= (TableList *)lex->auxiliary_table_list.first;
 
442
  TableList *target_tbl;
443
443
  
444
444
 
445
445
  /*
461
461
  */
462
462
  lex->select_lex.exclude_from_table_unique_test= true;
463
463
  /* Fix tables-to-be-deleted-from list to point at opened tables */
464
 
  for (target_tbl= (TABLE_LIST*) aux_tables;
 
464
  for (target_tbl= (TableList*) aux_tables;
465
465
       target_tbl;
466
466
       target_tbl= target_tbl->next_local)
467
467
  {
479
479
      inside subqueries/view.
480
480
    */
481
481
    {
482
 
      TABLE_LIST *duplicate;
 
482
      TableList *duplicate;
483
483
      if ((duplicate= unique_table(thd, target_tbl->correspondent_table,
484
484
                                   lex->query_tables, 0)))
485
485
      {
493
493
}
494
494
 
495
495
 
496
 
multi_delete::multi_delete(TABLE_LIST *dt, uint num_of_tables_arg)
 
496
multi_delete::multi_delete(TableList *dt, uint num_of_tables_arg)
497
497
  : delete_tables(dt), deleted(0), found(0),
498
498
    num_of_tables(num_of_tables_arg), error(0),
499
499
    do_delete(0), transactional_tables(0), normal_tables(0), error_handled(0)
517
517
bool
518
518
multi_delete::initialize_tables(JOIN *join)
519
519
{
520
 
  TABLE_LIST *walk;
 
520
  TableList *walk;
521
521
  Unique **tempfiles_ptr;
522
522
  
523
523
 
602
602
bool multi_delete::send_data(List<Item> &values __attribute__((unused)))
603
603
{
604
604
  int secure_counter= delete_while_scanning ? -1 : 0;
605
 
  TABLE_LIST *del_table;
 
605
  TableList *del_table;
606
606
  
607
607
 
608
608
  for (del_table= delete_tables;
842
842
  - If we want to have a name lock on the table on exit without errors.
843
843
*/
844
844
 
845
 
bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
 
845
bool mysql_truncate(THD *thd, TableList *table_list, bool dont_send_ok)
846
846
{
847
847
  HA_CREATE_INFO create_info;
848
848
  char path[FN_REFLEN];