diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index ce8fb04874e0260f53704eec74dc63b0c0c3c364..64aa0b7687781d196158877cae0ac920b6dfc942 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -454,7 +454,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
 
     if ((!(param->testflag & T_SILENT)))
       printf ("- check data record references index: %d\n",key+1);
-    if (keyinfo->flag & HA_FULLTEXT)
+    if (keyinfo->flag & (HA_FULLTEXT | HA_SPATIAL))
       full_text_keys++;
     if (share->state.key_root[key] == HA_OFFSET_ERROR &&
 	(info->state->records == 0 || keyinfo->flag & HA_FULLTEXT))
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 55f70e59fcf625b4d3983d51c02387d2d348ae6c..3c5b0491148641d901d8516697b37969fb0c2ff2 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -730,4 +730,12 @@ select geomfromtext(col9,col89) as a from t1;
 a
 NULL
 DROP TABLE t1;
+create table t1(col1 geometry not null,col15 geometrycollection not
+null,spatial index(col15),index(col1(15)))engine=myisam;
+insert into t1 set col15 = GeomFromText('POINT(6 5)');
+insert into t1 set col15 = GeomFromText('POINT(6 5)');
+check table t1 extended;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+drop table t1;
 End of 4.1 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index cf5c3b31bc1a631527a004ba7eff3490952462c6..77e73e0d590ae2e24a6ffcab3645057147d4206c 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -427,4 +427,15 @@ INSERT INTO `t1` VALUES ('','0000-00-00');
 select geomfromtext(col9,col89) as a from t1;
 DROP TABLE t1;
 
+#
+# Bug #30284 spatial key corruption 
+#
+
+create table t1(col1 geometry not null,col15 geometrycollection not
+null,spatial index(col15),index(col1(15)))engine=myisam;
+insert into t1 set col15 = GeomFromText('POINT(6 5)');
+insert into t1 set col15 = GeomFromText('POINT(6 5)');
+check table t1 extended;
+drop table t1;
+
 --echo End of 4.1 tests