~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.cc

  • Committer: Andrew Hutchings
  • Date: 2011-01-04 20:16:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2057.
  • Revision ID: andrew@linuxjedi.co.uk-20110104201655-fm6splh5wqpv8wnb
Revert join_cache buffer cleanup, causes valgrind problems and as much as I don't like it I think the current implementation seems to work

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
  if (!(cache->field=(CacheField*)
90
90
        memory::sql_alloc(sizeof(CacheField)*(cache->fields+table_count*2)+(blobs+1)* sizeof(CacheField*))))
91
91
  {
92
 
    size= cache->buff.size();
 
92
    size= cache->end - cache->buff;
93
93
    global_join_buffer.sub(size);
94
 
    cache->buff.clear();
 
94
    free((unsigned char*) cache->buff);
 
95
    cache->buff=0;
95
96
    return(1);
96
97
  }
97
98
  copy=cache->field;
170
171
    my_error(ER_OUT_OF_GLOBAL_JOINMEMORY, MYF(ME_ERROR+ME_WAITTANG));
171
172
    return 1;
172
173
  }
173
 
  cache->buff.resize(size);
174
 
  cache->end= &cache->buff.back();
 
174
  if (!(cache->buff= (unsigned char*) malloc(size)))
 
175
    return 1;
 
176
  cache->end= cache->buff+size;
175
177
  cache->reset_cache_write();
176
178
 
177
179
  return 0;
253
255
void JoinCache::reset_cache_read()
254
256
{
255
257
  record_nr= 0;
256
 
  pos= &buff[0];
 
258
  pos= buff;
257
259
}
258
260
 
259
261
void JoinCache::reset_cache_write()