~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Monty Taylor
  • Date: 2009-06-09 20:28:16 UTC
  • mfrom: (1058 staging)
  • mto: This revision was merged to the branch mainline in revision 1060.
  • Revision ID: mordred@inaugust.com-20090609202816-jk2w5vgkvejn8nrd
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  Session::killed_state killed_status= Session::NOT_KILLED;
53
53
 
54
54
 
55
 
  if (open_and_lock_tables(session, table_list))
 
55
  if (session->open_and_lock_tables(table_list))
56
56
    return(true);
57
57
 
58
58
  table= table_list->table;
366
366
    TableList *duplicate;
367
367
    if ((duplicate= unique_table(session, table_list, table_list->next_global, 0)))
368
368
    {
369
 
      update_non_unique_table_error(table_list, "DELETE", duplicate);
 
369
      my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->alias);
370
370
      return(true);
371
371
    }
372
372
  }
443
443
      if ((duplicate= unique_table(session, target_tbl->correspondent_table,
444
444
                                   lex->query_tables, 0)))
445
445
      {
446
 
        update_non_unique_table_error(target_tbl->correspondent_table,
447
 
                                      "DELETE", duplicate);
448
 
        return(true);
 
446
        my_error(ER_UPDATE_TABLE_USED, MYF(0), target_tbl->correspondent_table->alias);
 
447
 
 
448
        return true;
449
449
      }
450
450
    }
451
451
  }
452
 
  return(false);
 
452
 
 
453
  return false;
453
454
}
454
455
 
455
456
 
791
792
 
792
793
  memset(&create_info, 0, sizeof(create_info));
793
794
  /* If it is a temporary table, close and regenerate it */
794
 
  if (!dont_send_ok && (table= find_temporary_table(session, table_list)))
 
795
  if (!dont_send_ok && (table= session->find_temporary_table(table_list)))
795
796
  {
796
797
    StorageEngine *table_type= table->s->db_type();
797
798
    TableShare *share= table->s;
801
802
 
802
803
    table->file->info(HA_STATUS_AUTO | HA_STATUS_NO_LOCK);
803
804
 
804
 
    close_temporary_table(session, table, 0, 0);    // Don't free share
 
805
    session->close_temporary_table(table, false, false);    // Don't free share
805
806
    ha_create_table(session, share->normalized_path.str,
806
807
                    share->db.str, share->table_name.str, &create_info, 1);
807
808
    // We don't need to call invalidate() because this table is not in cache