summaryrefslogtreecommitdiff
path: root/mysql-test/r/alter_table.result
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-03-12 16:57:00 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-03-12 16:57:00 +0200
commitbd6aecf3f3c2cab2108cc0f75defea6cf17b97c9 (patch)
tree93d3582284d2660c83188dd608398a443fc4a994 /mysql-test/r/alter_table.result
parentcbd324d26256ba17a3e55ff7c72469ca9c8ad27f (diff)
downloadmariadb-git-bd6aecf3f3c2cab2108cc0f75defea6cf17b97c9.tar.gz
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
Diffstat (limited to 'mysql-test/r/alter_table.result')
-rw-r--r--mysql-test/r/alter_table.result34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index d8de2655c6c..82c35ff963a 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -826,3 +826,37 @@ create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
+CREATE TABLE t1 (a varchar(500));
+ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD KEY(b(50));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD c POINT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ `c` point default NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (a INT, KEY (a(20)));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+ALTER TABLE t1 ADD d INT;
+ALTER TABLE t1 ADD KEY (d(20));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
+DROP TABLE t1;