From: Date: September 26 2005 11:55am Subject: bk commit into 5.0 tree (hf:1.1993) BUG#12267 List-Archive: http://lists.mysql.com/internals/30324 X-Bug: 12267 Message-Id: <200509260955.j8Q9txiE026209@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of hf. When hf does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1993 05/09/26 14:55:52 hf@deer.(none) +3 -0 Fix for bug #12267 (primary key over GEOMETRY field) sql/sql_table.cc 1.274 05/09/26 14:54:41 hf@deer.(none) +2 -1 we should check this for GEOMETRY fields mysql-test/t/gis.test 1.23 05/09/26 14:54:41 hf@deer.(none) +8 -0 test case added mysql-test/r/gis.result 1.26 05/09/26 14:54:41 hf@deer.(none) +5 -0 test result fixed # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: hf # Host: deer.(none) # Root: /home/hf/work/mysql-5.0.12267 --- 1.273/sql/sql_table.cc Thu Sep 15 04:57:52 2005 +++ 1.274/sql/sql_table.cc Mon Sep 26 14:54:41 2005 @@ -1148,7 +1148,8 @@ { 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)) { --- 1.25/mysql-test/r/gis.result Sat Aug 27 20:05:19 2005 +++ 1.26/mysql-test/r/gis.result Mon Sep 26 14:54:41 2005 @@ -680,3 +680,8 @@ astext(fn3()) POINT(1 1) 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; --- 1.22/mysql-test/t/gis.test Sat Aug 27 20:05:19 2005 +++ 1.23/mysql-test/t/gis.test Mon Sep 26 14:54:41 2005 @@ -395,3 +395,11 @@ select astext(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;