Fix DEFINE INDEX UNIQUE statement parsing

This commit is contained in:
Tobie Morgan Hitchcock 2022-07-28 20:27:39 +01:00
parent f97e16a036
commit 89baebbd24

View file

@ -1019,11 +1019,7 @@ fn index(i: &str) -> IResult<&str, DefineIndexStatement> {
let (i, _) = alt((tag_no_case("COLUMNS"), tag_no_case("FIELDS")))(i)?; let (i, _) = alt((tag_no_case("COLUMNS"), tag_no_case("FIELDS")))(i)?;
let (i, _) = shouldbespace(i)?; let (i, _) = shouldbespace(i)?;
let (i, cols) = idiom::locals(i)?; let (i, cols) = idiom::locals(i)?;
let (i, uniq) = opt(|i| { let (i, uniq) = opt(tuple((shouldbespace, tag_no_case("UNIQUE"))))(i)?;
shouldbespace(i)?;
tag_no_case("UNIQUE")(i)?;
Ok((i, true))
})(i)?;
Ok(( Ok((
i, i,
DefineIndexStatement { DefineIndexStatement {