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

Method check_tmp_key

sql/table.cc:8695–8720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8693*/
8694
8695bool TABLE::check_tmp_key(uint key, uint key_parts,
8696 uint (*next_field_no) (uchar *), uchar *arg)
8697{
8698 Field **reg_field;
8699 uint i;
8700 uint key_len= 0;
8701
8702 for (i= 0; i < key_parts; i++)
8703 {
8704 uint fld_idx= next_field_no(arg);
8705 reg_field= field + fld_idx;
8706 if ((*reg_field)->type() == MYSQL_TYPE_BLOB)
8707 return FALSE;
8708 uint fld_store_len= (uint16) (*reg_field)->key_length();
8709 if ((*reg_field)->real_maybe_null())
8710 fld_store_len+= HA_KEY_NULL_LENGTH;
8711 if ((*reg_field)->real_type() == MYSQL_TYPE_VARCHAR ||
8712 (*reg_field)->type() == MYSQL_TYPE_GEOMETRY)
8713 fld_store_len+= HA_KEY_BLOB_LENGTH;
8714 key_len+= fld_store_len;
8715 }
8716
8717 // We use the on-disk storage engine's limit
8718 return key_len <= tmp_table_max_key_length() &&
8719 key_parts <= tmp_table_max_key_parts();
8720}
8721
8722
8723/**

Callers 1

Calls 6

tmp_table_max_key_lengthFunction · 0.85
tmp_table_max_key_partsFunction · 0.85
real_maybe_nullMethod · 0.80
typeMethod · 0.45
key_lengthMethod · 0.45
real_typeMethod · 0.45

Tested by

no test coverage detected