Commit 56d85e2a authored by unknown's avatar unknown

Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0

into deer.(none):/home/hf/work/mysql-5.0.12267


sql/sql_table.cc:
  Auto merged
parents 11541107 2616b657
...@@ -680,3 +680,8 @@ select astext(fn3()); ...@@ -680,3 +680,8 @@ select astext(fn3());
astext(fn3()) astext(fn3())
POINT(1 1) POINT(1 1)
drop function fn3; drop function fn3;
create table t1(pt POINT);
alter table t1 add primary key pti(pt);
ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
alter table t1 add primary key pti(pt(20));
drop table t1;
...@@ -395,3 +395,11 @@ show create function fn3; ...@@ -395,3 +395,11 @@ show create function fn3;
select astext(fn3()); select astext(fn3());
drop function fn3; drop function fn3;
#
# Bug #12267 (primary key over GIS)
#
create table t1(pt POINT);
--error 1170
alter table t1 add primary key pti(pt);
alter table t1 add primary key pti(pt(20));
drop table t1;
...@@ -1148,7 +1148,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -1148,7 +1148,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{ {
column->length*= sql_field->charset->mbmaxlen; column->length*= sql_field->charset->mbmaxlen;
if (f_is_blob(sql_field->pack_flag)) if (f_is_blob(sql_field->pack_flag) ||
(f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL))
{ {
if (!(file->table_flags() & HA_CAN_INDEX_BLOBS)) if (!(file->table_flags() & HA_CAN_INDEX_BLOBS))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment