[MDEV-7801] Unexpected syntax error in ALTER TABLE t1 ADD INDEX TYPE BTREE Created: 2015-03-18 Updated: 2019-10-04 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 5.1.67, 5.2.14, 5.3.12, 5.5, 10.0, 10.1, 10.3.4 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream, verified | ||
| Issue Links: |
|
||||||||
| Description |
|
USING and TYPE are supposed to be synonyms in the key algorithm type clause,
However, if I remove the index name (which is optional, according to the grammar), USING still works fine:
but TYPE fails:
It returns the following error:
The problem is obviously in this piece of grammar in sql_yacc.yy:
When it gets the word TYPE, it does no know if it is the index name, or the start of the key algorithm clause, such as "TYPE BTREE". There are more parser related problems:
The above script ignores the first USING and returns:
The expected behaviour would be to return an error telling about conflicting declarations. |