~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_extra.cc

  • Committer: Monty Taylor
  • Date: 2010-02-04 08:14:46 UTC
  • mfrom: (1277.2.1 build) (1280.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1283.
  • Revision ID: mordred@inaugust.com-20100204081446-ldh9m486va30uap6
Put everything in drizzled into drizzled namespace.
Put internal stuff into drizzled::internal namespace.
Removed some cruft.
Now every symbol that is shipped in a header is in the drizzled namespace
and everything in the server that's not shipped is labeled internal. woot. 
Removed a lot of the extra extern "C" stuff that was in there. Less ugliness for
internal callbacks now for Sun Studio.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <string.h>
22
22
#include <algorithm>
23
23
 
 
24
using namespace drizzled;
24
25
using namespace std;
25
26
 
26
27
static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function);
56
57
                                        /* Next/prev gives first/last */
57
58
    if (info->opt_flag & READ_CACHE_USED)
58
59
    {
59
 
      reinit_io_cache(&info->rec_cache,READ_CACHE,0,
 
60
      reinit_io_cache(&info->rec_cache, internal::READ_CACHE,0,
60
61
                      (bool) (info->lock_type != F_UNLCK),
61
62
                      (bool) test(info->update & HA_STATE_ROW_CHANGED)
62
63
                      );
84
85
          (READ_CACHE_USED | WRITE_CACHE_USED | MEMMAP_USED)))
85
86
    {
86
87
      cache_size= (extra_arg ? *(uint32_t*) extra_arg :
87
 
                   my_default_record_cache_size);
 
88
                   internal::my_default_record_cache_size);
88
89
      if (!(init_io_cache(&info->rec_cache,info->dfile,
89
90
                         (uint) min((uint32_t)info->state->data_file_length+1,
90
91
                                    cache_size),
91
 
                          READ_CACHE,0L,(bool) (info->lock_type != F_UNLCK),
 
92
                          internal::READ_CACHE,0L,(bool) (info->lock_type != F_UNLCK),
92
93
                          MYF(share->write_flag & MY_WAIT_IF_FULL))))
93
94
      {
94
95
        info->opt_flag|=READ_CACHE_USED;
101
102
  case HA_EXTRA_REINIT_CACHE:
102
103
    if (info->opt_flag & READ_CACHE_USED)
103
104
    {
104
 
      reinit_io_cache(&info->rec_cache,READ_CACHE,info->nextpos,
 
105
      reinit_io_cache(&info->rec_cache,internal::READ_CACHE,info->nextpos,
105
106
                      (bool) (info->lock_type != F_UNLCK),
106
107
                      (bool) test(info->update & HA_STATE_ROW_CHANGED));
107
108
      info->update&= ~HA_STATE_ROW_CHANGED;
117
118
    }
118
119
 
119
120
    cache_size= (extra_arg ? *(uint32_t*) extra_arg :
120
 
                 my_default_record_cache_size);
 
121
                 internal::my_default_record_cache_size);
121
122
    if (!(info->opt_flag &
122
123
          (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) &&
123
124
        !share->state.header.uniques)
124
125
      if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size,
125
 
                         WRITE_CACHE,info->state->data_file_length,
 
126
                         internal::WRITE_CACHE,info->state->data_file_length,
126
127
                          (bool) (info->lock_type != F_UNLCK),
127
128
                          MYF(share->write_flag & MY_WAIT_IF_FULL))))
128
129
      {
272
273
    }
273
274
    if (share->kfile >= 0)
274
275
      _mi_decrement_open_count(info);
275
 
    if (share->kfile >= 0 && my_close(share->kfile,MYF(0)))
 
276
    if (share->kfile >= 0 && internal::my_close(share->kfile,MYF(0)))
276
277
      error=errno;
277
278
    {
278
279
      list<MI_INFO *>::iterator it= myisam_open_list.begin();
281
282
        MI_INFO *tmpinfo= *it;
282
283
        if (tmpinfo->s == info->s)
283
284
        {
284
 
          if (tmpinfo->dfile >= 0 && my_close(tmpinfo->dfile,MYF(0)))
 
285
          if (tmpinfo->dfile >= 0 && internal::my_close(tmpinfo->dfile,MYF(0)))
285
286
            error = errno;
286
287
          tmpinfo->dfile= -1;
287
288
        }
302
303
    if (share->not_flushed)
303
304
    {
304
305
      share->not_flushed=0;
305
 
      if (my_sync(share->kfile, MYF(0)))
 
306
      if (internal::my_sync(share->kfile, MYF(0)))
306
307
        error= errno;
307
 
      if (my_sync(info->dfile, MYF(0)))
 
308
      if (internal::my_sync(info->dfile, MYF(0)))
308
309
        error= errno;
309
310
      if (error)
310
311
      {