| 8693 | */ |
| 8694 | |
| 8695 | bool 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 | /** |
no test coverage detected