diff options
author | unknown <sergefp@mysql.com> | 2005-10-23 02:49:57 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-10-23 02:49:57 +0400 |
commit | 3c02a0534d4b5450b2a5126bbf84428595c4a803 (patch) | |
tree | 496319ac159d34aa63a9666078ddc28558ca04c3 /include | |
parent | 1c9783e854965376844a021ab1312b373852f287 (diff) | |
parent | 02dc7bfb1a52c21621356cc0799f3f896a2e2fea (diff) | |
download | mariadb-git-3c02a0534d4b5450b2a5126bbf84428595c4a803.tar.gz |
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-nulls-stats-r2
sql/mysqld.cc:
Auto merged
Diffstat (limited to 'include')
-rw-r--r-- | include/my_base.h | 2 | ||||
-rw-r--r-- | include/my_handler.h | 2 | ||||
-rw-r--r-- | include/myisam.h | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/include/my_base.h b/include/my_base.h index d702ec45140..950af8903ff 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -319,6 +319,8 @@ enum ha_base_keytype { #define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ #define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ +#define SEARCH_RETURN_B_POS (65536*2) /* see ha_key_cmp for description */ + /* bits in opt_flag */ #define QUICK_USED 1 #define READ_CACHE_USED 2 diff --git a/include/my_handler.h b/include/my_handler.h index 18a6234d3f6..8b3cc1a1ee0 100644 --- a/include/my_handler.h +++ b/include/my_handler.h @@ -63,4 +63,6 @@ extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos); +extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); + #endif /* _my_handler_h */ diff --git a/include/myisam.h b/include/myisam.h index e276d4efdff..c2d3d99a414 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 only tuples without NULLs in the index components */ + 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, |