~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/records.cc

  • Committer: Joseph Daly
  • Date: 2010-09-16 17:47:44 UTC
  • mto: (1774.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1775.
  • Revision ID: jdaly@rx7-20100916174744-9myzc6sigk4zrmtn
fix copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/**
17
17
  @file
27
27
#include "drizzled/optimizer/range.h"
28
28
#include "drizzled/internal/my_sys.h"
29
29
#include "drizzled/internal/iocache.h"
30
 
#include "drizzled/drizzled.h"
31
30
 
32
31
namespace drizzled
33
32
{
111
110
                  rr_unpack_from_tempfile : rr_from_tempfile);
112
111
 
113
112
    io_cache=tempfile;
114
 
    io_cache->reinit_io_cache(internal::READ_CACHE,0L,0,0);
 
113
    reinit_io_cache(io_cache,internal::READ_CACHE,0L,0,0);
115
114
    ref_pos=table->cursor->ref;
116
115
    if (!table->cursor->inited)
117
116
      table->cursor->startTableScan(0);
173
172
{                   /* free cache if used */
174
173
  if (cache)
175
174
  {
176
 
    global_read_rnd_buffer.sub(session->variables.read_rnd_buff_size);
177
175
    free((char*) cache);
178
176
    cache= NULL;
179
177
  }
208
206
  int tmp;
209
207
  while ((tmp= info->select->quick->get_next()))
210
208
  {
211
 
    if (info->session->getKilled())
 
209
    if (info->session->killed)
212
210
    {
213
211
      my_error(ER_SERVER_SHUTDOWN, MYF(0));
214
212
      return 1;
272
270
  int tmp;
273
271
  while ((tmp= info->cursor->rnd_next(info->record)))
274
272
  {
275
 
    if (info->session->getKilled())
 
273
    if (info->session->killed)
276
274
    {
277
275
      info->session->send_kill_message();
278
276
      return 1;
404
402
  local_rec_cache_size= cache_records * reclength;
405
403
  rec_cache_size= cache_records * ref_length;
406
404
 
407
 
  if (not global_read_rnd_buffer.add(session->variables.read_rnd_buff_size))
408
 
  {
409
 
    my_error(ER_OUT_OF_GLOBAL_READRNDMEMORY, MYF(ME_ERROR+ME_WAITTANG));
410
 
    return false;
411
 
  }
412
 
 
413
405
  // We have to allocate one more byte to use uint3korr (see comments for it)
414
406
  if (cache_records <= 2 ||
415
407
      !(cache=(unsigned char*) malloc(local_rec_cache_size + cache_records * struct_length + 1)))
416
408
  {
417
409
    return false;
418
410
  }
419
 
#ifdef HAVE_VALGRIND
 
411
#ifdef HAVE_purify
420
412
  // Avoid warnings in qsort
421
413
  memset(cache, 0, local_rec_cache_size + cache_records * struct_length + 1);
422
414
#endif