parser: create index support LOCK syntax (#5851)

This commit is contained in:
winkyao
2018-02-11 10:22:56 +08:00
committed by Jack Yu
parent a63601ad21
commit f3c99cd535
2 changed files with 6 additions and 1 deletions

View File

@ -1012,6 +1012,10 @@ AlterTableSpec:
}
}
LockClauseOpt:
{}
| LockClause {}
LockClause:
"LOCK" eq "NONE"
{
@ -1533,7 +1537,7 @@ NumLiteral:
CreateIndexStmt:
"CREATE" CreateIndexStmtUnique "INDEX" Identifier IndexTypeOpt "ON" TableName '(' IndexColNameList ')' IndexOptionList
"CREATE" CreateIndexStmtUnique "INDEX" Identifier IndexTypeOpt "ON" TableName '(' IndexColNameList ')' IndexOptionList LockClauseOpt
{
var indexOption *ast.IndexOption
if $11 != nil {

View File

@ -1548,6 +1548,7 @@ func (s *testParserSuite) TestDDL(c *C) {
{"CREATE INDEX idx ON t (a) USING HASH", true},
{"CREATE INDEX idx ON t (a) COMMENT 'foo'", true},
{"CREATE INDEX idx ON t (a) USING HASH COMMENT 'foo'", true},
{"CREATE INDEX idx ON t (a) LOCK=NONE", true},
{"CREATE INDEX idx USING BTREE ON t (a) USING HASH COMMENT 'foo'", true},
{"CREATE INDEX idx USING BTREE ON t (a)", true},