http://www.cnblogs.com/xpchild/p/3770823.html

http://blog.sae.sina.com.cn/archives/3968

实例

http://blog.sae.sina.com.cn/archives/3968

http://www.cnblogs.com/xpchild/p/3770823.html

typedef struct st_key {
uint key_length; /* Tot length of key */
ulong flags; /* dupp key and pack flags */
uint key_parts; /* How many key_parts */ //一共有多少个column
uint extra_length;
uint usable_key_parts; /* Should normally be = key_parts */
uint block_size;
enum ha_key_alg algorithm;
/*
Note that parser is used when the table is opened for use, and
parser_name is used when the table is being created.
*/
union
{
plugin_ref parser; /* Fulltext [pre]parser */
LEX_STRING *parser_name; /* Fulltext [pre]parser name */
};
KEY_PART_INFO *key_part; //key中具体的column
char *name; /* Name of key */
/*
Array of AVG(#records with the same field value) for 1st ... Nth key part.
0 means 'not known'.
For temporary heap tables this member is NULL.
*/
ulong *rec_per_key;
union {
int bdb_return_if_eq;
} handler;
TABLE *table;
LEX_STRING comment;
} KEY;
typedef struct st_key_part_info {    /* Info about a key part */
Field *field;
uint offset; /* offset in record (from 0) */
uint null_offset; /* Offset to null_bit in record */
uint16 length; /* Length of keypart value in bytes */
/*
Number of bytes required to store the keypart value. This may be
different from the "length" field as it also counts
- possible NULL-flag byte (see HA_KEY_NULL_LENGTH)
- possible HA_KEY_BLOB_LENGTH bytes needed to store actual value length.
*/
uint16 store_length;
uint16 key_type;
uint16 fieldnr; /* Fieldnum in UNIREG */
uint16 key_part_flag; /* 0 or HA_REVERSE_SORT */
uint8 type;
uint8 null_bit; /* Position to null_bit */
} KEY_PART_INFO ;
typedef struct st_keyfile_info {    /* used with ha_info() */
uchar ref[MAX_REFLENGTH]; /* Pointer to current row */
uchar dupp_ref[MAX_REFLENGTH]; /* Pointer to dupp row */
uint ref_length; /* Length of ref (1-8) */
uint block_size; /* index block size */
File filenr; /* (uniq) filenr for table */
ha_rows records; /* Records i datafilen */
ha_rows deleted; /* Deleted records */
ulonglong data_file_length; /* Length off data file */
ulonglong max_data_file_length; /* Length off data file */
ulonglong index_file_length;
ulonglong max_index_file_length;
ulonglong delete_length; /* Free bytes */
ulonglong auto_increment_value;
int errkey,sortkey; /* Last errorkey and sorted by */
time_t create_time; /* When table was created */
time_t check_time;
time_t update_time;
ulong mean_rec_length; /* physical reclength */
} KEYFILE_INFO;

结构体key的更多相关文章

  1. STL map、set中key为结构体的用法

    下面是map定义的结构: // TEMPLATE CLASS map template<class _Kty, class _Ty, class _Pr = less<_Kty>, ...

  2. 结构体作为map的key或放入set中,需要重载<运算符

    结构体作为map的key或放入set中,需要重载<运算符,如下: typedef struct tagRoadKey{    int m_i32Type;    int m_i32Scale; ...

  3. go语言结构体

    定义: 是一种聚合的数据类型,是由零个或多个任意类型的值聚合成的实体. 成员: 每个值称为结构体的成员. 示例: 用结构体的经典案例处理公司的员工信息,每个员工信息包含一个唯一的员工编号.员工的名字. ...

  4. go 数组(array)、切片(slice)、map、结构体(struct)

    一 数组(array) go语言中的数组是固定长度的.使用前必须指定数组长度. go语言中数组是值类型.如果将数组赋值给另一个数组或者方法中参数使用都是复制一份,方法中使用可以使用指针传递地址. 声明 ...

  5. c# 利用结构体获取json数据

    最近做微信支付,要获取用户的openid,调用接口后返回的是json格式的数据,我想在c#后台把数据逐一取出,网上查了查,找到以下方法: 1.首先调用接口,要有一个post数据到指定url并返回数据的 ...

  6. swift 类和结构体

    1:类和结构体定义 类和结构体分别通过关键字class 和struct定义. swift的编码风格是类class和结构体struct名字使用大写字母开头的匈牙利表示法,相反的.类的方法和属性则用小写字 ...

  7. 关于OC中直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型

    关于OC直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型,我们完全可以把其转换为OC对象来进项打印调试,而不必对结构体中的成员变量进行打印.就好比我们可以使 ...

  8. Swift面向对象基础(上)——Swift中的类和结构体(上)

    学习来自<极客学院> import Foundation //1.定义类和结构体 /* [修饰符]calss 类名{ 零到多个构造器 零到多个属性 零到多个方法 零到多个下标 } 修饰符可 ...

  9. C语言结构体的强制类型转换

    陈浩师兄03年的一篇博客<用C写有面向对象特点的程序>描述了用C语言来实现类似C++类继承的方法,这样方法的核心要点就是结构体的强制类型转换,让我来简单分析分析C语言中的结构体强制类型转换 ...

随机推荐

  1. Quartz 2D画虚线-b

    这里使用的函数为 CGContextSetLineDash,有四个参数    CGContextSetLineDash(<#CGContextRef  _Nullable c#>, < ...

  2. Oracle 新建序列值

    create sequence MSG_OUTBOX_ID_SEQ minvalue maxvalue start increment cache ;

  3. Wireshark - ICMP 报文分析

    1. 测试机器,源 IP 地址为 10.21.28.110,目的 IP 地址为 10.6.0.24. 2. 使用 "ip.addr == 10.6.0.24 and icmp" 过 ...

  4. DataGridView 的cell赋值没有线程间访问的限制吗?

    1.如下代码,对DataGridView 的cell赋值不会出现线程访问问题,为什么呢? public Form1() { InitializeComponent(); } private void ...

  5. 3044 矩形面积求并 - Wikioi

    题目描述 Description 输入n个矩形,求他们总共占地面积(也就是求一下面积的并) 输入描述 Input Description 可能有多组数据,读到n=0为止(不超过15组) 每组数据第一行 ...

  6. springMVC+ibatis数据持久化入门级学习例子

    1.web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version=" ...

  7. linux故障救援

    今天手贱,误操作将/usr/lib整个文件夹都删了.但是系统内还有很多重要的文件和数据,不敢贸然重装系统. 弄了个u盘启动. 一开始整个系统只有一个分区,原系统装在这个分区里,我用u盘启动后,用分区管 ...

  8. How do you design object oriented projects?

    what are things you do during the high level design phase (before you begin programming) to determin ...

  9. POJ1222 高斯消元法解抑或方程

    第一次学怎么用高斯消元法解抑或方程组,思想其实很简单,方法可以看下面的链接:http://blog.csdn.net/zhuichao001/article/details/5440843 有了这种思 ...

  10. Ubuntu环境下nutch2.2.1集成HBase0.94.25

    nutch2.2.1集成HBase0.94.25 (详见:http://duguyiren3476.iteye.com/blog/2085973 ) 1. 修改nutch的hbase配置 //将自己的 ...