~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2009-12-06 01:55:53 UTC
  • mfrom: (1238.1.5 push)
  • Revision ID: brian@gaz-20091206015553-cva833q4gvwj11ob
Bundle for staging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
  Single table and multi table updates of tables.
19
19
  Multi-table updates were introduced by Sinisa & Monty
20
20
*/
21
 
#include <drizzled/server_includes.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/timestamp.h>
27
 
#include <drizzled/sql_parse.h>
 
21
#include "drizzled/server_includes.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/timestamp.h"
 
27
#include "drizzled/sql_parse.h"
 
28
#include "drizzled/optimizer/range.h"
 
29
#include "drizzled/records.h"
28
30
 
29
31
#include <list>
30
32
 
31
33
using namespace std;
32
 
 
 
34
using namespace drizzled;
33
35
 
34
36
/**
35
37
  Re-read record if more columns are needed for error message.
132
134
  ha_rows       updated, found;
133
135
  key_map       old_covering_keys;
134
136
  Table         *table;
135
 
  SQL_SELECT    *select;
 
137
  optimizer::SQL_SELECT *select= NULL;
136
138
  READ_RECORD   info;
137
139
  Select_Lex    *select_lex= &session->lex->select_lex;
138
140
  uint64_t     id;
210
212
  /* Update the table->cursor->stats.records number */
211
213
  table->cursor->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
212
214
 
213
 
  select= make_select(table, 0, 0, conds, 0, &error);
 
215
  select= optimizer::make_select(table, 0, 0, conds, 0, &error);
214
216
  if (error || !limit ||
215
217
      (select && select->check_quick(session, false, limit)))
216
218
  {
229
231
  }
230
232
  if (!select && limit != HA_POS_ERROR)
231
233
  {
232
 
    if ((used_index= get_index_for_order(table, order, limit)) != MAX_KEY)
 
234
    if ((used_index= optimizer::get_index_for_order(table, order, limit)) != MAX_KEY)
233
235
      need_sort= false;
234
236
  }
235
237
  /* If running in safe sql mode, don't allow updates without keys */
381
383
      }
382
384
      else
383
385
      {
384
 
        select= new SQL_SELECT;
 
386
        select= new optimizer::SQL_SELECT;
385
387
        select->head=table;
386
388
      }
387
389
      if (reinit_io_cache(&tempfile,READ_CACHE,0L,0,0))