结构体key
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的更多相关文章
- STL map、set中key为结构体的用法
下面是map定义的结构: // TEMPLATE CLASS map template<class _Kty, class _Ty, class _Pr = less<_Kty>, ...
- 结构体作为map的key或放入set中,需要重载<运算符
结构体作为map的key或放入set中,需要重载<运算符,如下: typedef struct tagRoadKey{ int m_i32Type; int m_i32Scale; ...
- go语言结构体
定义: 是一种聚合的数据类型,是由零个或多个任意类型的值聚合成的实体. 成员: 每个值称为结构体的成员. 示例: 用结构体的经典案例处理公司的员工信息,每个员工信息包含一个唯一的员工编号.员工的名字. ...
- go 数组(array)、切片(slice)、map、结构体(struct)
一 数组(array) go语言中的数组是固定长度的.使用前必须指定数组长度. go语言中数组是值类型.如果将数组赋值给另一个数组或者方法中参数使用都是复制一份,方法中使用可以使用指针传递地址. 声明 ...
- c# 利用结构体获取json数据
最近做微信支付,要获取用户的openid,调用接口后返回的是json格式的数据,我想在c#后台把数据逐一取出,网上查了查,找到以下方法: 1.首先调用接口,要有一个post数据到指定url并返回数据的 ...
- swift 类和结构体
1:类和结构体定义 类和结构体分别通过关键字class 和struct定义. swift的编码风格是类class和结构体struct名字使用大写字母开头的匈牙利表示法,相反的.类的方法和属性则用小写字 ...
- 关于OC中直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型
关于OC直接打印结构体,点(CGRect,CGSize,CGPoint,UIOffset)等数据类型,我们完全可以把其转换为OC对象来进项打印调试,而不必对结构体中的成员变量进行打印.就好比我们可以使 ...
- Swift面向对象基础(上)——Swift中的类和结构体(上)
学习来自<极客学院> import Foundation //1.定义类和结构体 /* [修饰符]calss 类名{ 零到多个构造器 零到多个属性 零到多个方法 零到多个下标 } 修饰符可 ...
- C语言结构体的强制类型转换
陈浩师兄03年的一篇博客<用C写有面向对象特点的程序>描述了用C语言来实现类似C++类继承的方法,这样方法的核心要点就是结构体的强制类型转换,让我来简单分析分析C语言中的结构体强制类型转换 ...
随机推荐
- 微信小程序、应用号、订阅号、服务号、企业号小总结
微信小程序是现在微信推出的一个新的项目,但是很多人都不是很清楚微信小程序是怎么一回事,不明白到底怎样分别微信小程序和别的公众号.订阅号等的区别,那么让小编来给你介绍一下. 微信小程序目前是内侧阶段,是 ...
- 学习KnockOut第二篇之Counter
学习KnockOut第二篇之Counter 欲看此 ...
- 【转】android如何浏览并选择图片 音频 视频
转自:http://www.cnblogs.com/top5/archive/2012/03/06/2381986.html 这几天 在学习并开发android系统的图片浏览 音频 视频 的浏览 ...
- 公众号开发学习Day01
登录https://mp.weixin.qq.com/后点击注册进入注册微信公众号界面,使用邮箱进行注册 注意点1:一个邮箱只能创建一个公众号,并且公众号的三种类型(订阅号,服务号,企业号)只能选一种 ...
- python re 正则表达式[转]
01.#!/usr/bin/env python 02.# -*- coding: utf-8 -*- 03.import re 04. 05.def regex(): 06. str = 'abcd ...
- win7旗舰版安装office2007后打开文件提示找不到proplusww.msi
今天第一次打开2007的excel,出现错误如下: 解决办法: 转自:http://blog.163.com/huacai9420@126/blog/static/521585422011911524 ...
- 关于struts2如何去掉默认的后缀(.action)
struts2是可以配置默认的后缀名的,如http://localhost:8080/test.action,这个是默认的,但是也可以通过配置去修改这个.action为别的. 这里是通过一个常量配置改 ...
- 【锋利的JQuery-学习笔记】菜单栏及其2级菜单
效果图: 鼠标移动到菜单项后如下: html: <div id="nav" class="mainNav"> <ul class=" ...
- 灵魂有香气的女子IOS版本APP,近期将考虑开放源代码
实在太忙,灵魂有香气的女子这个App,断断续续开发了1个多月了,前后台自己独立完成, 由于接触swift没多久,还属于新手行列,不熟悉,希望大家给出意见, 根据意见,完善后将于近期将考虑开放swift ...
- linux源码阅读笔记 asm函数
在linux源码中经常遇到__asm__函数.它其实是函数asm的宏定义 #define __asm__ asm,asm函数让系统执行汇编语句. __asm__常常与__volatile__一起出现. ...