~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_update.cc

  • Committer: Brian Aker
  • Date: 2010-11-06 15:43:10 UTC
  • mfrom: (1908.1.1 merge)
  • Revision ID: brian@tangent.org-20101106154310-g1jpjzwbc53pfc4f
Filesort encapsulation, plus modification to copy contructor

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
  Select_Lex    *select_lex= &session->lex->select_lex;
149
149
  uint64_t     id;
150
150
  List<Item> all_fields;
151
 
  Session::killed_state_t killed_status= Session::NOT_KILLED;
 
151
  Session::killed_state killed_status= Session::NOT_KILLED;
152
152
 
153
 
  DRIZZLE_UPDATE_START(session->getQueryString()->c_str());
 
153
  DRIZZLE_UPDATE_START(session->query.c_str());
154
154
  if (session->openTablesLock(table_list))
155
155
  {
156
156
    DRIZZLE_UPDATE_DONE(1, 0, 0);
341
341
      */
342
342
 
343
343
      internal::IO_CACHE tempfile;
344
 
      if (tempfile.open_cached_file(drizzle_tmpdir.c_str(),TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME)))
345
 
      {
 
344
      if (open_cached_file(&tempfile, drizzle_tmpdir.c_str(),TEMP_PREFIX,
 
345
                           DISK_BUFFER_SIZE, MYF(MY_WME)))
346
346
        goto err;
347
 
      }
348
347
 
349
348
      /* If quick select is used, initialize it before retrieving rows. */
350
349
      if (select && select->quick && select->quick->reset())
374
373
      session->set_proc_info("Searching rows for update");
375
374
      ha_rows tmp_limit= limit;
376
375
 
377
 
      while (not(error= info.read_record(&info)) && not session->getKilled())
 
376
      while (!(error=info.read_record(&info)) && !session->killed)
378
377
      {
379
378
        if (!(select && select->skip_record()))
380
379
        {
397
396
        else
398
397
          table->cursor->unlock_row();
399
398
      }
400
 
      if (session->getKilled() && not error)
 
399
      if (session->killed && !error)
401
400
        error= 1;                               // Aborted
402
401
      limit= tmp_limit;
403
402
      table->cursor->try_semi_consistent_read(0);
417
416
        select= new optimizer::SqlSelect;
418
417
        select->head=table;
419
418
      }
420
 
      if (tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
 
419
      if (reinit_io_cache(&tempfile,internal::READ_CACHE,0L,0,0))
421
420
        error=1;
422
421
      // Read row ptrs from this cursor
423
422
      memcpy(select->file, &tempfile, sizeof(tempfile));
467
466
  can_compare_record= (! (table->cursor->getEngine()->check_flag(HTON_BIT_PARTIAL_COLUMN_READ)) ||
468
467
                       table->write_set->is_subset_of(*table->read_set));
469
468
 
470
 
  while (not (error=info.read_record(&info)) && not session->getKilled())
 
469
  while (! (error=info.read_record(&info)) && !session->killed)
471
470
  {
472
 
    if (not (select && select->skip_record()))
 
471
    if (! (select && select->skip_record()))
473
472
    {
474
473
      if (table->cursor->was_semi_consistent_read())
475
474
        continue;  /* repeat the read of the same row if it still exists */
546
545
    It's assumed that if an error was set in combination with an effective
547
546
    killed status then the error is due to killing.
548
547
  */
549
 
  killed_status= session->getKilled(); // get the status of the volatile
 
548
  killed_status= session->killed; // get the status of the volatile
550
549
  // simulated killing after the loop must be ineffective for binlogging
551
550
  error= (killed_status == Session::NOT_KILLED)?  error : 1;
552
551