From: holyfoot Date: April 12 2006 5:05pm Subject: bk commit into 5.0 tree (holyfoot:1.2151) BUG#15860 List-Archive: http://lists.mysql.com/commits/4874 X-Bug: 15860 Message-Id: <20060412170534.D8AFBA0808E@deer.myoffice.izhnet.ru> 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.2151 06/04/12 22:05:23 holyfoot@deer.(none) +6 -0 bug #15860 (SPATIAL keys in INNODB) sql/sql_table.cc 1.304 06/04/12 22:03:59 holyfoot@stripped +6 -0 check that the handler allows SPATIAL keys sql/share/errmsg.txt 1.62 06/04/12 22:03:59 holyfoot@stripped +2 -0 error message added sql/handler.h 1.168 06/04/12 22:03:58 holyfoot@stripped +1 -0 HA_CAN_RTREEKEYS defined sql/ha_myisam.cc 1.166 06/04/12 22:03:58 holyfoot@stripped +1 -1 HA_CAN_RTREEKEYS added to ha_myisam mysql-test/t/innodb.test 1.130 06/04/12 22:03:58 holyfoot@stripped +7 -0 testcase mysql-test/r/innodb.result 1.160 06/04/12 22:03:58 holyfoot@stripped +2 -0 result added # 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: holyfoot # Host: deer.(none) # Root: /home/hf/work/mysql-5.0.15860 --- 1.165/sql/ha_myisam.cc Tue Jan 3 20:54:35 2006 +++ 1.166/sql/ha_myisam.cc Wed Apr 12 22:03:58 2006 @@ -165,7 +165,7 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME | - HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD), + HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS), can_enable_indexes(1) {} --- 1.167/sql/handler.h Sat Feb 25 19:46:25 2006 +++ 1.168/sql/handler.h Wed Apr 12 22:03:58 2006 @@ -80,6 +80,7 @@ */ #define HA_CAN_INSERT_DELAYED (1 << 14) #define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) +#define HA_CAN_RTREEKEYS (1 << 17) #define HA_NOT_DELETE_WITH_CACHE (1 << 18) #define HA_NO_PREFIX_CHAR_KEYS (1 << 20) #define HA_CAN_FULLTEXT (1 << 21) --- 1.303/sql/sql_table.cc Thu Mar 30 18:14:51 2006 +++ 1.304/sql/sql_table.cc Wed Apr 12 22:03:59 2006 @@ -1130,6 +1130,12 @@ /* TODO: Add proper checks if handler supports key_type and algorithm */ if (key_info->flags & HA_SPATIAL) { + if (!(file->table_flags() & HA_CAN_RTREEKEYS)) + { + my_message(ER_TABLE_CANT_HANDLE_SPKEYS, ER(ER_TABLE_CANT_HANDLE_SPKEYS), + MYF(0)); + DBUG_RETURN(-1); + } if (key_info->key_parts != 1) { my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX"); --- 1.61/sql/share/errmsg.txt Fri Mar 10 13:42:37 2006 +++ 1.62/sql/share/errmsg.txt Wed Apr 12 22:03:59 2006 @@ -5611,3 +5611,5 @@ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!" ER_SP_NO_AGGREGATE 42000 eng "AGGREGATE is not supported for stored functions" +ER_TABLE_CANT_HANDLE_SPKEYS + eng "The used table type doesn't support SPATIAL indexes" --- 1.159/mysql-test/r/innodb.result Tue Apr 11 16:13:48 2006 +++ 1.160/mysql-test/r/innodb.result Wed Apr 12 22:03:58 2006 @@ -3241,3 +3241,5 @@ a a 2005-10-01 2005-10-01 drop table t1, t2; +create table t1 (g geometry not null, spatial gk(g)) engine=innodb; +ERROR HY000: The used table type doesn't support SPATIAL indexes --- 1.129/mysql-test/t/innodb.test Tue Apr 11 16:13:48 2006 +++ 1.130/mysql-test/t/innodb.test Wed Apr 12 22:03:58 2006 @@ -2139,3 +2139,10 @@ select * from t1, t2 where t2.a between t1.a - interval 2 day and t1.a + interval 2 day; drop table t1, t2; + +# +# Bug #15680 (SPATIAL key in innodb) +# +--error 1461 +create table t1 (g geometry not null, spatial gk(g)) engine=innodb; +