Skip to content

Commit e319d3a

Browse files
Merge revert of BUG#31360522 from 'mysql-5.7' into mysql-8.0
Change-Id: Ib7914c4c0bc399a7a7ff0bcca3db3271cc491db2
2 parents 0bdd58b + 3d680eb commit e319d3a

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
@@ -770,11 +770,6 @@ static bool handle_list_of_fields(List_iterator<char> it, TABLE *table,
770770
*/
771771
for (i = 0; i < num_key_parts; i++) {
772772
Field *field = table->key_info[primary_key].key_part[i].field;
773-
// BLOB/TEXT columns are not allowed in partitioning keys.
774-
if (field->is_flag_set(BLOB_FLAG)) {
775-
my_error(ER_BLOB_FIELD_IN_PART_FUNC_ERROR, MYF(0));
776-
return true;
777-
}
778773
field->set_flag(GET_FIXED_FIELDS_FLAG);
779774
}
780775
} else {

sql/table.cc

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

2825-
/*
2826-
For spatial indexes, the key parts are assigned the length (4 *
2827-
sizeof(double)) in prepare_key_column() and the field->key_length() is
2828-
set to 0. This makes it appear like a prefixed index. However, prefixed
2829-
indexes are not allowed on Geometric columns. Hence skipping new field
2830-
creation for Geometric columns.
2831-
*/
28322825
if (field->key_length() != key_part->length &&
2833-
field->type() != MYSQL_TYPE_GEOMETRY) {
2826+
!field->is_flag_set(BLOB_FLAG)) {
28342827
/*
28352828
We are using only a prefix of the column as a key:
28362829
Create a new field for the key part that matches the index

0 commit comments

Comments
 (0)