~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.cc

[patch 112/129] Merge patch for revision 1925 from InnoDB SVN:
revno: 1925
revision-id: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6169
parent: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6163
committer: calvin
timestamp: Thu 2009-11-12 12:40:43 +0000
message:
  branches/zip: add test case for bug#46676
  
  This crash is reproducible with InnoDB plugin 1.0.4 + MySQL 5.1.37.
  But no longer reproducible after MySQL 5.1.38 (with plugin 1.0.5).
  Add test case to catch future regression.
added:
  mysql-test/innodb_bug46676.result 6169@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2Fmysql-test%2Finnodb_bug46676.result
  mysql-test/innodb_bug46676.test 6169@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2Fmysql-test%2Finnodb_bug46676.test
diff:
=== added file 'mysql-test/innodb_bug46676.result'

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "config.h"
31
31
#include "drizzled/sql_select.h" /* include join.h */
32
32
#include "drizzled/field/blob.h"
33
 
#include "drizzled/drizzled.h"
34
 
#include "drizzled/internal/my_sys.h"
35
33
 
36
34
#include <algorithm>
37
35
 
89
87
  if (!(cache->field=(CacheField*)
90
88
        memory::sql_alloc(sizeof(CacheField)*(cache->fields+table_count*2)+(blobs+1)* sizeof(CacheField*))))
91
89
  {
92
 
    size= cache->end - cache->buff;
93
 
    global_join_buffer.sub(size);
94
90
    free((unsigned char*) cache->buff);
95
91
    cache->buff=0;
96
92
    return(1);
166
162
  cache->blobs= blobs;
167
163
  *blob_ptr= NULL;                                      /* End sequentel */
168
164
  size= max((size_t) session->variables.join_buff_size, (size_t)cache->length);
169
 
  if (not global_join_buffer.add(size))
170
 
  {
171
 
    my_error(ER_OUT_OF_GLOBAL_JOINMEMORY, MYF(ME_ERROR+ME_WAITTANG));
172
 
    return 1;
173
 
  }
174
165
  if (!(cache->buff= (unsigned char*) malloc(size)))
175
166
    return 1;
176
167
  cache->end= cache->buff+size;