diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-28 14:17:09 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-28 14:17:09 +0200 |
commit | a983b2440767db660bdf38c4f8bb3a0b0f7b1d65 (patch) | |
tree | 04beefc3687b10e2e2322e7c586aede2c4e272a2 /storage/maria/maria_pack.c | |
parent | a915142f48a42237021be590de37ffab4cc5b107 (diff) | |
parent | bc891054962bc7cbd249f1ff75c64adb3b5bbc59 (diff) | |
download | mariadb-git-a983b2440767db660bdf38c4f8bb3a0b0f7b1d65.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'storage/maria/maria_pack.c')
-rw-r--r-- | storage/maria/maria_pack.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index 762d2890294..5bdeca327dd 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -782,27 +782,29 @@ static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records) for (i=0 ; i < info->s->base.fields ; i++) { enum en_fieldtype type; - count[i].field_length=info->s->columndef[i].length; - type= count[i].field_type= (enum en_fieldtype) info->s->columndef[i].type; + uint col_nr = info->s->columndef[i].column_nr; + count[col_nr].field_length=info->s->columndef[i].length; + type= count[col_nr].field_type= + (enum en_fieldtype) info->s->columndef[i].type; if (type == FIELD_INTERVALL || type == FIELD_CONSTANT || type == FIELD_ZERO) type = FIELD_NORMAL; - if (count[i].field_length <= 8 && + if (count[col_nr].field_length <= 8 && (type == FIELD_NORMAL || type == FIELD_SKIP_ZERO)) - count[i].max_zero_fill= count[i].field_length; + count[col_nr].max_zero_fill= count[col_nr].field_length; /* For every column initialize a tree, which is used to detect distinct column values. 'int_tree' works together with 'tree_buff' and 'tree_pos'. It's keys are implemented by pointers into 'tree_buff'. This is accomplished by '-1' as the element size. */ - init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, + init_tree(&count[col_nr].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, NULL, MYF(0)); if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) - count[i].tree_pos=count[i].tree_buff = - my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, + count[col_nr].tree_pos=count[col_nr].tree_buff = + my_malloc(count[col_nr].field_length > 1 ? tree_buff_length : 2, MYF(MY_WME)); } } |