~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:16:49 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051649-4kg0mdrgdtako8vp
add a FIXME to flesh out insert docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
/*
18
18
  Single table and multi table updates of tables.
 
19
  Multi-table updates were introduced by Sinisa & Monty
19
20
*/
20
 
 
21
 
#include <config.h>
22
 
 
23
 
#include <drizzled/sql_select.h>
24
 
#include <drizzled/error.h>
25
 
#include <drizzled/probes.h>
26
 
#include <drizzled/sql_base.h>
27
 
#include <drizzled/field/epoch.h>
28
 
#include <drizzled/sql_parse.h>
29
 
#include <drizzled/optimizer/range.h>
30
 
#include <drizzled/records.h>
31
 
#include <drizzled/internal/my_sys.h>
32
 
#include <drizzled/internal/iocache.h>
33
 
#include <drizzled/transaction_services.h>
34
 
#include <drizzled/filesort.h>
35
 
#include <drizzled/plugin/storage_engine.h>
 
21
#include "config.h"
 
22
#include "drizzled/sql_select.h"
 
23
#include "drizzled/error.h"
 
24
#include "drizzled/probes.h"
 
25
#include "drizzled/sql_base.h"
 
26
#include "drizzled/field/epoch.h"
 
27
#include "drizzled/sql_parse.h"
 
28
#include "drizzled/optimizer/range.h"
 
29
#include "drizzled/records.h"
 
30
#include "drizzled/internal/my_sys.h"
 
31
#include "drizzled/internal/iocache.h"
 
32
#include "drizzled/transaction_services.h"
 
33
#include "drizzled/filesort.h"
36
34
 
37
35
#include <boost/dynamic_bitset.hpp>
38
36
#include <list>
146
144
  Table         *table;
147
145
  optimizer::SqlSelect *select= NULL;
148
146
  ReadRecord    info;
149
 
  Select_Lex    *select_lex= &session->getLex()->select_lex;
 
147
  Select_Lex    *select_lex= &session->lex->select_lex;
150
148
  uint64_t     id;
151
149
  List<Item> all_fields;
152
150
  Session::killed_state_t killed_status= Session::NOT_KILLED;
330
328
        Filesort has already found and selected the rows we want to update,
331
329
        so we don't need the where clause
332
330
      */
333
 
      safe_delete(select);
 
331
      delete select;
 
332
      select= 0;
334
333
    }
335
334
    else
336
335
    {
408
407
      /* Change select to use tempfile */
409
408
      if (select)
410
409
      {
411
 
        safe_delete(select->quick);
 
410
        delete select->quick;
412
411
        if (select->free_cond)
413
412
          delete select->cond;
 
413
        select->quick=0;
414
414
        select->cond=0;
415
415
      }
416
416
      else
454
454
  session->set_proc_info("Updating");
455
455
 
456
456
  transactional_table= table->cursor->has_transactions();
457
 
  session->setAbortOnWarning(test(!ignore));
 
457
  session->abort_on_warning= test(!ignore);
458
458
 
459
459
  /*
460
460
    Assure that we can use position()
576
576
     * lp bug# 439719
577
577
     */
578
578
    session->main_da.reset_diagnostics_area();
579
 
    session->my_ok((ulong) session->rowCount(), found, id, buff);
580
 
    session->status_var.updated_row_count+= session->rowCount();
 
579
    session->my_ok((ulong) session->row_count_func, found, id, buff);
 
580
    session->status_var.updated_row_count+= session->row_count_func;
581
581
  }
582
582
  session->count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL;              /* calc cuted fields */
583
 
  session->setAbortOnWarning(false);
 
583
  session->abort_on_warning= 0;
584
584
  DRIZZLE_UPDATE_DONE((error >= 0 || session->is_error()), found, updated);
585
585
  return ((error >= 0 || session->is_error()) ? 1 : 0);
586
586
 
595
595
    table->key_read=0;
596
596
    table->cursor->extra(HA_EXTRA_NO_KEYREAD);
597
597
  }
598
 
  session->setAbortOnWarning(false);
 
598
  session->abort_on_warning= 0;
599
599
 
600
600
  DRIZZLE_UPDATE_DONE(1, 0, 0);
601
601
  return 1;
620
620
                         Item **conds, uint32_t order_num, Order *order)
621
621
{
622
622
  List<Item> all_fields;
623
 
  Select_Lex *select_lex= &session->getLex()->select_lex;
 
623
  Select_Lex *select_lex= &session->lex->select_lex;
624
624
 
625
 
  session->getLex()->allow_sum_func= 0;
 
625
  session->lex->allow_sum_func= 0;
626
626
 
627
627
  if (setup_tables_and_check_access(session, &select_lex->context,
628
628
                                    &select_lex->top_join_list,