~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_info.cc

  • Committer: Monty Taylor
  • Date: 2010-10-15 17:18:02 UTC
  • mto: (1859.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1860.
  • Revision ID: mordred@inaugust.com-20101015171802-qhk6zyfhrkvprr1n
Added support for registering regular sys_var instances via module::Context.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
16
/* Return useful base information for an open table */
17
17
 
18
 
#include "myisamdef.h"
19
 
#ifdef  __WIN__
 
18
#include "myisam_priv.h"
20
19
#include <sys/stat.h>
21
 
#endif
 
20
#include "drizzled/error.h"
 
21
 
 
22
using namespace drizzled;
22
23
 
23
24
        /* Get position to last record */
24
25
 
25
 
my_off_t mi_position(MI_INFO *info)
 
26
internal::my_off_t mi_position(MI_INFO *info)
26
27
{
27
28
  return info->lastpos;
28
29
}
31
32
/* Get information about the table */
32
33
/* if flag == 2 one get current info (no sync from database */
33
34
 
34
 
int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
 
35
int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint32_t flag)
35
36
{
36
37
  struct stat state;
37
38
  MYISAM_SHARE *share=info->s;
41
42
    return(0);                          /* Compatible with ISAM */
42
43
  if (!(flag & HA_STATUS_NO_LOCK))
43
44
  {
44
 
    pthread_mutex_lock(&share->intern_lock);
45
 
    VOID(_mi_readinfo(info,F_RDLCK,0));
 
45
    _mi_readinfo(info,F_RDLCK,0);
46
46
    fast_mi_writeinfo(info);
47
 
    pthread_mutex_unlock(&share->intern_lock);
48
47
  }
49
48
  if (flag & HA_STATUS_VARIABLE)
50
49
  {
57
56
    x->keys             = share->state.header.keys;
58
57
    x->check_time       = share->state.check_time;
59
58
    x->mean_reclength= x->records ?
60
 
      (ulong) ((x->data_file_length - x->delete_length) / x->records) :
61
 
      (ulong) share->min_pack_length;
 
59
      (uint32_t) ((x->data_file_length - x->delete_length) / x->records) :
 
60
      (uint32_t) share->min_pack_length;
62
61
  }
63
62
  if (flag & HA_STATUS_ERRKEY)
64
63
  {
73
72
    x->filenr    = info->dfile;
74
73
    x->options   = share->options;
75
74
    x->create_time=share->state.create_time;
76
 
    x->reflength= mi_get_pointer_length(share->base.max_data_file_length,
77
 
                                        myisam_data_pointer_size);
 
75
    x->reflength= mi_get_pointer_length(share->base.max_data_file_length, data_pointer_size);
78
76
    x->record_offset= ((share->options &
79
77
                        (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ?
80
78
                       0L : share->base.pack_reclength);