~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-10-10 09:27:50 UTC
  • mto: (2430.1.6 rf)
  • mto: This revision was merged to the branch mainline in revision 2436.
  • Revision ID: olafvdspek@gmail.com-20111010092750-ryxgmn7zj5yvxfkf
Refactor

Show diffs side-by-side

added added

removed removed

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