~clint-fewbar/drizzle/regex-policy-cache-limiter

« back to all changes in this revision

Viewing changes to drizzled/join_cache.cc

  • Committer: Clint Byrum
  • Date: 2012-03-15 18:05:43 UTC
  • mfrom: (2224.1.302 workspace)
  • Revision ID: clint@ubuntu.com-20120315180543-9jxxm4q10k3np2ws
merging with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <drizzled/internal/my_sys.h>
36
36
#include <drizzled/table.h>
37
37
#include <drizzled/session.h>
 
38
#include <drizzled/system_variables.h>
38
39
 
39
40
#include <algorithm>
40
41
 
41
42
using namespace std;
42
43
 
43
 
namespace drizzled
44
 
{
45
 
 
46
 
static uint32_t used_blob_length(CacheField **ptr);
 
44
namespace drizzled {
47
45
 
48
46
static uint32_t used_blob_length(CacheField **ptr)
49
47
{
52
50
  {
53
51
    (*ptr)->blob_length=blob_length=(*ptr)->blob_field->get_length();
54
52
    length+=blob_length;
55
 
    (*ptr)->blob_field->get_ptr(&(*ptr)->str);
 
53
    (*ptr)->str= (*ptr)->blob_field->get_ptr();
56
54
  }
57
55
  return length;
58
56
}
96
94
    global_join_buffer.sub(size);
97
95
    free((unsigned char*) cache->buff);
98
96
    cache->buff=0;
99
 
    return(1);
 
97
    return 1;
100
98
  }
101
99
  copy=cache->field;
102
100
  blob_ptr=cache->blob_ptr=(CacheField**)
174
172
    my_error(ER_OUT_OF_GLOBAL_JOINMEMORY, MYF(ME_ERROR+ME_WAITTANG));
175
173
    return 1;
176
174
  }
177
 
  if (!(cache->buff= (unsigned char*) malloc(size)))
178
 
    return 1;
 
175
  cache->buff= (unsigned char*) malloc(size);
179
176
  cache->end= cache->buff+size;
180
177
  cache->reset_cache_write();
181
178