mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 18:55:31 +02:00
Bug #26794:
Different set of conditions is used to verify the validity of index definitions over a GEOMETRY column in ALTER TABLE and CREATE TABLE. The difference was on how sub-keys notion validity is checked. Fixed by extending the CREATE TABLE condition to support the cases allowed in ALTER TABLE. Made the SHOW CREATE TABLE not to display spatial indexes using the sub-key notion. mysql-test/r/alter_table.result: Bug #26794: test case mysql-test/r/gis-rtree.result: Bug #26794: fixed SHOW CREATE TABLE output. mysql-test/t/alter_table.test: Bug #26794: test case sql/field.cc: Bug #26794: Allow sub-keys for GEOMETRY sql/sql_show.cc: Bug #26794: Don't show sub-key notion in SHOW CREATE TABLE for SPATIAL indexes. sql/sql_table.cc: Bug #26794: Allow sub-keys for GEOMETRY
This commit is contained in:
parent
cbd324d262
commit
bd6aecf3f3
6 changed files with 64 additions and 4 deletions
|
|
@ -1344,6 +1344,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||
}
|
||||
else if (!f_is_geom(sql_field->pack_flag) &&
|
||||
(column->length > length ||
|
||||
!Field::type_can_have_key_part (sql_field->sql_type) ||
|
||||
((f_is_packed(sql_field->pack_flag) ||
|
||||
((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
|
||||
(key_info->flags & HA_NOSAME))) &&
|
||||
|
|
@ -3470,7 +3471,8 @@ view_err:
|
|||
checking whether cfield->length < key_part_length (in chars).
|
||||
*/
|
||||
if (!Field::type_can_have_key_part(cfield->field->type()) ||
|
||||
!Field::type_can_have_key_part(cfield->sql_type) ||
|
||||
(!Field::type_can_have_key_part(cfield->sql_type) &&
|
||||
!f_is_geom (cfield->pack_flag)) ||
|
||||
(cfield->field->field_length == key_part_length &&
|
||||
!f_is_blob(key_part->key_type)) ||
|
||||
(cfield->length && (cfield->length < key_part_length /
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue