~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_extra.cc

  • Committer: Andrew Hutchings
  • Date: 2010-11-09 13:38:01 UTC
  • mto: (1919.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1920.
  • Revision ID: andrew@linuxjedi.co.uk-20101109133801-byjzsao76346395x
Add FLUSH GLOBAL STATUS; command
Clears the global status variables for the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                                        /* Next/prev gives first/last */
58
58
    if (info->opt_flag & READ_CACHE_USED)
59
59
    {
60
 
      info->rec_cache.reinit_io_cache(internal::READ_CACHE,0,
61
 
                                      (bool) (info->lock_type != F_UNLCK),
62
 
                                      (bool) test(info->update & HA_STATE_ROW_CHANGED));
 
60
      reinit_io_cache(&info->rec_cache, internal::READ_CACHE,0,
 
61
                      (bool) (info->lock_type != F_UNLCK),
 
62
                      (bool) test(info->update & HA_STATE_ROW_CHANGED)
 
63
                      );
63
64
    }
64
65
    info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND |
65
66
                   HA_STATE_PREV_FOUND);
77
78
    if (info->opt_flag & WRITE_CACHE_USED)
78
79
    {
79
80
      info->opt_flag&= ~WRITE_CACHE_USED;
80
 
      if ((error= info->rec_cache.end_io_cache()))
 
81
      if ((error=end_io_cache(&info->rec_cache)))
81
82
        break;
82
83
    }
83
84
    if (!(info->opt_flag &
85
86
    {
86
87
      cache_size= (extra_arg ? *(uint32_t*) extra_arg :
87
88
                   internal::my_default_record_cache_size);
88
 
      if (!(info->rec_cache.init_io_cache(info->dfile, (uint) min((uint32_t)info->state->data_file_length+1, cache_size),
89
 
                                          internal::READ_CACHE,0L,(bool) (info->lock_type != F_UNLCK),
90
 
                                          MYF(share->write_flag & MY_WAIT_IF_FULL))))
 
89
      if (!(init_io_cache(&info->rec_cache,info->dfile,
 
90
                         (uint) min((uint32_t)info->state->data_file_length+1,
 
91
                                    cache_size),
 
92
                          internal::READ_CACHE,0L,(bool) (info->lock_type != F_UNLCK),
 
93
                          MYF(share->write_flag & MY_WAIT_IF_FULL))))
91
94
      {
92
95
        info->opt_flag|=READ_CACHE_USED;
93
96
        info->update&= ~HA_STATE_ROW_CHANGED;
99
102
  case HA_EXTRA_REINIT_CACHE:
100
103
    if (info->opt_flag & READ_CACHE_USED)
101
104
    {
102
 
      info->rec_cache.reinit_io_cache(internal::READ_CACHE,info->nextpos,
 
105
      reinit_io_cache(&info->rec_cache,internal::READ_CACHE,info->nextpos,
103
106
                      (bool) (info->lock_type != F_UNLCK),
104
107
                      (bool) test(info->update & HA_STATE_ROW_CHANGED));
105
108
      info->update&= ~HA_STATE_ROW_CHANGED;
116
119
 
117
120
    cache_size= (extra_arg ? *(uint32_t*) extra_arg :
118
121
                 internal::my_default_record_cache_size);
119
 
    if (not (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) && !share->state.header.uniques)
120
 
    {
121
 
      if (not (info->rec_cache.init_io_cache(info->dfile, cache_size,
122
 
                                             internal::WRITE_CACHE,info->state->data_file_length,
123
 
                                             (bool) (info->lock_type != F_UNLCK),
124
 
                                             MYF(share->write_flag & MY_WAIT_IF_FULL))))
 
122
    if (!(info->opt_flag &
 
123
          (READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) &&
 
124
        !share->state.header.uniques)
 
125
      if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size,
 
126
                         internal::WRITE_CACHE,info->state->data_file_length,
 
127
                          (bool) (info->lock_type != F_UNLCK),
 
128
                          MYF(share->write_flag & MY_WAIT_IF_FULL))))
125
129
      {
126
 
        info->opt_flag|=WRITE_CACHE_USED;
127
 
        info->update&= ~(HA_STATE_ROW_CHANGED |
 
130
        info->opt_flag|=WRITE_CACHE_USED;
 
131
        info->update&= ~(HA_STATE_ROW_CHANGED |
128
132
                         HA_STATE_WRITE_AT_END |
129
133
                         HA_STATE_EXTEND_BLOCK);
130
134
      }
131
 
    }
132
135
    break;
133
136
  case HA_EXTRA_PREPARE_FOR_UPDATE:
134
137
    if (info->s->data_file_type != DYNAMIC_RECORD)
138
141
    if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
139
142
    {
140
143
      info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
141
 
      error= info->rec_cache.end_io_cache();
 
144
      error=end_io_cache(&info->rec_cache);
142
145
      /* Sergei will insert full text index caching here */
143
146
    }
144
147
#if !defined(TARGET_OS_SOLARIS)
366
369
  if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
367
370
  {
368
371
    info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
369
 
    error= info->rec_cache.end_io_cache();
 
372
    error= end_io_cache(&info->rec_cache);
370
373
  }
371
374
  if (share->base.blobs)
372
375
    mi_alloc_rec_buff(info, SIZE_MAX, &info->rec_buff);