~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_delete.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

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, TableList *table_list, COND *conds,
 
33
bool mysql_delete(Session *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
{
45
45
  ha_rows       deleted= 0;
46
46
  uint32_t usable_index= MAX_KEY;
47
47
  SELECT_LEX   *select_lex= &thd->lex->select_lex;
48
 
  THD::killed_state killed_status= THD::NOT_KILLED;
 
48
  Session::killed_state killed_status= Session::NOT_KILLED;
49
49
  
50
50
 
51
51
  if (open_and_lock_tables(thd, table_list))
276
276
      table->file->unlock_row();  // Row failed selection, release lock on it
277
277
  }
278
278
  killed_status= thd->killed;
279
 
  if (killed_status != THD::NOT_KILLED || thd->is_error())
 
279
  if (killed_status != Session::NOT_KILLED || thd->is_error())
280
280
    error= 1;                                   // Aborted
281
281
  if (will_batch && (loc_error= table->file->end_bulk_delete()))
282
282
  {
325
325
        statement-based; otherwise, 'ha_delete_row()' was used to
326
326
        delete specific rows which we might log row-based.
327
327
      */
328
 
      int log_result= thd->binlog_query(THD::ROW_QUERY_TYPE,
 
328
      int log_result= thd->binlog_query(Session::ROW_QUERY_TYPE,
329
329
                                        thd->query, thd->query_length,
330
330
                                        transactional_table, false, killed_status);
331
331
 
367
367
    false OK
368
368
    true  error
369
369
*/
370
 
int mysql_prepare_delete(THD *thd, TableList *table_list, Item **conds)
 
370
int mysql_prepare_delete(Session *thd, TableList *table_list, Item **conds)
371
371
{
372
372
  SELECT_LEX *select_lex= &thd->lex->select_lex;
373
373
  
434
434
    true  Error
435
435
*/
436
436
 
437
 
int mysql_multi_delete_prepare(THD *thd)
 
437
int mysql_multi_delete_prepare(Session *thd)
438
438
{
439
439
  LEX *lex= thd->lex;
440
440
  TableList *aux_tables= (TableList *)lex->auxiliary_table_list.first;
695
695
    */
696
696
    if (mysql_bin_log.is_open())
697
697
    {
698
 
      thd->binlog_query(THD::ROW_QUERY_TYPE,
 
698
      thd->binlog_query(Session::ROW_QUERY_TYPE,
699
699
                        thd->query, thd->query_length,
700
700
                        transactional_tables, false);
701
701
    }
784
784
 
785
785
bool multi_delete::send_eof()
786
786
{
787
 
  THD::killed_state killed_status= THD::NOT_KILLED;
 
787
  Session::killed_state killed_status= Session::NOT_KILLED;
788
788
  thd->set_proc_info("deleting from reference tables");
789
789
 
790
790
  /* Does deletes for the last n - 1 tables, returns 0 if ok */
792
792
 
793
793
  /* compute a total error to know if something failed */
794
794
  local_error= local_error || error;
795
 
  killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed;
 
795
  killed_status= (local_error == 0)? Session::NOT_KILLED : thd->killed;
796
796
  /* reset used flags */
797
797
  thd->set_proc_info("end");
798
798
 
802
802
    {
803
803
      if (local_error == 0)
804
804
        thd->clear_error();
805
 
      if (thd->binlog_query(THD::ROW_QUERY_TYPE,
 
805
      if (thd->binlog_query(Session::ROW_QUERY_TYPE,
806
806
                            thd->query, thd->query_length,
807
807
                            transactional_tables, false, killed_status) &&
808
808
          !normal_tables)
841
841
  - If we want to have a name lock on the table on exit without errors.
842
842
*/
843
843
 
844
 
bool mysql_truncate(THD *thd, TableList *table_list, bool dont_send_ok)
 
844
bool mysql_truncate(Session *thd, TableList *table_list, bool dont_send_ok)
845
845
{
846
846
  HA_CREATE_INFO create_info;
847
847
  char path[FN_REFLEN];