~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/sort.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-14 20:42:14 UTC
  • mto: (2318.6.3 refactor7)
  • mto: This revision was merged to the branch mainline in revision 2337.
  • Revision ID: olafvdspek@gmail.com-20110614204214-gswvc2b6fr113758
Remove malloc NULL check. Just die.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
      }
157
157
      while ((maxbuffer= (size_t)(records/(keys-1)+1)) != skr);
158
158
 
159
 
    if ((sort_keys=(unsigned char **)malloc(keys*(sort_length+sizeof(char*)))))
160
 
    {
161
 
      if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
162
 
                             maxbuffer/2))
163
 
      {
164
 
        free((unsigned char*) sort_keys);
165
 
        sort_keys= 0;
166
 
      }
167
 
      else
168
 
        break;
169
 
    }
170
 
    old_memavl=memavl;
 
159
    sort_keys=(unsigned char **)malloc(keys*(sort_length+sizeof(char*)));
 
160
    my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2);
 
161
    break;
 
162
    old_memavl=memavl; // todo: remove dead code
171
163
    if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY)
172
164
      memavl=MIN_SORT_MEMORY;
173
165
  }