@@ -352,6 +352,31 @@ public void testMySqlCreateTableWithTextIndexes() throws JSQLParserException {
352352 "CREATE TABLE table2 (id INT (10) UNSIGNED NOT NULL AUTO_INCREMENT, name TEXT, url TEXT, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), FULLTEXT KEY idx_table2_name (name)) ENGINE = InnoDB AUTO_INCREMENT = 7334 DEFAULT CHARSET = utf8" );
353353 }
354354
355+ @ Test
356+ public void testMySqlCreateTableWithSpatialIndex () throws JSQLParserException {
357+ assertSqlCanBeParsedAndDeparsed (
358+ "CREATE TABLE places (id INT NOT NULL, location GEOMETRY NOT NULL, SPATIAL KEY sp_idx_location (location))" );
359+ }
360+
361+ @ Test
362+ public void testMySqlCreateTableIssue2367 ()
363+ throws JSQLParserException {
364+ String sql = "CREATE TABLE test (\n "
365+ + "id int(11) NOT NULL COMMENT 'data id',\n "
366+ + "code varchar(100) NOT NULL COMMENT 'code',\n "
367+ + "name varchar(300) DEFAULT NULL COMMENT 'name',\n "
368+ + "geo geometry NOT NULL,\n "
369+ + "PRIMARY KEY (id),\n "
370+ + "UNIQUE KEY index_code (code) USING HASH COMMENT 'unique index on code',\n "
371+ + "UNIQUE KEY inx_code_name (code,name) USING BTREE COMMENT 'unique index on code and name',\n "
372+ + "UNIQUE KEY inx_id_code_name (id,code,name) USING BTREE COMMENT 'index 1',\n "
373+ + "SPATIAL KEY SPATIAL_geo (geo),\n "
374+ + "KEY NORMAL_name (name) COMMENT 'normal index',\n "
375+ + "FULLTEXT KEY fulltext_name (name)\n "
376+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='test table'" ;
377+ assertSqlCanBeParsedAndDeparsed (sql );
378+ }
379+
355380 @ Test
356381 public void testCreateTableWithCheck () throws JSQLParserException {
357382 assertSqlCanBeParsedAndDeparsed (
0 commit comments