MCPcopy Create free account
hub / github.com/MariaDB/server / append_possible_keys_stat

Method append_possible_keys_stat

sql/sql_explain.cc:3058–3086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3056*/
3057
3058int Explain_range_checked_fer::append_possible_keys_stat(MEM_ROOT *alloc,
3059 TABLE *table,
3060 key_map possible_keys)
3061{
3062 uint j;
3063 multi_alloc_root(alloc, &keys_stat, sizeof(ha_rows) * table->s->keys,
3064 &keys_stat_names, sizeof(char *) * table->s->keys, NULL);
3065 if ((!keys_stat) || (!keys_stat_names))
3066 {
3067 keys_stat= NULL;
3068 keys_stat_names= NULL;
3069 return 1;
3070 }
3071 keys_map= possible_keys;
3072 keys= table->s->keys;
3073 bzero(keys_stat, sizeof(ha_rows) * table->s->keys);
3074 for (j= 0; j < table->s->keys; j++)
3075 {
3076 if (possible_keys.is_set(j))
3077 {
3078 if (!(keys_stat_names[j]= key_set.append_str(alloc,
3079 table->key_info[j].name.str)))
3080 return 1;
3081 }
3082 else
3083 keys_stat_names[j]= NULL;
3084 }
3085 return 0;
3086}
3087
3088void Explain_range_checked_fer::collect_data(QUICK_SELECT_I *quick)
3089{

Callers 1

save_explain_dataMethod · 0.80

Calls 3

multi_alloc_rootFunction · 0.85
append_strMethod · 0.80
is_setMethod · 0.45

Tested by

no test coverage detected