~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_open.cc

Merge Monty - Updates to pandora-build to support features of gcc 4.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <boost/scoped_ptr.hpp>
24
24
#include <boost/scoped_array.hpp>
25
25
 
26
 
#include <drizzled/internal/m_string.h>
27
 
#include <drizzled/util/test.h>
28
 
#include <drizzled/charset.h>
29
 
#include <drizzled/memory/multi_malloc.h>
30
 
#include <drizzled/identifier.h>
 
26
#include "drizzled/charset_info.h"
 
27
#include "drizzled/internal/m_string.h"
 
28
#include "drizzled/util/test.h"
 
29
#include "drizzled/global_charset_info.h"
 
30
#include "drizzled/charset.h"
 
31
#include "drizzled/memory/multi_malloc.h"
31
32
 
32
33
 
33
34
using namespace std;
78
79
  have an open count of 0.
79
80
******************************************************************************/
80
81
 
81
 
MI_INFO *mi_open(const drizzled::identifier::Table &identifier, int mode, uint32_t open_flags)
 
82
MI_INFO *mi_open(const drizzled::TableIdentifier &identifier, int mode, uint32_t open_flags)
82
83
{
83
84
  int lock_error,kfile,open_mode,save_errno,have_rtree=0;
84
85
  uint32_t i,j,len,errpos,head_length,base_pos,offset,info_length,keys,
85
 
    key_parts,unique_key_parts,uniques;
 
86
    key_parts,unique_key_parts,fulltext_keys,uniques;
86
87
  char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
87
88
       data_name[FN_REFLEN], rp_buff[PATH_MAX];
88
89
  unsigned char *disk_cache= NULL;
119
120
    share_buff.state.rec_per_key_part=rec_per_key_part;
120
121
    share_buff.state.key_root=key_root;
121
122
    share_buff.state.key_del=key_del;
 
123
    share_buff.setKeyCache();
122
124
 
123
125
    if ((kfile=internal::my_open(name_buff,(open_mode=O_RDWR),MYF(0))) < 0)
124
126
    {
182
184
    len=mi_uint2korr(share->state.header.state_info_length);
183
185
    keys=    (uint) share->state.header.keys;
184
186
    uniques= (uint) share->state.header.uniques;
 
187
    fulltext_keys= (uint) share->state.header.fulltext_keys;
185
188
    key_parts= mi_uint2korr(share->state.header.key_parts);
186
189
    unique_key_parts= mi_uint2korr(share->state.header.unique_key_parts);
187
190
    share->state_diff_length=len-MI_STATE_INFO_SIZE;
503
506
  return(m_info);
504
507
 
505
508
err:
506
 
  free(disk_cache);
 
509
  if (disk_cache != NULL)
 
510
    free(disk_cache);
507
511
  save_errno=errno ? errno : HA_ERR_END_OF_FILE;
508
512
  if ((save_errno == HA_ERR_CRASHED) ||
509
513
      (save_errno == HA_ERR_CRASHED_ON_USAGE) ||
652
656
        cannot represent blank like ASCII does. In these cases we have
653
657
        to use _mi_seq_search() for the search.
654
658
      */
655
 
      if (not keyinfo->seg->charset || keyinfo->seg->charset->use_strnxfrm() ||
 
659
      if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) ||
656
660
          (keyinfo->seg->flag & HA_NULL_PART) ||
657
661
          (keyinfo->seg->charset->mbminlen > 1))
658
662
        keyinfo->bin_search=_mi_seq_search;
767
771
  state->state.empty    = mi_sizekorr(ptr);     ptr +=8;
768
772
  state->state.key_empty= mi_sizekorr(ptr);     ptr +=8;
769
773
  state->auto_increment=mi_uint8korr(ptr);      ptr +=8;
770
 
  state->state.checksum=(ha_checksum) mi_uint8korr(ptr);        ptr +=8;
 
774
  state->state.checksum=(internal::ha_checksum) mi_uint8korr(ptr);      ptr +=8;
771
775
  state->process= mi_uint4korr(ptr);            ptr +=4;
772
776
  state->unique = mi_uint4korr(ptr);            ptr +=4;
773
777
  state->status = mi_uint4korr(ptr);            ptr +=4;