- make mysql parser match anything as a col/table name when quoted
- add support for spatial index parsing
index : normal_index
| fulltext_index
+ | spatial_index
| <error>
table_name : NAME
}
}
+spatial_index : /spatial/i KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')'
+ {
+ $return = {
+ supertype => 'index',
+ type => 'spatial',
+ name => $item{'index_name(?)'}[0],
+ fields => $item[5],
+ }
+ }
+
name_with_opt_paren : NAME parens_value_list(s?)
{ $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] }
BACKTICK : '`'
-NAME : BACKTICK /\w+/ BACKTICK
+NAME : BACKTICK /[^`]+/ BACKTICK
{ $item[2] }
| /\w+/
{ $item[1] }
CHECK_C
FOREIGN_KEY
FULL_TEXT
+ SPATIAL
NOT_NULL
NORMAL
NULL
use constant FULL_TEXT => 'FULLTEXT';
+use constant SPATIAL => 'SPATIAL';
+
use constant NOT_NULL => 'NOT NULL';
use constant NORMAL => 'NORMAL';
UNIQUE, 1,
NORMAL, 1,
FULL_TEXT, 1, # MySQL only (?)
+ SPATIAL, 1, # MySQL only (?)
);
# ----------------------------------------------------------------------