Skip to content

Commit 952f53d

Browse files
Merge revert of BUG#31360522 from 'mysql-8.0' into mysql-8.4
Change-Id: I348dcf357671e214901f16b04f132f2e6a011091
2 parents bf6f654 + e319d3a commit 952f53d

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

sql/sql_partition.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,6 @@ static bool handle_list_of_fields(List_iterator<char> it, TABLE *table,
776776
*/
777777
for (i = 0; i < num_key_parts; i++) {
778778
Field *field = table->key_info[primary_key].key_part[i].field;
779-
// BLOB/TEXT columns are not allowed in partitioning keys.
780-
if (field->is_flag_set(BLOB_FLAG)) {
781-
my_error(ER_BLOB_FIELD_IN_PART_FUNC_ERROR, MYF(0));
782-
return true;
783-
}
784779
field->set_flag(GET_FIXED_FIELDS_FLAG);
785780
}
786781
} else {

sql/table.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,15 +2840,8 @@ bool create_key_part_field_with_prefix_length(TABLE *table, MEM_ROOT *root) {
28402840
key_part < key_part_end; key_part++) {
28412841
Field *field = key_part->field = table->field[key_part->fieldnr - 1];
28422842

2843-
/*
2844-
For spatial indexes, the key parts are assigned the length (4 *
2845-
sizeof(double)) in prepare_key_column() and the field->key_length() is
2846-
set to 0. This makes it appear like a prefixed index. However, prefixed
2847-
indexes are not allowed on Geometric columns. Hence skipping new field
2848-
creation for Geometric columns.
2849-
*/
28502843
if (field->key_length() != key_part->length &&
2851-
field->type() != MYSQL_TYPE_GEOMETRY) {
2844+
!field->is_flag_set(BLOB_FLAG)) {
28522845
/*
28532846
We are using only a prefix of the column as a key:
28542847
Create a new field for the key part that matches the index

0 commit comments

Comments
 (0)