~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008-2009 Sun Microsystems
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
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"
 
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>
33
38
 
34
39
#include <algorithm>
35
40
 
87
92
  if (!(cache->field=(CacheField*)
88
93
        memory::sql_alloc(sizeof(CacheField)*(cache->fields+table_count*2)+(blobs+1)* sizeof(CacheField*))))
89
94
  {
 
95
    size= cache->end - cache->buff;
 
96
    global_join_buffer.sub(size);
90
97
    free((unsigned char*) cache->buff);
91
98
    cache->buff=0;
92
99
    return(1);
162
169
  cache->blobs= blobs;
163
170
  *blob_ptr= NULL;                                      /* End sequentel */
164
171
  size= max((size_t) session->variables.join_buff_size, (size_t)cache->length);
 
172
  if (not global_join_buffer.add(size))
 
173
  {
 
174
    my_error(ER_OUT_OF_GLOBAL_JOINMEMORY, MYF(ME_ERROR+ME_WAITTANG));
 
175
    return 1;
 
176
  }
165
177
  if (!(cache->buff= (unsigned char*) malloc(size)))
166
178
    return 1;
167
179
  cache->end= cache->buff+size;