summaryrefslogtreecommitdiff
path: root/include/myisam.h
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-10-21 06:29:17 +0400
committerunknown <sergefp@mysql.com>2005-10-21 06:29:17 +0400
commit71fdef4d10b5eda9bec9743fc457cb8629e93344 (patch)
tree2ec77c30e97d8e7c0b2634973992317e30dffe08 /include/myisam.h
parent0c16a7ccc7354ef197472a9cdde182512c88dfe7 (diff)
downloadmariadb-git-71fdef4d10b5eda9bec9743fc457cb8629e93344.tar.gz
BUG#9622, stage 2, work together with fix for BUG#12232:
added "nulls_ignored" index statistics collection method for MyISAM tables. (notification trigger: this is about BUG#9622). include/my_base.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: Added SEARCH_RETURN_B_POS flag for ha_key_cmp() include/my_handler.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: added ha_find_null() include/myisam.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/mi_check.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method, added mi_collect_stats_*(), updated update_key_parts() to deal with all 3 methods. myisam/myisamchk.c: BUG#9622: Added nulls_ignored index statistics collection method for MyISAM myisam/myisamdef.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/sort.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. mysql-test/r/myisam.result: Testcase for BUG9622 mysql-test/t/myisam.test: Testcase for BUG9622 mysys/my_handler.c: BUG#9622: ha_key_cmp() now supports new SEARCH_RETURN_B_POS flag, added ha_find_null() sql/ha_myisam.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. sql/mysqld.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method.
Diffstat (limited to 'include/myisam.h')
-rw-r--r--include/myisam.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/myisam.h b/include/myisam.h
index e276d4efdff..e564bf29cac 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -322,7 +322,9 @@ typedef enum
/* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
MI_STATS_METHOD_NULLS_NOT_EQUAL,
/* Treat NULLs as equal when collecting statistics (like 4.0 did) */
- MI_STATS_METHOD_NULLS_EQUAL
+ MI_STATS_METHOD_NULLS_EQUAL,
+ /* Ignore NULLs - count tuples without NULLs only */
+ MI_STATS_METHOD_IGNORE_NULLS
} enum_mi_stats_method;
typedef struct st_mi_check_param
@@ -349,7 +351,14 @@ typedef struct st_mi_check_param
int tmpfile_createflag;
myf myf_rw;
IO_CACHE read_cache;
+
+ /*
+ The next two are used to collect statistics, see update_key_parts for
+ description.
+ */
ulonglong unique_count[MI_MAX_KEY_SEG+1];
+ ulonglong notnull_count[MI_MAX_KEY_SEG+1];
+
ha_checksum key_crc[MI_MAX_POSSIBLE_KEY];
ulong rec_per_key_part[MI_MAX_KEY_SEG*MI_MAX_POSSIBLE_KEY];
void *thd;
@@ -409,7 +418,8 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair);
int update_state_info(MI_CHECK *param, MI_INFO *info,uint update);
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
- ulonglong *unique, ulonglong records);
+ ulonglong *unique, ulonglong *notnull,
+ ulonglong records);
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
my_off_t length, const char *type);
int movepoint(MI_INFO *info,byte *record,my_off_t oldpos,